Mx support.
[girtod.git] / gtk2 / gobject2.d
blob4196e8a2ffb149a0fae5872a24db3d5b354b43a4
1 // *** DO NOT EDIT ***
2 // Automatically generated from "/usr/share/gir-1.0/GObject-2.0.gir"
4 module GObject2;
5 public import gtk2.glib2;
6 alias gtk2.glib2 GLib2;
8 // package: "gobject-2.0";
9 // C header: "glib-object.h";
11 // c:symbol-prefixes: ["g"]
12 // c:identifier-prefixes: ["G"]
14 // module GObject2;
17 // This is the signature of marshaller functions, required to marshall
18 // arrays of parameter values to signal emissions into C language callback
19 // invocations. It is merely an alias to #GClosureMarshal since the #GClosure
20 // mechanism takes over responsibility of actual function invocation for the
21 // signal system.
22 alias ClosureMarshal SignalCMarshaller;
24 // alias "Type" removed: Defined in glib
27 // A callback function used by the type system to finalize those portions
28 // of a derived types class structure that were setup from the corresponding
29 // GBaseInitFunc() function. Class finalization basically works the inverse
30 // way in which class intialization is performed.
31 // See GClassInitFunc() for a discussion of the class intialization process.
32 // <g_class>: The #GTypeClass structure to finalize.
33 extern (C) alias void function (void* g_class) BaseFinalizeFunc;
36 // A callback function used by the type system to do base initialization
37 // of the class structures of derived types. It is called as part of the
38 // initialization process of all derived classes and should reallocate
39 // or reset all dynamic class members copied over from the parent class.
40 // For example, class members (such as strings) that are not sufficiently
41 // handled by a plain memory copy of the parent class into the derived class
42 // have to be altered. See GClassInitFunc() for a discussion of the class
43 // intialization process.
44 // <g_class>: The #GTypeClass structure to initialize.
45 extern (C) alias void function (void* g_class) BaseInitFunc;
48 // #GBinding is the representation of a binding between a property on a
49 // #GObject instance (or source) and another property on another #GObject
50 // instance (or target). Whenever the source property changes, the same
51 // value is applied to the target property; for instance, the following
52 // binding:
53 //
54 // |[
55 // g_object_bind_property (object1, "property-a",
56 // object2, "property-b",
57 // G_BINDING_DEFAULT);
58 // ]|
59 //
60 // will cause <emphasis>object2:property-b</emphasis> to be updated every
61 // time g_object_set() or the specific accessor changes the value of
62 // <emphasis>object1:property-a</emphasis>.
63 //
64 // It is possible to create a bidirectional binding between two properties
65 // of two #GObject instances, so that if either property changes, the
66 // other is updated as well, for instance:
67 //
68 // |[
69 // g_object_bind_property (object1, "property-a",
70 // object2, "property-b",
71 // G_BINDING_BIDIRECTIONAL);
72 // ]|
73 //
74 // will keep the two properties in sync.
75 //
76 // It is also possible to set a custom transformation function (in both
77 // directions, in case of a bidirectional binding) to apply a custom
78 // transformation from the source value to the target value before
79 // applying it; for instance, the following binding:
80 //
81 // |[
82 // g_object_bind_property_full (adjustment1, "value",
83 // adjustment2, "value",
84 // G_BINDING_BIDIRECTIONAL,
85 // celsius_to_fahrenheit,
86 // fahrenheit_to_celsius,
87 // NULL, NULL);
88 // ]|
89 //
90 // will keep the <emphasis>value</emphasis> property of the two adjustments
91 // in sync; the <function>celsius_to_fahrenheit</function> function will be
92 // called whenever the <emphasis>adjustment1:value</emphasis> property changes
93 // and will transform the current value of the property before applying it
94 // to the <emphasis>adjustment2:value</emphasis> property; vice versa, the
95 // <function>fahrenheit_to_celsius</function> function will be called whenever
96 // the <emphasis>adjustment2:value</emphasis> property changes, and will
97 // transform the current value of the property before applying it to the
98 // <emphasis>adjustment1:value</emphasis>.
99 //
100 // Note that #GBinding does not resolve cycles by itself; a cycle like
102 // |[
103 // object1:propertyA -> object2:propertyB
104 // object2:propertyB -> object3:propertyC
105 // object3:propertyC -> object1:propertyA
106 // ]|
108 // might lead to an infinite loop. The loop, in this particular case,
109 // can be avoided if the objects emit the #GObject::notify signal only
110 // if the value has effectively been changed. A binding is implemented
111 // using the #GObject::notify signal, so it is susceptible to all the
112 // various ways of blocking a signal emission, like g_signal_stop_emission()
113 // or g_signal_handler_block().
115 // A binding will be severed, and the resources it allocates freed, whenever
116 // either one of the #GObject instances it refers to are finalized, or when
117 // the #GBinding instance loses its last reference.
119 // #GBinding is available since GObject 2.26
120 struct Binding /* : Object */ /* Version 2.26 */ {
121 alias method_parent this;
122 alias method_parent super_;
123 alias method_parent object;
124 Object method_parent;
127 // VERSION: 2.26
128 // Retrieves the flags passed when constructing the #GBinding
129 // RETURNS: the #GBindingFlags used by the #GBinding
130 BindingFlags get_flags()() {
131 return g_binding_get_flags(&this);
134 // VERSION: 2.26
135 // Retrieves the #GObject instance used as the source of the binding
136 // RETURNS: the source #GObject
137 Object* get_source()() {
138 return g_binding_get_source(&this);
141 // VERSION: 2.26
142 // Retrieves the name of the property of #GBinding:source used as the source
143 // of the binding
144 // RETURNS: the name of the source property
145 char* get_source_property()() {
146 return g_binding_get_source_property(&this);
149 // VERSION: 2.26
150 // Retrieves the #GObject instance used as the target of the binding
151 // RETURNS: the target #GObject
152 Object* get_target()() {
153 return g_binding_get_target(&this);
156 // VERSION: 2.26
157 // Retrieves the name of the property of #GBinding:target used as the target
158 // of the binding
159 // RETURNS: the name of the target property
160 char* get_target_property()() {
161 return g_binding_get_target_property(&this);
166 // Flags to be passed to g_object_bind_property() or
167 // g_object_bind_property_full().
169 // This enumeration can be extended at later date.
170 enum BindingFlags /* Version 2.26 */ {
171 DEFAULT = 0,
172 BIDIRECTIONAL = 1,
173 SYNC_CREATE = 2,
174 INVERT_BOOLEAN = 4
177 // VERSION: 2.26
178 // A function to be called to transform the source property of @source
179 // from @source_value into the target property of @target
180 // using @target_value.
182 // otherwise
183 // RETURNS: %TRUE if the transformation was successful, and %FALSE
184 // <binding>: a #GBinding
185 // <source_value>: the value of the source property
186 // <target_value>: the value of the target property
187 // <user_data>: data passed to the transform function
188 extern (C) alias int function (Binding* binding, Value* source_value, Value* target_value, void* user_data) BindingTransformFunc;
191 // Unintrospectable callback: BoxedCopyFunc() / ()
192 // This function is provided by the user and should produce a copy
193 // of the passed in boxed structure.
194 // RETURNS: The newly created copy of the boxed structure.
195 // <boxed>: The boxed structure to be copied.
196 extern (C) alias void* function (void* boxed) BoxedCopyFunc;
199 // This function is provided by the user and should free the boxed
200 // structure passed.
201 // <boxed>: The boxed structure to be freed.
202 extern (C) alias void function (void* boxed) BoxedFreeFunc;
204 // A #GCClosure is a specialization of #GClosure for C function callbacks.
205 struct CClosure {
206 Closure closure;
207 void* callback;
209 static void marshal_BOOLEAN__BOXED_BOXED()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
210 g_cclosure_marshal_BOOLEAN__BOXED_BOXED(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
213 // A marshaller for a #GCClosure with a callback of type
214 // <literal>gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter
215 // denotes a flags type.
216 // <closure>: the #GClosure to which the marshaller belongs
217 // <return_value>: a #GValue which can store the returned #gboolean
218 // <n_param_values>: 2
219 // <param_values>: a #GValue array holding instance and arg1
220 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
221 // <marshal_data>: additional data specified when registering the marshaller
222 static void marshal_BOOLEAN__FLAGS()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
223 g_cclosure_marshal_BOOLEAN__FLAGS(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
226 // A marshaller for a #GCClosure with a callback of type
227 // <literal>gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data)</literal>.
228 // <closure>: the #GClosure to which the marshaller belongs
229 // <return_value>: a #GValue, which can store the returned string
230 // <n_param_values>: 3
231 // <param_values>: a #GValue array holding instance, arg1 and arg2
232 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
233 // <marshal_data>: additional data specified when registering the marshaller
234 static void marshal_STRING__OBJECT_POINTER()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
235 g_cclosure_marshal_STRING__OBJECT_POINTER(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
238 // A marshaller for a #GCClosure with a callback of type
239 // <literal>void (*callback) (gpointer instance, gboolean arg1, gpointer user_data)</literal>.
240 // <closure>: the #GClosure to which the marshaller belongs
241 // <return_value>: ignored
242 // <n_param_values>: 2
243 // <param_values>: a #GValue array holding the instance and the #gboolean parameter
244 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
245 // <marshal_data>: additional data specified when registering the marshaller
246 static void marshal_VOID__BOOLEAN()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
247 g_cclosure_marshal_VOID__BOOLEAN(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
250 // A marshaller for a #GCClosure with a callback of type
251 // <literal>void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data)</literal>.
252 // <closure>: the #GClosure to which the marshaller belongs
253 // <return_value>: ignored
254 // <n_param_values>: 2
255 // <param_values>: a #GValue array holding the instance and the #GBoxed* parameter
256 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
257 // <marshal_data>: additional data specified when registering the marshaller
258 static void marshal_VOID__BOXED()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
259 g_cclosure_marshal_VOID__BOXED(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
262 // A marshaller for a #GCClosure with a callback of type
263 // <literal>void (*callback) (gpointer instance, gchar arg1, gpointer user_data)</literal>.
264 // <closure>: the #GClosure to which the marshaller belongs
265 // <return_value>: ignored
266 // <n_param_values>: 2
267 // <param_values>: a #GValue array holding the instance and the #gchar parameter
268 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
269 // <marshal_data>: additional data specified when registering the marshaller
270 static void marshal_VOID__CHAR()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
271 g_cclosure_marshal_VOID__CHAR(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
274 // A marshaller for a #GCClosure with a callback of type
275 // <literal>void (*callback) (gpointer instance, gdouble arg1, gpointer user_data)</literal>.
276 // <closure>: the #GClosure to which the marshaller belongs
277 // <return_value>: ignored
278 // <n_param_values>: 2
279 // <param_values>: a #GValue array holding the instance and the #gdouble parameter
280 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
281 // <marshal_data>: additional data specified when registering the marshaller
282 static void marshal_VOID__DOUBLE()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
283 g_cclosure_marshal_VOID__DOUBLE(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
286 // A marshaller for a #GCClosure with a callback of type
287 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter denotes an enumeration type..
288 // <closure>: the #GClosure to which the marshaller belongs
289 // <return_value>: ignored
290 // <n_param_values>: 2
291 // <param_values>: a #GValue array holding the instance and the enumeration parameter
292 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
293 // <marshal_data>: additional data specified when registering the marshaller
294 static void marshal_VOID__ENUM()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
295 g_cclosure_marshal_VOID__ENUM(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
298 // A marshaller for a #GCClosure with a callback of type
299 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter denotes a flags type.
300 // <closure>: the #GClosure to which the marshaller belongs
301 // <return_value>: ignored
302 // <n_param_values>: 2
303 // <param_values>: a #GValue array holding the instance and the flags parameter
304 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
305 // <marshal_data>: additional data specified when registering the marshaller
306 static void marshal_VOID__FLAGS()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
307 g_cclosure_marshal_VOID__FLAGS(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
310 // A marshaller for a #GCClosure with a callback of type
311 // <literal>void (*callback) (gpointer instance, gfloat arg1, gpointer user_data)</literal>.
312 // <closure>: the #GClosure to which the marshaller belongs
313 // <return_value>: ignored
314 // <n_param_values>: 2
315 // <param_values>: a #GValue array holding the instance and the #gfloat parameter
316 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
317 // <marshal_data>: additional data specified when registering the marshaller
318 static void marshal_VOID__FLOAT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
319 g_cclosure_marshal_VOID__FLOAT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
322 // A marshaller for a #GCClosure with a callback of type
323 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal>.
324 // <closure>: the #GClosure to which the marshaller belongs
325 // <return_value>: ignored
326 // <n_param_values>: 2
327 // <param_values>: a #GValue array holding the instance and the #gint parameter
328 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
329 // <marshal_data>: additional data specified when registering the marshaller
330 static void marshal_VOID__INT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
331 g_cclosure_marshal_VOID__INT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
334 // A marshaller for a #GCClosure with a callback of type
335 // <literal>void (*callback) (gpointer instance, glong arg1, gpointer user_data)</literal>.
336 // <closure>: the #GClosure to which the marshaller belongs
337 // <return_value>: ignored
338 // <n_param_values>: 2
339 // <param_values>: a #GValue array holding the instance and the #glong parameter
340 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
341 // <marshal_data>: additional data specified when registering the marshaller
342 static void marshal_VOID__LONG()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
343 g_cclosure_marshal_VOID__LONG(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
346 // A marshaller for a #GCClosure with a callback of type
347 // <literal>void (*callback) (gpointer instance, GObject *arg1, gpointer user_data)</literal>.
348 // <closure>: the #GClosure to which the marshaller belongs
349 // <return_value>: ignored
350 // <n_param_values>: 2
351 // <param_values>: a #GValue array holding the instance and the #GObject* parameter
352 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
353 // <marshal_data>: additional data specified when registering the marshaller
354 static void marshal_VOID__OBJECT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
355 g_cclosure_marshal_VOID__OBJECT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
358 // A marshaller for a #GCClosure with a callback of type
359 // <literal>void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data)</literal>.
360 // <closure>: the #GClosure to which the marshaller belongs
361 // <return_value>: ignored
362 // <n_param_values>: 2
363 // <param_values>: a #GValue array holding the instance and the #GParamSpec* parameter
364 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
365 // <marshal_data>: additional data specified when registering the marshaller
366 static void marshal_VOID__PARAM()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
367 g_cclosure_marshal_VOID__PARAM(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
370 // A marshaller for a #GCClosure with a callback of type
371 // <literal>void (*callback) (gpointer instance, gpointer arg1, gpointer user_data)</literal>.
372 // <closure>: the #GClosure to which the marshaller belongs
373 // <return_value>: ignored
374 // <n_param_values>: 2
375 // <param_values>: a #GValue array holding the instance and the #gpointer parameter
376 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
377 // <marshal_data>: additional data specified when registering the marshaller
378 static void marshal_VOID__POINTER()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
379 g_cclosure_marshal_VOID__POINTER(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
382 // A marshaller for a #GCClosure with a callback of type
383 // <literal>void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data)</literal>.
384 // <closure>: the #GClosure to which the marshaller belongs
385 // <return_value>: ignored
386 // <n_param_values>: 2
387 // <param_values>: a #GValue array holding the instance and the #gchar* parameter
388 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
389 // <marshal_data>: additional data specified when registering the marshaller
390 static void marshal_VOID__STRING()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
391 g_cclosure_marshal_VOID__STRING(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
394 // A marshaller for a #GCClosure with a callback of type
395 // <literal>void (*callback) (gpointer instance, guchar arg1, gpointer user_data)</literal>.
396 // <closure>: the #GClosure to which the marshaller belongs
397 // <return_value>: ignored
398 // <n_param_values>: 2
399 // <param_values>: a #GValue array holding the instance and the #guchar parameter
400 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
401 // <marshal_data>: additional data specified when registering the marshaller
402 static void marshal_VOID__UCHAR()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
403 g_cclosure_marshal_VOID__UCHAR(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
406 // A marshaller for a #GCClosure with a callback of type
407 // <literal>void (*callback) (gpointer instance, guint arg1, gpointer user_data)</literal>.
408 // <closure>: the #GClosure to which the marshaller belongs
409 // <return_value>: ignored
410 // <n_param_values>: 2
411 // <param_values>: a #GValue array holding the instance and the #guint parameter
412 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
413 // <marshal_data>: additional data specified when registering the marshaller
414 static void marshal_VOID__UINT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
415 g_cclosure_marshal_VOID__UINT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
418 // A marshaller for a #GCClosure with a callback of type
419 // <literal>void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data)</literal>.
420 // <closure>: the #GClosure to which the marshaller belongs
421 // <return_value>: ignored
422 // <n_param_values>: 3
423 // <param_values>: a #GValue array holding instance, arg1 and arg2
424 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
425 // <marshal_data>: additional data specified when registering the marshaller
426 static void marshal_VOID__UINT_POINTER()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
427 g_cclosure_marshal_VOID__UINT_POINTER(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
430 // A marshaller for a #GCClosure with a callback of type
431 // <literal>void (*callback) (gpointer instance, gulong arg1, gpointer user_data)</literal>.
432 // <closure>: the #GClosure to which the marshaller belongs
433 // <return_value>: ignored
434 // <n_param_values>: 2
435 // <param_values>: a #GValue array holding the instance and the #gulong parameter
436 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
437 // <marshal_data>: additional data specified when registering the marshaller
438 static void marshal_VOID__ULONG()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
439 g_cclosure_marshal_VOID__ULONG(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
442 // VERSION: 2.26
443 // A marshaller for a #GCClosure with a callback of type
444 // <literal>void (*callback) (gpointer instance, GVariant *arg1, gpointer user_data)</literal>.
445 // <closure>: the #GClosure to which the marshaller belongs
446 // <return_value>: ignored
447 // <n_param_values>: 2
448 // <param_values>: a #GValue array holding the instance and the #GVariant* parameter
449 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
450 // <marshal_data>: additional data specified when registering the marshaller
451 static void marshal_VOID__VARIANT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
452 g_cclosure_marshal_VOID__VARIANT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
455 // A marshaller for a #GCClosure with a callback of type
456 // <literal>void (*callback) (gpointer instance, gpointer user_data)</literal>.
457 // <closure>: the #GClosure to which the marshaller belongs
458 // <return_value>: ignored
459 // <n_param_values>: 1
460 // <param_values>: a #GValue array holding only the instance
461 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
462 // <marshal_data>: additional data specified when registering the marshaller
463 static void marshal_VOID__VOID()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
464 g_cclosure_marshal_VOID__VOID(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
467 // VERSION: 2.30
468 // A generic marshaller function implemented via <ulink
469 // url="http://sourceware.org/libffi/">libffi</ulink>.
470 // <closure>: A #GClosure.
471 // <return_gvalue>: A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
472 // <n_param_values>: The length of the @param_values array.
473 // <param_values>: An array of #GValue<!-- -->s holding the arguments on which to invoke the callback of closure.
474 // <invocation_hint>: The invocation hint given as the last argument to g_closure_invoke().
475 // <marshal_data>: Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
476 static void marshal_generic()(Closure* closure, Value* return_gvalue, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
477 g_cclosure_marshal_generic(closure, return_gvalue, n_param_values, param_values, invocation_hint, marshal_data);
480 // Unintrospectable function: new() / g_cclosure_new()
481 // Creates a new closure which invokes @callback_func with @user_data as
482 // the last parameter.
483 // RETURNS: a new #GCClosure
484 // <callback_func>: the function to invoke
485 // <user_data>: user data to pass to @callback_func
486 // <destroy_data>: destroy notify to be called when @user_data is no longer used
487 static Closure* /*new*/ new_()(Callback callback_func, void* user_data, ClosureNotify destroy_data) {
488 return g_cclosure_new(callback_func, user_data, destroy_data);
491 // Unintrospectable function: new_object() / g_cclosure_new_object()
492 // A variant of g_cclosure_new() which uses @object as @user_data and
493 // calls g_object_watch_closure() on @object and the created
494 // closure. This function is useful when you have a callback closely
495 // associated with a #GObject, and want the callback to no longer run
496 // after the object is is freed.
497 // RETURNS: a new #GCClosure
498 // <callback_func>: the function to invoke
499 // <object>: a #GObject pointer to pass to @callback_func
500 static Closure* /*new*/ new_object()(Callback callback_func, Object* object) {
501 return g_cclosure_new_object(callback_func, object);
504 // Unintrospectable function: new_object_swap() / g_cclosure_new_object_swap()
505 // A variant of g_cclosure_new_swap() which uses @object as @user_data
506 // and calls g_object_watch_closure() on @object and the created
507 // closure. This function is useful when you have a callback closely
508 // associated with a #GObject, and want the callback to no longer run
509 // after the object is is freed.
510 // RETURNS: a new #GCClosure
511 // <callback_func>: the function to invoke
512 // <object>: a #GObject pointer to pass to @callback_func
513 static Closure* /*new*/ new_object_swap()(Callback callback_func, Object* object) {
514 return g_cclosure_new_object_swap(callback_func, object);
517 // Unintrospectable function: new_swap() / g_cclosure_new_swap()
518 // Creates a new closure which invokes @callback_func with @user_data as
519 // the first parameter.
520 // RETURNS: a new #GCClosure
521 // <callback_func>: the function to invoke
522 // <user_data>: user data to pass to @callback_func
523 // <destroy_data>: destroy notify to be called when @user_data is no longer used
524 static Closure* /*new*/ new_swap()(Callback callback_func, void* user_data, ClosureNotify destroy_data) {
525 return g_cclosure_new_swap(callback_func, user_data, destroy_data);
530 // The type used for callback functions in structure definitions and function
531 // signatures. This doesn't mean that all callback functions must take no
532 // parameters and return void. The required signature of a callback function
533 // is determined by the context in which is used (e.g. the signal to which it
534 // is connected). Use G_CALLBACK() to cast the callback function to a #GCallback.
535 extern (C) alias void function () Callback;
538 // A callback function used by the type system to finalize a class.
539 // This function is rarely needed, as dynamically allocated class resources
540 // should be handled by GBaseInitFunc() and GBaseFinalizeFunc().
541 // Also, specification of a GClassFinalizeFunc() in the #GTypeInfo
542 // structure of a static type is invalid, because classes of static types
543 // will never be finalized (they are artificially kept alive when their
544 // reference count drops to zero).
545 // <g_class>: The #GTypeClass structure to finalize.
546 // <class_data>: The @class_data member supplied via the #GTypeInfo structure.
547 extern (C) alias void function (void* g_class, void* class_data) ClassFinalizeFunc;
550 // A callback function used by the type system to initialize the class
551 // of a specific type. This function should initialize all static class
552 // members.
553 // The initialization process of a class involves:
554 // <itemizedlist>
555 // <listitem><para>
556 // 1 - Copying common members from the parent class over to the
557 // derived class structure.
558 // </para></listitem>
559 // <listitem><para>
560 // 2 - Zero initialization of the remaining members not copied
561 // over from the parent class.
562 // </para></listitem>
563 // <listitem><para>
564 // 3 - Invocation of the GBaseInitFunc() initializers of all parent
565 // types and the class' type.
566 // </para></listitem>
567 // <listitem><para>
568 // 4 - Invocation of the class' GClassInitFunc() initializer.
569 // </para></listitem>
570 // </itemizedlist>
571 // Since derived classes are partially initialized through a memory copy
572 // of the parent class, the general rule is that GBaseInitFunc() and
573 // GBaseFinalizeFunc() should take care of necessary reinitialization
574 // and release of those class members that were introduced by the type
575 // that specified these GBaseInitFunc()/GBaseFinalizeFunc().
576 // GClassInitFunc() should only care about initializing static
577 // class members, while dynamic class members (such as allocated strings
578 // or reference counted resources) are better handled by a GBaseInitFunc()
579 // for this type, so proper initialization of the dynamic class members
580 // is performed for class initialization of derived types as well.
581 // An example may help to correspond the intend of the different class
582 // initializers:
584 // |[
585 // typedef struct {
586 // GObjectClass parent_class;
587 // gint static_integer;
588 // gchar *dynamic_string;
589 // } TypeAClass;
590 // static void
591 // type_a_base_class_init (TypeAClass *class)
592 // {
593 // class->dynamic_string = g_strdup ("some string");
594 // }
595 // static void
596 // type_a_base_class_finalize (TypeAClass *class)
597 // {
598 // g_free (class->dynamic_string);
599 // }
600 // static void
601 // type_a_class_init (TypeAClass *class)
602 // {
603 // class->static_integer = 42;
604 // }
606 // typedef struct {
607 // TypeAClass parent_class;
608 // gfloat static_float;
609 // GString *dynamic_gstring;
610 // } TypeBClass;
611 // static void
612 // type_b_base_class_init (TypeBClass *class)
613 // {
614 // class->dynamic_gstring = g_string_new ("some other string");
615 // }
616 // static void
617 // type_b_base_class_finalize (TypeBClass *class)
618 // {
619 // g_string_free (class->dynamic_gstring);
620 // }
621 // static void
622 // type_b_class_init (TypeBClass *class)
623 // {
624 // class->static_float = 3.14159265358979323846;
625 // }
626 // ]|
627 // Initialization of TypeBClass will first cause initialization of
628 // TypeAClass (derived classes reference their parent classes, see
629 // g_type_class_ref() on this).
630 // Initialization of TypeAClass roughly involves zero-initializing its fields,
631 // then calling its GBaseInitFunc() type_a_base_class_init() to allocate
632 // its dynamic members (dynamic_string), and finally calling its GClassInitFunc()
633 // type_a_class_init() to initialize its static members (static_integer).
634 // The first step in the initialization process of TypeBClass is then
635 // a plain memory copy of the contents of TypeAClass into TypeBClass and
636 // zero-initialization of the remaining fields in TypeBClass.
637 // The dynamic members of TypeAClass within TypeBClass now need
638 // reinitialization which is performed by calling type_a_base_class_init()
639 // with an argument of TypeBClass.
640 // After that, the GBaseInitFunc() of TypeBClass, type_b_base_class_init()
641 // is called to allocate the dynamic members of TypeBClass (dynamic_gstring),
642 // and finally the GClassInitFunc() of TypeBClass, type_b_class_init(),
643 // is called to complete the initialization process with the static members
644 // (static_float).
645 // Corresponding finalization counter parts to the GBaseInitFunc() functions
646 // have to be provided to release allocated resources at class finalization
647 // time.
648 // <g_class>: The #GTypeClass structure to initialize.
649 // <class_data>: The @class_data member supplied via the #GTypeInfo structure.
650 extern (C) alias void function (void* g_class, void* class_data) ClassInitFunc;
653 // A #GClosure represents a callback supplied by the programmer. It
654 // will generally comprise a function of some kind and a marshaller
655 // used to call it. It is the reponsibility of the marshaller to
656 // convert the arguments for the invocation from #GValue<!-- -->s into
657 // a suitable form, perform the callback on the converted arguments,
658 // and transform the return value back into a #GValue.
660 // In the case of C programs, a closure usually just holds a pointer
661 // to a function and maybe a data argument, and the marshaller
662 // converts between #GValue<!-- --> and native C types. The GObject
663 // library provides the #GCClosure type for this purpose. Bindings for
664 // other languages need marshallers which convert between #GValue<!--
665 // -->s and suitable representations in the runtime of the language in
666 // order to use functions written in that languages as callbacks.
668 // Within GObject, closures play an important role in the
669 // implementation of signals. When a signal is registered, the
670 // @c_marshaller argument to g_signal_new() specifies the default C
671 // marshaller for any closure which is connected to this
672 // signal. GObject provides a number of C marshallers for this
673 // purpose, see the g_cclosure_marshal_*() functions. Additional C
674 // marshallers can be generated with the <link
675 // linkend="glib-genmarshal">glib-genmarshal</link> utility. Closures
676 // can be explicitly connected to signals with
677 // g_signal_connect_closure(), but it usually more convenient to let
678 // GObject create a closure automatically by using one of the
679 // g_signal_connect_*() functions which take a callback function/user
680 // data pair.
682 // Using closures has a number of important advantages over a simple
683 // callback function/data pointer combination:
684 // <itemizedlist>
685 // <listitem><para>
686 // Closures allow the callee to get the types of the callback parameters,
687 // which means that language bindings don't have to write individual glue
688 // for each callback type.
689 // </para></listitem>
690 // <listitem><para>
691 // The reference counting of #GClosure makes it easy to handle reentrancy
692 // right; if a callback is removed while it is being invoked, the closure
693 // and its parameters won't be freed until the invocation finishes.
694 // </para></listitem>
695 // <listitem><para>
696 // g_closure_invalidate() and invalidation notifiers allow callbacks to be
697 // automatically removed when the objects they point to go away.
698 // </para></listitem>
699 // </itemizedlist>
700 struct Closure {
701 static import std.bitmanip; mixin(std.bitmanip.bitfields!(
702 uint, "ref_count", 15,
703 uint, "meta_marshal", 1,
704 uint, "n_guards", 1,
705 uint, "n_fnotifiers", 2,
706 uint, "n_inotifiers", 8,
707 uint, "in_inotify", 1,
708 uint, "floating", 1,
709 uint, "derivative_flag", 1,
710 uint, "in_marshal", 1,
711 uint, "is_invalid", 1));
712 extern (C) void function (Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) marshal;
713 private void* data;
714 private ClosureNotifyData* notifiers;
717 // A variant of g_closure_new_simple() which stores @object in the
718 // @data field of the closure and calls g_object_watch_closure() on
719 // @object and the created closure. This function is mainly useful
720 // when implementing new types of closures.
721 // RETURNS: a newly allocated #GClosure
722 // <sizeof_closure>: the size of the structure to allocate, must be at least <literal>sizeof (GClosure)</literal>
723 // <object>: a #GObject pointer to store in the @data field of the newly allocated #GClosure
724 static Closure* /*new*/ new_object()(uint sizeof_closure, Object* object) {
725 return g_closure_new_object(sizeof_closure, object);
728 // Allocates a struct of the given size and initializes the initial
729 // part as a #GClosure. This function is mainly useful when
730 // implementing new types of closures.
732 // |[
733 // typedef struct _MyClosure MyClosure;
734 // struct _MyClosure
735 // {
736 // GClosure closure;
737 // // extra data goes here
738 // };
740 // static void
741 // my_closure_finalize (gpointer notify_data,
742 // GClosure *closure)
743 // {
744 // MyClosure *my_closure = (MyClosure *)closure;
746 // // free extra data here
747 // }
749 // MyClosure *my_closure_new (gpointer data)
750 // {
751 // GClosure *closure;
752 // MyClosure *my_closure;
754 // closure = g_closure_new_simple (sizeof (MyClosure), data);
755 // my_closure = (MyClosure *) closure;
757 // // initialize extra data here
759 // g_closure_add_finalize_notifier (closure, notify_data,
760 // my_closure_finalize);
761 // return my_closure;
762 // }
763 // ]|
764 // RETURNS: a newly allocated #GClosure
765 // <sizeof_closure>: the size of the structure to allocate, must be at least <literal>sizeof (GClosure)</literal>
766 // <data>: data to store in the @data field of the newly allocated #GClosure
767 static Closure* /*new*/ new_simple()(uint sizeof_closure, void* data) {
768 return g_closure_new_simple(sizeof_closure, data);
771 // Unintrospectable method: add_finalize_notifier() / g_closure_add_finalize_notifier()
772 // Registers a finalization notifier which will be called when the
773 // reference count of @closure goes down to 0. Multiple finalization
774 // notifiers on a single closure are invoked in unspecified order. If
775 // a single call to g_closure_unref() results in the closure being
776 // both invalidated and finalized, then the invalidate notifiers will
777 // be run before the finalize notifiers.
778 // <notify_data>: data to pass to @notify_func
779 // <notify_func>: the callback function to register
780 void add_finalize_notifier()(void* notify_data, ClosureNotify notify_func) {
781 g_closure_add_finalize_notifier(&this, notify_data, notify_func);
784 // Unintrospectable method: add_invalidate_notifier() / g_closure_add_invalidate_notifier()
785 // Registers an invalidation notifier which will be called when the
786 // @closure is invalidated with g_closure_invalidate(). Invalidation
787 // notifiers are invoked before finalization notifiers, in an
788 // unspecified order.
789 // <notify_data>: data to pass to @notify_func
790 // <notify_func>: the callback function to register
791 void add_invalidate_notifier()(void* notify_data, ClosureNotify notify_func) {
792 g_closure_add_invalidate_notifier(&this, notify_data, notify_func);
795 // Unintrospectable method: add_marshal_guards() / g_closure_add_marshal_guards()
796 // Adds a pair of notifiers which get invoked before and after the
797 // closure callback, respectively. This is typically used to protect
798 // the extra arguments for the duration of the callback. See
799 // g_object_watch_closure() for an example of marshal guards.
800 // <pre_marshal_data>: data to pass to @pre_marshal_notify
801 // <pre_marshal_notify>: a function to call before the closure callback
802 // <post_marshal_data>: data to pass to @post_marshal_notify
803 // <post_marshal_notify>: a function to call after the closure callback
804 void add_marshal_guards()(void* pre_marshal_data, ClosureNotify pre_marshal_notify, void* post_marshal_data, ClosureNotify post_marshal_notify) {
805 g_closure_add_marshal_guards(&this, pre_marshal_data, pre_marshal_notify, post_marshal_data, post_marshal_notify);
808 // Sets a flag on the closure to indicate that its calling
809 // environment has become invalid, and thus causes any future
810 // invocations of g_closure_invoke() on this @closure to be
811 // ignored. Also, invalidation notifiers installed on the closure will
812 // be called at this point. Note that unless you are holding a
813 // reference to the closure yourself, the invalidation notifiers may
814 // unref the closure and cause it to be destroyed, so if you need to
815 // access the closure after calling g_closure_invalidate(), make sure
816 // that you've previously called g_closure_ref().
818 // Note that g_closure_invalidate() will also be called when the
819 // reference count of a closure drops to zero (unless it has already
820 // been invalidated before).
821 void invalidate()() {
822 g_closure_invalidate(&this);
825 // Invokes the closure, i.e. executes the callback represented by the @closure.
826 // <return_value>: a #GValue to store the return value. May be %NULL if the callback of @closure doesn't return a value.
827 // <n_param_values>: the length of the @param_values array
828 // <param_values>: an array of #GValue<!-- -->s holding the arguments on which to invoke the callback of @closure
829 // <invocation_hint>: a context-dependent invocation hint
830 void invoke()(Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint=null) {
831 g_closure_invoke(&this, return_value, n_param_values, param_values, invocation_hint);
834 // Increments the reference count on a closure to force it staying
835 // alive while the caller holds a pointer to it.
836 // RETURNS: The @closure passed in, for convenience
837 Closure* ref_()() {
838 return g_closure_ref(&this);
841 // Unintrospectable method: remove_finalize_notifier() / g_closure_remove_finalize_notifier()
842 // Removes a finalization notifier.
844 // Notice that notifiers are automatically removed after they are run.
845 // <notify_data>: data which was passed to g_closure_add_finalize_notifier() when registering @notify_func
846 // <notify_func>: the callback function to remove
847 void remove_finalize_notifier()(void* notify_data, ClosureNotify notify_func) {
848 g_closure_remove_finalize_notifier(&this, notify_data, notify_func);
851 // Unintrospectable method: remove_invalidate_notifier() / g_closure_remove_invalidate_notifier()
852 // Removes an invalidation notifier.
854 // Notice that notifiers are automatically removed after they are run.
855 // <notify_data>: data which was passed to g_closure_add_invalidate_notifier() when registering @notify_func
856 // <notify_func>: the callback function to remove
857 void remove_invalidate_notifier()(void* notify_data, ClosureNotify notify_func) {
858 g_closure_remove_invalidate_notifier(&this, notify_data, notify_func);
861 // Unintrospectable method: set_marshal() / g_closure_set_marshal()
862 // Sets the marshaller of @closure. The <literal>marshal_data</literal>
863 // of @marshal provides a way for a meta marshaller to provide additional
864 // information to the marshaller. (See g_closure_set_meta_marshal().) For
865 // GObject's C predefined marshallers (the g_cclosure_marshal_*()
866 // functions), what it provides is a callback function to use instead of
867 // @closure->callback.
868 // <marshal>: a #GClosureMarshal function
869 void set_marshal()(ClosureMarshal marshal) {
870 g_closure_set_marshal(&this, marshal);
873 // Unintrospectable method: set_meta_marshal() / g_closure_set_meta_marshal()
874 // Sets the meta marshaller of @closure. A meta marshaller wraps
875 // @closure->marshal and modifies the way it is called in some
876 // fashion. The most common use of this facility is for C callbacks.
877 // The same marshallers (generated by <link
878 // linkend="glib-genmarshal">glib-genmarshal</link>) are used
879 // everywhere, but the way that we get the callback function
880 // differs. In most cases we want to use @closure->callback, but in
881 // other cases we want to use some different technique to retrieve the
882 // callback function.
884 // For example, class closures for signals (see
885 // g_signal_type_cclosure_new()) retrieve the callback function from a
886 // fixed offset in the class structure. The meta marshaller retrieves
887 // the right callback and passes it to the marshaller as the
888 // @marshal_data argument.
889 // <marshal_data>: context-dependent data to pass to @meta_marshal
890 // <meta_marshal>: a #GClosureMarshal function
891 void set_meta_marshal()(void* marshal_data, ClosureMarshal meta_marshal) {
892 g_closure_set_meta_marshal(&this, marshal_data, meta_marshal);
895 // Takes over the initial ownership of a closure. Each closure is
896 // initially created in a <firstterm>floating</firstterm> state, which
897 // means that the initial reference count is not owned by any caller.
898 // g_closure_sink() checks to see if the object is still floating, and
899 // if so, unsets the floating state and decreases the reference
900 // count. If the closure is not floating, g_closure_sink() does
901 // nothing. The reason for the existence of the floating state is to
902 // prevent cumbersome code sequences like:
903 // |[
904 // closure = g_cclosure_new (cb_func, cb_data);
905 // g_source_set_closure (source, closure);
906 // g_closure_unref (closure); // XXX GObject doesn't really need this
907 // ]|
908 // Because g_source_set_closure() (and similar functions) take ownership of the
909 // initial reference count, if it is unowned, we instead can write:
910 // |[
911 // g_source_set_closure (source, g_cclosure_new (cb_func, cb_data));
912 // ]|
914 // Generally, this function is used together with g_closure_ref(). Ane example
915 // of storing a closure for later notification looks like:
916 // |[
917 // static GClosure *notify_closure = NULL;
918 // void
919 // foo_notify_set_closure (GClosure *closure)
920 // {
921 // if (notify_closure)
922 // g_closure_unref (notify_closure);
923 // notify_closure = closure;
924 // if (notify_closure)
925 // {
926 // g_closure_ref (notify_closure);
927 // g_closure_sink (notify_closure);
928 // }
929 // }
930 // ]|
932 // Because g_closure_sink() may decrement the reference count of a closure
933 // (if it hasn't been called on @closure yet) just like g_closure_unref(),
934 // g_closure_ref() should be called prior to this function.
935 void sink()() {
936 g_closure_sink(&this);
939 // Decrements the reference count of a closure after it was previously
940 // incremented by the same caller. If no other callers are using the
941 // closure, then the closure will be destroyed and freed.
942 void unref()() {
943 g_closure_unref(&this);
948 // The type used for marshaller functions.
949 // <closure>: the #GClosure to which the marshaller belongs
950 // <return_value>: a #GValue to store the return value. May be %NULL if the callback of @closure doesn't return a value.
951 // <n_param_values>: the length of the @param_values array
952 // <param_values>: an array of #GValue<!-- -->s holding the arguments on which to invoke the callback of @closure
953 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
954 // <marshal_data>: additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
955 extern (C) alias void function (Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint=null, void* marshal_data=null) ClosureMarshal;
958 // The type used for the various notification callbacks which can be registered
959 // on closures.
960 // <data>: data specified when registering the notification callback
961 // <closure>: the #GClosure on which the notification is emitted
962 extern (C) alias void function (void* data, Closure* closure) ClosureNotify;
964 struct ClosureNotifyData {
965 void* data;
966 ClosureNotify notify;
970 // The connection flags are used to specify the behaviour of a signal's
971 // connection.
972 enum ConnectFlags {
973 AFTER = 1,
974 SWAPPED = 2
977 // The class of an enumeration type holds information about its
978 // possible values.
979 struct EnumClass {
980 TypeClass g_type_class;
981 int minimum, maximum;
982 uint n_values;
983 EnumValue* values;
987 // A structure which contains a single enum value, its name, and its
988 // nickname.
989 struct EnumValue {
990 int value;
991 char* value_name, value_nick;
995 // The class of a flags type holds information about its
996 // possible values.
997 struct FlagsClass {
998 TypeClass g_type_class;
999 uint mask, n_values;
1000 FlagsValue* values;
1004 // A structure which contains a single flags value, its name, and its
1005 // nickname.
1006 struct FlagsValue {
1007 uint value;
1008 char* value_name, value_nick;
1012 // All the fields in the <structname>GInitiallyUnowned</structname> structure
1013 // are private to the #GInitiallyUnowned implementation and should never be
1014 // accessed directly.
1015 struct InitiallyUnowned /* : Object */ {
1016 TypeInstance g_type_instance;
1017 private uint ref_count;
1018 private GLib2.Data* qdata;
1021 // The class structure for the <structname>GInitiallyUnowned</structname> type.
1022 struct InitiallyUnownedClass {
1023 TypeClass g_type_class;
1024 private GLib2.SList* construct_properties;
1025 // Unintrospectable functionp: constructor() / ()
1026 extern (C) Object* function (Type type, uint n_construct_properties, ObjectConstructParam* construct_properties) constructor;
1027 extern (C) void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) set_property;
1028 extern (C) void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) get_property;
1029 extern (C) void function (Object* object) dispose;
1030 extern (C) void function (Object* object) finalize;
1031 extern (C) void function (Object* object, uint n_pspecs, ParamSpec** pspecs) dispatch_properties_changed;
1032 extern (C) void function (Object* object, ParamSpec* pspec) notify;
1033 extern (C) void function (Object* object) constructed;
1034 private size_t flags;
1035 private void*[6] pdummy;
1039 // A callback function used by the type system to initialize a new
1040 // instance of a type. This function initializes all instance members and
1041 // allocates any resources required by it.
1042 // Initialization of a derived instance involves calling all its parent
1043 // types instance initializers, so the class member of the instance
1044 // is altered during its initialization to always point to the class that
1045 // belongs to the type the current initializer was introduced for.
1046 // <instance>: The instance to initialize.
1047 // <g_class>: The class of the type the instance is created for.
1048 extern (C) alias void function (TypeInstance* instance, void* g_class) InstanceInitFunc;
1051 // A callback function used by the type system to finalize an interface.
1052 // This function should destroy any internal data and release any resources
1053 // allocated by the corresponding GInterfaceInitFunc() function.
1054 // <g_iface>: The interface structure to finalize.
1055 // <iface_data>: The @interface_data supplied via the #GInterfaceInfo structure.
1056 extern (C) alias void function (void* g_iface, void* iface_data) InterfaceFinalizeFunc;
1059 // A structure that provides information to the type system which is
1060 // used specifically for managing interface types.
1061 struct InterfaceInfo {
1062 InterfaceInitFunc interface_init;
1063 InterfaceFinalizeFunc interface_finalize;
1064 void* interface_data;
1068 // A callback function used by the type system to initialize a new
1069 // interface. This function should initialize all internal data and
1070 // allocate any resources required by the interface.
1071 // <g_iface>: The interface structure to initialize.
1072 // <iface_data>: The @interface_data supplied via the #GInterfaceInfo structure.
1073 extern (C) alias void function (void* g_iface, void* iface_data) InterfaceInitFunc;
1076 // All the fields in the <structname>GObject</structname> structure are private
1077 // to the #GObject implementation and should never be accessed directly.
1078 struct Object {
1079 TypeInstance g_type_instance;
1080 private uint ref_count;
1081 private GLib2.Data* qdata;
1084 // Unintrospectable constructor: new_valist() / g_object_new_valist()
1085 // Creates a new instance of a #GObject subtype and sets its properties.
1087 // Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY)
1088 // which are not explicitly specified are set to their default values.
1089 // RETURNS: a new instance of @object_type
1090 // <object_type>: the type id of the #GObject subtype to instantiate
1091 // <first_property_name>: the name of the first property
1092 // <var_args>: the value of the first property, followed optionally by more name/value pairs, followed by %NULL
1093 static Object* /*new*/ new_valist()(Type object_type, char* first_property_name, va_list var_args) {
1094 return g_object_new_valist(object_type, first_property_name, var_args);
1097 // Creates a new instance of a #GObject subtype and sets its properties.
1099 // Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY)
1100 // which are not explicitly specified are set to their default values.
1102 // @object_type
1103 // RETURNS: a new instance of
1104 // <object_type>: the type id of the #GObject subtype to instantiate
1105 // <n_parameters>: the length of the @parameters array
1106 // <parameters>: an array of #GParameter
1107 static Object* /*new*/ newv()(Type object_type, uint n_parameters, Parameter* parameters) {
1108 return g_object_newv(object_type, n_parameters, parameters);
1111 // VERSION: 2.26
1112 // Creates a binding between @source_property on @source and @target_property
1113 // on @target. Whenever the @source_property is changed the @target_property is
1114 // updated using the same value. For instance:
1116 // |[
1117 // g_object_bind_property (action, "active", widget, "sensitive", 0);
1118 // ]|
1120 // Will result in the "sensitive" property of the widget #GObject instance to be
1121 // updated with the same value of the "active" property of the action #GObject
1122 // instance.
1124 // If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
1125 // if @target_property on @target changes then the @source_property on @source
1126 // will be updated as well.
1128 // The binding will automatically be removed when either the @source or the
1129 // @target instances are finalized. To remove the binding without affecting the
1130 // @source and the @target you can just call g_object_unref() on the returned
1131 // #GBinding instance.
1133 // A #GObject can have multiple bindings.
1135 // binding between the two #GObject instances. The binding is released
1136 // whenever the #GBinding reference count reaches zero.
1137 // RETURNS: the #GBinding instance representing the
1138 // <source>: the source #GObject
1139 // <source_property>: the property on @source to bind
1140 // <target>: the target #GObject
1141 // <target_property>: the property on @target to bind
1142 // <flags>: flags to pass to #GBinding
1143 static Binding* bind_property()(void* source, char* source_property, void* target, char* target_property, BindingFlags flags) {
1144 return g_object_bind_property(source, source_property, target, target_property, flags);
1147 // VERSION: 2.26
1148 // Complete version of g_object_bind_property().
1150 // Creates a binding between @source_property on @source and @target_property
1151 // on @target, allowing you to set the transformation functions to be used by
1152 // the binding.
1154 // If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
1155 // if @target_property on @target changes then the @source_property on @source
1156 // will be updated as well. The @transform_from function is only used in case
1157 // of bidirectional bindings, otherwise it will be ignored
1159 // The binding will automatically be removed when either the @source or the
1160 // @target instances are finalized. To remove the binding without affecting the
1161 // @source and the @target you can just call g_object_unref() on the returned
1162 // #GBinding instance.
1164 // A #GObject can have multiple bindings.
1166 // <note>The same @user_data parameter will be used for both @transform_to
1167 // and @transform_from transformation functions; the @notify function will
1168 // be called once, when the binding is removed. If you need different data
1169 // for each transformation function, please use
1170 // g_object_bind_property_with_closures() instead.</note>
1172 // binding between the two #GObject instances. The binding is released
1173 // whenever the #GBinding reference count reaches zero.
1174 // RETURNS: the #GBinding instance representing the
1175 // <source>: the source #GObject
1176 // <source_property>: the property on @source to bind
1177 // <target>: the target #GObject
1178 // <target_property>: the property on @target to bind
1179 // <flags>: flags to pass to #GBinding
1180 // <transform_to>: the transformation function from the @source to the @target, or %NULL to use the default
1181 // <transform_from>: the transformation function from the @target to the @source, or %NULL to use the default
1182 // <user_data>: custom data to be passed to the transformation functions, or %NULL
1183 // <notify>: function to be called when disposing the binding, to free the resources used by the transformation functions
1184 static Binding* bind_property_full()(void* source, char* source_property, void* target, char* target_property, BindingFlags flags, BindingTransformFunc transform_to, BindingTransformFunc transform_from, void* user_data, GLib2.DestroyNotify notify) {
1185 return g_object_bind_property_full(source, source_property, target, target_property, flags, transform_to, transform_from, user_data, notify);
1188 // VERSION: 2.26
1189 // Creates a binding between @source_property on @source and @target_property
1190 // on @target, allowing you to set the transformation functions to be used by
1191 // the binding.
1193 // This function is the language bindings friendly version of
1194 // g_object_bind_property_full(), using #GClosure<!-- -->s instead of
1195 // function pointers.
1198 // binding between the two #GObject instances. The binding is released
1199 // whenever the #GBinding reference count reaches zero.
1200 // RETURNS: the #GBinding instance representing the
1201 // <source>: the source #GObject
1202 // <source_property>: the property on @source to bind
1203 // <target>: the target #GObject
1204 // <target_property>: the property on @target to bind
1205 // <flags>: flags to pass to #GBinding
1206 // <transform_to>: a #GClosure wrapping the transformation function from the @source to the @target, or %NULL to use the default
1207 // <transform_from>: a #GClosure wrapping the transformation function from the @target to the @source, or %NULL to use the default
1208 static Binding* bind_property_with_closures()(void* source, char* source_property, void* target, char* target_property, BindingFlags flags, Closure* transform_to, Closure* transform_from) {
1209 return g_object_bind_property_with_closures(source, source_property, target, target_property, flags, transform_to, transform_from);
1211 static size_t compat_control()(size_t what, void* data) {
1212 return g_object_compat_control(what, data);
1215 // Unintrospectable function: connect() / g_object_connect()
1216 // A convenience function to connect multiple signals at once.
1218 // The signal specs expected by this function have the form
1219 // "modifier::signal_name", where modifier can be one of the following:
1220 // <variablelist>
1221 // <varlistentry>
1222 // <term>signal</term>
1223 // <listitem><para>
1224 // equivalent to <literal>g_signal_connect_data (..., NULL, 0)</literal>
1225 // </para></listitem>
1226 // </varlistentry>
1227 // <varlistentry>
1228 // <term>object_signal</term>
1229 // <term>object-signal</term>
1230 // <listitem><para>
1231 // equivalent to <literal>g_signal_connect_object (..., 0)</literal>
1232 // </para></listitem>
1233 // </varlistentry>
1234 // <varlistentry>
1235 // <term>swapped_signal</term>
1236 // <term>swapped-signal</term>
1237 // <listitem><para>
1238 // equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED)</literal>
1239 // </para></listitem>
1240 // </varlistentry>
1241 // <varlistentry>
1242 // <term>swapped_object_signal</term>
1243 // <term>swapped-object-signal</term>
1244 // <listitem><para>
1245 // equivalent to <literal>g_signal_connect_object (..., G_CONNECT_SWAPPED)</literal>
1246 // </para></listitem>
1247 // </varlistentry>
1248 // <varlistentry>
1249 // <term>signal_after</term>
1250 // <term>signal-after</term>
1251 // <listitem><para>
1252 // equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_AFTER)</literal>
1253 // </para></listitem>
1254 // </varlistentry>
1255 // <varlistentry>
1256 // <term>object_signal_after</term>
1257 // <term>object-signal-after</term>
1258 // <listitem><para>
1259 // equivalent to <literal>g_signal_connect_object (..., G_CONNECT_AFTER)</literal>
1260 // </para></listitem>
1261 // </varlistentry>
1262 // <varlistentry>
1263 // <term>swapped_signal_after</term>
1264 // <term>swapped-signal-after</term>
1265 // <listitem><para>
1266 // equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER)</literal>
1267 // </para></listitem>
1268 // </varlistentry>
1269 // <varlistentry>
1270 // <term>swapped_object_signal_after</term>
1271 // <term>swapped-object-signal-after</term>
1272 // <listitem><para>
1273 // equivalent to <literal>g_signal_connect_object (..., G_CONNECT_SWAPPED | G_CONNECT_AFTER)</literal>
1274 // </para></listitem>
1275 // </varlistentry>
1276 // </variablelist>
1278 // |[
1279 // menu->toplevel = g_object_connect (g_object_new (GTK_TYPE_WINDOW,
1280 // "type", GTK_WINDOW_POPUP,
1281 // "child", menu,
1282 // NULL),
1283 // "signal::event", gtk_menu_window_event, menu,
1284 // "signal::size_request", gtk_menu_window_size_request, menu,
1285 // "signal::destroy", gtk_widget_destroyed, &amp;menu-&gt;toplevel,
1286 // NULL);
1287 // ]|
1288 // RETURNS: @object
1289 // <object>: a #GObject
1290 // <signal_spec>: the spec for the first signal
1291 alias g_object_connect connect; // Variadic
1293 // Unintrospectable function: disconnect() / g_object_disconnect()
1294 // A convenience function to disconnect multiple signals at once.
1296 // The signal specs expected by this function have the form
1297 // "any_signal", which means to disconnect any signal with matching
1298 // callback and data, or "any_signal::signal_name", which only
1299 // disconnects the signal named "signal_name".
1300 // <object>: a #GObject
1301 // <signal_spec>: the spec for the first signal
1302 alias g_object_disconnect disconnect; // Variadic
1304 // Unintrospectable function: get() / g_object_get()
1305 // Gets properties of an object.
1307 // In general, a copy is made of the property contents and the caller
1308 // is responsible for freeing the memory in the appropriate manner for
1309 // the type, for instance by calling g_free() or g_object_unref().
1311 // <example>
1312 // <title>Using g_object_get(<!-- -->)</title>
1313 // An example of using g_object_get() to get the contents
1314 // of three properties - one of type #G_TYPE_INT,
1315 // one of type #G_TYPE_STRING, and one of type #G_TYPE_OBJECT:
1316 // <programlisting>
1317 // gint intval;
1318 // gchar *strval;
1319 // GObject *objval;
1321 // g_object_get (my_object,
1322 // "int-property", &intval,
1323 // "str-property", &strval,
1324 // "obj-property", &objval,
1325 // NULL);
1327 // // Do something with intval, strval, objval
1329 // g_free (strval);
1330 // g_object_unref (objval);
1331 // </programlisting>
1332 // </example>
1333 // <object>: a #GObject
1334 // <first_property_name>: name of the first property to get
1335 alias g_object_get get; // Variadic
1337 // VERSION: 2.4
1338 // Find the #GParamSpec with the given name for an
1339 // interface. Generally, the interface vtable passed in as @g_iface
1340 // will be the default vtable from g_type_default_interface_ref(), or,
1341 // if you know the interface has already been loaded,
1342 // g_type_default_interface_peek().
1345 // interface with the name @property_name, or %NULL if no
1346 // such property exists.
1347 // RETURNS: the #GParamSpec for the property of the
1348 // <g_iface>: any interface vtable for the interface, or the default vtable for the interface
1349 // <property_name>: name of a property to lookup.
1350 static ParamSpec* interface_find_property()(void* g_iface, char* property_name) {
1351 return g_object_interface_find_property(g_iface, property_name);
1354 // VERSION: 2.4
1355 // Add a property to an interface; this is only useful for interfaces
1356 // that are added to GObject-derived types. Adding a property to an
1357 // interface forces all objects classes with that interface to have a
1358 // compatible property. The compatible property could be a newly
1359 // created #GParamSpec, but normally
1360 // g_object_class_override_property() will be used so that the object
1361 // class only needs to provide an implementation and inherits the
1362 // property description, default value, bounds, and so forth from the
1363 // interface property.
1365 // This function is meant to be called from the interface's default
1366 // vtable initialization function (the @class_init member of
1367 // #GTypeInfo.) It must not be called after after @class_init has
1368 // been called for any object types implementing this interface.
1369 // <g_iface>: any interface vtable for the interface, or the default vtable for the interface.
1370 // <pspec>: the #GParamSpec for the new property
1371 static void interface_install_property()(void* g_iface, ParamSpec* pspec) {
1372 g_object_interface_install_property(g_iface, pspec);
1375 // VERSION: 2.4
1376 // Lists the properties of an interface.Generally, the interface
1377 // vtable passed in as @g_iface will be the default vtable from
1378 // g_type_default_interface_ref(), or, if you know the interface has
1379 // already been loaded, g_type_default_interface_peek().
1382 // pointer to an array of pointers to #GParamSpec
1383 // structures. The paramspecs are owned by GLib, but the
1384 // array should be freed with g_free() when you are done with
1385 // it.
1386 // RETURNS: a
1387 // <g_iface>: any interface vtable for the interface, or the default vtable for the interface
1388 // <n_properties_p>: location to store number of properties returned.
1389 static ParamSpec** /*new container*/ interface_list_properties()(void* g_iface, /*out*/ uint* n_properties_p) {
1390 return g_object_interface_list_properties(g_iface, n_properties_p);
1393 // Unintrospectable function: new() / g_object_new()
1394 // Creates a new instance of a #GObject subtype and sets its properties.
1396 // Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY)
1397 // which are not explicitly specified are set to their default values.
1398 // RETURNS: a new instance of @object_type
1399 // <object_type>: the type id of the #GObject subtype to instantiate
1400 // <first_property_name>: the name of the first property
1401 alias g_object_new new_; // Variadic
1403 // Unintrospectable function: set() / g_object_set()
1404 // Sets properties on an object.
1405 // <object>: a #GObject
1406 // <first_property_name>: name of the first property to set
1407 alias g_object_set set; // Variadic
1409 // Unintrospectable method: add_toggle_ref() / g_object_add_toggle_ref()
1410 // VERSION: 2.8
1411 // Increases the reference count of the object by one and sets a
1412 // callback to be called when all other references to the object are
1413 // dropped, or when this is already the last reference to the object
1414 // and another reference is established.
1416 // This functionality is intended for binding @object to a proxy
1417 // object managed by another memory manager. This is done with two
1418 // paired references: the strong reference added by
1419 // g_object_add_toggle_ref() and a reverse reference to the proxy
1420 // object which is either a strong reference or weak reference.
1422 // The setup is that when there are no other references to @object,
1423 // only a weak reference is held in the reverse direction from @object
1424 // to the proxy object, but when there are other references held to
1425 // @object, a strong reference is held. The @notify callback is called
1426 // when the reference from @object to the proxy object should be
1427 // <firstterm>toggled</firstterm> from strong to weak (@is_last_ref
1428 // true) or weak to strong (@is_last_ref false).
1430 // Since a (normal) reference must be held to the object before
1431 // calling g_object_toggle_ref(), the initial state of the reverse
1432 // link is always strong.
1434 // Multiple toggle references may be added to the same gobject,
1435 // however if there are multiple toggle references to an object, none
1436 // of them will ever be notified until all but one are removed. For
1437 // this reason, you should only ever use a toggle reference if there
1438 // is important state in the proxy object.
1439 // <notify>: a function to call when this reference is the last reference to the object, or is no longer the last reference.
1440 // <data>: data to pass to @notify
1441 void add_toggle_ref()(ToggleNotify notify, void* data) {
1442 g_object_add_toggle_ref(&this, notify, data);
1445 // Unintrospectable method: add_weak_pointer() / g_object_add_weak_pointer()
1446 // Adds a weak reference from weak_pointer to @object to indicate that
1447 // the pointer located at @weak_pointer_location is only valid during
1448 // the lifetime of @object. When the @object is finalized,
1449 // @weak_pointer will be set to %NULL.
1450 // <weak_pointer_location>: The memory address of a pointer.
1451 void add_weak_pointer()(/*inout*/ void** weak_pointer_location) {
1452 g_object_add_weak_pointer(&this, weak_pointer_location);
1455 // VERSION: 2.10
1456 // This function is intended for #GObject implementations to re-enforce a
1457 // <link linkend="floating-ref">floating</link> object reference.
1458 // Doing this is seldom required: all
1459 // #GInitiallyUnowned<!-- -->s are created with a floating reference which
1460 // usually just needs to be sunken by calling g_object_ref_sink().
1461 void force_floating()() {
1462 g_object_force_floating(&this);
1465 // Increases the freeze count on @object. If the freeze count is
1466 // non-zero, the emission of "notify" signals on @object is
1467 // stopped. The signals are queued until the freeze count is decreased
1468 // to zero.
1470 // This is necessary for accessors that modify multiple properties to prevent
1471 // premature notification while the object is still being modified.
1472 void freeze_notify()() {
1473 g_object_freeze_notify(&this);
1476 // Gets a named field from the objects table of associations (see g_object_set_data()).
1477 // RETURNS: the data if found, or %NULL if no such data exists.
1478 // <key>: name of the key for that association
1479 void* get_data()(char* key) {
1480 return g_object_get_data(&this, key);
1483 // Gets a property of an object. @value must have been initialized to the
1484 // expected type of the property (or a type to which the expected type can be
1485 // transformed) using g_value_init().
1487 // In general, a copy is made of the property contents and the caller is
1488 // responsible for freeing the memory by calling g_value_unset().
1490 // Note that g_object_get_property() is really intended for language
1491 // bindings, g_object_get() is much more convenient for C programming.
1492 // <property_name>: the name of the property to get
1493 // <value>: return location for the property value
1494 void get_property()(char* property_name, Value* value) {
1495 g_object_get_property(&this, property_name, value);
1498 // This function gets back user data pointers stored via
1499 // g_object_set_qdata().
1500 // RETURNS: The user data pointer set, or %NULL
1501 // <quark>: A #GQuark, naming the user data pointer
1502 void* get_qdata()(GLib2.Quark quark) {
1503 return g_object_get_qdata(&this, quark);
1506 // Unintrospectable method: get_valist() / g_object_get_valist()
1507 // Gets properties of an object.
1509 // In general, a copy is made of the property contents and the caller
1510 // is responsible for freeing the memory in the appropriate manner for
1511 // the type, for instance by calling g_free() or g_object_unref().
1513 // See g_object_get().
1514 // <first_property_name>: name of the first property to get
1515 // <var_args>: return location for the first property, followed optionally by more name/return location pairs, followed by %NULL
1516 void get_valist()(char* first_property_name, va_list var_args) {
1517 g_object_get_valist(&this, first_property_name, var_args);
1520 // VERSION: 2.10
1521 // Checks whether @object has a <link linkend="floating-ref">floating</link>
1522 // reference.
1523 // RETURNS: %TRUE if @object has a floating reference
1524 int is_floating()() {
1525 return g_object_is_floating(&this);
1528 // Emits a "notify" signal for the property @property_name on @object.
1530 // When possible, eg. when signaling a property change from within the class
1531 // that registered the property, you should use g_object_notify_by_pspec()
1532 // instead.
1533 // <property_name>: the name of a property installed on the class of @object.
1534 void notify()(char* property_name) {
1535 g_object_notify(&this, property_name);
1538 // VERSION: 2.26
1539 // Emits a "notify" signal for the property specified by @pspec on @object.
1541 // This function omits the property name lookup, hence it is faster than
1542 // g_object_notify().
1544 // One way to avoid using g_object_notify() from within the
1545 // class that registered the properties, and using g_object_notify_by_pspec()
1546 // instead, is to store the GParamSpec used with
1547 // g_object_class_install_property() inside a static array, e.g.:
1549 // |[
1550 // enum
1551 // {
1552 // PROP_0,
1553 // PROP_FOO,
1554 // PROP_LAST
1555 // };
1557 // static GParamSpec *properties[PROP_LAST];
1559 // static void
1560 // my_object_class_init (MyObjectClass *klass)
1561 // {
1562 // properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
1563 // 0, 100,
1564 // 50,
1565 // G_PARAM_READWRITE);
1566 // g_object_class_install_property (gobject_class,
1567 // PROP_FOO,
1568 // properties[PROP_FOO]);
1569 // }
1570 // ]|
1572 // and then notify a change on the "foo" property with:
1574 // |[
1575 // g_object_notify_by_pspec (self, properties[PROP_FOO]);
1576 // ]|
1577 // <pspec>: the #GParamSpec of a property installed on the class of @object.
1578 void notify_by_pspec()(ParamSpec* pspec) {
1579 g_object_notify_by_pspec(&this, pspec);
1582 // Increases the reference count of @object.
1583 // RETURNS: the same @object
1584 Object* ref_()() {
1585 return g_object_ref(&this);
1588 // VERSION: 2.10
1589 // Increase the reference count of @object, and possibly remove the
1590 // <link linkend="floating-ref">floating</link> reference, if @object
1591 // has a floating reference.
1593 // In other words, if the object is floating, then this call "assumes
1594 // ownership" of the floating reference, converting it to a normal
1595 // reference by clearing the floating flag while leaving the reference
1596 // count unchanged. If the object is not floating, then this call
1597 // adds a new normal reference increasing the reference count by one.
1598 // RETURNS: @object
1599 Object* ref_sink()() {
1600 return g_object_ref_sink(&this);
1603 // Unintrospectable method: remove_toggle_ref() / g_object_remove_toggle_ref()
1604 // VERSION: 2.8
1605 // Removes a reference added with g_object_add_toggle_ref(). The
1606 // reference count of the object is decreased by one.
1607 // <notify>: a function to call when this reference is the last reference to the object, or is no longer the last reference.
1608 // <data>: data to pass to @notify
1609 void remove_toggle_ref()(ToggleNotify notify, void* data) {
1610 g_object_remove_toggle_ref(&this, notify, data);
1613 // Unintrospectable method: remove_weak_pointer() / g_object_remove_weak_pointer()
1614 // Removes a weak reference from @object that was previously added
1615 // using g_object_add_weak_pointer(). The @weak_pointer_location has
1616 // to match the one used with g_object_add_weak_pointer().
1617 // <weak_pointer_location>: The memory address of a pointer.
1618 void remove_weak_pointer()(/*inout*/ void** weak_pointer_location) {
1619 g_object_remove_weak_pointer(&this, weak_pointer_location);
1622 // Releases all references to other objects. This can be used to break
1623 // reference cycles.
1625 // This functions should only be called from object system implementations.
1626 void run_dispose()() {
1627 g_object_run_dispose(&this);
1630 // Each object carries around a table of associations from
1631 // strings to pointers. This function lets you set an association.
1633 // If the object already had an association with that name,
1634 // the old association will be destroyed.
1635 // <key>: name of the key
1636 // <data>: data to associate with that key
1637 void set_data()(char* key, void* data) {
1638 g_object_set_data(&this, key, data);
1641 // Unintrospectable method: set_data_full() / g_object_set_data_full()
1642 // Like g_object_set_data() except it adds notification
1643 // for when the association is destroyed, either by setting it
1644 // to a different value or when the object is destroyed.
1646 // Note that the @destroy callback is not called if @data is %NULL.
1647 // <key>: name of the key
1648 // <data>: data to associate with that key
1649 // <destroy>: function to call when the association is destroyed
1650 void set_data_full()(char* key, void* data, GLib2.DestroyNotify destroy) {
1651 g_object_set_data_full(&this, key, data, destroy);
1654 // Sets a property on an object.
1655 // <property_name>: the name of the property to set
1656 // <value>: the value
1657 void set_property()(char* property_name, Value* value) {
1658 g_object_set_property(&this, property_name, value);
1661 // Unintrospectable method: set_qdata() / g_object_set_qdata()
1662 // This sets an opaque, named pointer on an object.
1663 // The name is specified through a #GQuark (retrived e.g. via
1664 // g_quark_from_static_string()), and the pointer
1665 // can be gotten back from the @object with g_object_get_qdata()
1666 // until the @object is finalized.
1667 // Setting a previously set user data pointer, overrides (frees)
1668 // the old pointer set, using #NULL as pointer essentially
1669 // removes the data stored.
1670 // <quark>: A #GQuark, naming the user data pointer
1671 // <data>: An opaque user data pointer
1672 void set_qdata()(GLib2.Quark quark, void* data) {
1673 g_object_set_qdata(&this, quark, data);
1676 // Unintrospectable method: set_qdata_full() / g_object_set_qdata_full()
1677 // This function works like g_object_set_qdata(), but in addition,
1678 // a void (*destroy) (gpointer) function may be specified which is
1679 // called with @data as argument when the @object is finalized, or
1680 // the data is being overwritten by a call to g_object_set_qdata()
1681 // with the same @quark.
1682 // <quark>: A #GQuark, naming the user data pointer
1683 // <data>: An opaque user data pointer
1684 // <destroy>: Function to invoke with @data as argument, when @data needs to be freed
1685 void set_qdata_full()(GLib2.Quark quark, void* data, GLib2.DestroyNotify destroy) {
1686 g_object_set_qdata_full(&this, quark, data, destroy);
1689 // Unintrospectable method: set_valist() / g_object_set_valist()
1690 // Sets properties on an object.
1691 // <first_property_name>: name of the first property to set
1692 // <var_args>: value for the first property, followed optionally by more name/value pairs, followed by %NULL
1693 void set_valist()(char* first_property_name, va_list var_args) {
1694 g_object_set_valist(&this, first_property_name, var_args);
1697 // Remove a specified datum from the object's data associations,
1698 // without invoking the association's destroy handler.
1699 // RETURNS: the data if found, or %NULL if no such data exists.
1700 // <key>: name of the key
1701 void* /*new*/ steal_data()(char* key) {
1702 return g_object_steal_data(&this, key);
1705 // This function gets back user data pointers stored via
1706 // g_object_set_qdata() and removes the @data from object
1707 // without invoking its destroy() function (if any was
1708 // set).
1709 // Usually, calling this function is only required to update
1710 // user data pointers with a destroy notifier, for example:
1711 // |[
1712 // void
1713 // object_add_to_user_list (GObject *object,
1714 // const gchar *new_string)
1715 // {
1716 // // the quark, naming the object data
1717 // GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
1718 // // retrive the old string list
1719 // GList *list = g_object_steal_qdata (object, quark_string_list);
1721 // // prepend new string
1722 // list = g_list_prepend (list, g_strdup (new_string));
1723 // // this changed 'list', so we need to set it again
1724 // g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
1725 // }
1726 // static void
1727 // free_string_list (gpointer data)
1728 // {
1729 // GList *node, *list = data;
1731 // for (node = list; node; node = node->next)
1732 // g_free (node->data);
1733 // g_list_free (list);
1734 // }
1735 // ]|
1736 // Using g_object_get_qdata() in the above example, instead of
1737 // g_object_steal_qdata() would have left the destroy function set,
1738 // and thus the partial string list would have been freed upon
1739 // g_object_set_qdata_full().
1740 // RETURNS: The user data pointer set, or %NULL
1741 // <quark>: A #GQuark, naming the user data pointer
1742 void* /*new*/ steal_qdata()(GLib2.Quark quark) {
1743 return g_object_steal_qdata(&this, quark);
1746 // Reverts the effect of a previous call to
1747 // g_object_freeze_notify(). The freeze count is decreased on @object
1748 // and when it reaches zero, all queued "notify" signals are emitted.
1750 // It is an error to call this function when the freeze count is zero.
1751 void thaw_notify()() {
1752 g_object_thaw_notify(&this);
1755 // Decreases the reference count of @object. When its reference count
1756 // drops to 0, the object is finalized (i.e. its memory is freed).
1757 void unref()() {
1758 g_object_unref(&this);
1761 // This function essentially limits the life time of the @closure to
1762 // the life time of the object. That is, when the object is finalized,
1763 // the @closure is invalidated by calling g_closure_invalidate() on
1764 // it, in order to prevent invocations of the closure with a finalized
1765 // (nonexisting) object. Also, g_object_ref() and g_object_unref() are
1766 // added as marshal guards to the @closure, to ensure that an extra
1767 // reference count is held on @object during invocation of the
1768 // @closure. Usually, this function will be called on closures that
1769 // use this @object as closure data.
1770 // <closure>: GClosure to watch
1771 void watch_closure()(Closure* closure) {
1772 g_object_watch_closure(&this, closure);
1775 // Unintrospectable method: weak_ref() / g_object_weak_ref()
1776 // Adds a weak reference callback to an object. Weak references are
1777 // used for notification when an object is finalized. They are called
1778 // "weak references" because they allow you to safely hold a pointer
1779 // to an object without calling g_object_ref() (g_object_ref() adds a
1780 // strong reference, that is, forces the object to stay alive).
1781 // <notify>: callback to invoke before the object is freed
1782 // <data>: extra data to pass to notify
1783 void weak_ref()(WeakNotify notify, void* data) {
1784 g_object_weak_ref(&this, notify, data);
1787 // Unintrospectable method: weak_unref() / g_object_weak_unref()
1788 // Removes a weak reference callback to an object.
1789 // <notify>: callback to search for
1790 // <data>: data to search for
1791 void weak_unref()(WeakNotify notify, void* data) {
1792 g_object_weak_unref(&this, notify, data);
1795 // The notify signal is emitted on an object when one of its
1796 // properties has been changed. Note that getting this signal
1797 // doesn't guarantee that the value of the property has actually
1798 // changed, it may also be emitted when the setter for the property
1799 // is called to reinstate the previous value.
1801 // This signal is typically used to obtain change notification for a
1802 // single property, by specifying the property name as a detail in the
1803 // g_signal_connect() call, like this:
1804 // |[
1805 // g_signal_connect (text_view->buffer, "notify::paste-target-list",
1806 // G_CALLBACK (gtk_text_view_target_list_notify),
1807 // text_view)
1808 // ]|
1809 // It is important to note that you must use
1810 // <link linkend="canonical-parameter-name">canonical</link> parameter names as
1811 // detail strings for the notify signal.
1812 // <pspec>: the #GParamSpec of the property which changed.
1813 extern (C) alias static void function (Object* this_, ParamSpec* pspec, void* user_data=null) signal_notify;
1815 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1816 return super_.signal_connect!name(cb, data, cf);
1819 ulong signal_connect(string name:"notify", CB:signal_notify)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1820 return signal_connect_data!()(&this, cast(char*)"notify",
1821 cast(GObject2.Callback)cb, data, null, cf);
1826 // The class structure for the <structname>GObject</structname> type.
1828 // <example>
1829 // <title>Implementing singletons using a constructor</title>
1830 // <programlisting>
1831 // static MySingleton *the_singleton = NULL;
1833 // static GObject*
1834 // my_singleton_constructor (GType type,
1835 // guint n_construct_params,
1836 // GObjectConstructParam *construct_params)
1837 // {
1838 // GObject *object;
1840 // if (!the_singleton)
1841 // {
1842 // object = G_OBJECT_CLASS (parent_class)->constructor (type,
1843 // n_construct_params,
1844 // construct_params);
1845 // the_singleton = MY_SINGLETON (object);
1846 // }
1847 // else
1848 // object = g_object_ref (G_OBJECT (the_singleton));
1850 // return object;
1851 // }
1852 // </programlisting></example>
1853 struct ObjectClass {
1854 TypeClass g_type_class;
1855 private GLib2.SList* construct_properties;
1856 // Unintrospectable functionp: constructor() / ()
1857 extern (C) Object* function (Type type, uint n_construct_properties, ObjectConstructParam* construct_properties) constructor;
1858 extern (C) void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) set_property;
1859 extern (C) void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) get_property;
1860 extern (C) void function (Object* object) dispose;
1861 extern (C) void function (Object* object) finalize;
1862 extern (C) void function (Object* object, uint n_pspecs, ParamSpec** pspecs) dispatch_properties_changed;
1863 extern (C) void function (Object* object, ParamSpec* pspec) notify;
1864 extern (C) void function (Object* object) constructed;
1865 private size_t flags;
1866 private void*[6] pdummy;
1869 // Looks up the #GParamSpec for a property of a class.
1871 // %NULL if the class doesn't have a property of that name
1872 // RETURNS: the #GParamSpec for the property, or
1873 // <property_name>: the name of the property to look up
1874 ParamSpec* find_property()(char* property_name) {
1875 return g_object_class_find_property(&this, property_name);
1878 // VERSION: 2.26
1879 // Installs new properties from an array of #GParamSpec<!-- -->s. This is
1880 // usually done in the class initializer.
1882 // The property id of each property is the index of each #GParamSpec in
1883 // the @pspecs array.
1885 // The property id of 0 is treated specially by #GObject and it should not
1886 // be used to store a #GParamSpec.
1888 // This function should be used if you plan to use a static array of
1889 // #GParamSpec<!-- -->s and g_object_notify_by_pspec(). For instance, this
1890 // class initialization:
1892 // |[
1893 // enum {
1894 // PROP_0, PROP_FOO, PROP_BAR, N_PROPERTIES
1895 // };
1897 // static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, };
1899 // static void
1900 // my_object_class_init (MyObjectClass *klass)
1901 // {
1902 // GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
1904 // obj_properties[PROP_FOO] =
1905 // g_param_spec_int ("foo", "Foo", "Foo",
1906 // -1, G_MAXINT,
1907 // 0,
1908 // G_PARAM_READWRITE);
1910 // obj_properties[PROP_BAR] =
1911 // g_param_spec_string ("bar", "Bar", "Bar",
1912 // NULL,
1913 // G_PARAM_READWRITE);
1915 // gobject_class->set_property = my_object_set_property;
1916 // gobject_class->get_property = my_object_get_property;
1917 // g_object_class_install_properties (gobject_class,
1918 // N_PROPERTIES,
1919 // obj_properties);
1920 // }
1921 // ]|
1923 // allows calling g_object_notify_by_pspec() to notify of property changes:
1925 // |[
1926 // void
1927 // my_object_set_foo (MyObject *self, gint foo)
1928 // {
1929 // if (self->foo != foo)
1930 // {
1931 // self->foo = foo;
1932 // g_object_notify_by_pspec (G_OBJECT (self), obj_properties[PROP_FOO]);
1933 // }
1934 // }
1935 // ]|
1936 // <n_pspecs>: the length of the #GParamSpec<!-- -->s array
1937 // <pspecs>: the #GParamSpec<!-- -->s array defining the new properties
1938 void install_properties()(uint n_pspecs, ParamSpec** pspecs) {
1939 g_object_class_install_properties(&this, n_pspecs, pspecs);
1942 // Installs a new property. This is usually done in the class initializer.
1944 // Note that it is possible to redefine a property in a derived class,
1945 // by installing a property with the same name. This can be useful at times,
1946 // e.g. to change the range of allowed values or the default value.
1947 // <property_id>: the id for the new property
1948 // <pspec>: the #GParamSpec for the new property
1949 void install_property()(uint property_id, ParamSpec* pspec) {
1950 g_object_class_install_property(&this, property_id, pspec);
1953 // Get an array of #GParamSpec* for all properties of a class.
1955 // #GParamSpec* which should be freed after use
1956 // RETURNS: an array of
1957 // <n_properties>: return location for the length of the returned array
1958 ParamSpec** /*new container*/ list_properties()(/*out*/ uint* n_properties) {
1959 return g_object_class_list_properties(&this, n_properties);
1962 // VERSION: 2.4
1963 // Registers @property_id as referring to a property with the
1964 // name @name in a parent class or in an interface implemented
1965 // by @oclass. This allows this class to <firstterm>override</firstterm>
1966 // a property implementation in a parent class or to provide
1967 // the implementation of a property from an interface.
1969 // <note>
1970 // Internally, overriding is implemented by creating a property of type
1971 // #GParamSpecOverride; generally operations that query the properties of
1972 // the object class, such as g_object_class_find_property() or
1973 // g_object_class_list_properties() will return the overridden
1974 // property. However, in one case, the @construct_properties argument of
1975 // the @constructor virtual function, the #GParamSpecOverride is passed
1976 // instead, so that the @param_id field of the #GParamSpec will be
1977 // correct. For virtually all uses, this makes no difference. If you
1978 // need to get the overridden property, you can call
1979 // g_param_spec_get_redirect_target().
1980 // </note>
1981 // <property_id>: the new property ID
1982 // <name>: the name of a property registered in a parent class or in an interface of this class.
1983 void override_property()(uint property_id, char* name) {
1984 g_object_class_override_property(&this, property_id, name);
1989 // The <structname>GObjectConstructParam</structname> struct is an auxiliary
1990 // structure used to hand #GParamSpec/#GValue pairs to the @constructor of
1991 // a #GObjectClass.
1992 struct ObjectConstructParam {
1993 ParamSpec* pspec;
1994 Value* value;
1998 // The type of the @finalize function of #GObjectClass.
1999 // <object>: the #GObject being finalized
2000 extern (C) alias void function (Object* object) ObjectFinalizeFunc;
2003 // The type of the @get_property function of #GObjectClass.
2004 // <object>: a #GObject
2005 // <property_id>: the numeric id under which the property was registered with g_object_class_install_property().
2006 // <value>: a #GValue to return the property value in
2007 // <pspec>: the #GParamSpec describing the property
2008 extern (C) alias void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) ObjectGetPropertyFunc;
2011 // The type of the @set_property function of #GObjectClass.
2012 // <object>: a #GObject
2013 // <property_id>: the numeric id under which the property was registered with g_object_class_install_property().
2014 // <value>: the new value for the property
2015 // <pspec>: the #GParamSpec describing the property
2016 extern (C) alias void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) ObjectSetPropertyFunc;
2018 enum int PARAM_MASK = 255;
2019 enum int PARAM_READWRITE = 0;
2020 enum int PARAM_STATIC_STRINGS = 0;
2021 enum int PARAM_USER_SHIFT = 8;
2023 // Through the #GParamFlags flag values, certain aspects of parameters
2024 // can be configured.
2025 enum ParamFlags {
2026 READABLE = 1,
2027 WRITABLE = 2,
2028 CONSTRUCT = 4,
2029 CONSTRUCT_ONLY = 8,
2030 LAX_VALIDATION = 16,
2031 STATIC_NAME = 32,
2032 PRIVATE = 32,
2033 STATIC_NICK = 64,
2034 STATIC_BLURB = 128,
2035 DEPRECATED = cast(uint)2147483648
2038 // #GParamSpec is an object structure that encapsulates the metadata
2039 // required to specify parameters, such as e.g. #GObject properties.
2041 // <para id="canonical-parameter-name">
2042 // Parameter names need to start with a letter (a-z or A-Z). Subsequent
2043 // characters can be letters, numbers or a '-'.
2044 // All other characters are replaced by a '-' during construction.
2045 // The result of this replacement is called the canonical name of the
2046 // parameter.
2047 // </para>
2048 struct ParamSpec {
2049 TypeInstance g_type_instance;
2050 char* name;
2051 ParamFlags flags;
2052 Type value_type, owner_type;
2053 private char* _nick, _blurb;
2054 private GLib2.Data* qdata;
2055 private uint ref_count, param_id;
2058 // Unintrospectable function: internal() / g_param_spec_internal()
2059 // Creates a new #GParamSpec instance.
2061 // A property name consists of segments consisting of ASCII letters and
2062 // digits, separated by either the '-' or '_' character. The first
2063 // character of a property name must be a letter. Names which violate these
2064 // rules lead to undefined behaviour.
2066 // When creating and looking up a #GParamSpec, either separator can be
2067 // used, but they cannot be mixed. Using '-' is considerably more
2068 // efficient and in fact required when using property names as detail
2069 // strings for signals.
2071 // Beyond the name, #GParamSpec<!-- -->s have two more descriptive
2072 // strings associated with them, the @nick, which should be suitable
2073 // for use as a label for the property in a property editor, and the
2074 // @blurb, which should be a somewhat longer description, suitable for
2075 // e.g. a tooltip. The @nick and @blurb should ideally be localized.
2076 // RETURNS: a newly allocated #GParamSpec instance
2077 // <param_type>: the #GType for the property; must be derived from #G_TYPE_PARAM
2078 // <name>: the canonical name of the property
2079 // <nick>: the nickname of the property
2080 // <blurb>: a short description of the property
2081 // <flags>: a combination of #GParamFlags
2082 static void* internal()(Type param_type, char* name, char* nick, char* blurb, ParamFlags flags) {
2083 return g_param_spec_internal(param_type, name, nick, blurb, flags);
2086 // Get the short description of a #GParamSpec.
2087 // RETURNS: the short description of @pspec.
2088 char* get_blurb()() {
2089 return g_param_spec_get_blurb(&this);
2092 // Get the name of a #GParamSpec.
2094 // The name is always an "interned" string (as per g_intern_string()).
2095 // This allows for pointer-value comparisons.
2096 // RETURNS: the name of @pspec.
2097 char* get_name()() {
2098 return g_param_spec_get_name(&this);
2101 // Get the nickname of a #GParamSpec.
2102 // RETURNS: the nickname of @pspec.
2103 char* get_nick()() {
2104 return g_param_spec_get_nick(&this);
2107 // Gets back user data pointers stored via g_param_spec_set_qdata().
2108 // RETURNS: the user data pointer set, or %NULL
2109 // <quark>: a #GQuark, naming the user data pointer
2110 void* get_qdata()(GLib2.Quark quark) {
2111 return g_param_spec_get_qdata(&this, quark);
2114 // VERSION: 2.4
2115 // If the paramspec redirects operations to another paramspec,
2116 // returns that paramspec. Redirect is used typically for
2117 // providing a new implementation of a property in a derived
2118 // type while preserving all the properties from the parent
2119 // type. Redirection is established by creating a property
2120 // of type #GParamSpecOverride. See g_object_class_override_property()
2121 // for an example of the use of this capability.
2124 // paramspec should be redirected, or %NULL if none.
2125 // RETURNS: paramspec to which requests on this
2126 ParamSpec* get_redirect_target()() {
2127 return g_param_spec_get_redirect_target(&this);
2130 // Unintrospectable method: ref() / g_param_spec_ref()
2131 // Increments the reference count of @pspec.
2132 // RETURNS: the #GParamSpec that was passed into this function
2133 ParamSpec* ref_()() {
2134 return g_param_spec_ref(&this);
2137 // Unintrospectable method: ref_sink() / g_param_spec_ref_sink()
2138 // VERSION: 2.10
2139 // Convenience function to ref and sink a #GParamSpec.
2140 // RETURNS: the #GParamSpec that was passed into this function
2141 ParamSpec* ref_sink()() {
2142 return g_param_spec_ref_sink(&this);
2145 // Sets an opaque, named pointer on a #GParamSpec. The name is
2146 // specified through a #GQuark (retrieved e.g. via
2147 // g_quark_from_static_string()), and the pointer can be gotten back
2148 // from the @pspec with g_param_spec_get_qdata(). Setting a
2149 // previously set user data pointer, overrides (frees) the old pointer
2150 // set, using %NULL as pointer essentially removes the data stored.
2151 // <quark>: a #GQuark, naming the user data pointer
2152 // <data>: an opaque user data pointer
2153 void set_qdata()(GLib2.Quark quark, void* data) {
2154 g_param_spec_set_qdata(&this, quark, data);
2157 // Unintrospectable method: set_qdata_full() / g_param_spec_set_qdata_full()
2158 // This function works like g_param_spec_set_qdata(), but in addition,
2159 // a <literal>void (*destroy) (gpointer)</literal> function may be
2160 // specified which is called with @data as argument when the @pspec is
2161 // finalized, or the data is being overwritten by a call to
2162 // g_param_spec_set_qdata() with the same @quark.
2163 // <quark>: a #GQuark, naming the user data pointer
2164 // <data>: an opaque user data pointer
2165 // <destroy>: function to invoke with @data as argument, when @data needs to be freed
2166 void set_qdata_full()(GLib2.Quark quark, void* data, GLib2.DestroyNotify destroy) {
2167 g_param_spec_set_qdata_full(&this, quark, data, destroy);
2170 // The initial reference count of a newly created #GParamSpec is 1,
2171 // even though no one has explicitly called g_param_spec_ref() on it
2172 // yet. So the initial reference count is flagged as "floating", until
2173 // someone calls <literal>g_param_spec_ref (pspec); g_param_spec_sink
2174 // (pspec);</literal> in sequence on it, taking over the initial
2175 // reference count (thus ending up with a @pspec that has a reference
2176 // count of 1 still, but is not flagged "floating" anymore).
2177 void sink()() {
2178 g_param_spec_sink(&this);
2181 // Gets back user data pointers stored via g_param_spec_set_qdata()
2182 // and removes the @data from @pspec without invoking its destroy()
2183 // function (if any was set). Usually, calling this function is only
2184 // required to update user data pointers with a destroy notifier.
2185 // RETURNS: the user data pointer set, or %NULL
2186 // <quark>: a #GQuark, naming the user data pointer
2187 void* steal_qdata()(GLib2.Quark quark) {
2188 return g_param_spec_steal_qdata(&this, quark);
2191 // Unintrospectable method: unref() / g_param_spec_unref()
2192 // Decrements the reference count of a @pspec.
2193 void unref()() {
2194 g_param_spec_unref(&this);
2198 // A #GParamSpec derived structure that contains the meta data for boolean properties.
2199 struct ParamSpecBoolean /* : ParamSpec */ {
2200 alias parent_instance this;
2201 alias parent_instance super_;
2202 alias parent_instance paramspec;
2203 ParamSpec parent_instance;
2204 int default_value;
2207 // A #GParamSpec derived structure that contains the meta data for boxed properties.
2208 struct ParamSpecBoxed /* : ParamSpec */ {
2209 alias parent_instance this;
2210 alias parent_instance super_;
2211 alias parent_instance paramspec;
2212 ParamSpec parent_instance;
2215 // A #GParamSpec derived structure that contains the meta data for character properties.
2216 struct ParamSpecChar /* : ParamSpec */ {
2217 alias parent_instance this;
2218 alias parent_instance super_;
2219 alias parent_instance paramspec;
2220 ParamSpec parent_instance;
2221 byte minimum, maximum, default_value;
2225 // The class structure for the <structname>GParamSpec</structname> type.
2226 // Normally, <structname>GParamSpec</structname> classes are filled by
2227 // g_param_type_register_static().
2228 struct ParamSpecClass {
2229 TypeClass g_type_class;
2230 Type value_type;
2231 extern (C) void function (ParamSpec* pspec) finalize;
2232 extern (C) void function (ParamSpec* pspec, Value* value) value_set_default;
2233 extern (C) int function (ParamSpec* pspec, Value* value) value_validate;
2234 extern (C) int function (ParamSpec* pspec, Value* value1, Value* value2) values_cmp;
2235 private void*[4] dummy;
2238 // A #GParamSpec derived structure that contains the meta data for double properties.
2239 struct ParamSpecDouble /* : ParamSpec */ {
2240 alias parent_instance this;
2241 alias parent_instance super_;
2242 alias parent_instance paramspec;
2243 ParamSpec parent_instance;
2244 double minimum, maximum, default_value, epsilon;
2248 // A #GParamSpec derived structure that contains the meta data for enum
2249 // properties.
2250 struct ParamSpecEnum /* : ParamSpec */ {
2251 alias parent_instance this;
2252 alias parent_instance super_;
2253 alias parent_instance paramspec;
2254 ParamSpec parent_instance;
2255 EnumClass* enum_class;
2256 int default_value;
2260 // A #GParamSpec derived structure that contains the meta data for flags
2261 // properties.
2262 struct ParamSpecFlags /* : ParamSpec */ {
2263 alias parent_instance this;
2264 alias parent_instance super_;
2265 alias parent_instance paramspec;
2266 ParamSpec parent_instance;
2267 FlagsClass* flags_class;
2268 uint default_value;
2271 // A #GParamSpec derived structure that contains the meta data for float properties.
2272 struct ParamSpecFloat /* : ParamSpec */ {
2273 alias parent_instance this;
2274 alias parent_instance super_;
2275 alias parent_instance paramspec;
2276 ParamSpec parent_instance;
2277 float minimum, maximum, default_value, epsilon;
2280 // A #GParamSpec derived structure that contains the meta data for #GType properties.
2281 struct ParamSpecGType /* : ParamSpec */ /* Version 2.10 */ {
2282 alias parent_instance this;
2283 alias parent_instance super_;
2284 alias parent_instance paramspec;
2285 ParamSpec parent_instance;
2286 Type is_a_type;
2289 // A #GParamSpec derived structure that contains the meta data for integer properties.
2290 struct ParamSpecInt /* : ParamSpec */ {
2291 alias parent_instance this;
2292 alias parent_instance super_;
2293 alias parent_instance paramspec;
2294 ParamSpec parent_instance;
2295 int minimum, maximum, default_value;
2298 // A #GParamSpec derived structure that contains the meta data for 64bit integer properties.
2299 struct ParamSpecInt64 /* : ParamSpec */ {
2300 alias parent_instance this;
2301 alias parent_instance super_;
2302 alias parent_instance paramspec;
2303 ParamSpec parent_instance;
2304 long minimum, maximum, default_value;
2307 // A #GParamSpec derived structure that contains the meta data for long integer properties.
2308 struct ParamSpecLong /* : ParamSpec */ {
2309 alias parent_instance this;
2310 alias parent_instance super_;
2311 alias parent_instance paramspec;
2312 ParamSpec parent_instance;
2313 c_long minimum, maximum, default_value;
2316 // A #GParamSpec derived structure that contains the meta data for object properties.
2317 struct ParamSpecObject /* : ParamSpec */ {
2318 alias parent_instance this;
2319 alias parent_instance super_;
2320 alias parent_instance paramspec;
2321 ParamSpec parent_instance;
2325 // This is a type of #GParamSpec type that simply redirects operations to
2326 // another paramspec. All operations other than getting or
2327 // setting the value are redirected, including accessing the nick and
2328 // blurb, validating a value, and so forth. See
2329 // g_param_spec_get_redirect_target() for retrieving the overidden
2330 // property. #GParamSpecOverride is used in implementing
2331 // g_object_class_override_property(), and will not be directly useful
2332 // unless you are implementing a new base type similar to GObject.
2333 struct ParamSpecOverride /* : ParamSpec */ /* Version 2.4 */ {
2334 alias parent_instance this;
2335 alias parent_instance super_;
2336 alias parent_instance paramspec;
2337 ParamSpec parent_instance;
2338 private ParamSpec* overridden;
2342 // A #GParamSpec derived structure that contains the meta data for %G_TYPE_PARAM
2343 // properties.
2344 struct ParamSpecParam /* : ParamSpec */ {
2345 alias parent_instance this;
2346 alias parent_instance super_;
2347 alias parent_instance paramspec;
2348 ParamSpec parent_instance;
2351 // A #GParamSpec derived structure that contains the meta data for pointer properties.
2352 struct ParamSpecPointer /* : ParamSpec */ {
2353 alias parent_instance this;
2354 alias parent_instance super_;
2355 alias parent_instance paramspec;
2356 ParamSpec parent_instance;
2360 // A #GParamSpecPool maintains a collection of #GParamSpec<!-- -->s which can be
2361 // quickly accessed by owner and name. The implementation of the #GObject property
2362 // system uses such a pool to store the #GParamSpecs of the properties all object
2363 // types.
2364 struct ParamSpecPool {
2366 // Inserts a #GParamSpec in the pool.
2367 // <pspec>: the #GParamSpec to insert
2368 // <owner_type>: a #GType identifying the owner of @pspec
2369 void insert()(ParamSpec* pspec, Type owner_type) {
2370 g_param_spec_pool_insert(&this, pspec, owner_type);
2373 // Gets an array of all #GParamSpec<!-- -->s owned by @owner_type in
2374 // the pool.
2376 // allocated array containing pointers to all #GParamSpecs
2377 // owned by @owner_type in the pool
2378 // RETURNS: a newly
2379 // <owner_type>: the owner to look for
2380 // <n_pspecs_p>: return location for the length of the returned array
2381 ParamSpec** /*new container*/ list()(Type owner_type, /*out*/ uint* n_pspecs_p) {
2382 return g_param_spec_pool_list(&this, owner_type, n_pspecs_p);
2385 // Gets an #GList of all #GParamSpec<!-- -->s owned by @owner_type in
2386 // the pool.
2388 // #GList of all #GParamSpec<!-- -->s owned by @owner_type in
2389 // the pool#GParamSpec<!-- -->s.
2390 // RETURNS: a
2391 // <owner_type>: the owner to look for
2392 GLib2.List* /*new container*/ list_owned()(Type owner_type) {
2393 return g_param_spec_pool_list_owned(&this, owner_type);
2396 // Looks up a #GParamSpec in the pool.
2398 // matching #GParamSpec was found.
2399 // RETURNS: The found #GParamSpec, or %NULL if no
2400 // <param_name>: the name to look for
2401 // <owner_type>: the owner to look for
2402 // <walk_ancestors>: If %TRUE, also try to find a #GParamSpec with @param_name owned by an ancestor of @owner_type.
2403 ParamSpec* lookup()(char* param_name, Type owner_type, int walk_ancestors) {
2404 return g_param_spec_pool_lookup(&this, param_name, owner_type, walk_ancestors);
2407 // Removes a #GParamSpec from the pool.
2408 // <pspec>: the #GParamSpec to remove
2409 void remove()(ParamSpec* pspec) {
2410 g_param_spec_pool_remove(&this, pspec);
2413 // Creates a new #GParamSpecPool.
2415 // If @type_prefixing is %TRUE, lookups in the newly created pool will
2416 // allow to specify the owner as a colon-separated prefix of the
2417 // property name, like "GtkContainer:border-width". This feature is
2418 // deprecated, so you should always set @type_prefixing to %FALSE.
2419 // RETURNS: a newly allocated #GParamSpecPool.
2420 // <type_prefixing>: Whether the pool will support type-prefixed property names.
2421 static ParamSpecPool* new_()(int type_prefixing) {
2422 return g_param_spec_pool_new(type_prefixing);
2427 // A #GParamSpec derived structure that contains the meta data for string
2428 // properties.
2429 struct ParamSpecString /* : ParamSpec */ {
2430 alias parent_instance this;
2431 alias parent_instance super_;
2432 alias parent_instance paramspec;
2433 ParamSpec parent_instance;
2434 char* default_value, cset_first, cset_nth;
2435 char substitutor;
2436 static import std.bitmanip; mixin(std.bitmanip.bitfields!(
2437 uint, "null_fold_if_empty", 1,
2438 uint, "ensure_non_null", 1,
2439 uint, "__dummy32A", 30));
2443 // This structure is used to provide the type system with the information
2444 // required to initialize and destruct (finalize) a parameter's class and
2445 // instances thereof.
2446 // The initialized structure is passed to the g_param_type_register_static()
2447 // The type system will perform a deep copy of this structure, so its memory
2448 // does not need to be persistent across invocation of
2449 // g_param_type_register_static().
2450 struct ParamSpecTypeInfo {
2451 ushort instance_size, n_preallocs;
2452 extern (C) void function (ParamSpec* pspec) instance_init;
2453 Type value_type;
2454 extern (C) void function (ParamSpec* pspec) finalize;
2455 extern (C) void function (ParamSpec* pspec, Value* value) value_set_default;
2456 extern (C) int function (ParamSpec* pspec, Value* value) value_validate;
2457 extern (C) int function (ParamSpec* pspec, Value* value1, Value* value2) values_cmp;
2460 // A #GParamSpec derived structure that contains the meta data for unsigned character properties.
2461 struct ParamSpecUChar /* : ParamSpec */ {
2462 alias parent_instance this;
2463 alias parent_instance super_;
2464 alias parent_instance paramspec;
2465 ParamSpec parent_instance;
2466 ubyte minimum, maximum, default_value;
2469 // A #GParamSpec derived structure that contains the meta data for unsigned integer properties.
2470 struct ParamSpecUInt /* : ParamSpec */ {
2471 alias parent_instance this;
2472 alias parent_instance super_;
2473 alias parent_instance paramspec;
2474 ParamSpec parent_instance;
2475 uint minimum, maximum, default_value;
2478 // A #GParamSpec derived structure that contains the meta data for unsigned 64bit integer properties.
2479 struct ParamSpecUInt64 /* : ParamSpec */ {
2480 alias parent_instance this;
2481 alias parent_instance super_;
2482 alias parent_instance paramspec;
2483 ParamSpec parent_instance;
2484 ulong minimum, maximum, default_value;
2487 // A #GParamSpec derived structure that contains the meta data for unsigned long integer properties.
2488 struct ParamSpecULong /* : ParamSpec */ {
2489 alias parent_instance this;
2490 alias parent_instance super_;
2491 alias parent_instance paramspec;
2492 ParamSpec parent_instance;
2493 c_ulong minimum, maximum, default_value;
2496 // A #GParamSpec derived structure that contains the meta data for unichar (unsigned integer) properties.
2497 struct ParamSpecUnichar /* : ParamSpec */ {
2498 alias parent_instance this;
2499 alias parent_instance super_;
2500 alias parent_instance paramspec;
2501 ParamSpec parent_instance;
2502 dchar default_value;
2505 // A #GParamSpec derived structure that contains the meta data for #GValueArray properties.
2506 struct ParamSpecValueArray /* : ParamSpec */ {
2507 alias parent_instance this;
2508 alias parent_instance super_;
2509 alias parent_instance paramspec;
2510 ParamSpec parent_instance;
2511 ParamSpec* element_spec;
2512 uint fixed_n_elements;
2515 // A #GParamSpec derived structure that contains the meta data for #GVariant properties.
2516 struct ParamSpecVariant /* : ParamSpec */ /* Version 2.26 */ {
2517 alias parent_instance this;
2518 alias parent_instance super_;
2519 alias parent_instance paramspec;
2520 ParamSpec parent_instance;
2521 GLib2.VariantType* type;
2522 GLib2.Variant* default_value;
2523 private void*[4] padding;
2527 // The <structname>GParameter</structname> struct is an auxiliary structure used
2528 // to hand parameter name/value pairs to g_object_newv().
2529 struct Parameter {
2530 char* name;
2531 Value value;
2534 enum int SIGNAL_FLAGS_MASK = 255;
2535 enum int SIGNAL_MATCH_MASK = 63;
2537 // The signal accumulator is a special callback function that can be used
2538 // to collect return values of the various callbacks that are called
2539 // during a signal emission. The signal accumulator is specified at signal
2540 // creation time, if it is left %NULL, no accumulation of callback return
2541 // values is performed. The return value of signal emissions is then the
2542 // value returned by the last callback.
2544 // should be aborted. Returning %FALSE means to abort the
2545 // current emission and %TRUE is returned for continuation.
2546 // RETURNS: The accumulator function returns whether the signal emission
2547 // <ihint>: Signal invocation hint, see #GSignalInvocationHint.
2548 // <return_accu>: Accumulator to collect callback return values in, this is the return value of the current signal emission.
2549 // <handler_return>: A #GValue holding the return value of the signal handler.
2550 // <data>: Callback data that was specified when creating the signal.
2551 extern (C) alias int function (SignalInvocationHint* ihint, Value* return_accu, Value* handler_return, void* data) SignalAccumulator;
2554 // A simple function pointer to get invoked when the signal is emitted. This
2555 // allows you to tie a hook to the signal type, so that it will trap all
2556 // emissions of that signal, from any object.
2558 // You may not attach these to signals created with the #G_SIGNAL_NO_HOOKS flag.
2560 // hook is disconnected (and destroyed).
2561 // RETURNS: whether it wants to stay connected. If it returns %FALSE, the signal
2562 // <ihint>: Signal invocation hint, see #GSignalInvocationHint.
2563 // <n_param_values>: the number of parameters to the function, including the instance on which the signal was emitted.
2564 // <param_values>: the instance on which the signal was emitted, followed by the parameters of the emission.
2565 // <data>: user data associated with the hook.
2566 extern (C) alias int function (SignalInvocationHint* ihint, uint n_param_values, Value* param_values, void* data) SignalEmissionHook;
2569 // The signal flags are used to specify a signal's behaviour, the overall
2570 // signal description outlines how especially the RUN flags control the
2571 // stages of a signal emission.
2572 enum SignalFlags {
2573 RUN_FIRST = 1,
2574 RUN_LAST = 2,
2575 RUN_CLEANUP = 4,
2576 NO_RECURSE = 8,
2577 DETAILED = 16,
2578 ACTION = 32,
2579 NO_HOOKS = 64,
2580 MUST_COLLECT = 128
2583 // The #GSignalInvocationHint structure is used to pass on additional information
2584 // to callbacks during a signal emission.
2585 struct SignalInvocationHint {
2586 uint signal_id;
2587 GLib2.Quark detail;
2588 SignalFlags run_type;
2592 // The match types specify what g_signal_handlers_block_matched(),
2593 // g_signal_handlers_unblock_matched() and g_signal_handlers_disconnect_matched()
2594 // match signals by.
2595 enum SignalMatchType {
2596 ID = 1,
2597 DETAIL = 2,
2598 CLOSURE = 4,
2599 FUNC = 8,
2600 DATA = 16,
2601 UNBLOCKED = 32
2604 // A structure holding in-depth information for a specific signal. It is
2605 // filled in by the g_signal_query() function.
2606 struct SignalQuery {
2607 uint signal_id;
2608 char* signal_name;
2609 Type itype;
2610 SignalFlags signal_flags;
2611 Type return_type;
2612 uint n_params;
2613 Type* param_types;
2616 enum int TYPE_FUNDAMENTAL_MAX = 255;
2617 enum int TYPE_FUNDAMENTAL_SHIFT = 2;
2618 enum int TYPE_RESERVED_BSE_FIRST = 32;
2619 enum int TYPE_RESERVED_BSE_LAST = 48;
2620 enum int TYPE_RESERVED_GLIB_FIRST = 22;
2621 enum int TYPE_RESERVED_GLIB_LAST = 31;
2622 enum int TYPE_RESERVED_USER_FIRST = 49;
2624 // A callback function used for notification when the state
2625 // of a toggle reference changes. See g_object_add_toggle_ref().
2626 // <data>: Callback data passed to g_object_add_toggle_ref()
2627 // <object>: The object on which g_object_add_toggle_ref() was called.
2628 // <is_last_ref>: %TRUE if the toggle reference is now the last reference to the object. %FALSE if the toggle reference was the last reference and there are now other references.
2629 extern (C) alias void function (void* data, Object* object, int is_last_ref) ToggleNotify;
2631 // A union holding one collected value.
2632 union TypeCValue {
2633 int v_int;
2634 c_long v_long;
2635 long v_int64;
2636 double v_double;
2637 void* v_pointer;
2640 // An opaque structure used as the base of all classes.
2641 struct TypeClass {
2642 private Type g_type;
2644 // Unintrospectable method: get_private() / g_type_class_get_private()
2645 void* get_private()(Type private_type) {
2646 return g_type_class_get_private(&this, private_type);
2649 // This is a convenience function often needed in class initializers.
2650 // It returns the class structure of the immediate parent type of the
2651 // class passed in. Since derived classes hold a reference count on
2652 // their parent classes as long as they are instantiated, the returned
2653 // class will always exist. This function is essentially equivalent
2654 // to:
2656 // <programlisting>
2657 // g_type_class_peek (g_type_parent (G_TYPE_FROM_CLASS (g_class)));
2658 // </programlisting>
2660 // of @g_class.
2661 // RETURNS: The parent class
2662 TypeClass* peek_parent()() {
2663 return g_type_class_peek_parent(&this);
2666 // Decrements the reference count of the class structure being passed in.
2667 // Once the last reference count of a class has been released, classes
2668 // may be finalized by the type system, so further dereferencing of a
2669 // class pointer after g_type_class_unref() are invalid.
2670 void unref()() {
2671 g_type_class_unref(&this);
2674 // Unintrospectable method: unref_uncached() / g_type_class_unref_uncached()
2675 // A variant of g_type_class_unref() for use in #GTypeClassCacheFunc
2676 // implementations. It unreferences a class without consulting the chain
2677 // of #GTypeClassCacheFunc<!-- -->s, avoiding the recursion which would occur
2678 // otherwise.
2679 void unref_uncached()() {
2680 g_type_class_unref_uncached(&this);
2683 // VERSION: 2.4
2684 // Registers a private structure for an instantiatable type.
2686 // When an object is allocated, the private structures for
2687 // the type and all of its parent types are allocated
2688 // sequentially in the same memory block as the public
2689 // structures.
2691 // Note that the accumulated size of the private structures of
2692 // a type and all its parent types cannot excced 64kB.
2694 // This function should be called in the type's class_init() function.
2695 // The private structure can be retrieved using the
2696 // G_TYPE_INSTANCE_GET_PRIVATE() macro.
2698 // The following example shows attaching a private structure
2699 // <structname>MyObjectPrivate</structname> to an object
2700 // <structname>MyObject</structname> defined in the standard GObject
2701 // fashion.
2702 // type's class_init() function.
2704 // |[
2705 // typedef struct _MyObject MyObject;
2706 // typedef struct _MyObjectPrivate MyObjectPrivate;
2708 // struct _MyObject {
2709 // GObject parent;
2711 // MyObjectPrivate *priv;
2712 // };
2714 // struct _MyObjectPrivate {
2715 // int some_field;
2716 // };
2718 // static void
2719 // my_object_class_init (MyObjectClass *klass)
2720 // {
2721 // g_type_class_add_private (klass, sizeof (MyObjectPrivate));
2722 // }
2724 // static void
2725 // my_object_init (MyObject *my_object)
2726 // {
2727 // my_object->priv = G_TYPE_INSTANCE_GET_PRIVATE (my_object,
2728 // MY_TYPE_OBJECT,
2729 // MyObjectPrivate);
2730 // }
2732 // static int
2733 // my_object_get_some_field (MyObject *my_object)
2734 // {
2735 // MyObjectPrivate *priv = my_object->priv;
2737 // return priv->some_field;
2738 // }
2739 // ]|
2740 // <g_class>: class structure for an instantiatable type
2741 // <private_size>: size of private structure.
2742 static void add_private()(void* g_class, size_t private_size) {
2743 g_type_class_add_private(g_class, private_size);
2746 // This function is essentially the same as g_type_class_ref(), except that
2747 // the classes reference count isn't incremented. As a consequence, this function
2748 // may return %NULL if the class of the type passed in does not currently
2749 // exist (hasn't been referenced before).
2751 // structure for the given type ID or %NULL if the class does not
2752 // currently exist.
2753 // RETURNS: The #GTypeClass
2754 // <type>: Type ID of a classed type.
2755 static TypeClass* peek()(Type type) {
2756 return g_type_class_peek(type);
2759 // VERSION: 2.4
2760 // A more efficient version of g_type_class_peek() which works only for
2761 // static types.
2763 // structure for the given type ID or %NULL if the class does not
2764 // currently exist or is dynamically loaded.
2765 // RETURNS: The #GTypeClass
2766 // <type>: Type ID of a classed type.
2767 static TypeClass* peek_static()(Type type) {
2768 return g_type_class_peek_static(type);
2771 // Increments the reference count of the class structure belonging to
2772 // @type. This function will demand-create the class if it doesn't
2773 // exist already.
2775 // structure for the given type ID.
2776 // RETURNS: The #GTypeClass
2777 // <type>: Type ID of a classed type.
2778 static TypeClass* ref_()(Type type) {
2779 return g_type_class_ref(type);
2784 // A callback function which is called when the reference count of a class
2785 // drops to zero. It may use g_type_class_ref() to prevent the class from
2786 // being freed. You should not call g_type_class_unref() from a
2787 // #GTypeClassCacheFunc function to prevent infinite recursion, use
2788 // g_type_class_unref_uncached() instead.
2790 // The functions have to check the class id passed in to figure
2791 // whether they actually want to cache the class of this type, since all
2792 // classes are routed through the same #GTypeClassCacheFunc chain.
2794 // called, %FALSE to continue.
2795 // RETURNS: %TRUE to stop further #GTypeClassCacheFunc<!-- -->s from being
2796 // <cache_data>: data that was given to the g_type_add_class_cache_func() call
2797 // <g_class>: The #GTypeClass structure which is unreferenced
2798 extern (C) alias int function (void* cache_data, TypeClass* g_class) TypeClassCacheFunc;
2801 // The <type>GTypeDebugFlags</type> enumeration values can be passed to
2802 // g_type_init_with_debug_flags() to trigger debugging messages during runtime.
2803 // Note that the messages can also be triggered by setting the
2804 // <envar>GOBJECT_DEBUG</envar> environment variable to a ':'-separated list of
2805 // "objects" and "signals".
2806 enum TypeDebugFlags {
2807 NONE = 0,
2808 OBJECTS = 1,
2809 SIGNALS = 2,
2810 MASK = 3
2812 // Bit masks used to check or determine characteristics of a type.
2813 enum TypeFlags {
2814 ABSTRACT = 16,
2815 VALUE_ABSTRACT = 32
2818 // Bit masks used to check or determine specific characteristics of a
2819 // fundamental type.
2820 enum TypeFundamentalFlags {
2821 CLASSED = 1,
2822 INSTANTIATABLE = 2,
2823 DERIVABLE = 4,
2824 DEEP_DERIVABLE = 8
2827 // A structure that provides information to the type system which is
2828 // used specifically for managing fundamental types.
2829 struct TypeFundamentalInfo {
2830 TypeFundamentalFlags type_flags;
2834 // This structure is used to provide the type system with the information
2835 // required to initialize and destruct (finalize) a type's class and
2836 // its instances.
2837 // The initialized structure is passed to the g_type_register_static() function
2838 // (or is copied into the provided #GTypeInfo structure in the
2839 // g_type_plugin_complete_type_info()). The type system will perform a deep
2840 // copy of this structure, so its memory does not need to be persistent
2841 // across invocation of g_type_register_static().
2842 struct GTypeInfo {
2843 ushort class_size;
2844 BaseInitFunc base_init;
2845 BaseFinalizeFunc base_finalize;
2846 ClassInitFunc class_init;
2847 ClassFinalizeFunc class_finalize;
2848 const(void)* class_data;
2849 ushort instance_size, n_preallocs;
2850 InstanceInitFunc instance_init;
2851 TypeValueTable* value_table;
2854 // An opaque structure used as the base of all type instances.
2855 struct TypeInstance {
2856 private TypeClass* g_class;
2858 // Unintrospectable method: get_private() / g_type_instance_get_private()
2859 void* get_private()(Type private_type) {
2860 return g_type_instance_get_private(&this, private_type);
2864 // An opaque structure used as the base of all interface types.
2865 struct TypeInterface {
2866 private Type g_type, g_instance_type;
2869 // Returns the corresponding #GTypeInterface structure of the parent type
2870 // of the instance type to which @g_iface belongs. This is useful when
2871 // deriving the implementation of an interface from the parent type and
2872 // then possibly overriding some methods.
2874 // corresponding #GTypeInterface structure of the parent type of the
2875 // instance type to which @g_iface belongs, or %NULL if the parent
2876 // type doesn't conform to the interface.
2877 // RETURNS: The
2878 TypeInterface* peek_parent()() {
2879 return g_type_interface_peek_parent(&this);
2882 // Adds @prerequisite_type to the list of prerequisites of @interface_type.
2883 // This means that any type implementing @interface_type must also implement
2884 // @prerequisite_type. Prerequisites can be thought of as an alternative to
2885 // interface derivation (which GType doesn't support). An interface can have
2886 // at most one instantiatable prerequisite type.
2887 // <interface_type>: #GType value of an interface type.
2888 // <prerequisite_type>: #GType value of an interface or instantiatable type.
2889 static void add_prerequisite()(Type interface_type, Type prerequisite_type) {
2890 g_type_interface_add_prerequisite(interface_type, prerequisite_type);
2893 // Returns the #GTypePlugin structure for the dynamic interface
2894 // @interface_type which has been added to @instance_type, or %NULL if
2895 // @interface_type has not been added to @instance_type or does not
2896 // have a #GTypePlugin structure. See g_type_add_interface_dynamic().
2898 // interface @interface_type of @instance_type.
2899 // RETURNS: the #GTypePlugin for the dynamic
2900 // <instance_type>: the #GType value of an instantiatable type.
2901 // <interface_type>: the #GType value of an interface type.
2902 static TypePlugin* get_plugin()(Type instance_type, Type interface_type) {
2903 return g_type_interface_get_plugin(instance_type, interface_type);
2906 // Returns the #GTypeInterface structure of an interface to which the
2907 // passed in class conforms.
2909 // structure of iface_type if implemented by @instance_class, %NULL
2910 // otherwise
2911 // RETURNS: The GTypeInterface
2912 // <instance_class>: A #GTypeClass structure.
2913 // <iface_type>: An interface ID which this class conforms to.
2914 static TypeInterface* peek()(TypeClass* instance_class, Type iface_type) {
2915 return g_type_interface_peek(instance_class, iface_type);
2918 // VERSION: 2.2
2919 // Returns the prerequisites of an interfaces type.
2922 // newly-allocated zero-terminated array of #GType containing
2923 // the prerequisites of @interface_type
2924 // RETURNS: a
2925 // <interface_type>: an interface type
2926 // <n_prerequisites>: location to return the number of prerequisites, or %NULL
2927 static Type* /*new*/ prerequisites()(Type interface_type, /*out*/ uint* n_prerequisites=null) {
2928 return g_type_interface_prerequisites(interface_type, n_prerequisites);
2933 // VERSION: 2.4
2934 // A callback called after an interface vtable is initialized.
2935 // See g_type_add_interface_check().
2936 // <check_data>: data passed to g_type_add_interface_check().
2937 // <g_iface>: the interface that has been initialized
2938 extern (C) alias void function (void* check_data, void* g_iface) TypeInterfaceCheckFunc;
2941 // #GTypeModule provides a simple implementation of the #GTypePlugin
2942 // interface. The model of #GTypeModule is a dynamically loaded module
2943 // which implements some number of types and interface
2944 // implementations. When the module is loaded, it registers its types
2945 // and interfaces using g_type_module_register_type() and
2946 // g_type_module_add_interface(). As long as any instances of these
2947 // types and interface implementations are in use, the module is kept
2948 // loaded. When the types and interfaces are gone, the module may be
2949 // unloaded. If the types and interfaces become used again, the module
2950 // will be reloaded. Note that the last unref cannot happen in module
2951 // code, since that would lead to the caller's code being unloaded before
2952 // g_object_unref() returns to it.
2954 // Keeping track of whether the module should be loaded or not is done by
2955 // using a use count - it starts at zero, and whenever it is greater than
2956 // zero, the module is loaded. The use count is maintained internally by
2957 // the type system, but also can be explicitly controlled by
2958 // g_type_module_use() and g_type_module_unuse(). Typically, when loading
2959 // a module for the first type, g_type_module_use() will be used to load
2960 // it so that it can initialize its types. At some later point, when the
2961 // module no longer needs to be loaded except for the type
2962 // implementations it contains, g_type_module_unuse() is called.
2964 // #GTypeModule does not actually provide any implementation of module
2965 // loading and unloading. To create a particular module type you must
2966 // derive from #GTypeModule and implement the load and unload functions
2967 // in #GTypeModuleClass.
2968 struct TypeModule /* : Object */ {
2969 mixin TypePlugin.__interface__;
2970 alias parent_instance this;
2971 alias parent_instance super_;
2972 alias parent_instance object;
2973 Object parent_instance;
2974 uint use_count;
2975 GLib2.SList* type_infos, interface_infos;
2976 char* name;
2979 // Registers an additional interface for a type, whose interface lives
2980 // in the given type plugin. If the interface was already registered
2981 // for the type in this plugin, nothing will be done.
2983 // As long as any instances of the type exist, the type plugin will
2984 // not be unloaded.
2985 // <instance_type>: type to which to add the interface.
2986 // <interface_type>: interface type to add
2987 // <interface_info>: type information structure
2988 void add_interface()(Type instance_type, Type interface_type, InterfaceInfo* interface_info) {
2989 g_type_module_add_interface(&this, instance_type, interface_type, interface_info);
2992 // VERSION: 2.6
2993 // Looks up or registers an enumeration that is implemented with a particular
2994 // type plugin. If a type with name @type_name was previously registered,
2995 // the #GType identifier for the type is returned, otherwise the type
2996 // is newly registered, and the resulting #GType identifier returned.
2998 // As long as any instances of the type exist, the type plugin will
2999 // not be unloaded.
3000 // RETURNS: the new or existing type ID
3001 // <name>: name for the type
3002 // <const_static_values>: an array of #GEnumValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0.
3003 Type register_enum()(char* name, EnumValue* const_static_values) {
3004 return g_type_module_register_enum(&this, name, const_static_values);
3007 // VERSION: 2.6
3008 // Looks up or registers a flags type that is implemented with a particular
3009 // type plugin. If a type with name @type_name was previously registered,
3010 // the #GType identifier for the type is returned, otherwise the type
3011 // is newly registered, and the resulting #GType identifier returned.
3013 // As long as any instances of the type exist, the type plugin will
3014 // not be unloaded.
3015 // RETURNS: the new or existing type ID
3016 // <name>: name for the type
3017 // <const_static_values>: an array of #GFlagsValue structs for the possible flags values. The array is terminated by a struct with all members being 0.
3018 Type register_flags()(char* name, FlagsValue* const_static_values) {
3019 return g_type_module_register_flags(&this, name, const_static_values);
3022 // Looks up or registers a type that is implemented with a particular
3023 // type plugin. If a type with name @type_name was previously registered,
3024 // the #GType identifier for the type is returned, otherwise the type
3025 // is newly registered, and the resulting #GType identifier returned.
3027 // When reregistering a type (typically because a module is unloaded
3028 // then reloaded, and reinitialized), @module and @parent_type must
3029 // be the same as they were previously.
3031 // As long as any instances of the type exist, the type plugin will
3032 // not be unloaded.
3033 // RETURNS: the new or existing type ID
3034 // <parent_type>: the type for the parent class
3035 // <type_name>: name for the type
3036 // <type_info>: type information structure
3037 // <flags>: flags field providing details about the type
3038 Type register_type()(Type parent_type, char* type_name, GTypeInfo* type_info, TypeFlags flags) {
3039 return g_type_module_register_type(&this, parent_type, type_name, type_info, flags);
3042 // Sets the name for a #GTypeModule
3043 // <name>: a human-readable name to use in error messages.
3044 void set_name()(char* name) {
3045 g_type_module_set_name(&this, name);
3048 // Decreases the use count of a #GTypeModule by one. If the
3049 // result is zero, the module will be unloaded. (However, the
3050 // #GTypeModule will not be freed, and types associated with the
3051 // #GTypeModule are not unregistered. Once a #GTypeModule is
3052 // initialized, it must exist forever.)
3053 void unuse()() {
3054 g_type_module_unuse(&this);
3057 // Increases the use count of a #GTypeModule by one. If the
3058 // use count was zero before, the plugin will be loaded.
3059 // If loading the plugin fails, the use count is reset to
3060 // its prior value.
3062 // loading the plugin failed.
3063 // RETURNS: %FALSE if the plugin needed to be loaded and
3064 int use()() {
3065 return g_type_module_use(&this);
3070 // In order to implement dynamic loading of types based on #GTypeModule,
3071 // the @load and @unload functions in #GTypeModuleClass must be implemented.
3072 struct TypeModuleClass {
3073 ObjectClass parent_class;
3074 extern (C) int function (TypeModule* module_) load;
3075 extern (C) void function (TypeModule* module_) unload;
3076 extern (C) void function () reserved1;
3077 extern (C) void function () reserved2;
3078 extern (C) void function () reserved3;
3079 extern (C) void function () reserved4;
3083 // The GObject type system supports dynamic loading of types. The
3084 // #GTypePlugin interface is used to handle the lifecycle of
3085 // dynamically loaded types. It goes as follows:
3087 // <orderedlist>
3088 // <listitem><para>
3089 // The type is initially introduced (usually upon loading the module
3090 // the first time, or by your main application that knows what modules
3091 // introduces what types), like this:
3092 // |[
3093 // new_type_id = g_type_register_dynamic (parent_type_id,
3094 // "TypeName",
3095 // new_type_plugin,
3096 // type_flags);
3097 // ]|
3098 // where <literal>new_type_plugin</literal> is an implementation of the
3099 // #GTypePlugin interface.
3100 // </para></listitem>
3101 // <listitem><para>
3102 // The type's implementation is referenced, e.g. through
3103 // g_type_class_ref() or through g_type_create_instance() (this is
3104 // being called by g_object_new()) or through one of the above done on
3105 // a type derived from <literal>new_type_id</literal>.
3106 // </para></listitem>
3107 // <listitem><para>
3108 // This causes the type system to load the type's implementation by calling
3109 // g_type_plugin_use() and g_type_plugin_complete_type_info() on
3110 // <literal>new_type_plugin</literal>.
3111 // </para></listitem>
3112 // <listitem><para>
3113 // At some point the type's implementation isn't required anymore, e.g. after
3114 // g_type_class_unref() or g_type_free_instance() (called when the reference
3115 // count of an instance drops to zero).
3116 // </para></listitem>
3117 // <listitem><para>
3118 // This causes the type system to throw away the information retrieved from
3119 // g_type_plugin_complete_type_info() and then it calls
3120 // g_type_plugin_unuse() on <literal>new_type_plugin</literal>.
3121 // </para></listitem>
3122 // <listitem><para>
3123 // Things may repeat from the second step.
3124 // </para></listitem>
3125 // </orderedlist>
3127 // So basically, you need to implement a #GTypePlugin type that
3128 // carries a use_count, once use_count goes from zero to one, you need
3129 // to load the implementation to successfully handle the upcoming
3130 // g_type_plugin_complete_type_info() call. Later, maybe after
3131 // succeeding use/unuse calls, once use_count drops to zero, you can
3132 // unload the implementation again. The type system makes sure to call
3133 // g_type_plugin_use() and g_type_plugin_complete_type_info() again
3134 // when the type is needed again.
3136 // #GTypeModule is an implementation of #GTypePlugin that already
3137 // implements most of this except for the actual module loading and
3138 // unloading. It even handles multiple registered types per module.
3139 struct TypePlugin /* Interface */ {
3140 mixin template __interface__() {
3141 // Calls the @complete_interface_info function from the
3142 // #GTypePluginClass of @plugin. There should be no need to use this
3143 // function outside of the GObject type system itself.
3144 // <instance_type>: the #GType of an instantiable type to which the interface is added
3145 // <interface_type>: the #GType of the interface whose info is completed
3146 // <info>: the #GInterfaceInfo to fill in
3147 void complete_interface_info()(Type instance_type, Type interface_type, InterfaceInfo* info) {
3148 g_type_plugin_complete_interface_info(cast(TypePlugin*)&this, instance_type, interface_type, info);
3151 // Calls the @complete_type_info function from the #GTypePluginClass of @plugin.
3152 // There should be no need to use this function outside of the GObject
3153 // type system itself.
3154 // <g_type>: the #GType whose info is completed
3155 // <info>: the #GTypeInfo struct to fill in
3156 // <value_table>: the #GTypeValueTable to fill in
3157 void complete_type_info()(Type g_type, GTypeInfo* info, TypeValueTable* value_table) {
3158 g_type_plugin_complete_type_info(cast(TypePlugin*)&this, g_type, info, value_table);
3161 // Calls the @unuse_plugin function from the #GTypePluginClass of
3162 // @plugin. There should be no need to use this function outside of
3163 // the GObject type system itself.
3164 void unuse()() {
3165 g_type_plugin_unuse(cast(TypePlugin*)&this);
3168 // Calls the @use_plugin function from the #GTypePluginClass of
3169 // @plugin. There should be no need to use this function outside of
3170 // the GObject type system itself.
3171 void use()() {
3172 g_type_plugin_use(cast(TypePlugin*)&this);
3175 mixin __interface__;
3179 // The #GTypePlugin interface is used by the type system in order to handle
3180 // the lifecycle of dynamically loaded types.
3181 struct TypePluginClass {
3182 private TypeInterface base_iface;
3183 TypePluginUse use_plugin;
3184 TypePluginUnuse unuse_plugin;
3185 TypePluginCompleteTypeInfo complete_type_info;
3186 TypePluginCompleteInterfaceInfo complete_interface_info;
3190 // The type of the @complete_interface_info function of #GTypePluginClass.
3191 // <plugin>: the #GTypePlugin
3192 // <instance_type>: the #GType of an instantiable type to which the interface is added
3193 // <interface_type>: the #GType of the interface whose info is completed
3194 // <info>: the #GInterfaceInfo to fill in
3195 extern (C) alias void function (TypePlugin* plugin, Type instance_type, Type interface_type, InterfaceInfo* info) TypePluginCompleteInterfaceInfo;
3198 // The type of the @complete_type_info function of #GTypePluginClass.
3199 // <plugin>: the #GTypePlugin
3200 // <g_type>: the #GType whose info is completed
3201 // <info>: the #GTypeInfo struct to fill in
3202 // <value_table>: the #GTypeValueTable to fill in
3203 extern (C) alias void function (TypePlugin* plugin, Type g_type, GTypeInfo* info, TypeValueTable* value_table) TypePluginCompleteTypeInfo;
3206 // The type of the @unuse_plugin function of #GTypePluginClass.
3207 // <plugin>: the #GTypePlugin whose use count should be decreased
3208 extern (C) alias void function (TypePlugin* plugin) TypePluginUnuse;
3211 // The type of the @use_plugin function of #GTypePluginClass, which gets called
3212 // to increase the use count of @plugin.
3213 // <plugin>: the #GTypePlugin whose use count should be increased
3214 extern (C) alias void function (TypePlugin* plugin) TypePluginUse;
3217 // A structure holding information for a specific type. It is
3218 // filled in by the g_type_query() function.
3219 struct TypeQuery {
3220 Type type;
3221 char* type_name;
3222 uint class_size, instance_size;
3226 // The #GTypeValueTable provides the functions required by the #GValue implementation,
3227 // to serve as a container for values of a type.
3228 struct TypeValueTable {
3229 extern (C) void function (Value* value) value_init;
3230 extern (C) void function (Value* value) value_free;
3231 extern (C) void function (Value* src_value, Value* dest_value) value_copy;
3232 // Unintrospectable functionp: value_peek_pointer() / ()
3233 extern (C) void* function (Value* value) value_peek_pointer;
3234 char* collect_format;
3235 extern (C) char* /*new*/ function (Value* value, uint n_collect_values, TypeCValue* collect_values, uint collect_flags) collect_value;
3236 char* lcopy_format;
3237 extern (C) char* /*new*/ function (Value* value, uint n_collect_values, TypeCValue* collect_values, uint collect_flags) lcopy_value;
3240 // Unintrospectable function: peek() / g_type_value_table_peek()
3241 // Returns the location of the #GTypeValueTable associated with @type.
3242 // <emphasis>Note that this function should only be used from source code
3243 // that implements or has internal knowledge of the implementation of
3244 // @type.</emphasis>
3246 // %NULL if there is no #GTypeValueTable associated with @type.
3247 // RETURNS: Location of the #GTypeValueTable associated with @type or
3248 // <type>: A #GType value.
3249 static TypeValueTable* peek()(Type type) {
3250 return g_type_value_table_peek(type);
3254 enum int VALUE_COLLECT_FORMAT_MAX_LENGTH = 8;
3255 enum int VALUE_NOCOPY_CONTENTS = 134217728;
3257 // An opaque structure used to hold different types of values.
3258 // The data within the structure has protected scope: it is accessible only
3259 // to functions within a #GTypeValueTable structure, or implementations of
3260 // the g_value_*() API. That is, code portions which implement new fundamental
3261 // types.
3262 // #GValue users cannot make any assumptions about how data is stored
3263 // within the 2 element @data union, and the @g_type member should
3264 // only be accessed through the G_VALUE_TYPE() macro.
3265 struct Value {
3266 private Type g_type;
3267 _Value__data__union[2] data;
3270 // Copies the value of @src_value into @dest_value.
3271 // <dest_value>: An initialized #GValue structure of the same type as @src_value.
3272 void copy()(Value* dest_value) {
3273 g_value_copy(&this, dest_value);
3276 // Unintrospectable method: dup_boxed() / g_value_dup_boxed()
3277 // Get the contents of a %G_TYPE_BOXED derived #GValue. Upon getting,
3278 // the boxed value is duplicated and needs to be later freed with
3279 // g_boxed_free(), e.g. like: g_boxed_free (G_VALUE_TYPE (@value),
3280 // return_value);
3281 // RETURNS: boxed contents of @value
3282 void* dup_boxed()() {
3283 return g_value_dup_boxed(&this);
3286 // Get the contents of a %G_TYPE_OBJECT derived #GValue, increasing
3287 // its reference count. If the contents of the #GValue are %NULL, then
3288 // %NULL will be returned.
3290 // should be unreferenced when no longer needed.
3291 // RETURNS: object content of @value,
3292 Object* /*new*/ dup_object()() {
3293 return g_value_dup_object(&this);
3296 // Unintrospectable method: dup_param() / g_value_dup_param()
3297 // Get the contents of a %G_TYPE_PARAM #GValue, increasing its
3298 // reference count.
3300 // no longer needed.
3301 // RETURNS: #GParamSpec content of @value, should be unreferenced when
3302 ParamSpec* dup_param()() {
3303 return g_value_dup_param(&this);
3306 // Get a copy the contents of a %G_TYPE_STRING #GValue.
3307 // RETURNS: a newly allocated copy of the string content of @value
3308 char* /*new*/ dup_string()() {
3309 return g_value_dup_string(&this);
3312 // VERSION: 2.26
3313 // Get the contents of a variant #GValue, increasing its refcount.
3315 // g_variant_unref() when no longer needed
3316 // RETURNS: variant contents of @value, should be unrefed using
3317 GLib2.Variant* /*new*/ dup_variant()() {
3318 return g_value_dup_variant(&this);
3321 // Determines if @value will fit inside the size of a pointer value.
3322 // This is an internal function introduced mainly for C marshallers.
3323 // RETURNS: %TRUE if @value will fit inside a pointer value.
3324 int fits_pointer()() {
3325 return g_value_fits_pointer(&this);
3328 // Get the contents of a %G_TYPE_BOOLEAN #GValue.
3329 // RETURNS: boolean contents of @value
3330 int get_boolean()() {
3331 return g_value_get_boolean(&this);
3334 // Get the contents of a %G_TYPE_BOXED derived #GValue.
3335 // RETURNS: boxed contents of @value
3336 void* get_boxed()() {
3337 return g_value_get_boxed(&this);
3340 // Get the contents of a %G_TYPE_CHAR #GValue.
3341 // RETURNS: character contents of @value
3342 char get_char()() {
3343 return g_value_get_char(&this);
3346 // Get the contents of a %G_TYPE_DOUBLE #GValue.
3347 // RETURNS: double contents of @value
3348 double get_double()() {
3349 return g_value_get_double(&this);
3352 // Get the contents of a %G_TYPE_ENUM #GValue.
3353 // RETURNS: enum contents of @value
3354 int get_enum()() {
3355 return g_value_get_enum(&this);
3358 // Get the contents of a %G_TYPE_FLAGS #GValue.
3359 // RETURNS: flags contents of @value
3360 uint get_flags()() {
3361 return g_value_get_flags(&this);
3364 // Get the contents of a %G_TYPE_FLOAT #GValue.
3365 // RETURNS: float contents of @value
3366 float get_float()() {
3367 return g_value_get_float(&this);
3370 // Get the contents of a %G_TYPE_INT #GValue.
3371 // RETURNS: integer contents of @value
3372 int get_int()() {
3373 return g_value_get_int(&this);
3376 // Get the contents of a %G_TYPE_INT64 #GValue.
3377 // RETURNS: 64bit integer contents of @value
3378 long get_int64()() {
3379 return g_value_get_int64(&this);
3382 // Get the contents of a %G_TYPE_LONG #GValue.
3383 // RETURNS: long integer contents of @value
3384 c_long get_long()() {
3385 return g_value_get_long(&this);
3388 // Get the contents of a %G_TYPE_OBJECT derived #GValue.
3389 // RETURNS: object contents of @value
3390 Object* get_object()() {
3391 return g_value_get_object(&this);
3394 // Get the contents of a %G_TYPE_PARAM #GValue.
3395 // RETURNS: #GParamSpec content of @value
3396 ParamSpec* get_param()() {
3397 return g_value_get_param(&this);
3400 // Get the contents of a pointer #GValue.
3401 // RETURNS: pointer contents of @value
3402 void* get_pointer()() {
3403 return g_value_get_pointer(&this);
3406 // Get the contents of a %G_TYPE_STRING #GValue.
3407 // RETURNS: string content of @value
3408 char* get_string()() {
3409 return g_value_get_string(&this);
3412 // Get the contents of a %G_TYPE_UCHAR #GValue.
3413 // RETURNS: unsigned character contents of @value
3414 ubyte get_uchar()() {
3415 return g_value_get_uchar(&this);
3418 // Get the contents of a %G_TYPE_UINT #GValue.
3419 // RETURNS: unsigned integer contents of @value
3420 uint get_uint()() {
3421 return g_value_get_uint(&this);
3424 // Get the contents of a %G_TYPE_UINT64 #GValue.
3425 // RETURNS: unsigned 64bit integer contents of @value
3426 ulong get_uint64()() {
3427 return g_value_get_uint64(&this);
3430 // Get the contents of a %G_TYPE_ULONG #GValue.
3431 // RETURNS: unsigned long integer contents of @value
3432 c_ulong get_ulong()() {
3433 return g_value_get_ulong(&this);
3436 // VERSION: 2.26
3437 // Get the contents of a variant #GValue.
3438 // RETURNS: variant contents of @value
3439 GLib2.Variant* /*new*/ get_variant()() {
3440 return g_value_get_variant(&this);
3443 // Initializes @value with the default value of @type.
3444 // RETURNS: the #GValue structure that has been passed in
3445 // <g_type>: Type the #GValue should hold values of.
3446 Value* init()(Type g_type) {
3447 return g_value_init(&this, g_type);
3450 // function asserts that g_value_fits_pointer() returned %TRUE for the
3451 // passed in value. This is an internal function introduced mainly
3452 // for C marshallers.
3453 // RETURNS: the value contents as pointer. This
3454 void* peek_pointer()() {
3455 return g_value_peek_pointer(&this);
3458 // Clears the current value in @value and resets it to the default value
3459 // (as if the value had just been initialized).
3460 // RETURNS: the #GValue structure that has been passed in
3461 Value* /*new*/ reset()() {
3462 return g_value_reset(&this);
3465 // Set the contents of a %G_TYPE_BOOLEAN #GValue to @v_boolean.
3466 // <v_boolean>: boolean value to be set
3467 void set_boolean()(int v_boolean) {
3468 g_value_set_boolean(&this, v_boolean);
3471 // Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.
3472 // <v_boxed>: boxed value to be set
3473 void set_boxed()(const(void)* v_boxed=null) {
3474 g_value_set_boxed(&this, v_boxed);
3477 // DEPRECATED (v2.4) method: set_boxed_take_ownership - Use g_value_take_boxed() instead.
3478 // This is an internal function introduced mainly for C marshallers.
3479 // <v_boxed>: duplicated unowned boxed value to be set
3480 void set_boxed_take_ownership()(const(void)* v_boxed=null) {
3481 g_value_set_boxed_take_ownership(&this, v_boxed);
3484 // Set the contents of a %G_TYPE_CHAR #GValue to @v_char.
3485 // <v_char>: character value to be set
3486 void set_char()(char v_char) {
3487 g_value_set_char(&this, v_char);
3490 // Set the contents of a %G_TYPE_DOUBLE #GValue to @v_double.
3491 // <v_double>: double value to be set
3492 void set_double()(double v_double) {
3493 g_value_set_double(&this, v_double);
3496 // Set the contents of a %G_TYPE_ENUM #GValue to @v_enum.
3497 // <v_enum>: enum value to be set
3498 void set_enum()(int v_enum) {
3499 g_value_set_enum(&this, v_enum);
3502 // Set the contents of a %G_TYPE_FLAGS #GValue to @v_flags.
3503 // <v_flags>: flags value to be set
3504 void set_flags()(uint v_flags) {
3505 g_value_set_flags(&this, v_flags);
3508 // Set the contents of a %G_TYPE_FLOAT #GValue to @v_float.
3509 // <v_float>: float value to be set
3510 void set_float()(float v_float) {
3511 g_value_set_float(&this, v_float);
3514 // VERSION: 2.12
3515 // Set the contents of a %G_TYPE_GTYPE #GValue to @v_gtype.
3516 // <v_gtype>: #GType to be set
3517 void set_gtype()(Type v_gtype) {
3518 g_value_set_gtype(&this, v_gtype);
3521 // Sets @value from an instantiatable type via the
3522 // value_table's collect_value() function.
3523 // <instance>: the instance
3524 void set_instance()(void* instance=null) {
3525 g_value_set_instance(&this, instance);
3528 // Set the contents of a %G_TYPE_INT #GValue to @v_int.
3529 // <v_int>: integer value to be set
3530 void set_int()(int v_int) {
3531 g_value_set_int(&this, v_int);
3534 // Set the contents of a %G_TYPE_INT64 #GValue to @v_int64.
3535 // <v_int64>: 64bit integer value to be set
3536 void set_int64()(long v_int64) {
3537 g_value_set_int64(&this, v_int64);
3540 // Set the contents of a %G_TYPE_LONG #GValue to @v_long.
3541 // <v_long>: long integer value to be set
3542 void set_long()(c_long v_long) {
3543 g_value_set_long(&this, v_long);
3546 // Set the contents of a %G_TYPE_OBJECT derived #GValue to @v_object.
3548 // g_value_set_object() increases the reference count of @v_object
3549 // (the #GValue holds a reference to @v_object). If you do not wish
3550 // to increase the reference count of the object (i.e. you wish to
3551 // pass your current reference to the #GValue because you no longer
3552 // need it), use g_value_take_object() instead.
3554 // It is important that your #GValue holds a reference to @v_object (either its
3555 // own, or one it has taken) to ensure that the object won't be destroyed while
3556 // the #GValue still exists).
3557 // <v_object>: object value to be set
3558 void set_object()(Object* v_object=null) {
3559 g_value_set_object(&this, v_object);
3562 // Unintrospectable method: set_object_take_ownership() / g_value_set_object_take_ownership()
3563 // DEPRECATED (v2.4) method: set_object_take_ownership - Use g_value_take_object() instead.
3564 // This is an internal function introduced mainly for C marshallers.
3565 // <v_object>: object value to be set
3566 void set_object_take_ownership()(void* v_object=null) {
3567 g_value_set_object_take_ownership(&this, v_object);
3570 // Set the contents of a %G_TYPE_PARAM #GValue to @param.
3571 // <param>: the #GParamSpec to be set
3572 void set_param()(ParamSpec* param=null) {
3573 g_value_set_param(&this, param);
3576 // Unintrospectable method: set_param_take_ownership() / g_value_set_param_take_ownership()
3577 // DEPRECATED (v2.4) method: set_param_take_ownership - Use g_value_take_param() instead.
3578 // This is an internal function introduced mainly for C marshallers.
3579 // <param>: the #GParamSpec to be set
3580 void set_param_take_ownership()(ParamSpec* param=null) {
3581 g_value_set_param_take_ownership(&this, param);
3584 // Set the contents of a pointer #GValue to @v_pointer.
3585 // <v_pointer>: pointer value to be set
3586 void set_pointer()(void* v_pointer) {
3587 g_value_set_pointer(&this, v_pointer);
3590 // Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.
3591 // The boxed value is assumed to be static, and is thus not duplicated
3592 // when setting the #GValue.
3593 // <v_boxed>: static boxed value to be set
3594 void set_static_boxed()(const(void)* v_boxed=null) {
3595 g_value_set_static_boxed(&this, v_boxed);
3598 // Set the contents of a %G_TYPE_STRING #GValue to @v_string.
3599 // The string is assumed to be static, and is thus not duplicated
3600 // when setting the #GValue.
3601 // <v_string>: static string to be set
3602 void set_static_string()(char* v_string=null) {
3603 g_value_set_static_string(&this, v_string);
3606 // Set the contents of a %G_TYPE_STRING #GValue to @v_string.
3607 // <v_string>: caller-owned string to be duplicated for the #GValue
3608 void set_string()(char* v_string=null) {
3609 g_value_set_string(&this, v_string);
3612 // DEPRECATED (v2.4) method: set_string_take_ownership - Use g_value_take_string() instead.
3613 // This is an internal function introduced mainly for C marshallers.
3614 // <v_string>: duplicated unowned string to be set
3615 void set_string_take_ownership()(char* v_string=null) {
3616 g_value_set_string_take_ownership(&this, v_string);
3619 // Set the contents of a %G_TYPE_UCHAR #GValue to @v_uchar.
3620 // <v_uchar>: unsigned character value to be set
3621 void set_uchar()(ubyte v_uchar) {
3622 g_value_set_uchar(&this, v_uchar);
3625 // Set the contents of a %G_TYPE_UINT #GValue to @v_uint.
3626 // <v_uint>: unsigned integer value to be set
3627 void set_uint()(uint v_uint) {
3628 g_value_set_uint(&this, v_uint);
3631 // Set the contents of a %G_TYPE_UINT64 #GValue to @v_uint64.
3632 // <v_uint64>: unsigned 64bit integer value to be set
3633 void set_uint64()(ulong v_uint64) {
3634 g_value_set_uint64(&this, v_uint64);
3637 // Set the contents of a %G_TYPE_ULONG #GValue to @v_ulong.
3638 // <v_ulong>: unsigned long integer value to be set
3639 void set_ulong()(c_ulong v_ulong) {
3640 g_value_set_ulong(&this, v_ulong);
3643 // VERSION: 2.26
3644 // Set the contents of a variant #GValue to @variant.
3645 // If the variant is floating, it is consumed.
3646 // <variant>: a #GVariant, or %NULL
3647 void set_variant()(GLib2.Variant* variant=null) {
3648 g_value_set_variant(&this, variant);
3651 // VERSION: 2.4
3652 // Sets the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed
3653 // and takes over the ownership of the callers reference to @v_boxed;
3654 // the caller doesn't have to unref it any more.
3655 // <v_boxed>: duplicated unowned boxed value to be set
3656 void take_boxed()(const(void)* v_boxed=null) {
3657 g_value_take_boxed(&this, v_boxed);
3660 // Unintrospectable method: take_object() / g_value_take_object()
3661 // VERSION: 2.4
3662 // Sets the contents of a %G_TYPE_OBJECT derived #GValue to @v_object
3663 // and takes over the ownership of the callers reference to @v_object;
3664 // the caller doesn't have to unref it any more (i.e. the reference
3665 // count of the object is not increased).
3667 // If you want the #GValue to hold its own reference to @v_object, use
3668 // g_value_set_object() instead.
3669 // <v_object>: object value to be set
3670 void take_object()(void* v_object=null) {
3671 g_value_take_object(&this, v_object);
3674 // Unintrospectable method: take_param() / g_value_take_param()
3675 // VERSION: 2.4
3676 // Sets the contents of a %G_TYPE_PARAM #GValue to @param and takes
3677 // over the ownership of the callers reference to @param; the caller
3678 // doesn't have to unref it any more.
3679 // <param>: the #GParamSpec to be set
3680 void take_param()(ParamSpec* param=null) {
3681 g_value_take_param(&this, param);
3684 // VERSION: 2.4
3685 // Sets the contents of a %G_TYPE_STRING #GValue to @v_string.
3686 // <v_string>: string to take ownership of
3687 void take_string()(char* v_string=null) {
3688 g_value_take_string(&this, v_string);
3691 // VERSION: 2.26
3692 // Set the contents of a variant #GValue to @variant, and takes over
3693 // the ownership of the caller's reference to @variant;
3694 // the caller doesn't have to unref it any more (i.e. the reference
3695 // count of the variant is not increased).
3697 // If @variant was floating then its floating reference is converted to
3698 // a hard reference.
3700 // If you want the #GValue to hold its own reference to @variant, use
3701 // g_value_set_variant() instead.
3703 // This is an internal function introduced mainly for C marshallers.
3704 // <variant>: a #GVariant, or %NULL
3705 void take_variant()(GLib2.Variant* variant=null) {
3706 g_value_take_variant(&this, variant);
3709 // Tries to cast the contents of @src_value into a type appropriate
3710 // to store in @dest_value, e.g. to transform a %G_TYPE_INT value
3711 // into a %G_TYPE_FLOAT value. Performing transformations between
3712 // value types might incur precision lossage. Especially
3713 // transformations into strings might reveal seemingly arbitrary
3714 // results and shouldn't be relied upon for production code (such
3715 // as rcfile value or object property serialization).
3717 // Upon failing transformations, @dest_value is left untouched.
3718 // RETURNS: Whether a transformation rule was found and could be applied.
3719 // <dest_value>: Target value.
3720 int transform()(Value* dest_value) {
3721 return g_value_transform(&this, dest_value);
3724 // Clears the current value in @value and "unsets" the type,
3725 // this releases all resources associated with this GValue.
3726 // An unset value is the same as an uninitialized (zero-filled)
3727 // #GValue structure.
3728 void unset()() {
3729 g_value_unset(&this);
3732 // Unintrospectable function: register_transform_func() / g_value_register_transform_func()
3733 // Registers a value transformation function for use in g_value_transform().
3734 // A previously registered transformation function for @src_type and @dest_type
3735 // will be replaced.
3736 // <src_type>: Source type.
3737 // <dest_type>: Target type.
3738 // <transform_func>: a function which transforms values of type @src_type into value of type @dest_type
3739 static void register_transform_func()(Type src_type, Type dest_type, ValueTransform transform_func) {
3740 g_value_register_transform_func(src_type, dest_type, transform_func);
3743 // Returns whether a #GValue of type @src_type can be copied into
3744 // a #GValue of type @dest_type.
3745 // RETURNS: %TRUE if g_value_copy() is possible with @src_type and @dest_type.
3746 // <src_type>: source type to be copied.
3747 // <dest_type>: destination type for copying.
3748 static int type_compatible()(Type src_type, Type dest_type) {
3749 return g_value_type_compatible(src_type, dest_type);
3752 // Check whether g_value_transform() is able to transform values
3753 // of type @src_type into values of type @dest_type.
3754 // RETURNS: %TRUE if the transformation is possible, %FALSE otherwise.
3755 // <src_type>: Source type.
3756 // <dest_type>: Target type.
3757 static int type_transformable()(Type src_type, Type dest_type) {
3758 return g_value_type_transformable(src_type, dest_type);
3762 // A #GValueArray contains an array of #GValue elements.
3763 struct ValueArray {
3764 uint n_values;
3765 Value* values;
3766 private uint n_prealloced;
3769 // Allocate and initialize a new #GValueArray, optionally preserve space
3770 // for @n_prealloced elements. New arrays always contain 0 elements,
3771 // regardless of the value of @n_prealloced.
3772 // RETURNS: a newly allocated #GValueArray with 0 values
3773 // <n_prealloced>: number of values to preallocate space for
3774 static ValueArray* /*new*/ new_()(uint n_prealloced) {
3775 return g_value_array_new(n_prealloced);
3778 // Insert a copy of @value as last element of @value_array. If @value is
3779 // %NULL, an uninitialized value is appended.
3780 // RETURNS: the #GValueArray passed in as @value_array
3781 // <value>: #GValue to copy into #GValueArray, or %NULL
3782 ValueArray* append()(Value* value=null) {
3783 return g_value_array_append(&this, value);
3786 // Construct an exact copy of a #GValueArray by duplicating all its
3787 // contents.
3788 // RETURNS: Newly allocated copy of #GValueArray
3789 ValueArray* /*new*/ copy()() {
3790 return g_value_array_copy(&this);
3792 // Free a #GValueArray including its contents.
3793 void free()() {
3794 g_value_array_free(&this);
3797 // Return a pointer to the value at @index_ containd in @value_array.
3798 // RETURNS: pointer to a value at @index_ in @value_array
3799 // <index_>: index of the value of interest
3800 Value* get_nth()(uint index_) {
3801 return g_value_array_get_nth(&this, index_);
3804 // Insert a copy of @value at specified position into @value_array. If @value
3805 // is %NULL, an uninitialized value is inserted.
3806 // RETURNS: the #GValueArray passed in as @value_array
3807 // <index_>: insertion position, must be &lt;= value_array-&gt;n_values
3808 // <value>: #GValue to copy into #GValueArray, or %NULL
3809 ValueArray* insert()(uint index_, Value* value=null) {
3810 return g_value_array_insert(&this, index_, value);
3813 // Insert a copy of @value as first element of @value_array. If @value is
3814 // %NULL, an uninitialized value is prepended.
3815 // RETURNS: the #GValueArray passed in as @value_array
3816 // <value>: #GValue to copy into #GValueArray, or %NULL
3817 ValueArray* prepend()(Value* value=null) {
3818 return g_value_array_prepend(&this, value);
3821 // Remove the value at position @index_ from @value_array.
3822 // RETURNS: the #GValueArray passed in as @value_array
3823 // <index_>: position of value to remove, which must be less than <code>value_array-><link linkend="GValueArray.n-values">n_values</link></code>
3824 ValueArray* remove()(uint index_) {
3825 return g_value_array_remove(&this, index_);
3828 // Sort @value_array using @compare_func to compare the elements according to
3829 // the semantics of #GCompareFunc.
3831 // The current implementation uses Quick-Sort as sorting algorithm.
3832 // RETURNS: the #GValueArray passed in as @value_array
3833 // <compare_func>: function to compare elements
3834 ValueArray* sort()(GLib2.CompareFunc compare_func) {
3835 return g_value_array_sort(&this, compare_func);
3838 // Sort @value_array using @compare_func to compare the elements according
3839 // to the semantics of #GCompareDataFunc.
3841 // The current implementation uses Quick-Sort as sorting algorithm.
3842 // RETURNS: the #GValueArray passed in as @value_array
3843 // <compare_func>: function to compare elements
3844 // <user_data>: extra data argument provided for @compare_func
3845 ValueArray* sort_with_data()(GLib2.CompareDataFunc compare_func, void* user_data) {
3846 return g_value_array_sort_with_data(&this, compare_func, user_data);
3851 // The type of value transformation functions which can be registered with
3852 // g_value_register_transform_func().
3853 // <src_value>: Source value.
3854 // <dest_value>: Target value.
3855 extern (C) alias void function (Value* src_value, Value* dest_value) ValueTransform;
3858 // A #GWeakNotify function can be added to an object as a callback that gets
3859 // triggered when the object is finalized. Since the object is already being
3860 // finalized when the #GWeakNotify is called, there's not much you could do
3861 // with the object, apart from e.g. using its address as hash-index or the like.
3862 // <data>: data that was provided when the weak reference was established
3863 // <where_the_object_was>: the object being finalized
3864 extern (C) alias void function (void* data, Object* where_the_object_was) WeakNotify;
3866 union _Value__data__union {
3867 int v_int;
3868 uint v_uint;
3869 c_long v_long;
3870 c_ulong v_ulong;
3871 long v_int64;
3872 ulong v_uint64;
3873 float v_float;
3874 double v_double;
3875 void* v_pointer;
3879 // Unintrospectable function: boxed_copy() / g_boxed_copy()
3880 // Provide a copy of a boxed structure @src_boxed which is of type @boxed_type.
3881 // RETURNS: The newly created copy of the boxed structure.
3882 // <boxed_type>: The type of @src_boxed.
3883 // <src_boxed>: The boxed structure to be copied.
3884 static void* boxed_copy()(Type boxed_type, const(void)* src_boxed) {
3885 return g_boxed_copy(boxed_type, src_boxed);
3889 // Free the boxed structure @boxed which is of type @boxed_type.
3890 // <boxed_type>: The type of @boxed.
3891 // <boxed>: The boxed structure to be freed.
3892 static void boxed_free()(Type boxed_type, void* boxed) {
3893 g_boxed_free(boxed_type, boxed);
3897 // Unintrospectable function: boxed_type_register_static() / g_boxed_type_register_static()
3898 // This function creates a new %G_TYPE_BOXED derived type id for a new
3899 // boxed type with name @name. Boxed type handling functions have to be
3900 // provided to copy and free opaque boxed structures of this type.
3901 // RETURNS: New %G_TYPE_BOXED derived type id for @name.
3902 // <name>: Name of the new boxed type.
3903 // <boxed_copy>: Boxed structure copy function.
3904 // <boxed_free>: Boxed structure free function.
3905 static Type boxed_type_register_static()(char* name, BoxedCopyFunc boxed_copy, BoxedFreeFunc boxed_free) {
3906 return g_boxed_type_register_static(name, boxed_copy, boxed_free);
3909 // MOVED TO: CClosure.marshal_BOOLEAN__BOXED_BOXED
3910 static void cclosure_marshal_BOOLEAN__BOXED_BOXED()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
3911 g_cclosure_marshal_BOOLEAN__BOXED_BOXED(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
3915 // MOVED TO: CClosure.marshal_BOOLEAN__FLAGS
3916 // A marshaller for a #GCClosure with a callback of type
3917 // <literal>gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter
3918 // denotes a flags type.
3919 // <closure>: the #GClosure to which the marshaller belongs
3920 // <return_value>: a #GValue which can store the returned #gboolean
3921 // <n_param_values>: 2
3922 // <param_values>: a #GValue array holding instance and arg1
3923 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
3924 // <marshal_data>: additional data specified when registering the marshaller
3925 static void cclosure_marshal_BOOLEAN__FLAGS()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
3926 g_cclosure_marshal_BOOLEAN__FLAGS(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
3930 // MOVED TO: CClosure.marshal_STRING__OBJECT_POINTER
3931 // A marshaller for a #GCClosure with a callback of type
3932 // <literal>gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data)</literal>.
3933 // <closure>: the #GClosure to which the marshaller belongs
3934 // <return_value>: a #GValue, which can store the returned string
3935 // <n_param_values>: 3
3936 // <param_values>: a #GValue array holding instance, arg1 and arg2
3937 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
3938 // <marshal_data>: additional data specified when registering the marshaller
3939 static void cclosure_marshal_STRING__OBJECT_POINTER()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
3940 g_cclosure_marshal_STRING__OBJECT_POINTER(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
3944 // MOVED TO: CClosure.marshal_VOID__BOOLEAN
3945 // A marshaller for a #GCClosure with a callback of type
3946 // <literal>void (*callback) (gpointer instance, gboolean arg1, gpointer user_data)</literal>.
3947 // <closure>: the #GClosure to which the marshaller belongs
3948 // <return_value>: ignored
3949 // <n_param_values>: 2
3950 // <param_values>: a #GValue array holding the instance and the #gboolean parameter
3951 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
3952 // <marshal_data>: additional data specified when registering the marshaller
3953 static void cclosure_marshal_VOID__BOOLEAN()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
3954 g_cclosure_marshal_VOID__BOOLEAN(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
3958 // MOVED TO: CClosure.marshal_VOID__BOXED
3959 // A marshaller for a #GCClosure with a callback of type
3960 // <literal>void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data)</literal>.
3961 // <closure>: the #GClosure to which the marshaller belongs
3962 // <return_value>: ignored
3963 // <n_param_values>: 2
3964 // <param_values>: a #GValue array holding the instance and the #GBoxed* parameter
3965 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
3966 // <marshal_data>: additional data specified when registering the marshaller
3967 static void cclosure_marshal_VOID__BOXED()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
3968 g_cclosure_marshal_VOID__BOXED(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
3972 // MOVED TO: CClosure.marshal_VOID__CHAR
3973 // A marshaller for a #GCClosure with a callback of type
3974 // <literal>void (*callback) (gpointer instance, gchar arg1, gpointer user_data)</literal>.
3975 // <closure>: the #GClosure to which the marshaller belongs
3976 // <return_value>: ignored
3977 // <n_param_values>: 2
3978 // <param_values>: a #GValue array holding the instance and the #gchar parameter
3979 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
3980 // <marshal_data>: additional data specified when registering the marshaller
3981 static void cclosure_marshal_VOID__CHAR()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
3982 g_cclosure_marshal_VOID__CHAR(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
3986 // MOVED TO: CClosure.marshal_VOID__DOUBLE
3987 // A marshaller for a #GCClosure with a callback of type
3988 // <literal>void (*callback) (gpointer instance, gdouble arg1, gpointer user_data)</literal>.
3989 // <closure>: the #GClosure to which the marshaller belongs
3990 // <return_value>: ignored
3991 // <n_param_values>: 2
3992 // <param_values>: a #GValue array holding the instance and the #gdouble parameter
3993 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
3994 // <marshal_data>: additional data specified when registering the marshaller
3995 static void cclosure_marshal_VOID__DOUBLE()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
3996 g_cclosure_marshal_VOID__DOUBLE(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4000 // MOVED TO: CClosure.marshal_VOID__ENUM
4001 // A marshaller for a #GCClosure with a callback of type
4002 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter denotes an enumeration type..
4003 // <closure>: the #GClosure to which the marshaller belongs
4004 // <return_value>: ignored
4005 // <n_param_values>: 2
4006 // <param_values>: a #GValue array holding the instance and the enumeration parameter
4007 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4008 // <marshal_data>: additional data specified when registering the marshaller
4009 static void cclosure_marshal_VOID__ENUM()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
4010 g_cclosure_marshal_VOID__ENUM(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4014 // MOVED TO: CClosure.marshal_VOID__FLAGS
4015 // A marshaller for a #GCClosure with a callback of type
4016 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter denotes a flags type.
4017 // <closure>: the #GClosure to which the marshaller belongs
4018 // <return_value>: ignored
4019 // <n_param_values>: 2
4020 // <param_values>: a #GValue array holding the instance and the flags parameter
4021 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4022 // <marshal_data>: additional data specified when registering the marshaller
4023 static void cclosure_marshal_VOID__FLAGS()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
4024 g_cclosure_marshal_VOID__FLAGS(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4028 // MOVED TO: CClosure.marshal_VOID__FLOAT
4029 // A marshaller for a #GCClosure with a callback of type
4030 // <literal>void (*callback) (gpointer instance, gfloat arg1, gpointer user_data)</literal>.
4031 // <closure>: the #GClosure to which the marshaller belongs
4032 // <return_value>: ignored
4033 // <n_param_values>: 2
4034 // <param_values>: a #GValue array holding the instance and the #gfloat parameter
4035 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4036 // <marshal_data>: additional data specified when registering the marshaller
4037 static void cclosure_marshal_VOID__FLOAT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
4038 g_cclosure_marshal_VOID__FLOAT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4042 // MOVED TO: CClosure.marshal_VOID__INT
4043 // A marshaller for a #GCClosure with a callback of type
4044 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal>.
4045 // <closure>: the #GClosure to which the marshaller belongs
4046 // <return_value>: ignored
4047 // <n_param_values>: 2
4048 // <param_values>: a #GValue array holding the instance and the #gint parameter
4049 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4050 // <marshal_data>: additional data specified when registering the marshaller
4051 static void cclosure_marshal_VOID__INT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
4052 g_cclosure_marshal_VOID__INT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4056 // MOVED TO: CClosure.marshal_VOID__LONG
4057 // A marshaller for a #GCClosure with a callback of type
4058 // <literal>void (*callback) (gpointer instance, glong arg1, gpointer user_data)</literal>.
4059 // <closure>: the #GClosure to which the marshaller belongs
4060 // <return_value>: ignored
4061 // <n_param_values>: 2
4062 // <param_values>: a #GValue array holding the instance and the #glong parameter
4063 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4064 // <marshal_data>: additional data specified when registering the marshaller
4065 static void cclosure_marshal_VOID__LONG()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
4066 g_cclosure_marshal_VOID__LONG(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4070 // MOVED TO: CClosure.marshal_VOID__OBJECT
4071 // A marshaller for a #GCClosure with a callback of type
4072 // <literal>void (*callback) (gpointer instance, GObject *arg1, gpointer user_data)</literal>.
4073 // <closure>: the #GClosure to which the marshaller belongs
4074 // <return_value>: ignored
4075 // <n_param_values>: 2
4076 // <param_values>: a #GValue array holding the instance and the #GObject* parameter
4077 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4078 // <marshal_data>: additional data specified when registering the marshaller
4079 static void cclosure_marshal_VOID__OBJECT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
4080 g_cclosure_marshal_VOID__OBJECT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4084 // MOVED TO: CClosure.marshal_VOID__PARAM
4085 // A marshaller for a #GCClosure with a callback of type
4086 // <literal>void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data)</literal>.
4087 // <closure>: the #GClosure to which the marshaller belongs
4088 // <return_value>: ignored
4089 // <n_param_values>: 2
4090 // <param_values>: a #GValue array holding the instance and the #GParamSpec* parameter
4091 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4092 // <marshal_data>: additional data specified when registering the marshaller
4093 static void cclosure_marshal_VOID__PARAM()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
4094 g_cclosure_marshal_VOID__PARAM(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4098 // MOVED TO: CClosure.marshal_VOID__POINTER
4099 // A marshaller for a #GCClosure with a callback of type
4100 // <literal>void (*callback) (gpointer instance, gpointer arg1, gpointer user_data)</literal>.
4101 // <closure>: the #GClosure to which the marshaller belongs
4102 // <return_value>: ignored
4103 // <n_param_values>: 2
4104 // <param_values>: a #GValue array holding the instance and the #gpointer parameter
4105 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4106 // <marshal_data>: additional data specified when registering the marshaller
4107 static void cclosure_marshal_VOID__POINTER()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
4108 g_cclosure_marshal_VOID__POINTER(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4112 // MOVED TO: CClosure.marshal_VOID__STRING
4113 // A marshaller for a #GCClosure with a callback of type
4114 // <literal>void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data)</literal>.
4115 // <closure>: the #GClosure to which the marshaller belongs
4116 // <return_value>: ignored
4117 // <n_param_values>: 2
4118 // <param_values>: a #GValue array holding the instance and the #gchar* parameter
4119 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4120 // <marshal_data>: additional data specified when registering the marshaller
4121 static void cclosure_marshal_VOID__STRING()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
4122 g_cclosure_marshal_VOID__STRING(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4126 // MOVED TO: CClosure.marshal_VOID__UCHAR
4127 // A marshaller for a #GCClosure with a callback of type
4128 // <literal>void (*callback) (gpointer instance, guchar arg1, gpointer user_data)</literal>.
4129 // <closure>: the #GClosure to which the marshaller belongs
4130 // <return_value>: ignored
4131 // <n_param_values>: 2
4132 // <param_values>: a #GValue array holding the instance and the #guchar parameter
4133 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4134 // <marshal_data>: additional data specified when registering the marshaller
4135 static void cclosure_marshal_VOID__UCHAR()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
4136 g_cclosure_marshal_VOID__UCHAR(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4140 // MOVED TO: CClosure.marshal_VOID__UINT
4141 // A marshaller for a #GCClosure with a callback of type
4142 // <literal>void (*callback) (gpointer instance, guint arg1, gpointer user_data)</literal>.
4143 // <closure>: the #GClosure to which the marshaller belongs
4144 // <return_value>: ignored
4145 // <n_param_values>: 2
4146 // <param_values>: a #GValue array holding the instance and the #guint parameter
4147 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4148 // <marshal_data>: additional data specified when registering the marshaller
4149 static void cclosure_marshal_VOID__UINT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
4150 g_cclosure_marshal_VOID__UINT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4154 // MOVED TO: CClosure.marshal_VOID__UINT_POINTER
4155 // A marshaller for a #GCClosure with a callback of type
4156 // <literal>void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data)</literal>.
4157 // <closure>: the #GClosure to which the marshaller belongs
4158 // <return_value>: ignored
4159 // <n_param_values>: 3
4160 // <param_values>: a #GValue array holding instance, arg1 and arg2
4161 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4162 // <marshal_data>: additional data specified when registering the marshaller
4163 static void cclosure_marshal_VOID__UINT_POINTER()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
4164 g_cclosure_marshal_VOID__UINT_POINTER(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4168 // MOVED TO: CClosure.marshal_VOID__ULONG
4169 // A marshaller for a #GCClosure with a callback of type
4170 // <literal>void (*callback) (gpointer instance, gulong arg1, gpointer user_data)</literal>.
4171 // <closure>: the #GClosure to which the marshaller belongs
4172 // <return_value>: ignored
4173 // <n_param_values>: 2
4174 // <param_values>: a #GValue array holding the instance and the #gulong parameter
4175 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4176 // <marshal_data>: additional data specified when registering the marshaller
4177 static void cclosure_marshal_VOID__ULONG()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
4178 g_cclosure_marshal_VOID__ULONG(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4182 // VERSION: 2.26
4183 // MOVED TO: CClosure.marshal_VOID__VARIANT
4184 // A marshaller for a #GCClosure with a callback of type
4185 // <literal>void (*callback) (gpointer instance, GVariant *arg1, gpointer user_data)</literal>.
4186 // <closure>: the #GClosure to which the marshaller belongs
4187 // <return_value>: ignored
4188 // <n_param_values>: 2
4189 // <param_values>: a #GValue array holding the instance and the #GVariant* parameter
4190 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4191 // <marshal_data>: additional data specified when registering the marshaller
4192 static void cclosure_marshal_VOID__VARIANT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
4193 g_cclosure_marshal_VOID__VARIANT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4197 // MOVED TO: CClosure.marshal_VOID__VOID
4198 // A marshaller for a #GCClosure with a callback of type
4199 // <literal>void (*callback) (gpointer instance, gpointer user_data)</literal>.
4200 // <closure>: the #GClosure to which the marshaller belongs
4201 // <return_value>: ignored
4202 // <n_param_values>: 1
4203 // <param_values>: a #GValue array holding only the instance
4204 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4205 // <marshal_data>: additional data specified when registering the marshaller
4206 static void cclosure_marshal_VOID__VOID()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
4207 g_cclosure_marshal_VOID__VOID(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4211 // VERSION: 2.30
4212 // MOVED TO: CClosure.marshal_generic
4213 // A generic marshaller function implemented via <ulink
4214 // url="http://sourceware.org/libffi/">libffi</ulink>.
4215 // <closure>: A #GClosure.
4216 // <return_gvalue>: A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
4217 // <n_param_values>: The length of the @param_values array.
4218 // <param_values>: An array of #GValue<!-- -->s holding the arguments on which to invoke the callback of closure.
4219 // <invocation_hint>: The invocation hint given as the last argument to g_closure_invoke().
4220 // <marshal_data>: Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
4221 static void cclosure_marshal_generic()(Closure* closure, Value* return_gvalue, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) {
4222 g_cclosure_marshal_generic(closure, return_gvalue, n_param_values, param_values, invocation_hint, marshal_data);
4226 // Unintrospectable function: cclosure_new() / g_cclosure_new()
4227 // MOVED TO: CClosure.new
4228 // Creates a new closure which invokes @callback_func with @user_data as
4229 // the last parameter.
4230 // RETURNS: a new #GCClosure
4231 // <callback_func>: the function to invoke
4232 // <user_data>: user data to pass to @callback_func
4233 // <destroy_data>: destroy notify to be called when @user_data is no longer used
4234 static Closure* /*new*/ cclosure_new()(Callback callback_func, void* user_data, ClosureNotify destroy_data) {
4235 return g_cclosure_new(callback_func, user_data, destroy_data);
4239 // Unintrospectable function: cclosure_new_object() / g_cclosure_new_object()
4240 // MOVED TO: CClosure.new_object
4241 // A variant of g_cclosure_new() which uses @object as @user_data and
4242 // calls g_object_watch_closure() on @object and the created
4243 // closure. This function is useful when you have a callback closely
4244 // associated with a #GObject, and want the callback to no longer run
4245 // after the object is is freed.
4246 // RETURNS: a new #GCClosure
4247 // <callback_func>: the function to invoke
4248 // <object>: a #GObject pointer to pass to @callback_func
4249 static Closure* /*new*/ cclosure_new_object()(Callback callback_func, Object* object) {
4250 return g_cclosure_new_object(callback_func, object);
4254 // Unintrospectable function: cclosure_new_object_swap() / g_cclosure_new_object_swap()
4255 // MOVED TO: CClosure.new_object_swap
4256 // A variant of g_cclosure_new_swap() which uses @object as @user_data
4257 // and calls g_object_watch_closure() on @object and the created
4258 // closure. This function is useful when you have a callback closely
4259 // associated with a #GObject, and want the callback to no longer run
4260 // after the object is is freed.
4261 // RETURNS: a new #GCClosure
4262 // <callback_func>: the function to invoke
4263 // <object>: a #GObject pointer to pass to @callback_func
4264 static Closure* /*new*/ cclosure_new_object_swap()(Callback callback_func, Object* object) {
4265 return g_cclosure_new_object_swap(callback_func, object);
4269 // Unintrospectable function: cclosure_new_swap() / g_cclosure_new_swap()
4270 // MOVED TO: CClosure.new_swap
4271 // Creates a new closure which invokes @callback_func with @user_data as
4272 // the first parameter.
4273 // RETURNS: a new #GCClosure
4274 // <callback_func>: the function to invoke
4275 // <user_data>: user data to pass to @callback_func
4276 // <destroy_data>: destroy notify to be called when @user_data is no longer used
4277 static Closure* /*new*/ cclosure_new_swap()(Callback callback_func, void* user_data, ClosureNotify destroy_data) {
4278 return g_cclosure_new_swap(callback_func, user_data, destroy_data);
4282 // Unintrospectable function: clear_object() / g_clear_object()
4283 // VERSION: 2.28
4284 // Clears a reference to a #GObject.
4286 // @object_ptr must not be %NULL.
4288 // If the reference is %NULL then this function does nothing.
4289 // Otherwise, the reference count of the object is decreased and the
4290 // pointer is set to %NULL.
4292 // This function is threadsafe and modifies the pointer atomically,
4293 // using memory barriers where needed.
4295 // A macro is also included that allows this function to be used without
4296 // pointer casts.
4297 // <object_ptr>: a pointer to a #GObject reference
4298 static void clear_object()(Object** object_ptr) {
4299 g_clear_object(object_ptr);
4303 // This function is meant to be called from the complete_type_info()
4304 // function of a #GTypePlugin implementation, as in the following
4305 // example:
4307 // |[
4308 // static void
4309 // my_enum_complete_type_info (GTypePlugin *plugin,
4310 // GType g_type,
4311 // GTypeInfo *info,
4312 // GTypeValueTable *value_table)
4313 // {
4314 // static const GEnumValue values[] = {
4315 // { MY_ENUM_FOO, "MY_ENUM_FOO", "foo" },
4316 // { MY_ENUM_BAR, "MY_ENUM_BAR", "bar" },
4317 // { 0, NULL, NULL }
4318 // };
4320 // g_enum_complete_type_info (type, info, values);
4321 // }
4322 // ]|
4323 // <g_enum_type>: the type identifier of the type being completed
4324 // <info>: the #GTypeInfo struct to be filled in
4325 // <const_values>: An array of #GEnumValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0.
4326 static void enum_complete_type_info()(Type g_enum_type, GTypeInfo* info, EnumValue* const_values) {
4327 g_enum_complete_type_info(g_enum_type, info, const_values);
4331 // Unintrospectable function: enum_get_value() / g_enum_get_value()
4332 // Returns the #GEnumValue for a value.
4334 // member of the enumeration
4335 // RETURNS: the #GEnumValue for @value, or %NULL if @value is not a
4336 // <enum_class>: a #GEnumClass
4337 // <value>: the value to look up
4338 static EnumValue* enum_get_value()(EnumClass* enum_class, int value) {
4339 return g_enum_get_value(enum_class, value);
4343 // Unintrospectable function: enum_get_value_by_name() / g_enum_get_value_by_name()
4344 // Looks up a #GEnumValue by name.
4346 // enumeration doesn't have a member with that name
4347 // RETURNS: the #GEnumValue with name @name, or %NULL if the
4348 // <enum_class>: a #GEnumClass
4349 // <name>: the name to look up
4350 static EnumValue* enum_get_value_by_name()(EnumClass* enum_class, char* name) {
4351 return g_enum_get_value_by_name(enum_class, name);
4355 // Unintrospectable function: enum_get_value_by_nick() / g_enum_get_value_by_nick()
4356 // Looks up a #GEnumValue by nickname.
4358 // enumeration doesn't have a member with that nickname
4359 // RETURNS: the #GEnumValue with nickname @nick, or %NULL if the
4360 // <enum_class>: a #GEnumClass
4361 // <nick>: the nickname to look up
4362 static EnumValue* enum_get_value_by_nick()(EnumClass* enum_class, char* nick) {
4363 return g_enum_get_value_by_nick(enum_class, nick);
4367 // Registers a new static enumeration type with the name @name.
4369 // It is normally more convenient to let <link
4370 // linkend="glib-mkenums">glib-mkenums</link> generate a
4371 // my_enum_get_type() function from a usual C enumeration definition
4372 // than to write one yourself using g_enum_register_static().
4373 // RETURNS: The new type identifier.
4374 // <name>: A nul-terminated string used as the name of the new type.
4375 // <const_static_values>: An array of #GEnumValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0. GObject keeps a reference to the data, so it cannot be stack-allocated.
4376 static Type enum_register_static()(char* name, EnumValue* const_static_values) {
4377 return g_enum_register_static(name, const_static_values);
4381 // This function is meant to be called from the complete_type_info()
4382 // function of a #GTypePlugin implementation, see the example for
4383 // g_enum_complete_type_info() above.
4384 // <g_flags_type>: the type identifier of the type being completed
4385 // <info>: the #GTypeInfo struct to be filled in
4386 // <const_values>: An array of #GFlagsValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0.
4387 static void flags_complete_type_info()(Type g_flags_type, GTypeInfo* info, FlagsValue* const_values) {
4388 g_flags_complete_type_info(g_flags_type, info, const_values);
4392 // Unintrospectable function: flags_get_first_value() / g_flags_get_first_value()
4393 // Returns the first #GFlagsValue which is set in @value.
4395 // none is set
4396 // RETURNS: the first #GFlagsValue which is set in @value, or %NULL if
4397 // <flags_class>: a #GFlagsClass
4398 // <value>: the value
4399 static FlagsValue* flags_get_first_value()(FlagsClass* flags_class, uint value) {
4400 return g_flags_get_first_value(flags_class, value);
4404 // Unintrospectable function: flags_get_value_by_name() / g_flags_get_value_by_name()
4405 // Looks up a #GFlagsValue by name.
4407 // flag with that name
4408 // RETURNS: the #GFlagsValue with name @name, or %NULL if there is no
4409 // <flags_class>: a #GFlagsClass
4410 // <name>: the name to look up
4411 static FlagsValue* flags_get_value_by_name()(FlagsClass* flags_class, char* name) {
4412 return g_flags_get_value_by_name(flags_class, name);
4416 // Unintrospectable function: flags_get_value_by_nick() / g_flags_get_value_by_nick()
4417 // Looks up a #GFlagsValue by nickname.
4419 // no flag with that nickname
4420 // RETURNS: the #GFlagsValue with nickname @nick, or %NULL if there is
4421 // <flags_class>: a #GFlagsClass
4422 // <nick>: the nickname to look up
4423 static FlagsValue* flags_get_value_by_nick()(FlagsClass* flags_class, char* nick) {
4424 return g_flags_get_value_by_nick(flags_class, nick);
4428 // Registers a new static flags type with the name @name.
4430 // It is normally more convenient to let <link
4431 // linkend="glib-mkenums">glib-mkenums</link> generate a
4432 // my_flags_get_type() function from a usual C enumeration definition
4433 // than to write one yourself using g_flags_register_static().
4434 // RETURNS: The new type identifier.
4435 // <name>: A nul-terminated string used as the name of the new type.
4436 // <const_static_values>: An array of #GFlagsValue structs for the possible flags values. The array is terminated by a struct with all members being 0. GObject keeps a reference to the data, so it cannot be stack-allocated.
4437 static Type flags_register_static()(char* name, FlagsValue* const_static_values) {
4438 return g_flags_register_static(name, const_static_values);
4441 static Type gtype_get_type()() {
4442 return g_gtype_get_type();
4446 // Unintrospectable function: param_spec_boolean() / g_param_spec_boolean()
4447 // Creates a new #GParamSpecBoolean instance specifying a %G_TYPE_BOOLEAN
4448 // property.
4450 // See g_param_spec_internal() for details on property names.
4451 // RETURNS: a newly created parameter specification
4452 // <name>: canonical name of the property specified
4453 // <nick>: nick name for the property specified
4454 // <blurb>: description of the property specified
4455 // <default_value>: default value for the property specified
4456 // <flags>: flags for the property specified
4457 static ParamSpec* param_spec_boolean()(char* name, char* nick, char* blurb, int default_value, ParamFlags flags) {
4458 return g_param_spec_boolean(name, nick, blurb, default_value, flags);
4462 // Unintrospectable function: param_spec_boxed() / g_param_spec_boxed()
4463 // Creates a new #GParamSpecBoxed instance specifying a %G_TYPE_BOXED
4464 // derived property.
4466 // See g_param_spec_internal() for details on property names.
4467 // RETURNS: a newly created parameter specification
4468 // <name>: canonical name of the property specified
4469 // <nick>: nick name for the property specified
4470 // <blurb>: description of the property specified
4471 // <boxed_type>: %G_TYPE_BOXED derived type of this property
4472 // <flags>: flags for the property specified
4473 static ParamSpec* param_spec_boxed()(char* name, char* nick, char* blurb, Type boxed_type, ParamFlags flags) {
4474 return g_param_spec_boxed(name, nick, blurb, boxed_type, flags);
4478 // Unintrospectable function: param_spec_char() / g_param_spec_char()
4479 // Creates a new #GParamSpecChar instance specifying a %G_TYPE_CHAR property.
4480 // RETURNS: a newly created parameter specification
4481 // <name>: canonical name of the property specified
4482 // <nick>: nick name for the property specified
4483 // <blurb>: description of the property specified
4484 // <minimum>: minimum value for the property specified
4485 // <maximum>: maximum value for the property specified
4486 // <default_value>: default value for the property specified
4487 // <flags>: flags for the property specified
4488 static ParamSpec* param_spec_char()(char* name, char* nick, char* blurb, byte minimum, byte maximum, byte default_value, ParamFlags flags) {
4489 return g_param_spec_char(name, nick, blurb, minimum, maximum, default_value, flags);
4493 // Unintrospectable function: param_spec_double() / g_param_spec_double()
4494 // Creates a new #GParamSpecDouble instance specifying a %G_TYPE_DOUBLE
4495 // property.
4497 // See g_param_spec_internal() for details on property names.
4498 // RETURNS: a newly created parameter specification
4499 // <name>: canonical name of the property specified
4500 // <nick>: nick name for the property specified
4501 // <blurb>: description of the property specified
4502 // <minimum>: minimum value for the property specified
4503 // <maximum>: maximum value for the property specified
4504 // <default_value>: default value for the property specified
4505 // <flags>: flags for the property specified
4506 static ParamSpec* param_spec_double()(char* name, char* nick, char* blurb, double minimum, double maximum, double default_value, ParamFlags flags) {
4507 return g_param_spec_double(name, nick, blurb, minimum, maximum, default_value, flags);
4511 // Unintrospectable function: param_spec_enum() / g_param_spec_enum()
4512 // Creates a new #GParamSpecEnum instance specifying a %G_TYPE_ENUM
4513 // property.
4515 // See g_param_spec_internal() for details on property names.
4516 // RETURNS: a newly created parameter specification
4517 // <name>: canonical name of the property specified
4518 // <nick>: nick name for the property specified
4519 // <blurb>: description of the property specified
4520 // <enum_type>: a #GType derived from %G_TYPE_ENUM
4521 // <default_value>: default value for the property specified
4522 // <flags>: flags for the property specified
4523 static ParamSpec* param_spec_enum()(char* name, char* nick, char* blurb, Type enum_type, int default_value, ParamFlags flags) {
4524 return g_param_spec_enum(name, nick, blurb, enum_type, default_value, flags);
4528 // Unintrospectable function: param_spec_flags() / g_param_spec_flags()
4529 // Creates a new #GParamSpecFlags instance specifying a %G_TYPE_FLAGS
4530 // property.
4532 // See g_param_spec_internal() for details on property names.
4533 // RETURNS: a newly created parameter specification
4534 // <name>: canonical name of the property specified
4535 // <nick>: nick name for the property specified
4536 // <blurb>: description of the property specified
4537 // <flags_type>: a #GType derived from %G_TYPE_FLAGS
4538 // <default_value>: default value for the property specified
4539 // <flags>: flags for the property specified
4540 static ParamSpec* param_spec_flags()(char* name, char* nick, char* blurb, Type flags_type, uint default_value, ParamFlags flags) {
4541 return g_param_spec_flags(name, nick, blurb, flags_type, default_value, flags);
4545 // Unintrospectable function: param_spec_float() / g_param_spec_float()
4546 // Creates a new #GParamSpecFloat instance specifying a %G_TYPE_FLOAT property.
4548 // See g_param_spec_internal() for details on property names.
4549 // RETURNS: a newly created parameter specification
4550 // <name>: canonical name of the property specified
4551 // <nick>: nick name for the property specified
4552 // <blurb>: description of the property specified
4553 // <minimum>: minimum value for the property specified
4554 // <maximum>: maximum value for the property specified
4555 // <default_value>: default value for the property specified
4556 // <flags>: flags for the property specified
4557 static ParamSpec* param_spec_float()(char* name, char* nick, char* blurb, float minimum, float maximum, float default_value, ParamFlags flags) {
4558 return g_param_spec_float(name, nick, blurb, minimum, maximum, default_value, flags);
4562 // Unintrospectable function: param_spec_gtype() / g_param_spec_gtype()
4563 // VERSION: 2.10
4564 // Creates a new #GParamSpecGType instance specifying a
4565 // %G_TYPE_GTYPE property.
4567 // See g_param_spec_internal() for details on property names.
4568 // RETURNS: a newly created parameter specification
4569 // <name>: canonical name of the property specified
4570 // <nick>: nick name for the property specified
4571 // <blurb>: description of the property specified
4572 // <is_a_type>: a #GType whose subtypes are allowed as values of the property (use %G_TYPE_NONE for any type)
4573 // <flags>: flags for the property specified
4574 static ParamSpec* param_spec_gtype()(char* name, char* nick, char* blurb, Type is_a_type, ParamFlags flags) {
4575 return g_param_spec_gtype(name, nick, blurb, is_a_type, flags);
4579 // Unintrospectable function: param_spec_int() / g_param_spec_int()
4580 // Creates a new #GParamSpecInt instance specifying a %G_TYPE_INT property.
4582 // See g_param_spec_internal() for details on property names.
4583 // RETURNS: a newly created parameter specification
4584 // <name>: canonical name of the property specified
4585 // <nick>: nick name for the property specified
4586 // <blurb>: description of the property specified
4587 // <minimum>: minimum value for the property specified
4588 // <maximum>: maximum value for the property specified
4589 // <default_value>: default value for the property specified
4590 // <flags>: flags for the property specified
4591 static ParamSpec* param_spec_int()(char* name, char* nick, char* blurb, int minimum, int maximum, int default_value, ParamFlags flags) {
4592 return g_param_spec_int(name, nick, blurb, minimum, maximum, default_value, flags);
4596 // Unintrospectable function: param_spec_int64() / g_param_spec_int64()
4597 // Creates a new #GParamSpecInt64 instance specifying a %G_TYPE_INT64 property.
4599 // See g_param_spec_internal() for details on property names.
4600 // RETURNS: a newly created parameter specification
4601 // <name>: canonical name of the property specified
4602 // <nick>: nick name for the property specified
4603 // <blurb>: description of the property specified
4604 // <minimum>: minimum value for the property specified
4605 // <maximum>: maximum value for the property specified
4606 // <default_value>: default value for the property specified
4607 // <flags>: flags for the property specified
4608 static ParamSpec* param_spec_int64()(char* name, char* nick, char* blurb, long minimum, long maximum, long default_value, ParamFlags flags) {
4609 return g_param_spec_int64(name, nick, blurb, minimum, maximum, default_value, flags);
4613 // Unintrospectable function: param_spec_long() / g_param_spec_long()
4614 // Creates a new #GParamSpecLong instance specifying a %G_TYPE_LONG property.
4616 // See g_param_spec_internal() for details on property names.
4617 // RETURNS: a newly created parameter specification
4618 // <name>: canonical name of the property specified
4619 // <nick>: nick name for the property specified
4620 // <blurb>: description of the property specified
4621 // <minimum>: minimum value for the property specified
4622 // <maximum>: maximum value for the property specified
4623 // <default_value>: default value for the property specified
4624 // <flags>: flags for the property specified
4625 static ParamSpec* param_spec_long()(char* name, char* nick, char* blurb, c_long minimum, c_long maximum, c_long default_value, ParamFlags flags) {
4626 return g_param_spec_long(name, nick, blurb, minimum, maximum, default_value, flags);
4630 // Unintrospectable function: param_spec_object() / g_param_spec_object()
4631 // Creates a new #GParamSpecBoxed instance specifying a %G_TYPE_OBJECT
4632 // derived property.
4634 // See g_param_spec_internal() for details on property names.
4635 // RETURNS: a newly created parameter specification
4636 // <name>: canonical name of the property specified
4637 // <nick>: nick name for the property specified
4638 // <blurb>: description of the property specified
4639 // <object_type>: %G_TYPE_OBJECT derived type of this property
4640 // <flags>: flags for the property specified
4641 static ParamSpec* param_spec_object()(char* name, char* nick, char* blurb, Type object_type, ParamFlags flags) {
4642 return g_param_spec_object(name, nick, blurb, object_type, flags);
4646 // Unintrospectable function: param_spec_override() / g_param_spec_override()
4647 // VERSION: 2.4
4648 // Creates a new property of type #GParamSpecOverride. This is used
4649 // to direct operations to another paramspec, and will not be directly
4650 // useful unless you are implementing a new base type similar to GObject.
4651 // RETURNS: the newly created #GParamSpec
4652 // <name>: the name of the property.
4653 // <overridden>: The property that is being overridden
4654 static ParamSpec* param_spec_override()(char* name, ParamSpec* overridden) {
4655 return g_param_spec_override(name, overridden);
4659 // Unintrospectable function: param_spec_param() / g_param_spec_param()
4660 // Creates a new #GParamSpecParam instance specifying a %G_TYPE_PARAM
4661 // property.
4663 // See g_param_spec_internal() for details on property names.
4664 // RETURNS: a newly created parameter specification
4665 // <name>: canonical name of the property specified
4666 // <nick>: nick name for the property specified
4667 // <blurb>: description of the property specified
4668 // <param_type>: a #GType derived from %G_TYPE_PARAM
4669 // <flags>: flags for the property specified
4670 static ParamSpec* param_spec_param()(char* name, char* nick, char* blurb, Type param_type, ParamFlags flags) {
4671 return g_param_spec_param(name, nick, blurb, param_type, flags);
4675 // Unintrospectable function: param_spec_pointer() / g_param_spec_pointer()
4676 // Creates a new #GParamSpecPoiner instance specifying a pointer property.
4678 // See g_param_spec_internal() for details on property names.
4679 // RETURNS: a newly created parameter specification
4680 // <name>: canonical name of the property specified
4681 // <nick>: nick name for the property specified
4682 // <blurb>: description of the property specified
4683 // <flags>: flags for the property specified
4684 static ParamSpec* param_spec_pointer()(char* name, char* nick, char* blurb, ParamFlags flags) {
4685 return g_param_spec_pointer(name, nick, blurb, flags);
4689 // MOVED TO: ParamSpecPool.new
4690 // Creates a new #GParamSpecPool.
4692 // If @type_prefixing is %TRUE, lookups in the newly created pool will
4693 // allow to specify the owner as a colon-separated prefix of the
4694 // property name, like "GtkContainer:border-width". This feature is
4695 // deprecated, so you should always set @type_prefixing to %FALSE.
4696 // RETURNS: a newly allocated #GParamSpecPool.
4697 // <type_prefixing>: Whether the pool will support type-prefixed property names.
4698 static ParamSpecPool* param_spec_pool_new()(int type_prefixing) {
4699 return g_param_spec_pool_new(type_prefixing);
4703 // Unintrospectable function: param_spec_string() / g_param_spec_string()
4704 // Creates a new #GParamSpecString instance.
4706 // See g_param_spec_internal() for details on property names.
4707 // RETURNS: a newly created parameter specification
4708 // <name>: canonical name of the property specified
4709 // <nick>: nick name for the property specified
4710 // <blurb>: description of the property specified
4711 // <default_value>: default value for the property specified
4712 // <flags>: flags for the property specified
4713 static ParamSpec* param_spec_string()(char* name, char* nick, char* blurb, char* default_value, ParamFlags flags) {
4714 return g_param_spec_string(name, nick, blurb, default_value, flags);
4718 // Unintrospectable function: param_spec_uchar() / g_param_spec_uchar()
4719 // Creates a new #GParamSpecUChar instance specifying a %G_TYPE_UCHAR property.
4720 // RETURNS: a newly created parameter specification
4721 // <name>: canonical name of the property specified
4722 // <nick>: nick name for the property specified
4723 // <blurb>: description of the property specified
4724 // <minimum>: minimum value for the property specified
4725 // <maximum>: maximum value for the property specified
4726 // <default_value>: default value for the property specified
4727 // <flags>: flags for the property specified
4728 static ParamSpec* param_spec_uchar()(char* name, char* nick, char* blurb, ubyte minimum, ubyte maximum, ubyte default_value, ParamFlags flags) {
4729 return g_param_spec_uchar(name, nick, blurb, minimum, maximum, default_value, flags);
4733 // Unintrospectable function: param_spec_uint() / g_param_spec_uint()
4734 // Creates a new #GParamSpecUInt instance specifying a %G_TYPE_UINT property.
4736 // See g_param_spec_internal() for details on property names.
4737 // RETURNS: a newly created parameter specification
4738 // <name>: canonical name of the property specified
4739 // <nick>: nick name for the property specified
4740 // <blurb>: description of the property specified
4741 // <minimum>: minimum value for the property specified
4742 // <maximum>: maximum value for the property specified
4743 // <default_value>: default value for the property specified
4744 // <flags>: flags for the property specified
4745 static ParamSpec* param_spec_uint()(char* name, char* nick, char* blurb, uint minimum, uint maximum, uint default_value, ParamFlags flags) {
4746 return g_param_spec_uint(name, nick, blurb, minimum, maximum, default_value, flags);
4750 // Unintrospectable function: param_spec_uint64() / g_param_spec_uint64()
4751 // Creates a new #GParamSpecUInt64 instance specifying a %G_TYPE_UINT64
4752 // property.
4754 // See g_param_spec_internal() for details on property names.
4755 // RETURNS: a newly created parameter specification
4756 // <name>: canonical name of the property specified
4757 // <nick>: nick name for the property specified
4758 // <blurb>: description of the property specified
4759 // <minimum>: minimum value for the property specified
4760 // <maximum>: maximum value for the property specified
4761 // <default_value>: default value for the property specified
4762 // <flags>: flags for the property specified
4763 static ParamSpec* param_spec_uint64()(char* name, char* nick, char* blurb, ulong minimum, ulong maximum, ulong default_value, ParamFlags flags) {
4764 return g_param_spec_uint64(name, nick, blurb, minimum, maximum, default_value, flags);
4768 // Unintrospectable function: param_spec_ulong() / g_param_spec_ulong()
4769 // Creates a new #GParamSpecULong instance specifying a %G_TYPE_ULONG
4770 // property.
4772 // See g_param_spec_internal() for details on property names.
4773 // RETURNS: a newly created parameter specification
4774 // <name>: canonical name of the property specified
4775 // <nick>: nick name for the property specified
4776 // <blurb>: description of the property specified
4777 // <minimum>: minimum value for the property specified
4778 // <maximum>: maximum value for the property specified
4779 // <default_value>: default value for the property specified
4780 // <flags>: flags for the property specified
4781 static ParamSpec* param_spec_ulong()(char* name, char* nick, char* blurb, c_ulong minimum, c_ulong maximum, c_ulong default_value, ParamFlags flags) {
4782 return g_param_spec_ulong(name, nick, blurb, minimum, maximum, default_value, flags);
4786 // Unintrospectable function: param_spec_unichar() / g_param_spec_unichar()
4787 // Creates a new #GParamSpecUnichar instance specifying a %G_TYPE_UINT
4788 // property. #GValue structures for this property can be accessed with
4789 // g_value_set_uint() and g_value_get_uint().
4791 // See g_param_spec_internal() for details on property names.
4792 // RETURNS: a newly created parameter specification
4793 // <name>: canonical name of the property specified
4794 // <nick>: nick name for the property specified
4795 // <blurb>: description of the property specified
4796 // <default_value>: default value for the property specified
4797 // <flags>: flags for the property specified
4798 static ParamSpec* param_spec_unichar()(char* name, char* nick, char* blurb, dchar default_value, ParamFlags flags) {
4799 return g_param_spec_unichar(name, nick, blurb, default_value, flags);
4803 // Unintrospectable function: param_spec_value_array() / g_param_spec_value_array()
4804 // Creates a new #GParamSpecValueArray instance specifying a
4805 // %G_TYPE_VALUE_ARRAY property. %G_TYPE_VALUE_ARRAY is a
4806 // %G_TYPE_BOXED type, as such, #GValue structures for this property
4807 // can be accessed with g_value_set_boxed() and g_value_get_boxed().
4809 // See g_param_spec_internal() for details on property names.
4810 // RETURNS: a newly created parameter specification
4811 // <name>: canonical name of the property specified
4812 // <nick>: nick name for the property specified
4813 // <blurb>: description of the property specified
4814 // <element_spec>: a #GParamSpec describing the elements contained in arrays of this property, may be %NULL
4815 // <flags>: flags for the property specified
4816 static ParamSpec* param_spec_value_array()(char* name, char* nick, char* blurb, ParamSpec* element_spec, ParamFlags flags) {
4817 return g_param_spec_value_array(name, nick, blurb, element_spec, flags);
4821 // Unintrospectable function: param_spec_variant() / g_param_spec_variant()
4822 // VERSION: 2.26
4823 // Creates a new #GParamSpecVariant instance specifying a #GVariant
4824 // property.
4826 // If @default_value is floating, it is consumed.
4828 // See g_param_spec_internal() for details on property names.
4829 // RETURNS: the newly created #GParamSpec
4830 // <name>: canonical name of the property specified
4831 // <nick>: nick name for the property specified
4832 // <blurb>: description of the property specified
4833 // <type>: a #GVariantType
4834 // <default_value>: a #GVariant of type @type to use as the default value, or %NULL
4835 // <flags>: flags for the property specified
4836 static ParamSpec* param_spec_variant()(char* name, char* nick, char* blurb, GLib2.VariantType* type, GLib2.Variant* default_value, ParamFlags flags) {
4837 return g_param_spec_variant(name, nick, blurb, type, default_value, flags);
4841 // Registers @name as the name of a new static type derived from
4842 // #G_TYPE_PARAM. The type system uses the information contained in
4843 // the #GParamSpecTypeInfo structure pointed to by @info to manage the
4844 // #GParamSpec type and its instances.
4845 // RETURNS: The new type identifier.
4846 // <name>: 0-terminated string used as the name of the new #GParamSpec type.
4847 // <pspec_info>: The #GParamSpecTypeInfo for this #GParamSpec type.
4848 static Type param_type_register_static()(char* name, ParamSpecTypeInfo* pspec_info) {
4849 return g_param_type_register_static(name, pspec_info);
4853 // Transforms @src_value into @dest_value if possible, and then
4854 // validates @dest_value, in order for it to conform to @pspec. If
4855 // @strict_validation is %TRUE this function will only succeed if the
4856 // transformed @dest_value complied to @pspec without modifications.
4858 // See also g_value_type_transformable(), g_value_transform() and
4859 // g_param_value_validate().
4861 // %FALSE otherwise and @dest_value is left untouched.
4862 // RETURNS: %TRUE if transformation and validation were successful,
4863 // <pspec>: a valid #GParamSpec
4864 // <src_value>: souce #GValue
4865 // <dest_value>: destination #GValue of correct type for @pspec
4866 // <strict_validation>: %TRUE requires @dest_value to conform to @pspec without modifications
4867 static int param_value_convert()(ParamSpec* pspec, Value* src_value, Value* dest_value, int strict_validation) {
4868 return g_param_value_convert(pspec, src_value, dest_value, strict_validation);
4872 // Checks whether @value contains the default value as specified in @pspec.
4873 // RETURNS: whether @value contains the canonical default for this @pspec
4874 // <pspec>: a valid #GParamSpec
4875 // <value>: a #GValue of correct type for @pspec
4876 static int param_value_defaults()(ParamSpec* pspec, Value* value) {
4877 return g_param_value_defaults(pspec, value);
4881 // Sets @value to its default value as specified in @pspec.
4882 // <pspec>: a valid #GParamSpec
4883 // <value>: a #GValue of correct type for @pspec
4884 static void param_value_set_default()(ParamSpec* pspec, Value* value) {
4885 g_param_value_set_default(pspec, value);
4889 // Ensures that the contents of @value comply with the specifications
4890 // set out by @pspec. For example, a #GParamSpecInt might require
4891 // that integers stored in @value may not be smaller than -42 and not be
4892 // greater than +42. If @value contains an integer outside of this range,
4893 // it is modified accordingly, so the resulting value will fit into the
4894 // range -42 .. +42.
4895 // RETURNS: whether modifying @value was necessary to ensure validity
4896 // <pspec>: a valid #GParamSpec
4897 // <value>: a #GValue of correct type for @pspec
4898 static int param_value_validate()(ParamSpec* pspec, Value* value) {
4899 return g_param_value_validate(pspec, value);
4903 // Compares @value1 with @value2 according to @pspec, and return -1, 0 or +1,
4904 // if @value1 is found to be less than, equal to or greater than @value2,
4905 // respectively.
4906 // RETURNS: -1, 0 or +1, for a less than, equal to or greater than result
4907 // <pspec>: a valid #GParamSpec
4908 // <value1>: a #GValue of correct type for @pspec
4909 // <value2>: a #GValue of correct type for @pspec
4910 static int param_values_cmp()(ParamSpec* pspec, Value* value1, Value* value2) {
4911 return g_param_values_cmp(pspec, value1, value2);
4915 // Creates a new %G_TYPE_POINTER derived type id for a new
4916 // pointer type with name @name.
4917 // RETURNS: a new %G_TYPE_POINTER derived type id for @name.
4918 // <name>: the name of the new pointer type.
4919 static Type pointer_type_register_static()(char* name) {
4920 return g_pointer_type_register_static(name);
4924 // VERSION: 2.28
4925 // A predefined #GSignalAccumulator for signals intended to be used as a
4926 // hook for application code to provide a particular value. Usually
4927 // only one such value is desired and multiple handlers for the same
4928 // signal don't make much sense (except for the case of the default
4929 // handler defined in the class structure, in which case you will
4930 // usually want the signal connection to override the class handler).
4932 // This accumulator will use the return value from the first signal
4933 // handler that is run as the return value for the signal and not run
4934 // any further handlers (ie: the first handler "wins").
4935 // RETURNS: standard #GSignalAccumulator result
4936 // <ihint>: standard #GSignalAccumulator parameter
4937 // <return_accu>: standard #GSignalAccumulator parameter
4938 // <handler_return>: standard #GSignalAccumulator parameter
4939 // <dummy>: standard #GSignalAccumulator parameter
4940 static int signal_accumulator_first_wins()(SignalInvocationHint* ihint, Value* return_accu, Value* handler_return, void* dummy) {
4941 return g_signal_accumulator_first_wins(ihint, return_accu, handler_return, dummy);
4945 // VERSION: 2.4
4946 // A predefined #GSignalAccumulator for signals that return a
4947 // boolean values. The behavior that this accumulator gives is
4948 // that a return of %TRUE stops the signal emission: no further
4949 // callbacks will be invoked, while a return of %FALSE allows
4950 // the emission to continue. The idea here is that a %TRUE return
4951 // indicates that the callback <emphasis>handled</emphasis> the signal,
4952 // and no further handling is needed.
4953 // RETURNS: standard #GSignalAccumulator result
4954 // <ihint>: standard #GSignalAccumulator parameter
4955 // <return_accu>: standard #GSignalAccumulator parameter
4956 // <handler_return>: standard #GSignalAccumulator parameter
4957 // <dummy>: standard #GSignalAccumulator parameter
4958 static int signal_accumulator_true_handled()(SignalInvocationHint* ihint, Value* return_accu, Value* handler_return, void* dummy) {
4959 return g_signal_accumulator_true_handled(ihint, return_accu, handler_return, dummy);
4963 // Adds an emission hook for a signal, which will get called for any emission
4964 // of that signal, independent of the instance. This is possible only
4965 // for signals which don't have #G_SIGNAL_NO_HOOKS flag set.
4966 // RETURNS: the hook id, for later use with g_signal_remove_emission_hook().
4967 // <signal_id>: the signal identifier, as returned by g_signal_lookup().
4968 // <detail>: the detail on which to call the hook.
4969 // <hook_func>: a #GSignalEmissionHook function.
4970 // <hook_data>: user data for @hook_func.
4971 // <data_destroy>: a #GDestroyNotify for @hook_data.
4972 static c_ulong signal_add_emission_hook()(uint signal_id, GLib2.Quark detail, SignalEmissionHook hook_func, void* hook_data, GLib2.DestroyNotify data_destroy) {
4973 return g_signal_add_emission_hook(signal_id, detail, hook_func, hook_data, data_destroy);
4977 // Calls the original class closure of a signal. This function should only
4978 // be called from an overridden class closure; see
4979 // g_signal_override_class_closure() and
4980 // g_signal_override_class_handler().
4981 // <instance_and_params>: (array) the argument list of the signal emission. The first element in the array is a #GValue for the instance the signal is being emitted on. The rest are any arguments to be passed to the signal.
4982 // <return_value>: Location for the return value.
4983 static void signal_chain_from_overridden()(Value* instance_and_params, Value* return_value) {
4984 g_signal_chain_from_overridden(instance_and_params, return_value);
4988 // Unintrospectable function: signal_chain_from_overridden_handler() / g_signal_chain_from_overridden_handler()
4989 // VERSION: 2.18
4990 // Calls the original class closure of a signal. This function should
4991 // only be called from an overridden class closure; see
4992 // g_signal_override_class_closure() and
4993 // g_signal_override_class_handler().
4994 // <instance>: the instance the signal is being emitted on.
4995 alias g_signal_chain_from_overridden_handler signal_chain_from_overridden_handler; // Variadic
4998 // Connects a closure to a signal for a particular object.
4999 // RETURNS: the handler id
5000 // <instance>: the instance to connect to.
5001 // <detailed_signal>: a string of the form "signal-name::detail".
5002 // <closure>: the closure to connect.
5003 // <after>: whether the handler should be called before or after the default handler of the signal.
5004 static c_ulong signal_connect_closure()(void* instance, char* detailed_signal, Closure* closure, int after) {
5005 return g_signal_connect_closure(instance, detailed_signal, closure, after);
5009 // Connects a closure to a signal for a particular object.
5010 // RETURNS: the handler id
5011 // <instance>: the instance to connect to.
5012 // <signal_id>: the id of the signal.
5013 // <detail>: the detail.
5014 // <closure>: the closure to connect.
5015 // <after>: whether the handler should be called before or after the default handler of the signal.
5016 static c_ulong signal_connect_closure_by_id()(void* instance, uint signal_id, GLib2.Quark detail, Closure* closure, int after) {
5017 return g_signal_connect_closure_by_id(instance, signal_id, detail, closure, after);
5021 // Unintrospectable function: signal_connect_data() / g_signal_connect_data()
5022 // Connects a #GCallback function to a signal for a particular object. Similar
5023 // to g_signal_connect(), but allows to provide a #GClosureNotify for the data
5024 // which will be called when the signal handler is disconnected and no longer
5025 // used. Specify @connect_flags if you need <literal>..._after()</literal> or
5026 // <literal>..._swapped()</literal> variants of this function.
5027 // RETURNS: the handler id
5028 // <instance>: the instance to connect to.
5029 // <detailed_signal>: a string of the form "signal-name::detail".
5030 // <c_handler>: the #GCallback to connect.
5031 // <data>: data to pass to @c_handler calls.
5032 // <destroy_data>: a #GClosureNotify for @data.
5033 // <connect_flags>: a combination of #GConnectFlags.
5034 static c_ulong signal_connect_data()(void* instance, char* detailed_signal, Callback c_handler, void* data, ClosureNotify destroy_data, ConnectFlags connect_flags) {
5035 return g_signal_connect_data(instance, detailed_signal, c_handler, data, destroy_data, connect_flags);
5039 // Unintrospectable function: signal_connect_object() / g_signal_connect_object()
5040 // This is similar to g_signal_connect_data(), but uses a closure which
5041 // ensures that the @gobject stays alive during the call to @c_handler
5042 // by temporarily adding a reference count to @gobject.
5044 // Note that there is a bug in GObject that makes this function
5045 // much less useful than it might seem otherwise. Once @gobject is
5046 // disposed, the callback will no longer be called, but, the signal
5047 // handler is <emphasis>not</emphasis> currently disconnected. If the
5048 // @instance is itself being freed at the same time than this doesn't
5049 // matter, since the signal will automatically be removed, but
5050 // if @instance persists, then the signal handler will leak. You
5051 // should not remove the signal yourself because in a future versions of
5052 // GObject, the handler <emphasis>will</emphasis> automatically
5053 // be disconnected.
5055 // It's possible to work around this problem in a way that will
5056 // continue to work with future versions of GObject by checking
5057 // that the signal handler is still connected before disconnected it:
5058 // <informalexample><programlisting>
5059 // if (g_signal_handler_is_connected (instance, id))
5060 // g_signal_handler_disconnect (instance, id);
5061 // </programlisting></informalexample>
5062 // RETURNS: the handler id.
5063 // <instance>: the instance to connect to.
5064 // <detailed_signal>: a string of the form "signal-name::detail".
5065 // <c_handler>: the #GCallback to connect.
5066 // <gobject>: the object to pass as data to @c_handler.
5067 // <connect_flags>: a combination of #GConnnectFlags.
5068 static c_ulong signal_connect_object()(void* instance, char* detailed_signal, Callback c_handler, void* gobject, ConnectFlags connect_flags) {
5069 return g_signal_connect_object(instance, detailed_signal, c_handler, gobject, connect_flags);
5073 // Unintrospectable function: signal_emit() / g_signal_emit()
5074 // Emits a signal.
5076 // Note that g_signal_emit() resets the return value to the default
5077 // if no handlers are connected, in contrast to g_signal_emitv().
5078 // <instance>: the instance the signal is being emitted on.
5079 // <signal_id>: the signal id
5080 // <detail>: the detail
5081 alias g_signal_emit signal_emit; // Variadic
5084 // Unintrospectable function: signal_emit_by_name() / g_signal_emit_by_name()
5085 // Emits a signal.
5087 // Note that g_signal_emit_by_name() resets the return value to the default
5088 // if no handlers are connected, in contrast to g_signal_emitv().
5089 // <instance>: the instance the signal is being emitted on.
5090 // <detailed_signal>: a string of the form "signal-name::detail".
5091 alias g_signal_emit_by_name signal_emit_by_name; // Variadic
5094 // Unintrospectable function: signal_emit_valist() / g_signal_emit_valist()
5095 // Emits a signal.
5097 // Note that g_signal_emit_valist() resets the return value to the default
5098 // if no handlers are connected, in contrast to g_signal_emitv().
5099 // <instance>: the instance the signal is being emitted on.
5100 // <signal_id>: the signal id
5101 // <detail>: the detail
5102 // <var_args>: a list of parameters to be passed to the signal, followed by a location for the return value. If the return type of the signal is #G_TYPE_NONE, the return value location can be omitted.
5103 static void signal_emit_valist()(void* instance, uint signal_id, GLib2.Quark detail, va_list var_args) {
5104 g_signal_emit_valist(instance, signal_id, detail, var_args);
5108 // Emits a signal.
5110 // Note that g_signal_emitv() doesn't change @return_value if no handlers are
5111 // connected, in contrast to g_signal_emit() and g_signal_emit_valist().
5112 // <instance_and_params>: argument list for the signal emission. The first element in the array is a #GValue for the instance the signal is being emitted on. The rest are any arguments to be passed to the signal.
5113 // <signal_id>: the signal id
5114 // <detail>: the detail
5115 // <return_value>: Location to store the return value of the signal emission.
5116 static void signal_emitv()(Value* instance_and_params, uint signal_id, GLib2.Quark detail, Value* return_value) {
5117 g_signal_emitv(instance_and_params, signal_id, detail, return_value);
5121 // Returns the invocation hint of the innermost signal emission of instance.
5122 // RETURNS: the invocation hint of the innermost signal emission.
5123 // <instance>: the instance to query
5124 static SignalInvocationHint* signal_get_invocation_hint()(void* instance) {
5125 return g_signal_get_invocation_hint(instance);
5129 // Blocks a handler of an instance so it will not be called during any
5130 // signal emissions unless it is unblocked again. Thus "blocking" a
5131 // signal handler means to temporarily deactive it, a signal handler
5132 // has to be unblocked exactly the same amount of times it has been
5133 // blocked before to become active again.
5135 // The @handler_id has to be a valid signal handler id, connected to a
5136 // signal of @instance.
5137 // <instance>: The instance to block the signal handler of.
5138 // <handler_id>: Handler id of the handler to be blocked.
5139 static void signal_handler_block()(void* instance, c_ulong handler_id) {
5140 g_signal_handler_block(instance, handler_id);
5144 // Disconnects a handler from an instance so it will not be called during
5145 // any future or currently ongoing emissions of the signal it has been
5146 // connected to. The @handler_id becomes invalid and may be reused.
5148 // The @handler_id has to be a valid signal handler id, connected to a
5149 // signal of @instance.
5150 // <instance>: The instance to remove the signal handler from.
5151 // <handler_id>: Handler id of the handler to be disconnected.
5152 static void signal_handler_disconnect()(void* instance, c_ulong handler_id) {
5153 g_signal_handler_disconnect(instance, handler_id);
5157 // Finds the first signal handler that matches certain selection criteria.
5158 // The criteria mask is passed as an OR-ed combination of #GSignalMatchType
5159 // flags, and the criteria values are passed as arguments.
5160 // The match @mask has to be non-0 for successful matches.
5161 // If no handler was found, 0 is returned.
5162 // RETURNS: A valid non-0 signal handler id for a successful match.
5163 // <instance>: The instance owning the signal handler to be found.
5164 // <mask>: Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handler has to match.
5165 // <signal_id>: Signal the handler has to be connected to.
5166 // <detail>: Signal detail the handler has to be connected to.
5167 // <closure>: The closure the handler will invoke.
5168 // <func>: The C closure callback of the handler (useless for non-C closures).
5169 // <data>: The closure data of the handler's closure.
5170 static c_ulong signal_handler_find()(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data) {
5171 return g_signal_handler_find(instance, mask, signal_id, detail, closure, func, data);
5175 // Returns whether @handler_id is the id of a handler connected to @instance.
5176 // RETURNS: whether @handler_id identifies a handler connected to @instance.
5177 // <instance>: The instance where a signal handler is sought.
5178 // <handler_id>: the handler id.
5179 static int signal_handler_is_connected()(void* instance, c_ulong handler_id) {
5180 return g_signal_handler_is_connected(instance, handler_id);
5184 // Undoes the effect of a previous g_signal_handler_block() call. A
5185 // blocked handler is skipped during signal emissions and will not be
5186 // invoked, unblocking it (for exactly the amount of times it has been
5187 // blocked before) reverts its "blocked" state, so the handler will be
5188 // recognized by the signal system and is called upon future or
5189 // currently ongoing signal emissions (since the order in which
5190 // handlers are called during signal emissions is deterministic,
5191 // whether the unblocked handler in question is called as part of a
5192 // currently ongoing emission depends on how far that emission has
5193 // proceeded yet).
5195 // The @handler_id has to be a valid id of a signal handler that is
5196 // connected to a signal of @instance and is currently blocked.
5197 // <instance>: The instance to unblock the signal handler of.
5198 // <handler_id>: Handler id of the handler to be unblocked.
5199 static void signal_handler_unblock()(void* instance, c_ulong handler_id) {
5200 g_signal_handler_unblock(instance, handler_id);
5204 // Blocks all handlers on an instance that match a certain selection criteria.
5205 // The criteria mask is passed as an OR-ed combination of #GSignalMatchType
5206 // flags, and the criteria values are passed as arguments.
5207 // Passing at least one of the %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC
5208 // or %G_SIGNAL_MATCH_DATA match flags is required for successful matches.
5209 // If no handlers were found, 0 is returned, the number of blocked handlers
5210 // otherwise.
5211 // RETURNS: The number of handlers that matched.
5212 // <instance>: The instance to block handlers from.
5213 // <mask>: Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handlers have to match.
5214 // <signal_id>: Signal the handlers have to be connected to.
5215 // <detail>: Signal detail the handlers have to be connected to.
5216 // <closure>: The closure the handlers will invoke.
5217 // <func>: The C closure callback of the handlers (useless for non-C closures).
5218 // <data>: The closure data of the handlers' closures.
5219 static uint signal_handlers_block_matched()(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data) {
5220 return g_signal_handlers_block_matched(instance, mask, signal_id, detail, closure, func, data);
5223 static void signal_handlers_destroy()(void* instance) {
5224 g_signal_handlers_destroy(instance);
5228 // Disconnects all handlers on an instance that match a certain
5229 // selection criteria. The criteria mask is passed as an OR-ed
5230 // combination of #GSignalMatchType flags, and the criteria values are
5231 // passed as arguments. Passing at least one of the
5232 // %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC or
5233 // %G_SIGNAL_MATCH_DATA match flags is required for successful
5234 // matches. If no handlers were found, 0 is returned, the number of
5235 // disconnected handlers otherwise.
5236 // RETURNS: The number of handlers that matched.
5237 // <instance>: The instance to remove handlers from.
5238 // <mask>: Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handlers have to match.
5239 // <signal_id>: Signal the handlers have to be connected to.
5240 // <detail>: Signal detail the handlers have to be connected to.
5241 // <closure>: The closure the handlers will invoke.
5242 // <func>: The C closure callback of the handlers (useless for non-C closures).
5243 // <data>: The closure data of the handlers' closures.
5244 static uint signal_handlers_disconnect_matched()(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data) {
5245 return g_signal_handlers_disconnect_matched(instance, mask, signal_id, detail, closure, func, data);
5249 // Unblocks all handlers on an instance that match a certain selection
5250 // criteria. The criteria mask is passed as an OR-ed combination of
5251 // #GSignalMatchType flags, and the criteria values are passed as arguments.
5252 // Passing at least one of the %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC
5253 // or %G_SIGNAL_MATCH_DATA match flags is required for successful matches.
5254 // If no handlers were found, 0 is returned, the number of unblocked handlers
5255 // otherwise. The match criteria should not apply to any handlers that are
5256 // not currently blocked.
5257 // RETURNS: The number of handlers that matched.
5258 // <instance>: The instance to unblock handlers from.
5259 // <mask>: Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handlers have to match.
5260 // <signal_id>: Signal the handlers have to be connected to.
5261 // <detail>: Signal detail the handlers have to be connected to.
5262 // <closure>: The closure the handlers will invoke.
5263 // <func>: The C closure callback of the handlers (useless for non-C closures).
5264 // <data>: The closure data of the handlers' closures.
5265 static uint signal_handlers_unblock_matched()(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data) {
5266 return g_signal_handlers_unblock_matched(instance, mask, signal_id, detail, closure, func, data);
5270 // Returns whether there are any handlers connected to @instance for the
5271 // given signal id and detail.
5273 // One example of when you might use this is when the arguments to the
5274 // signal are difficult to compute. A class implementor may opt to not
5275 // emit the signal if no one is attached anyway, thus saving the cost
5276 // of building the arguments.
5278 // otherwise.
5279 // RETURNS: %TRUE if a handler is connected to the signal, %FALSE
5280 // <instance>: the object whose signal handlers are sought.
5281 // <signal_id>: the signal id.
5282 // <detail>: the detail.
5283 // <may_be_blocked>: whether blocked handlers should count as match.
5284 static int signal_has_handler_pending()(void* instance, uint signal_id, GLib2.Quark detail, int may_be_blocked) {
5285 return g_signal_has_handler_pending(instance, signal_id, detail, may_be_blocked);
5289 // Lists the signals by id that a certain instance or interface type
5290 // created. Further information about the signals can be acquired through
5291 // g_signal_query().
5292 // RETURNS: Newly allocated array of signal IDs.
5293 // <itype>: Instance or interface type.
5294 // <n_ids>: Location to store the number of signal ids for @itype.
5295 static uint* signal_list_ids()(Type itype, /*out*/ uint* n_ids) {
5296 return g_signal_list_ids(itype, n_ids);
5300 // Given the name of the signal and the type of object it connects to, gets
5301 // the signal's identifying integer. Emitting the signal by number is
5302 // somewhat faster than using the name each time.
5304 // Also tries the ancestors of the given type.
5306 // See g_signal_new() for details on allowed signal names.
5307 // RETURNS: the signal's identifying number, or 0 if no signal was found.
5308 // <name>: the signal's name.
5309 // <itype>: the type that the signal operates on.
5310 static uint signal_lookup()(char* name, Type itype) {
5311 return g_signal_lookup(name, itype);
5315 // Given the signal's identifier, finds its name.
5317 // Two different signals may have the same name, if they have differing types.
5318 // RETURNS: the signal name, or %NULL if the signal number was invalid.
5319 // <signal_id>: the signal's identifying number.
5320 static char* signal_name()(uint signal_id) {
5321 return g_signal_name(signal_id);
5325 // Unintrospectable function: signal_new() / g_signal_new()
5326 // Creates a new signal. (This is usually done in the class initializer.)
5328 // A signal name consists of segments consisting of ASCII letters and
5329 // digits, separated by either the '-' or '_' character. The first
5330 // character of a signal name must be a letter. Names which violate these
5331 // rules lead to undefined behaviour of the GSignal system.
5333 // When registering a signal and looking up a signal, either separator can
5334 // be used, but they cannot be mixed.
5336 // If 0 is used for @class_offset subclasses cannot override the class handler
5337 // in their <code>class_init</code> method by doing
5338 // <code>super_class->signal_handler = my_signal_handler</code>. Instead they
5339 // will have to use g_signal_override_class_handler().
5341 // If c_marshaller is %NULL, g_cclosure_marshal_generic() will be used as
5342 // the marshaller for this signal.
5343 // RETURNS: the signal id
5344 // <signal_name>: the name for the signal
5345 // <itype>: the type this signal pertains to. It will also pertain to types which are derived from this type.
5346 // <signal_flags>: a combination of #GSignalFlags specifying detail of when the default handler is to be invoked. You should at least specify %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST.
5347 // <class_offset>: The offset of the function pointer in the class structure for this type. Used to invoke a class method generically. Pass 0 to not associate a class method slot with this signal.
5348 // <accumulator>: the accumulator for this signal; may be %NULL.
5349 // <accu_data>: user data for the @accumulator.
5350 // <c_marshaller>: the function to translate arrays of parameter values to signal emissions into C language callback invocations or %NULL.
5351 // <return_type>: the type of return value, or #G_TYPE_NONE for a signal without a return value.
5352 // <n_params>: the number of parameter types to follow.
5353 alias g_signal_new signal_new; // Variadic
5356 // Unintrospectable function: signal_new_class_handler() / g_signal_new_class_handler()
5357 // VERSION: 2.18
5358 // Creates a new signal. (This is usually done in the class initializer.)
5360 // This is a variant of g_signal_new() that takes a C callback instead
5361 // off a class offset for the signal's class handler. This function
5362 // doesn't need a function pointer exposed in the class structure of
5363 // an object definition, instead the function pointer is passed
5364 // directly and can be overriden by derived classes with
5365 // g_signal_override_class_closure() or
5366 // g_signal_override_class_handler()and chained to with
5367 // g_signal_chain_from_overridden() or
5368 // g_signal_chain_from_overridden_handler().
5370 // See g_signal_new() for information about signal names.
5372 // If c_marshaller is %NULL @g_cclosure_marshal_generic will be used as
5373 // the marshaller for this signal.
5374 // RETURNS: the signal id
5375 // <signal_name>: the name for the signal
5376 // <itype>: the type this signal pertains to. It will also pertain to types which are derived from this type.
5377 // <signal_flags>: a combination of #GSignalFlags specifying detail of when the default handler is to be invoked. You should at least specify %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST.
5378 // <class_handler>: a #GCallback which acts as class implementation of this signal. Used to invoke a class method generically. Pass %NULL to not associate a class method with this signal.
5379 // <accumulator>: the accumulator for this signal; may be %NULL.
5380 // <accu_data>: user data for the @accumulator.
5381 // <c_marshaller>: the function to translate arrays of parameter values to signal emissions into C language callback invocations or %NULL.
5382 // <return_type>: the type of return value, or #G_TYPE_NONE for a signal without a return value.
5383 // <n_params>: the number of parameter types to follow.
5384 alias g_signal_new_class_handler signal_new_class_handler; // Variadic
5387 // Unintrospectable function: signal_new_valist() / g_signal_new_valist()
5388 // Creates a new signal. (This is usually done in the class initializer.)
5390 // See g_signal_new() for details on allowed signal names.
5392 // If c_marshaller is %NULL, g_cclosure_marshal_generic() will be used as
5393 // the marshaller for this signal.
5394 // RETURNS: the signal id
5395 // <signal_name>: the name for the signal
5396 // <itype>: the type this signal pertains to. It will also pertain to types which are derived from this type.
5397 // <signal_flags>: a combination of #GSignalFlags specifying detail of when the default handler is to be invoked. You should at least specify %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST.
5398 // <class_closure>: The closure to invoke on signal emission; may be %NULL.
5399 // <accumulator>: the accumulator for this signal; may be %NULL.
5400 // <accu_data>: user data for the @accumulator.
5401 // <c_marshaller>: the function to translate arrays of parameter values to signal emissions into C language callback invocations or %NULL.
5402 // <return_type>: the type of return value, or #G_TYPE_NONE for a signal without a return value.
5403 // <n_params>: the number of parameter types in @args.
5404 // <args>: va_list of #GType, one for each parameter.
5405 static uint signal_new_valist()(char* signal_name, Type itype, SignalFlags signal_flags, Closure* class_closure, SignalAccumulator accumulator, void* accu_data, SignalCMarshaller c_marshaller, Type return_type, uint n_params, va_list args) {
5406 return g_signal_new_valist(signal_name, itype, signal_flags, class_closure, accumulator, accu_data, c_marshaller, return_type, n_params, args);
5410 // Unintrospectable function: signal_newv() / g_signal_newv()
5411 // Creates a new signal. (This is usually done in the class initializer.)
5413 // See g_signal_new() for details on allowed signal names.
5415 // If c_marshaller is %NULL @g_cclosure_marshal_generic will be used as
5416 // the marshaller for this signal.
5417 // RETURNS: the signal id
5418 // <signal_name>: the name for the signal
5419 // <itype>: the type this signal pertains to. It will also pertain to types which are derived from this type
5420 // <signal_flags>: a combination of #GSignalFlags specifying detail of when the default handler is to be invoked. You should at least specify %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST
5421 // <class_closure>: The closure to invoke on signal emission; may be %NULL
5422 // <accumulator>: the accumulator for this signal; may be %NULL
5423 // <accu_data>: user data for the @accumulator
5424 // <c_marshaller>: the function to translate arrays of parameter values to signal emissions into C language callback invocations or %NULL
5425 // <return_type>: the type of return value, or #G_TYPE_NONE for a signal without a return value
5426 // <n_params>: the length of @param_types
5427 // <param_types>: an array of types, one for each parameter
5428 static uint signal_newv()(char* signal_name, Type itype, SignalFlags signal_flags, Closure* class_closure, SignalAccumulator accumulator, void* accu_data, SignalCMarshaller c_marshaller, Type return_type, uint n_params, Type* param_types) {
5429 return g_signal_newv(signal_name, itype, signal_flags, class_closure, accumulator, accu_data, c_marshaller, return_type, n_params, param_types);
5433 // Overrides the class closure (i.e. the default handler) for the given signal
5434 // for emissions on instances of @instance_type. @instance_type must be derived
5435 // from the type to which the signal belongs.
5437 // See g_signal_chain_from_overridden() and
5438 // g_signal_chain_from_overridden_handler() for how to chain up to the
5439 // parent class closure from inside the overridden one.
5440 // <signal_id>: the signal id
5441 // <instance_type>: the instance type on which to override the class closure for the signal.
5442 // <class_closure>: the closure.
5443 static void signal_override_class_closure()(uint signal_id, Type instance_type, Closure* class_closure) {
5444 g_signal_override_class_closure(signal_id, instance_type, class_closure);
5448 // Unintrospectable function: signal_override_class_handler() / g_signal_override_class_handler()
5449 // VERSION: 2.18
5450 // Overrides the class closure (i.e. the default handler) for the
5451 // given signal for emissions on instances of @instance_type with
5452 // callabck @class_handler. @instance_type must be derived from the
5453 // type to which the signal belongs.
5455 // See g_signal_chain_from_overridden() and
5456 // g_signal_chain_from_overridden_handler() for how to chain up to the
5457 // parent class closure from inside the overridden one.
5458 // <signal_name>: the name for the signal
5459 // <instance_type>: the instance type on which to override the class handler for the signal.
5460 // <class_handler>: the handler.
5461 static void signal_override_class_handler()(char* signal_name, Type instance_type, Callback class_handler) {
5462 g_signal_override_class_handler(signal_name, instance_type, class_handler);
5466 // Internal function to parse a signal name into its @signal_id
5467 // and @detail quark.
5468 // RETURNS: Whether the signal name could successfully be parsed and @signal_id_p and @detail_p contain valid return values.
5469 // <detailed_signal>: a string of the form "signal-name::detail".
5470 // <itype>: The interface/instance type that introduced "signal-name".
5471 // <signal_id_p>: Location to store the signal id.
5472 // <detail_p>: Location to store the detail quark.
5473 // <force_detail_quark>: %TRUE forces creation of a #GQuark for the detail.
5474 static int signal_parse_name()(char* detailed_signal, Type itype, /*out*/ uint* signal_id_p, /*out*/ GLib2.Quark* detail_p, int force_detail_quark) {
5475 return g_signal_parse_name(detailed_signal, itype, signal_id_p, detail_p, force_detail_quark);
5479 // Queries the signal system for in-depth information about a
5480 // specific signal. This function will fill in a user-provided
5481 // structure to hold signal-specific information. If an invalid
5482 // signal id is passed in, the @signal_id member of the #GSignalQuery
5483 // is 0. All members filled into the #GSignalQuery structure should
5484 // be considered constant and have to be left untouched.
5485 // <signal_id>: The signal id of the signal to query information for.
5486 // <query>: A user provided structure that is filled in with constant values upon success.
5487 static void signal_query()(uint signal_id, /*out*/ SignalQuery* query) {
5488 g_signal_query(signal_id, query);
5492 // Deletes an emission hook.
5493 // <signal_id>: the id of the signal
5494 // <hook_id>: the id of the emission hook, as returned by g_signal_add_emission_hook()
5495 static void signal_remove_emission_hook()(uint signal_id, c_ulong hook_id) {
5496 g_signal_remove_emission_hook(signal_id, hook_id);
5500 // Stops a signal's current emission.
5502 // This will prevent the default method from running, if the signal was
5503 // %G_SIGNAL_RUN_LAST and you connected normally (i.e. without the "after"
5504 // flag).
5506 // Prints a warning if used on a signal which isn't being emitted.
5507 // <instance>: the object whose signal handlers you wish to stop.
5508 // <signal_id>: the signal identifier, as returned by g_signal_lookup().
5509 // <detail>: the detail which the signal was emitted with.
5510 static void signal_stop_emission()(void* instance, uint signal_id, GLib2.Quark detail) {
5511 g_signal_stop_emission(instance, signal_id, detail);
5515 // Stops a signal's current emission.
5517 // This is just like g_signal_stop_emission() except it will look up the
5518 // signal id for you.
5519 // <instance>: the object whose signal handlers you wish to stop.
5520 // <detailed_signal>: a string of the form "signal-name::detail".
5521 static void signal_stop_emission_by_name()(void* instance, char* detailed_signal) {
5522 g_signal_stop_emission_by_name(instance, detailed_signal);
5526 // Creates a new closure which invokes the function found at the offset
5527 // @struct_offset in the class structure of the interface or classed type
5528 // identified by @itype.
5529 // RETURNS: a new #GCClosure
5530 // <itype>: the #GType identifier of an interface or classed type
5531 // <struct_offset>: the offset of the member function of @itype's class structure which is to be invoked by the new closure
5532 static Closure* /*new*/ signal_type_cclosure_new()(Type itype, uint struct_offset) {
5533 return g_signal_type_cclosure_new(itype, struct_offset);
5537 // Set the callback for a source as a #GClosure.
5539 // If the source is not one of the standard GLib types, the @closure_callback
5540 // and @closure_marshal fields of the #GSourceFuncs structure must have been
5541 // filled in with pointers to appropriate functions.
5542 // <source>: the source
5543 // <closure>: a #GClosure
5544 static void source_set_closure()(GLib2.Source* source, Closure* closure) {
5545 g_source_set_closure(source, closure);
5549 // Sets a dummy callback for @source. The callback will do nothing, and
5550 // if the source expects a #gboolean return value, it will return %TRUE.
5551 // (If the source expects any other type of return value, it will return
5552 // a 0/%NULL value; whatever g_value_init() initializes a #GValue to for
5553 // that type.)
5555 // If the source is not one of the standard GLib types, the
5556 // @closure_callback and @closure_marshal fields of the #GSourceFuncs
5557 // structure must have been filled in with pointers to appropriate
5558 // functions.
5559 // <source>: the source
5560 static void source_set_dummy_callback()(GLib2.Source* source) {
5561 g_source_set_dummy_callback(source);
5565 // Return a newly allocated string, which describes the contents of a
5566 // #GValue. The main purpose of this function is to describe #GValue
5567 // contents for debugging output, the way in which the contents are
5568 // described may change between different GLib versions.
5569 // RETURNS: Newly allocated string.
5570 // <value>: #GValue which contents are to be described.
5571 static char* /*new*/ strdup_value_contents()(Value* value) {
5572 return g_strdup_value_contents(value);
5576 // Unintrospectable function: type_add_class_cache_func() / g_type_add_class_cache_func()
5577 // Adds a #GTypeClassCacheFunc to be called before the reference count of a
5578 // class goes from one to zero. This can be used to prevent premature class
5579 // destruction. All installed #GTypeClassCacheFunc functions will be chained
5580 // until one of them returns %TRUE. The functions have to check the class id
5581 // passed in to figure whether they actually want to cache the class of this
5582 // type, since all classes are routed through the same #GTypeClassCacheFunc
5583 // chain.
5584 // <cache_data>: data to be passed to @cache_func
5585 // <cache_func>: a #GTypeClassCacheFunc
5586 static void type_add_class_cache_func()(void* cache_data, TypeClassCacheFunc cache_func) {
5587 g_type_add_class_cache_func(cache_data, cache_func);
5591 // VERSION: 2.24
5592 // Registers a private class structure for a classed type;
5593 // when the class is allocated, the private structures for
5594 // the class and all of its parent types are allocated
5595 // sequentially in the same memory block as the public
5596 // structures. This function should be called in the
5597 // type's get_type() function after the type is registered.
5598 // The private structure can be retrieved using the
5599 // G_TYPE_CLASS_GET_PRIVATE() macro.
5600 // <class_type>: GType of an classed type.
5601 // <private_size>: size of private structure.
5602 static void type_add_class_private()(Type class_type, size_t private_size) {
5603 g_type_add_class_private(class_type, private_size);
5607 // Unintrospectable function: type_add_interface_check() / g_type_add_interface_check()
5608 // VERSION: 2.4
5609 // Adds a function to be called after an interface vtable is
5610 // initialized for any class (i.e. after the @interface_init member of
5611 // #GInterfaceInfo has been called).
5613 // This function is useful when you want to check an invariant that
5614 // depends on the interfaces of a class. For instance, the
5615 // implementation of #GObject uses this facility to check that an
5616 // object implements all of the properties that are defined on its
5617 // interfaces.
5618 // <check_data>: data to pass to @check_func
5619 // <check_func>: function to be called after each interface is initialized.
5620 static void type_add_interface_check()(void* check_data, TypeInterfaceCheckFunc check_func) {
5621 g_type_add_interface_check(check_data, check_func);
5625 // Adds the dynamic @interface_type to @instantiable_type. The information
5626 // contained in the #GTypePlugin structure pointed to by @plugin
5627 // is used to manage the relationship.
5628 // <instance_type>: the #GType value of an instantiable type.
5629 // <interface_type>: the #GType value of an interface type.
5630 // <plugin>: the #GTypePlugin structure to retrieve the #GInterfaceInfo from.
5631 static void type_add_interface_dynamic()(Type instance_type, Type interface_type, TypePlugin* plugin) {
5632 g_type_add_interface_dynamic(instance_type, interface_type, plugin);
5636 // Adds the static @interface_type to @instantiable_type. The information
5637 // contained in the #GTypeInterfaceInfo structure pointed to by @info
5638 // is used to manage the relationship.
5639 // <instance_type>: #GType value of an instantiable type.
5640 // <interface_type>: #GType value of an interface type.
5641 // <info>: The #GInterfaceInfo structure for this (@instance_type, @interface_type) combination.
5642 static void type_add_interface_static()(Type instance_type, Type interface_type, InterfaceInfo* info) {
5643 g_type_add_interface_static(instance_type, interface_type, info);
5646 // Unintrospectable function: type_check_class_cast() / g_type_check_class_cast()
5647 static TypeClass* type_check_class_cast()(TypeClass* g_class, Type is_a_type) {
5648 return g_type_check_class_cast(g_class, is_a_type);
5651 static int type_check_class_is_a()(TypeClass* g_class, Type is_a_type) {
5652 return g_type_check_class_is_a(g_class, is_a_type);
5656 // Private helper function to aid implementation of the G_TYPE_CHECK_INSTANCE()
5657 // macro.
5658 // <instance>: A valid #GTypeInstance structure.
5659 static int type_check_instance()(TypeInstance* instance) {
5660 return g_type_check_instance(instance);
5663 // Unintrospectable function: type_check_instance_cast() / g_type_check_instance_cast()
5664 static TypeInstance* type_check_instance_cast()(TypeInstance* instance, Type iface_type) {
5665 return g_type_check_instance_cast(instance, iface_type);
5668 static int type_check_instance_is_a()(TypeInstance* instance, Type iface_type) {
5669 return g_type_check_instance_is_a(instance, iface_type);
5672 static int type_check_is_value_type()(Type type) {
5673 return g_type_check_is_value_type(type);
5676 static int type_check_value()(Value* value) {
5677 return g_type_check_value(value);
5680 static int type_check_value_holds()(Value* value, Type type) {
5681 return g_type_check_value_holds(value, type);
5685 // Return a newly allocated and 0-terminated array of type IDs, listing the
5686 // child types of @type. The return value has to be g_free()ed after use.
5688 // and 0-terminated array of child types.
5689 // RETURNS: Newly allocated
5690 // <type>: The parent type.
5691 // <n_children>: Optional #guint pointer to contain the number of child types.
5692 static Type* /*new*/ type_children()(Type type, /*out*/ uint* n_children=null) {
5693 return g_type_children(type, n_children);
5697 // VERSION: 2.4
5698 // MOVED TO: TypeClass.add_private
5699 // Registers a private structure for an instantiatable type.
5701 // When an object is allocated, the private structures for
5702 // the type and all of its parent types are allocated
5703 // sequentially in the same memory block as the public
5704 // structures.
5706 // Note that the accumulated size of the private structures of
5707 // a type and all its parent types cannot excced 64kB.
5709 // This function should be called in the type's class_init() function.
5710 // The private structure can be retrieved using the
5711 // G_TYPE_INSTANCE_GET_PRIVATE() macro.
5713 // The following example shows attaching a private structure
5714 // <structname>MyObjectPrivate</structname> to an object
5715 // <structname>MyObject</structname> defined in the standard GObject
5716 // fashion.
5717 // type's class_init() function.
5719 // |[
5720 // typedef struct _MyObject MyObject;
5721 // typedef struct _MyObjectPrivate MyObjectPrivate;
5723 // struct _MyObject {
5724 // GObject parent;
5726 // MyObjectPrivate *priv;
5727 // };
5729 // struct _MyObjectPrivate {
5730 // int some_field;
5731 // };
5733 // static void
5734 // my_object_class_init (MyObjectClass *klass)
5735 // {
5736 // g_type_class_add_private (klass, sizeof (MyObjectPrivate));
5737 // }
5739 // static void
5740 // my_object_init (MyObject *my_object)
5741 // {
5742 // my_object->priv = G_TYPE_INSTANCE_GET_PRIVATE (my_object,
5743 // MY_TYPE_OBJECT,
5744 // MyObjectPrivate);
5745 // }
5747 // static int
5748 // my_object_get_some_field (MyObject *my_object)
5749 // {
5750 // MyObjectPrivate *priv = my_object->priv;
5752 // return priv->some_field;
5753 // }
5754 // ]|
5755 // <g_class>: class structure for an instantiatable type
5756 // <private_size>: size of private structure.
5757 static void type_class_add_private()(void* g_class, size_t private_size) {
5758 g_type_class_add_private(g_class, private_size);
5762 // MOVED TO: TypeClass.peek
5763 // This function is essentially the same as g_type_class_ref(), except that
5764 // the classes reference count isn't incremented. As a consequence, this function
5765 // may return %NULL if the class of the type passed in does not currently
5766 // exist (hasn't been referenced before).
5768 // structure for the given type ID or %NULL if the class does not
5769 // currently exist.
5770 // RETURNS: The #GTypeClass
5771 // <type>: Type ID of a classed type.
5772 static TypeClass* type_class_peek()(Type type) {
5773 return g_type_class_peek(type);
5777 // VERSION: 2.4
5778 // MOVED TO: TypeClass.peek_static
5779 // A more efficient version of g_type_class_peek() which works only for
5780 // static types.
5782 // structure for the given type ID or %NULL if the class does not
5783 // currently exist or is dynamically loaded.
5784 // RETURNS: The #GTypeClass
5785 // <type>: Type ID of a classed type.
5786 static TypeClass* type_class_peek_static()(Type type) {
5787 return g_type_class_peek_static(type);
5791 // MOVED TO: TypeClass.ref
5792 // Increments the reference count of the class structure belonging to
5793 // @type. This function will demand-create the class if it doesn't
5794 // exist already.
5796 // structure for the given type ID.
5797 // RETURNS: The #GTypeClass
5798 // <type>: Type ID of a classed type.
5799 static TypeClass* type_class_ref()(Type type) {
5800 return g_type_class_ref(type);
5804 // Unintrospectable function: type_create_instance() / g_type_create_instance()
5805 // Creates and initializes an instance of @type if @type is valid and
5806 // can be instantiated. The type system only performs basic allocation
5807 // and structure setups for instances: actual instance creation should
5808 // happen through functions supplied by the type's fundamental type
5809 // implementation. So use of g_type_create_instance() is reserved for
5810 // implementators of fundamental types only. E.g. instances of the
5811 // #GObject hierarchy should be created via g_object_new() and
5812 // <emphasis>never</emphasis> directly through
5813 // g_type_create_instance() which doesn't handle things like singleton
5814 // objects or object construction. Note: Do <emphasis>not</emphasis>
5815 // use this function, unless you're implementing a fundamental
5816 // type. Also language bindings should <emphasis>not</emphasis> use
5817 // this function but g_object_new() instead.
5819 // treatment by the fundamental type implementation.
5820 // RETURNS: An allocated and initialized instance, subject to further
5821 // <type>: An instantiatable type to create an instance for.
5822 static TypeInstance* type_create_instance()(Type type) {
5823 return g_type_create_instance(type);
5827 // VERSION: 2.4
5828 // If the interface type @g_type is currently in use, returns its
5829 // default interface vtable.
5832 // vtable for the interface, or %NULL if the type is not currently in
5833 // use.
5834 // RETURNS: the default
5835 // <g_type>: an interface type
5836 static TypeInterface* type_default_interface_peek()(Type g_type) {
5837 return g_type_default_interface_peek(g_type);
5841 // VERSION: 2.4
5842 // Increments the reference count for the interface type @g_type,
5843 // and returns the default interface vtable for the type.
5845 // If the type is not currently in use, then the default vtable
5846 // for the type will be created and initalized by calling
5847 // the base interface init and default vtable init functions for
5848 // the type (the @<structfield>base_init</structfield>
5849 // and <structfield>class_init</structfield> members of #GTypeInfo).
5850 // Calling g_type_default_interface_ref() is useful when you
5851 // want to make sure that signals and properties for an interface
5852 // have been installed.
5855 // vtable for the interface; call g_type_default_interface_unref()
5856 // when you are done using the interface.
5857 // RETURNS: the default
5858 // <g_type>: an interface type
5859 static TypeInterface* type_default_interface_ref()(Type g_type) {
5860 return g_type_default_interface_ref(g_type);
5864 // VERSION: 2.4
5865 // Decrements the reference count for the type corresponding to the
5866 // interface default vtable @g_iface. If the type is dynamic, then
5867 // when no one is using the interface and all references have
5868 // been released, the finalize function for the interface's default
5869 // vtable (the <structfield>class_finalize</structfield> member of
5870 // #GTypeInfo) will be called.
5871 // <g_iface>: the default vtable structure for a interface, as returned by g_type_default_interface_ref()
5872 static void type_default_interface_unref()(TypeInterface* g_iface) {
5873 g_type_default_interface_unref(g_iface);
5877 // Returns the length of the ancestry of the passed in type. This
5878 // includes the type itself, so that e.g. a fundamental type has depth 1.
5879 // RETURNS: The depth of @type.
5880 // <type>: A #GType value.
5881 static uint type_depth()(Type type) {
5882 return g_type_depth(type);
5886 // Frees an instance of a type, returning it to the instance pool for
5887 // the type, if there is one.
5889 // Like g_type_create_instance(), this function is reserved for
5890 // implementors of fundamental types.
5891 // <instance>: an instance of a type.
5892 static void type_free_instance()(TypeInstance* instance) {
5893 g_type_free_instance(instance);
5897 // Lookup the type ID from a given type name, returning 0 if no type
5898 // has been registered under this name (this is the preferred method
5899 // to find out by name whether a specific type has been registered
5900 // yet).
5901 // RETURNS: Corresponding type ID or 0.
5902 // <name>: Type name to lookup.
5903 static Type type_from_name()(char* name) {
5904 return g_type_from_name(name);
5908 // Internal function, used to extract the fundamental type ID portion.
5909 // use G_TYPE_FUNDAMENTAL() instead.
5910 // RETURNS: fundamental type ID
5911 // <type_id>: valid type ID
5912 static Type type_fundamental()(Type type_id) {
5913 return g_type_fundamental(type_id);
5917 // Returns the next free fundamental type id which can be used to
5918 // register a new fundamental type with g_type_register_fundamental().
5919 // The returned type ID represents the highest currently registered
5920 // fundamental type identifier.
5922 // or 0 if the type system ran out of fundamental type IDs.
5923 // RETURNS: The nextmost fundamental type ID to be registered,
5924 static Type type_fundamental_next()() {
5925 return g_type_fundamental_next();
5929 // Returns the #GTypePlugin structure for @type or
5930 // %NULL if @type does not have a #GTypePlugin structure.
5932 // dynamic type, %NULL otherwise.
5933 // RETURNS: The corresponding plugin if @type is a
5934 // <type>: The #GType to retrieve the plugin for.
5935 static TypePlugin* type_get_plugin()(Type type) {
5936 return g_type_get_plugin(type);
5940 // Obtains data which has previously been attached to @type
5941 // with g_type_set_qdata().
5943 // Note that this does not take subtyping into account; data
5944 // attached to one type with g_type_set_qdata() cannot
5945 // be retrieved from a subtype using g_type_get_qdata().
5946 // RETURNS: the data, or %NULL if no data was found
5947 // <type>: a #GType
5948 // <quark>: a #GQuark id to identify the data
5949 static void* type_get_qdata()(Type type, GLib2.Quark quark) {
5950 return g_type_get_qdata(type, quark);
5954 // Prior to any use of the type system, g_type_init() has to be called
5955 // to initialize the type system and assorted other code portions
5956 // (such as the various fundamental type implementations or the signal
5957 // system).
5959 // Since version 2.24 this also initializes the thread system
5960 static void type_init()() {
5961 g_type_init();
5965 // Similar to g_type_init(), but additionally sets debug flags.
5966 // <debug_flags>: Bitwise combination of #GTypeDebugFlags values for debugging purposes.
5967 static void type_init_with_debug_flags()(TypeDebugFlags debug_flags) {
5968 g_type_init_with_debug_flags(debug_flags);
5972 // MOVED TO: TypeInterface.add_prerequisite
5973 // Adds @prerequisite_type to the list of prerequisites of @interface_type.
5974 // This means that any type implementing @interface_type must also implement
5975 // @prerequisite_type. Prerequisites can be thought of as an alternative to
5976 // interface derivation (which GType doesn't support). An interface can have
5977 // at most one instantiatable prerequisite type.
5978 // <interface_type>: #GType value of an interface type.
5979 // <prerequisite_type>: #GType value of an interface or instantiatable type.
5980 static void type_interface_add_prerequisite()(Type interface_type, Type prerequisite_type) {
5981 g_type_interface_add_prerequisite(interface_type, prerequisite_type);
5985 // MOVED TO: TypeInterface.get_plugin
5986 // Returns the #GTypePlugin structure for the dynamic interface
5987 // @interface_type which has been added to @instance_type, or %NULL if
5988 // @interface_type has not been added to @instance_type or does not
5989 // have a #GTypePlugin structure. See g_type_add_interface_dynamic().
5991 // interface @interface_type of @instance_type.
5992 // RETURNS: the #GTypePlugin for the dynamic
5993 // <instance_type>: the #GType value of an instantiatable type.
5994 // <interface_type>: the #GType value of an interface type.
5995 static TypePlugin* type_interface_get_plugin()(Type instance_type, Type interface_type) {
5996 return g_type_interface_get_plugin(instance_type, interface_type);
6000 // MOVED TO: TypeInterface.peek
6001 // Returns the #GTypeInterface structure of an interface to which the
6002 // passed in class conforms.
6004 // structure of iface_type if implemented by @instance_class, %NULL
6005 // otherwise
6006 // RETURNS: The GTypeInterface
6007 // <instance_class>: A #GTypeClass structure.
6008 // <iface_type>: An interface ID which this class conforms to.
6009 static TypeInterface* type_interface_peek()(TypeClass* instance_class, Type iface_type) {
6010 return g_type_interface_peek(instance_class, iface_type);
6014 // VERSION: 2.2
6015 // MOVED TO: TypeInterface.prerequisites
6016 // Returns the prerequisites of an interfaces type.
6019 // newly-allocated zero-terminated array of #GType containing
6020 // the prerequisites of @interface_type
6021 // RETURNS: a
6022 // <interface_type>: an interface type
6023 // <n_prerequisites>: location to return the number of prerequisites, or %NULL
6024 static Type* /*new*/ type_interface_prerequisites()(Type interface_type, /*out*/ uint* n_prerequisites=null) {
6025 return g_type_interface_prerequisites(interface_type, n_prerequisites);
6029 // Return a newly allocated and 0-terminated array of type IDs, listing the
6030 // interface types that @type conforms to. The return value has to be
6031 // g_free()ed after use.
6033 // allocated and 0-terminated array of interface types.
6034 // RETURNS: Newly
6035 // <type>: The type to list interface types for.
6036 // <n_interfaces>: Optional #guint pointer to contain the number of interface types.
6037 static Type* /*new*/ type_interfaces()(Type type, /*out*/ uint* n_interfaces=null) {
6038 return g_type_interfaces(type, n_interfaces);
6042 // If @is_a_type is a derivable type, check whether @type is a
6043 // descendant of @is_a_type. If @is_a_type is an interface, check
6044 // whether @type conforms to it.
6045 // RETURNS: %TRUE if @type is_a @is_a_type holds true.
6046 // <type>: Type to check anchestry for.
6047 // <is_a_type>: Possible anchestor of @type or interface @type could conform to.
6048 static int type_is_a()(Type type, Type is_a_type) {
6049 return g_type_is_a(type, is_a_type);
6053 // Get the unique name that is assigned to a type ID. Note that this
6054 // function (like all other GType API) cannot cope with invalid type
6055 // IDs. %G_TYPE_INVALID may be passed to this function, as may be any
6056 // other validly registered type ID, but randomized type IDs should
6057 // not be passed in and will most likely lead to a crash.
6058 // RETURNS: Static type name or %NULL.
6059 // <type>: Type to return name for.
6060 static char* type_name()(Type type) {
6061 return g_type_name(type);
6064 static char* type_name_from_class()(TypeClass* g_class) {
6065 return g_type_name_from_class(g_class);
6068 static char* type_name_from_instance()(TypeInstance* instance) {
6069 return g_type_name_from_instance(instance);
6073 // Given a @leaf_type and a @root_type which is contained in its
6074 // anchestry, return the type that @root_type is the immediate parent
6075 // of. In other words, this function determines the type that is
6076 // derived directly from @root_type which is also a base class of
6077 // @leaf_type. Given a root type and a leaf type, this function can
6078 // be used to determine the types and order in which the leaf type is
6079 // descended from the root type.
6080 // RETURNS: Immediate child of @root_type and anchestor of @leaf_type.
6081 // <leaf_type>: Descendant of @root_type and the type to be returned.
6082 // <root_type>: Immediate parent of the returned type.
6083 static Type type_next_base()(Type leaf_type, Type root_type) {
6084 return g_type_next_base(leaf_type, root_type);
6088 // Return the direct parent type of the passed in type. If the passed
6089 // in type has no parent, i.e. is a fundamental type, 0 is returned.
6090 // RETURNS: The parent type.
6091 // <type>: The derived type.
6092 static Type type_parent()(Type type) {
6093 return g_type_parent(type);
6097 // Get the corresponding quark of the type IDs name.
6098 // RETURNS: The type names quark or 0.
6099 // <type>: Type to return quark of type name for.
6100 static GLib2.Quark type_qname()(Type type) {
6101 return g_type_qname(type);
6105 // Queries the type system for information about a specific type.
6106 // This function will fill in a user-provided structure to hold
6107 // type-specific information. If an invalid #GType is passed in, the
6108 // @type member of the #GTypeQuery is 0. All members filled into the
6109 // #GTypeQuery structure should be considered constant and have to be
6110 // left untouched.
6111 // <type>: the #GType value of a static, classed type.
6112 // <query>: A user provided structure that is filled in with constant values upon success.
6113 static void type_query()(Type type, /*out*/ TypeQuery* query) {
6114 g_type_query(type, query);
6118 // Registers @type_name as the name of a new dynamic type derived from
6119 // @parent_type. The type system uses the information contained in the
6120 // #GTypePlugin structure pointed to by @plugin to manage the type and its
6121 // instances (if not abstract). The value of @flags determines the nature
6122 // (e.g. abstract or not) of the type.
6123 // RETURNS: The new type identifier or #G_TYPE_INVALID if registration failed.
6124 // <parent_type>: Type from which this type will be derived.
6125 // <type_name>: 0-terminated string used as the name of the new type.
6126 // <plugin>: The #GTypePlugin structure to retrieve the #GTypeInfo from.
6127 // <flags>: Bitwise combination of #GTypeFlags values.
6128 static Type type_register_dynamic()(Type parent_type, char* type_name, TypePlugin* plugin, TypeFlags flags) {
6129 return g_type_register_dynamic(parent_type, type_name, plugin, flags);
6133 // Registers @type_id as the predefined identifier and @type_name as the
6134 // name of a fundamental type. The type system uses the information
6135 // contained in the #GTypeInfo structure pointed to by @info and the
6136 // #GTypeFundamentalInfo structure pointed to by @finfo to manage the
6137 // type and its instances. The value of @flags determines additional
6138 // characteristics of the fundamental type.
6139 // RETURNS: The predefined type identifier.
6140 // <type_id>: A predefined type identifier.
6141 // <type_name>: 0-terminated string used as the name of the new type.
6142 // <info>: The #GTypeInfo structure for this type.
6143 // <finfo>: The #GTypeFundamentalInfo structure for this type.
6144 // <flags>: Bitwise combination of #GTypeFlags values.
6145 static Type type_register_fundamental()(Type type_id, char* type_name, GTypeInfo* info, TypeFundamentalInfo* finfo, TypeFlags flags) {
6146 return g_type_register_fundamental(type_id, type_name, info, finfo, flags);
6150 // Registers @type_name as the name of a new static type derived from
6151 // @parent_type. The type system uses the information contained in the
6152 // #GTypeInfo structure pointed to by @info to manage the type and its
6153 // instances (if not abstract). The value of @flags determines the nature
6154 // (e.g. abstract or not) of the type.
6155 // RETURNS: The new type identifier.
6156 // <parent_type>: Type from which this type will be derived.
6157 // <type_name>: 0-terminated string used as the name of the new type.
6158 // <info>: The #GTypeInfo structure for this type.
6159 // <flags>: Bitwise combination of #GTypeFlags values.
6160 static Type type_register_static()(Type parent_type, char* type_name, GTypeInfo* info, TypeFlags flags) {
6161 return g_type_register_static(parent_type, type_name, info, flags);
6165 // Unintrospectable function: type_register_static_simple() / g_type_register_static_simple()
6166 // VERSION: 2.12
6167 // Registers @type_name as the name of a new static type derived from
6168 // @parent_type. The value of @flags determines the nature (e.g.
6169 // abstract or not) of the type. It works by filling a #GTypeInfo
6170 // struct and calling g_type_register_static().
6171 // RETURNS: The new type identifier.
6172 // <parent_type>: Type from which this type will be derived.
6173 // <type_name>: 0-terminated string used as the name of the new type.
6174 // <class_size>: Size of the class structure (see #GTypeInfo)
6175 // <class_init>: Location of the class initialization function (see #GTypeInfo)
6176 // <instance_size>: Size of the instance structure (see #GTypeInfo)
6177 // <instance_init>: Location of the instance initialization function (see #GTypeInfo)
6178 // <flags>: Bitwise combination of #GTypeFlags values.
6179 static Type type_register_static_simple()(Type parent_type, char* type_name, uint class_size, ClassInitFunc class_init, uint instance_size, InstanceInitFunc instance_init, TypeFlags flags) {
6180 return g_type_register_static_simple(parent_type, type_name, class_size, class_init, instance_size, instance_init, flags);
6184 // Unintrospectable function: type_remove_class_cache_func() / g_type_remove_class_cache_func()
6185 // Removes a previously installed #GTypeClassCacheFunc. The cache
6186 // maintained by @cache_func has to be empty when calling
6187 // g_type_remove_class_cache_func() to avoid leaks.
6188 // <cache_data>: data that was given when adding @cache_func
6189 // <cache_func>: a #GTypeClassCacheFunc
6190 static void type_remove_class_cache_func()(void* cache_data, TypeClassCacheFunc cache_func) {
6191 g_type_remove_class_cache_func(cache_data, cache_func);
6195 // Unintrospectable function: type_remove_interface_check() / g_type_remove_interface_check()
6196 // VERSION: 2.4
6197 // Removes an interface check function added with
6198 // g_type_add_interface_check().
6199 // <check_data>: callback data passed to g_type_add_interface_check()
6200 // <check_func>: callback function passed to g_type_add_interface_check()
6201 static void type_remove_interface_check()(void* check_data, TypeInterfaceCheckFunc check_func) {
6202 g_type_remove_interface_check(check_data, check_func);
6206 // Attaches arbitrary data to a type.
6207 // <type>: a #GType
6208 // <quark>: a #GQuark id to identify the data
6209 // <data>: the data
6210 static void type_set_qdata()(Type type, GLib2.Quark quark, void* data) {
6211 g_type_set_qdata(type, quark, data);
6214 static int type_test_flags()(Type type, uint flags) {
6215 return g_type_test_flags(type, flags);
6219 // Unintrospectable function: type_value_table_peek() / g_type_value_table_peek()
6220 // MOVED TO: TypeValueTable.peek
6221 // Returns the location of the #GTypeValueTable associated with @type.
6222 // <emphasis>Note that this function should only be used from source code
6223 // that implements or has internal knowledge of the implementation of
6224 // @type.</emphasis>
6226 // %NULL if there is no #GTypeValueTable associated with @type.
6227 // RETURNS: Location of the #GTypeValueTable associated with @type or
6228 // <type>: A #GType value.
6229 static TypeValueTable* type_value_table_peek()(Type type) {
6230 return g_type_value_table_peek(type);
6234 // VERSION: 2.12
6235 // Get the contents of a %G_TYPE_GTYPE #GValue.
6236 // RETURNS: the #GType stored in @value
6237 // <value>: a valid #GValue of type %G_TYPE_GTYPE
6238 static Type value_get_gtype()(Value* value) {
6239 return g_value_get_gtype(value);
6243 // Unintrospectable function: value_register_transform_func() / g_value_register_transform_func()
6244 // MOVED TO: Value.register_transform_func
6245 // Registers a value transformation function for use in g_value_transform().
6246 // A previously registered transformation function for @src_type and @dest_type
6247 // will be replaced.
6248 // <src_type>: Source type.
6249 // <dest_type>: Target type.
6250 // <transform_func>: a function which transforms values of type @src_type into value of type @dest_type
6251 static void value_register_transform_func()(Type src_type, Type dest_type, ValueTransform transform_func) {
6252 g_value_register_transform_func(src_type, dest_type, transform_func);
6256 // MOVED TO: Value.type_compatible
6257 // Returns whether a #GValue of type @src_type can be copied into
6258 // a #GValue of type @dest_type.
6259 // RETURNS: %TRUE if g_value_copy() is possible with @src_type and @dest_type.
6260 // <src_type>: source type to be copied.
6261 // <dest_type>: destination type for copying.
6262 static int value_type_compatible()(Type src_type, Type dest_type) {
6263 return g_value_type_compatible(src_type, dest_type);
6267 // MOVED TO: Value.type_transformable
6268 // Check whether g_value_transform() is able to transform values
6269 // of type @src_type into values of type @dest_type.
6270 // RETURNS: %TRUE if the transformation is possible, %FALSE otherwise.
6271 // <src_type>: Source type.
6272 // <dest_type>: Target type.
6273 static int value_type_transformable()(Type src_type, Type dest_type) {
6274 return g_value_type_transformable(src_type, dest_type);
6278 // C prototypes:
6280 extern (C) {
6281 BindingFlags g_binding_get_flags(Binding* this_);
6282 Object* g_binding_get_source(Binding* this_);
6283 char* g_binding_get_source_property(Binding* this_);
6284 Object* g_binding_get_target(Binding* this_);
6285 char* g_binding_get_target_property(Binding* this_);
6286 void g_cclosure_marshal_BOOLEAN__BOXED_BOXED(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6287 void g_cclosure_marshal_BOOLEAN__FLAGS(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6288 void g_cclosure_marshal_STRING__OBJECT_POINTER(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6289 void g_cclosure_marshal_VOID__BOOLEAN(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6290 void g_cclosure_marshal_VOID__BOXED(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6291 void g_cclosure_marshal_VOID__CHAR(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6292 void g_cclosure_marshal_VOID__DOUBLE(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6293 void g_cclosure_marshal_VOID__ENUM(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6294 void g_cclosure_marshal_VOID__FLAGS(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6295 void g_cclosure_marshal_VOID__FLOAT(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6296 void g_cclosure_marshal_VOID__INT(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6297 void g_cclosure_marshal_VOID__LONG(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6298 void g_cclosure_marshal_VOID__OBJECT(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6299 void g_cclosure_marshal_VOID__PARAM(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6300 void g_cclosure_marshal_VOID__POINTER(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6301 void g_cclosure_marshal_VOID__STRING(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6302 void g_cclosure_marshal_VOID__UCHAR(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6303 void g_cclosure_marshal_VOID__UINT(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6304 void g_cclosure_marshal_VOID__UINT_POINTER(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6305 void g_cclosure_marshal_VOID__ULONG(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6306 void g_cclosure_marshal_VOID__VARIANT(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6307 void g_cclosure_marshal_VOID__VOID(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6308 void g_cclosure_marshal_generic(Closure* closure, Value* return_gvalue, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data);
6309 Closure* /*new*/ g_cclosure_new(Callback callback_func, void* user_data, ClosureNotify destroy_data);
6310 Closure* /*new*/ g_cclosure_new_object(Callback callback_func, Object* object);
6311 Closure* /*new*/ g_cclosure_new_object_swap(Callback callback_func, Object* object);
6312 Closure* /*new*/ g_cclosure_new_swap(Callback callback_func, void* user_data, ClosureNotify destroy_data);
6313 Closure* /*new*/ g_closure_new_object(uint sizeof_closure, Object* object);
6314 Closure* /*new*/ g_closure_new_simple(uint sizeof_closure, void* data);
6315 void g_closure_add_finalize_notifier(Closure* this_, void* notify_data, ClosureNotify notify_func);
6316 void g_closure_add_invalidate_notifier(Closure* this_, void* notify_data, ClosureNotify notify_func);
6317 void g_closure_add_marshal_guards(Closure* this_, void* pre_marshal_data, ClosureNotify pre_marshal_notify, void* post_marshal_data, ClosureNotify post_marshal_notify);
6318 void g_closure_invalidate(Closure* this_);
6319 void g_closure_invoke(Closure* this_, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint=null);
6320 Closure* g_closure_ref(Closure* this_);
6321 void g_closure_remove_finalize_notifier(Closure* this_, void* notify_data, ClosureNotify notify_func);
6322 void g_closure_remove_invalidate_notifier(Closure* this_, void* notify_data, ClosureNotify notify_func);
6323 void g_closure_set_marshal(Closure* this_, ClosureMarshal marshal);
6324 void g_closure_set_meta_marshal(Closure* this_, void* marshal_data, ClosureMarshal meta_marshal);
6325 void g_closure_sink(Closure* this_);
6326 void g_closure_unref(Closure* this_);
6327 Object* /*new*/ g_object_new_valist(Type object_type, char* first_property_name, va_list var_args);
6328 Object* /*new*/ g_object_newv(Type object_type, uint n_parameters, Parameter* parameters);
6329 Binding* g_object_bind_property(void* source, char* source_property, void* target, char* target_property, BindingFlags flags);
6330 Binding* g_object_bind_property_full(void* source, char* source_property, void* target, char* target_property, BindingFlags flags, BindingTransformFunc transform_to, BindingTransformFunc transform_from, void* user_data, GLib2.DestroyNotify notify);
6331 Binding* g_object_bind_property_with_closures(void* source, char* source_property, void* target, char* target_property, BindingFlags flags, Closure* transform_to, Closure* transform_from);
6332 size_t g_object_compat_control(size_t what, void* data);
6333 void* g_object_connect(void* object, char* signal_spec, ...);
6334 void g_object_disconnect(void* object, char* signal_spec, ...);
6335 void g_object_get(void* object, char* first_property_name, ...);
6336 ParamSpec* g_object_interface_find_property(void* g_iface, char* property_name);
6337 void g_object_interface_install_property(void* g_iface, ParamSpec* pspec);
6338 ParamSpec** /*new container*/ g_object_interface_list_properties(void* g_iface, /*out*/ uint* n_properties_p);
6339 void* /*new*/ g_object_new(Type object_type, char* first_property_name, ...);
6340 void g_object_set(void* object, char* first_property_name, ...);
6341 void g_object_add_toggle_ref(Object* this_, ToggleNotify notify, void* data);
6342 void g_object_add_weak_pointer(Object* this_, /*inout*/ void** weak_pointer_location);
6343 void g_object_force_floating(Object* this_);
6344 void g_object_freeze_notify(Object* this_);
6345 void* g_object_get_data(Object* this_, char* key);
6346 void g_object_get_property(Object* this_, char* property_name, Value* value);
6347 void* g_object_get_qdata(Object* this_, GLib2.Quark quark);
6348 void g_object_get_valist(Object* this_, char* first_property_name, va_list var_args);
6349 int g_object_is_floating(Object* this_);
6350 void g_object_notify(Object* this_, char* property_name);
6351 void g_object_notify_by_pspec(Object* this_, ParamSpec* pspec);
6352 Object* g_object_ref(Object* this_);
6353 Object* g_object_ref_sink(Object* this_);
6354 void g_object_remove_toggle_ref(Object* this_, ToggleNotify notify, void* data);
6355 void g_object_remove_weak_pointer(Object* this_, /*inout*/ void** weak_pointer_location);
6356 void g_object_run_dispose(Object* this_);
6357 void g_object_set_data(Object* this_, char* key, void* data);
6358 void g_object_set_data_full(Object* this_, char* key, void* data, GLib2.DestroyNotify destroy);
6359 void g_object_set_property(Object* this_, char* property_name, Value* value);
6360 void g_object_set_qdata(Object* this_, GLib2.Quark quark, void* data);
6361 void g_object_set_qdata_full(Object* this_, GLib2.Quark quark, void* data, GLib2.DestroyNotify destroy);
6362 void g_object_set_valist(Object* this_, char* first_property_name, va_list var_args);
6363 void* /*new*/ g_object_steal_data(Object* this_, char* key);
6364 void* /*new*/ g_object_steal_qdata(Object* this_, GLib2.Quark quark);
6365 void g_object_thaw_notify(Object* this_);
6366 void g_object_unref(Object* this_);
6367 void g_object_watch_closure(Object* this_, Closure* closure);
6368 void g_object_weak_ref(Object* this_, WeakNotify notify, void* data);
6369 void g_object_weak_unref(Object* this_, WeakNotify notify, void* data);
6370 ParamSpec* g_object_class_find_property(ObjectClass* this_, char* property_name);
6371 void g_object_class_install_properties(ObjectClass* this_, uint n_pspecs, ParamSpec** pspecs);
6372 void g_object_class_install_property(ObjectClass* this_, uint property_id, ParamSpec* pspec);
6373 ParamSpec** /*new container*/ g_object_class_list_properties(ObjectClass* this_, /*out*/ uint* n_properties);
6374 void g_object_class_override_property(ObjectClass* this_, uint property_id, char* name);
6375 void* g_param_spec_internal(Type param_type, char* name, char* nick, char* blurb, ParamFlags flags);
6376 char* g_param_spec_get_blurb(ParamSpec* this_);
6377 char* g_param_spec_get_name(ParamSpec* this_);
6378 char* g_param_spec_get_nick(ParamSpec* this_);
6379 void* g_param_spec_get_qdata(ParamSpec* this_, GLib2.Quark quark);
6380 ParamSpec* g_param_spec_get_redirect_target(ParamSpec* this_);
6381 ParamSpec* g_param_spec_ref(ParamSpec* this_);
6382 ParamSpec* g_param_spec_ref_sink(ParamSpec* this_);
6383 void g_param_spec_set_qdata(ParamSpec* this_, GLib2.Quark quark, void* data);
6384 void g_param_spec_set_qdata_full(ParamSpec* this_, GLib2.Quark quark, void* data, GLib2.DestroyNotify destroy);
6385 void g_param_spec_sink(ParamSpec* this_);
6386 void* g_param_spec_steal_qdata(ParamSpec* this_, GLib2.Quark quark);
6387 void g_param_spec_unref(ParamSpec* this_);
6388 void g_param_spec_pool_insert(ParamSpecPool* this_, ParamSpec* pspec, Type owner_type);
6389 ParamSpec** /*new container*/ g_param_spec_pool_list(ParamSpecPool* this_, Type owner_type, /*out*/ uint* n_pspecs_p);
6390 GLib2.List* /*new container*/ g_param_spec_pool_list_owned(ParamSpecPool* this_, Type owner_type);
6391 ParamSpec* g_param_spec_pool_lookup(ParamSpecPool* this_, char* param_name, Type owner_type, int walk_ancestors);
6392 void g_param_spec_pool_remove(ParamSpecPool* this_, ParamSpec* pspec);
6393 ParamSpecPool* g_param_spec_pool_new(int type_prefixing);
6394 void* g_type_class_get_private(TypeClass* this_, Type private_type);
6395 TypeClass* g_type_class_peek_parent(TypeClass* this_);
6396 void g_type_class_unref(TypeClass* this_);
6397 void g_type_class_unref_uncached(TypeClass* this_);
6398 void g_type_class_add_private(void* g_class, size_t private_size);
6399 TypeClass* g_type_class_peek(Type type);
6400 TypeClass* g_type_class_peek_static(Type type);
6401 TypeClass* g_type_class_ref(Type type);
6402 void* g_type_instance_get_private(TypeInstance* this_, Type private_type);
6403 TypeInterface* g_type_interface_peek_parent(TypeInterface* this_);
6404 void g_type_interface_add_prerequisite(Type interface_type, Type prerequisite_type);
6405 TypePlugin* g_type_interface_get_plugin(Type instance_type, Type interface_type);
6406 TypeInterface* g_type_interface_peek(TypeClass* instance_class, Type iface_type);
6407 Type* /*new*/ g_type_interface_prerequisites(Type interface_type, /*out*/ uint* n_prerequisites=null);
6408 void g_type_module_add_interface(TypeModule* this_, Type instance_type, Type interface_type, InterfaceInfo* interface_info);
6409 Type g_type_module_register_enum(TypeModule* this_, char* name, EnumValue* const_static_values);
6410 Type g_type_module_register_flags(TypeModule* this_, char* name, FlagsValue* const_static_values);
6411 Type g_type_module_register_type(TypeModule* this_, Type parent_type, char* type_name, GTypeInfo* type_info, TypeFlags flags);
6412 void g_type_module_set_name(TypeModule* this_, char* name);
6413 void g_type_module_unuse(TypeModule* this_);
6414 int g_type_module_use(TypeModule* this_);
6415 void g_type_plugin_complete_interface_info(TypePlugin* this_, Type instance_type, Type interface_type, InterfaceInfo* info);
6416 void g_type_plugin_complete_type_info(TypePlugin* this_, Type g_type, GTypeInfo* info, TypeValueTable* value_table);
6417 void g_type_plugin_unuse(TypePlugin* this_);
6418 void g_type_plugin_use(TypePlugin* this_);
6419 TypeValueTable* g_type_value_table_peek(Type type);
6420 void g_value_copy(Value* this_, Value* dest_value);
6421 void* g_value_dup_boxed(Value* this_);
6422 Object* /*new*/ g_value_dup_object(Value* this_);
6423 ParamSpec* g_value_dup_param(Value* this_);
6424 char* /*new*/ g_value_dup_string(Value* this_);
6425 GLib2.Variant* /*new*/ g_value_dup_variant(Value* this_);
6426 int g_value_fits_pointer(Value* this_);
6427 int g_value_get_boolean(Value* this_);
6428 void* g_value_get_boxed(Value* this_);
6429 char g_value_get_char(Value* this_);
6430 double g_value_get_double(Value* this_);
6431 int g_value_get_enum(Value* this_);
6432 uint g_value_get_flags(Value* this_);
6433 float g_value_get_float(Value* this_);
6434 int g_value_get_int(Value* this_);
6435 long g_value_get_int64(Value* this_);
6436 c_long g_value_get_long(Value* this_);
6437 Object* g_value_get_object(Value* this_);
6438 ParamSpec* g_value_get_param(Value* this_);
6439 void* g_value_get_pointer(Value* this_);
6440 char* g_value_get_string(Value* this_);
6441 ubyte g_value_get_uchar(Value* this_);
6442 uint g_value_get_uint(Value* this_);
6443 ulong g_value_get_uint64(Value* this_);
6444 c_ulong g_value_get_ulong(Value* this_);
6445 GLib2.Variant* /*new*/ g_value_get_variant(Value* this_);
6446 Value* g_value_init(Value* this_, Type g_type);
6447 void* g_value_peek_pointer(Value* this_);
6448 Value* /*new*/ g_value_reset(Value* this_);
6449 void g_value_set_boolean(Value* this_, int v_boolean);
6450 void g_value_set_boxed(Value* this_, const(void)* v_boxed=null);
6451 void g_value_set_boxed_take_ownership(Value* this_, const(void)* v_boxed=null);
6452 void g_value_set_char(Value* this_, char v_char);
6453 void g_value_set_double(Value* this_, double v_double);
6454 void g_value_set_enum(Value* this_, int v_enum);
6455 void g_value_set_flags(Value* this_, uint v_flags);
6456 void g_value_set_float(Value* this_, float v_float);
6457 void g_value_set_gtype(Value* this_, Type v_gtype);
6458 void g_value_set_instance(Value* this_, void* instance=null);
6459 void g_value_set_int(Value* this_, int v_int);
6460 void g_value_set_int64(Value* this_, long v_int64);
6461 void g_value_set_long(Value* this_, c_long v_long);
6462 void g_value_set_object(Value* this_, Object* v_object=null);
6463 void g_value_set_object_take_ownership(Value* this_, void* v_object=null);
6464 void g_value_set_param(Value* this_, ParamSpec* param=null);
6465 void g_value_set_param_take_ownership(Value* this_, ParamSpec* param=null);
6466 void g_value_set_pointer(Value* this_, void* v_pointer);
6467 void g_value_set_static_boxed(Value* this_, const(void)* v_boxed=null);
6468 void g_value_set_static_string(Value* this_, char* v_string=null);
6469 void g_value_set_string(Value* this_, char* v_string=null);
6470 void g_value_set_string_take_ownership(Value* this_, char* v_string=null);
6471 void g_value_set_uchar(Value* this_, ubyte v_uchar);
6472 void g_value_set_uint(Value* this_, uint v_uint);
6473 void g_value_set_uint64(Value* this_, ulong v_uint64);
6474 void g_value_set_ulong(Value* this_, c_ulong v_ulong);
6475 void g_value_set_variant(Value* this_, GLib2.Variant* variant=null);
6476 void g_value_take_boxed(Value* this_, const(void)* v_boxed=null);
6477 void g_value_take_object(Value* this_, void* v_object=null);
6478 void g_value_take_param(Value* this_, ParamSpec* param=null);
6479 void g_value_take_string(Value* this_, char* v_string=null);
6480 void g_value_take_variant(Value* this_, GLib2.Variant* variant=null);
6481 int g_value_transform(Value* this_, Value* dest_value);
6482 void g_value_unset(Value* this_);
6483 void g_value_register_transform_func(Type src_type, Type dest_type, ValueTransform transform_func);
6484 int g_value_type_compatible(Type src_type, Type dest_type);
6485 int g_value_type_transformable(Type src_type, Type dest_type);
6486 ValueArray* /*new*/ g_value_array_new(uint n_prealloced);
6487 ValueArray* g_value_array_append(ValueArray* this_, Value* value=null);
6488 ValueArray* /*new*/ g_value_array_copy(ValueArray* this_);
6489 void g_value_array_free(ValueArray* this_);
6490 Value* g_value_array_get_nth(ValueArray* this_, uint index_);
6491 ValueArray* g_value_array_insert(ValueArray* this_, uint index_, Value* value=null);
6492 ValueArray* g_value_array_prepend(ValueArray* this_, Value* value=null);
6493 ValueArray* g_value_array_remove(ValueArray* this_, uint index_);
6494 ValueArray* g_value_array_sort(ValueArray* this_, GLib2.CompareFunc compare_func);
6495 ValueArray* g_value_array_sort_with_data(ValueArray* this_, GLib2.CompareDataFunc compare_func, void* user_data);
6496 void* g_boxed_copy(Type boxed_type, const(void)* src_boxed);
6497 void g_boxed_free(Type boxed_type, void* boxed);
6498 Type g_boxed_type_register_static(char* name, BoxedCopyFunc boxed_copy, BoxedFreeFunc boxed_free);
6499 void g_clear_object(Object** object_ptr);
6500 void g_enum_complete_type_info(Type g_enum_type, GTypeInfo* info, EnumValue* const_values);
6501 EnumValue* g_enum_get_value(EnumClass* enum_class, int value);
6502 EnumValue* g_enum_get_value_by_name(EnumClass* enum_class, char* name);
6503 EnumValue* g_enum_get_value_by_nick(EnumClass* enum_class, char* nick);
6504 Type g_enum_register_static(char* name, EnumValue* const_static_values);
6505 void g_flags_complete_type_info(Type g_flags_type, GTypeInfo* info, FlagsValue* const_values);
6506 FlagsValue* g_flags_get_first_value(FlagsClass* flags_class, uint value);
6507 FlagsValue* g_flags_get_value_by_name(FlagsClass* flags_class, char* name);
6508 FlagsValue* g_flags_get_value_by_nick(FlagsClass* flags_class, char* nick);
6509 Type g_flags_register_static(char* name, FlagsValue* const_static_values);
6510 Type g_gtype_get_type();
6511 ParamSpec* g_param_spec_boolean(char* name, char* nick, char* blurb, int default_value, ParamFlags flags);
6512 ParamSpec* g_param_spec_boxed(char* name, char* nick, char* blurb, Type boxed_type, ParamFlags flags);
6513 ParamSpec* g_param_spec_char(char* name, char* nick, char* blurb, byte minimum, byte maximum, byte default_value, ParamFlags flags);
6514 ParamSpec* g_param_spec_double(char* name, char* nick, char* blurb, double minimum, double maximum, double default_value, ParamFlags flags);
6515 ParamSpec* g_param_spec_enum(char* name, char* nick, char* blurb, Type enum_type, int default_value, ParamFlags flags);
6516 ParamSpec* g_param_spec_flags(char* name, char* nick, char* blurb, Type flags_type, uint default_value, ParamFlags flags);
6517 ParamSpec* g_param_spec_float(char* name, char* nick, char* blurb, float minimum, float maximum, float default_value, ParamFlags flags);
6518 ParamSpec* g_param_spec_gtype(char* name, char* nick, char* blurb, Type is_a_type, ParamFlags flags);
6519 ParamSpec* g_param_spec_int(char* name, char* nick, char* blurb, int minimum, int maximum, int default_value, ParamFlags flags);
6520 ParamSpec* g_param_spec_int64(char* name, char* nick, char* blurb, long minimum, long maximum, long default_value, ParamFlags flags);
6521 ParamSpec* g_param_spec_long(char* name, char* nick, char* blurb, c_long minimum, c_long maximum, c_long default_value, ParamFlags flags);
6522 ParamSpec* g_param_spec_object(char* name, char* nick, char* blurb, Type object_type, ParamFlags flags);
6523 ParamSpec* g_param_spec_override(char* name, ParamSpec* overridden);
6524 ParamSpec* g_param_spec_param(char* name, char* nick, char* blurb, Type param_type, ParamFlags flags);
6525 ParamSpec* g_param_spec_pointer(char* name, char* nick, char* blurb, ParamFlags flags);
6526 ParamSpec* g_param_spec_string(char* name, char* nick, char* blurb, char* default_value, ParamFlags flags);
6527 ParamSpec* g_param_spec_uchar(char* name, char* nick, char* blurb, ubyte minimum, ubyte maximum, ubyte default_value, ParamFlags flags);
6528 ParamSpec* g_param_spec_uint(char* name, char* nick, char* blurb, uint minimum, uint maximum, uint default_value, ParamFlags flags);
6529 ParamSpec* g_param_spec_uint64(char* name, char* nick, char* blurb, ulong minimum, ulong maximum, ulong default_value, ParamFlags flags);
6530 ParamSpec* g_param_spec_ulong(char* name, char* nick, char* blurb, c_ulong minimum, c_ulong maximum, c_ulong default_value, ParamFlags flags);
6531 ParamSpec* g_param_spec_unichar(char* name, char* nick, char* blurb, dchar default_value, ParamFlags flags);
6532 ParamSpec* g_param_spec_value_array(char* name, char* nick, char* blurb, ParamSpec* element_spec, ParamFlags flags);
6533 ParamSpec* g_param_spec_variant(char* name, char* nick, char* blurb, GLib2.VariantType* type, GLib2.Variant* default_value, ParamFlags flags);
6534 Type g_param_type_register_static(char* name, ParamSpecTypeInfo* pspec_info);
6535 int g_param_value_convert(ParamSpec* pspec, Value* src_value, Value* dest_value, int strict_validation);
6536 int g_param_value_defaults(ParamSpec* pspec, Value* value);
6537 void g_param_value_set_default(ParamSpec* pspec, Value* value);
6538 int g_param_value_validate(ParamSpec* pspec, Value* value);
6539 int g_param_values_cmp(ParamSpec* pspec, Value* value1, Value* value2);
6540 Type g_pointer_type_register_static(char* name);
6541 int g_signal_accumulator_first_wins(SignalInvocationHint* ihint, Value* return_accu, Value* handler_return, void* dummy);
6542 int g_signal_accumulator_true_handled(SignalInvocationHint* ihint, Value* return_accu, Value* handler_return, void* dummy);
6543 c_ulong g_signal_add_emission_hook(uint signal_id, GLib2.Quark detail, SignalEmissionHook hook_func, void* hook_data, GLib2.DestroyNotify data_destroy);
6544 void g_signal_chain_from_overridden(Value* instance_and_params, Value* return_value);
6545 void g_signal_chain_from_overridden_handler(void* instance, ...);
6546 c_ulong g_signal_connect_closure(void* instance, char* detailed_signal, Closure* closure, int after);
6547 c_ulong g_signal_connect_closure_by_id(void* instance, uint signal_id, GLib2.Quark detail, Closure* closure, int after);
6548 c_ulong g_signal_connect_data(void* instance, char* detailed_signal, Callback c_handler, void* data, ClosureNotify destroy_data, ConnectFlags connect_flags);
6549 c_ulong g_signal_connect_object(void* instance, char* detailed_signal, Callback c_handler, void* gobject, ConnectFlags connect_flags);
6550 void g_signal_emit(void* instance, uint signal_id, GLib2.Quark detail, ...);
6551 void g_signal_emit_by_name(void* instance, char* detailed_signal, ...);
6552 void g_signal_emit_valist(void* instance, uint signal_id, GLib2.Quark detail, va_list var_args);
6553 void g_signal_emitv(Value* instance_and_params, uint signal_id, GLib2.Quark detail, Value* return_value);
6554 SignalInvocationHint* g_signal_get_invocation_hint(void* instance);
6555 void g_signal_handler_block(void* instance, c_ulong handler_id);
6556 void g_signal_handler_disconnect(void* instance, c_ulong handler_id);
6557 c_ulong g_signal_handler_find(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data);
6558 int g_signal_handler_is_connected(void* instance, c_ulong handler_id);
6559 void g_signal_handler_unblock(void* instance, c_ulong handler_id);
6560 uint g_signal_handlers_block_matched(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data);
6561 void g_signal_handlers_destroy(void* instance);
6562 uint g_signal_handlers_disconnect_matched(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data);
6563 uint g_signal_handlers_unblock_matched(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data);
6564 int g_signal_has_handler_pending(void* instance, uint signal_id, GLib2.Quark detail, int may_be_blocked);
6565 uint* g_signal_list_ids(Type itype, /*out*/ uint* n_ids);
6566 uint g_signal_lookup(char* name, Type itype);
6567 char* g_signal_name(uint signal_id);
6568 uint g_signal_new(char* signal_name, Type itype, SignalFlags signal_flags, uint class_offset, SignalAccumulator accumulator, void* accu_data, SignalCMarshaller c_marshaller, Type return_type, uint n_params, ...);
6569 uint g_signal_new_class_handler(char* signal_name, Type itype, SignalFlags signal_flags, Callback class_handler, SignalAccumulator accumulator, void* accu_data, SignalCMarshaller c_marshaller, Type return_type, uint n_params, ...);
6570 uint g_signal_new_valist(char* signal_name, Type itype, SignalFlags signal_flags, Closure* class_closure, SignalAccumulator accumulator, void* accu_data, SignalCMarshaller c_marshaller, Type return_type, uint n_params, va_list args);
6571 uint g_signal_newv(char* signal_name, Type itype, SignalFlags signal_flags, Closure* class_closure, SignalAccumulator accumulator, void* accu_data, SignalCMarshaller c_marshaller, Type return_type, uint n_params, Type* param_types);
6572 void g_signal_override_class_closure(uint signal_id, Type instance_type, Closure* class_closure);
6573 void g_signal_override_class_handler(char* signal_name, Type instance_type, Callback class_handler);
6574 int g_signal_parse_name(char* detailed_signal, Type itype, /*out*/ uint* signal_id_p, /*out*/ GLib2.Quark* detail_p, int force_detail_quark);
6575 void g_signal_query(uint signal_id, /*out*/ SignalQuery* query);
6576 void g_signal_remove_emission_hook(uint signal_id, c_ulong hook_id);
6577 void g_signal_stop_emission(void* instance, uint signal_id, GLib2.Quark detail);
6578 void g_signal_stop_emission_by_name(void* instance, char* detailed_signal);
6579 Closure* /*new*/ g_signal_type_cclosure_new(Type itype, uint struct_offset);
6580 void g_source_set_closure(GLib2.Source* source, Closure* closure);
6581 void g_source_set_dummy_callback(GLib2.Source* source);
6582 char* /*new*/ g_strdup_value_contents(Value* value);
6583 void g_type_add_class_cache_func(void* cache_data, TypeClassCacheFunc cache_func);
6584 void g_type_add_class_private(Type class_type, size_t private_size);
6585 void g_type_add_interface_check(void* check_data, TypeInterfaceCheckFunc check_func);
6586 void g_type_add_interface_dynamic(Type instance_type, Type interface_type, TypePlugin* plugin);
6587 void g_type_add_interface_static(Type instance_type, Type interface_type, InterfaceInfo* info);
6588 TypeClass* g_type_check_class_cast(TypeClass* g_class, Type is_a_type);
6589 int g_type_check_class_is_a(TypeClass* g_class, Type is_a_type);
6590 int g_type_check_instance(TypeInstance* instance);
6591 TypeInstance* g_type_check_instance_cast(TypeInstance* instance, Type iface_type);
6592 int g_type_check_instance_is_a(TypeInstance* instance, Type iface_type);
6593 int g_type_check_is_value_type(Type type);
6594 int g_type_check_value(Value* value);
6595 int g_type_check_value_holds(Value* value, Type type);
6596 Type* /*new*/ g_type_children(Type type, /*out*/ uint* n_children=null);
6597 TypeInstance* g_type_create_instance(Type type);
6598 TypeInterface* g_type_default_interface_peek(Type g_type);
6599 TypeInterface* g_type_default_interface_ref(Type g_type);
6600 void g_type_default_interface_unref(TypeInterface* g_iface);
6601 uint g_type_depth(Type type);
6602 void g_type_free_instance(TypeInstance* instance);
6603 Type g_type_from_name(char* name);
6604 Type g_type_fundamental(Type type_id);
6605 Type g_type_fundamental_next();
6606 TypePlugin* g_type_get_plugin(Type type);
6607 void* g_type_get_qdata(Type type, GLib2.Quark quark);
6608 void g_type_init();
6609 void g_type_init_with_debug_flags(TypeDebugFlags debug_flags);
6610 Type* /*new*/ g_type_interfaces(Type type, /*out*/ uint* n_interfaces=null);
6611 int g_type_is_a(Type type, Type is_a_type);
6612 char* g_type_name(Type type);
6613 char* g_type_name_from_class(TypeClass* g_class);
6614 char* g_type_name_from_instance(TypeInstance* instance);
6615 Type g_type_next_base(Type leaf_type, Type root_type);
6616 Type g_type_parent(Type type);
6617 GLib2.Quark g_type_qname(Type type);
6618 void g_type_query(Type type, /*out*/ TypeQuery* query);
6619 Type g_type_register_dynamic(Type parent_type, char* type_name, TypePlugin* plugin, TypeFlags flags);
6620 Type g_type_register_fundamental(Type type_id, char* type_name, GTypeInfo* info, TypeFundamentalInfo* finfo, TypeFlags flags);
6621 Type g_type_register_static(Type parent_type, char* type_name, GTypeInfo* info, TypeFlags flags);
6622 Type g_type_register_static_simple(Type parent_type, char* type_name, uint class_size, ClassInitFunc class_init, uint instance_size, InstanceInitFunc instance_init, TypeFlags flags);
6623 void g_type_remove_class_cache_func(void* cache_data, TypeClassCacheFunc cache_func);
6624 void g_type_remove_interface_check(void* check_data, TypeInterfaceCheckFunc check_func);
6625 void g_type_set_qdata(Type type, GLib2.Quark quark, void* data);
6626 int g_type_test_flags(Type type, uint flags);
6627 Type g_value_get_gtype(Value* value);