Support pre-GTK3 GLibs too.
[girtod.git] / gtk2 / gobject2.d
blob19b99edba20e678a0e175b3731e55cf8a12acbbd
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;
16 // --- mixin/GObject2__MODULE_HEAD.d --->
18 // Newer GLib versions define 'Type', older ones do not.
19 static if (!is(Type))
20 alias size_t Type;
22 // <--- mixin/GObject2__MODULE_HEAD.d ---
25 // This is the signature of marshaller functions, required to marshall
26 // arrays of parameter values to signal emissions into C language callback
27 // invocations. It is merely an alias to #GClosureMarshal since the #GClosure
28 // mechanism takes over responsibility of actual function invocation for the
29 // signal system.
30 alias ClosureMarshal SignalCMarshaller;
32 // alias "Type" removed: Defined in glib
35 // A callback function used by the type system to finalize those portions
36 // of a derived types class structure that were setup from the corresponding
37 // GBaseInitFunc() function. Class finalization basically works the inverse
38 // way in which class intialization is performed.
39 // See GClassInitFunc() for a discussion of the class intialization process.
40 // <g_class>: The #GTypeClass structure to finalize.
41 extern (C) alias void function (void* g_class) nothrow BaseFinalizeFunc;
44 // A callback function used by the type system to do base initialization
45 // of the class structures of derived types. It is called as part of the
46 // initialization process of all derived classes and should reallocate
47 // or reset all dynamic class members copied over from the parent class.
48 // For example, class members (such as strings) that are not sufficiently
49 // handled by a plain memory copy of the parent class into the derived class
50 // have to be altered. See GClassInitFunc() for a discussion of the class
51 // intialization process.
52 // <g_class>: The #GTypeClass structure to initialize.
53 extern (C) alias void function (void* g_class) nothrow BaseInitFunc;
56 // #GBinding is the representation of a binding between a property on a
57 // #GObject instance (or source) and another property on another #GObject
58 // instance (or target). Whenever the source property changes, the same
59 // value is applied to the target property; for instance, the following
60 // binding:
61 //
62 // |[
63 // g_object_bind_property (object1, "property-a",
64 // object2, "property-b",
65 // G_BINDING_DEFAULT);
66 // ]|
67 //
68 // will cause <emphasis>object2:property-b</emphasis> to be updated every
69 // time g_object_set() or the specific accessor changes the value of
70 // <emphasis>object1:property-a</emphasis>.
71 //
72 // It is possible to create a bidirectional binding between two properties
73 // of two #GObject instances, so that if either property changes, the
74 // other is updated as well, for instance:
75 //
76 // |[
77 // g_object_bind_property (object1, "property-a",
78 // object2, "property-b",
79 // G_BINDING_BIDIRECTIONAL);
80 // ]|
81 //
82 // will keep the two properties in sync.
83 //
84 // It is also possible to set a custom transformation function (in both
85 // directions, in case of a bidirectional binding) to apply a custom
86 // transformation from the source value to the target value before
87 // applying it; for instance, the following binding:
88 //
89 // |[
90 // g_object_bind_property_full (adjustment1, "value",
91 // adjustment2, "value",
92 // G_BINDING_BIDIRECTIONAL,
93 // celsius_to_fahrenheit,
94 // fahrenheit_to_celsius,
95 // NULL, NULL);
96 // ]|
97 //
98 // will keep the <emphasis>value</emphasis> property of the two adjustments
99 // in sync; the <function>celsius_to_fahrenheit</function> function will be
100 // called whenever the <emphasis>adjustment1:value</emphasis> property changes
101 // and will transform the current value of the property before applying it
102 // to the <emphasis>adjustment2:value</emphasis> property; vice versa, the
103 // <function>fahrenheit_to_celsius</function> function will be called whenever
104 // the <emphasis>adjustment2:value</emphasis> property changes, and will
105 // transform the current value of the property before applying it to the
106 // <emphasis>adjustment1:value</emphasis>.
108 // Note that #GBinding does not resolve cycles by itself; a cycle like
110 // |[
111 // object1:propertyA -> object2:propertyB
112 // object2:propertyB -> object3:propertyC
113 // object3:propertyC -> object1:propertyA
114 // ]|
116 // might lead to an infinite loop. The loop, in this particular case,
117 // can be avoided if the objects emit the #GObject::notify signal only
118 // if the value has effectively been changed. A binding is implemented
119 // using the #GObject::notify signal, so it is susceptible to all the
120 // various ways of blocking a signal emission, like g_signal_stop_emission()
121 // or g_signal_handler_block().
123 // A binding will be severed, and the resources it allocates freed, whenever
124 // either one of the #GObject instances it refers to are finalized, or when
125 // the #GBinding instance loses its last reference.
127 // #GBinding is available since GObject 2.26
128 struct Binding /* : Object */ /* Version 2.26 */ {
129 alias method_parent this;
130 alias method_parent super_;
131 alias method_parent object;
132 Object method_parent;
135 // VERSION: 2.26
136 // Retrieves the flags passed when constructing the #GBinding
137 // RETURNS: the #GBindingFlags used by the #GBinding
138 BindingFlags get_flags()() nothrow {
139 return g_binding_get_flags(&this);
142 // VERSION: 2.26
143 // Retrieves the #GObject instance used as the source of the binding
144 // RETURNS: the source #GObject
145 Object* get_source()() nothrow {
146 return g_binding_get_source(&this);
149 // VERSION: 2.26
150 // Retrieves the name of the property of #GBinding:source used as the source
151 // of the binding
152 // RETURNS: the name of the source property
153 char* get_source_property()() nothrow {
154 return g_binding_get_source_property(&this);
157 // VERSION: 2.26
158 // Retrieves the #GObject instance used as the target of the binding
159 // RETURNS: the target #GObject
160 Object* get_target()() nothrow {
161 return g_binding_get_target(&this);
164 // VERSION: 2.26
165 // Retrieves the name of the property of #GBinding:target used as the target
166 // of the binding
167 // RETURNS: the name of the target property
168 char* get_target_property()() nothrow {
169 return g_binding_get_target_property(&this);
174 // Flags to be passed to g_object_bind_property() or
175 // g_object_bind_property_full().
177 // This enumeration can be extended at later date.
178 enum BindingFlags /* Version 2.26 */ {
179 DEFAULT = 0,
180 BIDIRECTIONAL = 1,
181 SYNC_CREATE = 2,
182 INVERT_BOOLEAN = 4
185 // VERSION: 2.26
186 // A function to be called to transform the source property of @source
187 // from @source_value into the target property of @target
188 // using @target_value.
190 // otherwise
191 // RETURNS: %TRUE if the transformation was successful, and %FALSE
192 // <binding>: a #GBinding
193 // <source_value>: the value of the source property
194 // <target_value>: the value of the target property
195 // <user_data>: data passed to the transform function
196 extern (C) alias int function (Binding* binding, Value* source_value, Value* target_value, void* user_data) nothrow BindingTransformFunc;
199 // Unintrospectable callback: BoxedCopyFunc() / ()
200 // This function is provided by the user and should produce a copy
201 // of the passed in boxed structure.
202 // RETURNS: The newly created copy of the boxed structure.
203 // <boxed>: The boxed structure to be copied.
204 extern (C) alias void* function (void* boxed) nothrow BoxedCopyFunc;
207 // This function is provided by the user and should free the boxed
208 // structure passed.
209 // <boxed>: The boxed structure to be freed.
210 extern (C) alias void function (void* boxed) nothrow BoxedFreeFunc;
212 // A #GCClosure is a specialization of #GClosure for C function callbacks.
213 struct CClosure {
214 Closure closure;
215 void* callback;
217 static void marshal_BOOLEAN__BOXED_BOXED()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
218 g_cclosure_marshal_BOOLEAN__BOXED_BOXED(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
221 // A marshaller for a #GCClosure with a callback of type
222 // <literal>gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter
223 // denotes a flags type.
224 // <closure>: the #GClosure to which the marshaller belongs
225 // <return_value>: a #GValue which can store the returned #gboolean
226 // <n_param_values>: 2
227 // <param_values>: a #GValue array holding instance and arg1
228 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
229 // <marshal_data>: additional data specified when registering the marshaller
230 static void marshal_BOOLEAN__FLAGS()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
231 g_cclosure_marshal_BOOLEAN__FLAGS(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
234 // A marshaller for a #GCClosure with a callback of type
235 // <literal>gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data)</literal>.
236 // <closure>: the #GClosure to which the marshaller belongs
237 // <return_value>: a #GValue, which can store the returned string
238 // <n_param_values>: 3
239 // <param_values>: a #GValue array holding instance, arg1 and arg2
240 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
241 // <marshal_data>: additional data specified when registering the marshaller
242 static void marshal_STRING__OBJECT_POINTER()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
243 g_cclosure_marshal_STRING__OBJECT_POINTER(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
246 // A marshaller for a #GCClosure with a callback of type
247 // <literal>void (*callback) (gpointer instance, gboolean arg1, gpointer user_data)</literal>.
248 // <closure>: the #GClosure to which the marshaller belongs
249 // <return_value>: ignored
250 // <n_param_values>: 2
251 // <param_values>: a #GValue array holding the instance and the #gboolean parameter
252 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
253 // <marshal_data>: additional data specified when registering the marshaller
254 static void marshal_VOID__BOOLEAN()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
255 g_cclosure_marshal_VOID__BOOLEAN(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
258 // A marshaller for a #GCClosure with a callback of type
259 // <literal>void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data)</literal>.
260 // <closure>: the #GClosure to which the marshaller belongs
261 // <return_value>: ignored
262 // <n_param_values>: 2
263 // <param_values>: a #GValue array holding the instance and the #GBoxed* parameter
264 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
265 // <marshal_data>: additional data specified when registering the marshaller
266 static void marshal_VOID__BOXED()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
267 g_cclosure_marshal_VOID__BOXED(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
270 // A marshaller for a #GCClosure with a callback of type
271 // <literal>void (*callback) (gpointer instance, gchar arg1, gpointer user_data)</literal>.
272 // <closure>: the #GClosure to which the marshaller belongs
273 // <return_value>: ignored
274 // <n_param_values>: 2
275 // <param_values>: a #GValue array holding the instance and the #gchar parameter
276 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
277 // <marshal_data>: additional data specified when registering the marshaller
278 static void marshal_VOID__CHAR()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
279 g_cclosure_marshal_VOID__CHAR(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
282 // A marshaller for a #GCClosure with a callback of type
283 // <literal>void (*callback) (gpointer instance, gdouble arg1, gpointer user_data)</literal>.
284 // <closure>: the #GClosure to which the marshaller belongs
285 // <return_value>: ignored
286 // <n_param_values>: 2
287 // <param_values>: a #GValue array holding the instance and the #gdouble parameter
288 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
289 // <marshal_data>: additional data specified when registering the marshaller
290 static void marshal_VOID__DOUBLE()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
291 g_cclosure_marshal_VOID__DOUBLE(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
294 // A marshaller for a #GCClosure with a callback of type
295 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter denotes an enumeration type..
296 // <closure>: the #GClosure to which the marshaller belongs
297 // <return_value>: ignored
298 // <n_param_values>: 2
299 // <param_values>: a #GValue array holding the instance and the enumeration parameter
300 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
301 // <marshal_data>: additional data specified when registering the marshaller
302 static void marshal_VOID__ENUM()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
303 g_cclosure_marshal_VOID__ENUM(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
306 // A marshaller for a #GCClosure with a callback of type
307 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter denotes a flags type.
308 // <closure>: the #GClosure to which the marshaller belongs
309 // <return_value>: ignored
310 // <n_param_values>: 2
311 // <param_values>: a #GValue array holding the instance and the flags parameter
312 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
313 // <marshal_data>: additional data specified when registering the marshaller
314 static void marshal_VOID__FLAGS()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
315 g_cclosure_marshal_VOID__FLAGS(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
318 // A marshaller for a #GCClosure with a callback of type
319 // <literal>void (*callback) (gpointer instance, gfloat arg1, gpointer user_data)</literal>.
320 // <closure>: the #GClosure to which the marshaller belongs
321 // <return_value>: ignored
322 // <n_param_values>: 2
323 // <param_values>: a #GValue array holding the instance and the #gfloat parameter
324 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
325 // <marshal_data>: additional data specified when registering the marshaller
326 static void marshal_VOID__FLOAT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
327 g_cclosure_marshal_VOID__FLOAT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
330 // A marshaller for a #GCClosure with a callback of type
331 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal>.
332 // <closure>: the #GClosure to which the marshaller belongs
333 // <return_value>: ignored
334 // <n_param_values>: 2
335 // <param_values>: a #GValue array holding the instance and the #gint parameter
336 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
337 // <marshal_data>: additional data specified when registering the marshaller
338 static void marshal_VOID__INT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
339 g_cclosure_marshal_VOID__INT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
342 // A marshaller for a #GCClosure with a callback of type
343 // <literal>void (*callback) (gpointer instance, glong arg1, gpointer user_data)</literal>.
344 // <closure>: the #GClosure to which the marshaller belongs
345 // <return_value>: ignored
346 // <n_param_values>: 2
347 // <param_values>: a #GValue array holding the instance and the #glong parameter
348 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
349 // <marshal_data>: additional data specified when registering the marshaller
350 static void marshal_VOID__LONG()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
351 g_cclosure_marshal_VOID__LONG(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
354 // A marshaller for a #GCClosure with a callback of type
355 // <literal>void (*callback) (gpointer instance, GObject *arg1, gpointer user_data)</literal>.
356 // <closure>: the #GClosure to which the marshaller belongs
357 // <return_value>: ignored
358 // <n_param_values>: 2
359 // <param_values>: a #GValue array holding the instance and the #GObject* parameter
360 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
361 // <marshal_data>: additional data specified when registering the marshaller
362 static void marshal_VOID__OBJECT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
363 g_cclosure_marshal_VOID__OBJECT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
366 // A marshaller for a #GCClosure with a callback of type
367 // <literal>void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data)</literal>.
368 // <closure>: the #GClosure to which the marshaller belongs
369 // <return_value>: ignored
370 // <n_param_values>: 2
371 // <param_values>: a #GValue array holding the instance and the #GParamSpec* parameter
372 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
373 // <marshal_data>: additional data specified when registering the marshaller
374 static void marshal_VOID__PARAM()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
375 g_cclosure_marshal_VOID__PARAM(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
378 // A marshaller for a #GCClosure with a callback of type
379 // <literal>void (*callback) (gpointer instance, gpointer arg1, gpointer user_data)</literal>.
380 // <closure>: the #GClosure to which the marshaller belongs
381 // <return_value>: ignored
382 // <n_param_values>: 2
383 // <param_values>: a #GValue array holding the instance and the #gpointer parameter
384 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
385 // <marshal_data>: additional data specified when registering the marshaller
386 static void marshal_VOID__POINTER()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
387 g_cclosure_marshal_VOID__POINTER(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
390 // A marshaller for a #GCClosure with a callback of type
391 // <literal>void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data)</literal>.
392 // <closure>: the #GClosure to which the marshaller belongs
393 // <return_value>: ignored
394 // <n_param_values>: 2
395 // <param_values>: a #GValue array holding the instance and the #gchar* parameter
396 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
397 // <marshal_data>: additional data specified when registering the marshaller
398 static void marshal_VOID__STRING()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
399 g_cclosure_marshal_VOID__STRING(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
402 // A marshaller for a #GCClosure with a callback of type
403 // <literal>void (*callback) (gpointer instance, guchar arg1, gpointer user_data)</literal>.
404 // <closure>: the #GClosure to which the marshaller belongs
405 // <return_value>: ignored
406 // <n_param_values>: 2
407 // <param_values>: a #GValue array holding the instance and the #guchar parameter
408 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
409 // <marshal_data>: additional data specified when registering the marshaller
410 static void marshal_VOID__UCHAR()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
411 g_cclosure_marshal_VOID__UCHAR(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
414 // A marshaller for a #GCClosure with a callback of type
415 // <literal>void (*callback) (gpointer instance, guint arg1, gpointer user_data)</literal>.
416 // <closure>: the #GClosure to which the marshaller belongs
417 // <return_value>: ignored
418 // <n_param_values>: 2
419 // <param_values>: a #GValue array holding the instance and the #guint parameter
420 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
421 // <marshal_data>: additional data specified when registering the marshaller
422 static void marshal_VOID__UINT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
423 g_cclosure_marshal_VOID__UINT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
426 // A marshaller for a #GCClosure with a callback of type
427 // <literal>void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data)</literal>.
428 // <closure>: the #GClosure to which the marshaller belongs
429 // <return_value>: ignored
430 // <n_param_values>: 3
431 // <param_values>: a #GValue array holding instance, arg1 and arg2
432 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
433 // <marshal_data>: additional data specified when registering the marshaller
434 static void marshal_VOID__UINT_POINTER()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
435 g_cclosure_marshal_VOID__UINT_POINTER(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
438 // A marshaller for a #GCClosure with a callback of type
439 // <literal>void (*callback) (gpointer instance, gulong arg1, gpointer user_data)</literal>.
440 // <closure>: the #GClosure to which the marshaller belongs
441 // <return_value>: ignored
442 // <n_param_values>: 2
443 // <param_values>: a #GValue array holding the instance and the #gulong parameter
444 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
445 // <marshal_data>: additional data specified when registering the marshaller
446 static void marshal_VOID__ULONG()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
447 g_cclosure_marshal_VOID__ULONG(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
450 // VERSION: 2.26
451 // A marshaller for a #GCClosure with a callback of type
452 // <literal>void (*callback) (gpointer instance, GVariant *arg1, gpointer user_data)</literal>.
453 // <closure>: the #GClosure to which the marshaller belongs
454 // <return_value>: ignored
455 // <n_param_values>: 2
456 // <param_values>: a #GValue array holding the instance and the #GVariant* parameter
457 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
458 // <marshal_data>: additional data specified when registering the marshaller
459 static void marshal_VOID__VARIANT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
460 g_cclosure_marshal_VOID__VARIANT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
463 // A marshaller for a #GCClosure with a callback of type
464 // <literal>void (*callback) (gpointer instance, gpointer user_data)</literal>.
465 // <closure>: the #GClosure to which the marshaller belongs
466 // <return_value>: ignored
467 // <n_param_values>: 1
468 // <param_values>: a #GValue array holding only the instance
469 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
470 // <marshal_data>: additional data specified when registering the marshaller
471 static void marshal_VOID__VOID()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
472 g_cclosure_marshal_VOID__VOID(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
475 // VERSION: 2.30
476 // A generic marshaller function implemented via <ulink
477 // url="http://sourceware.org/libffi/">libffi</ulink>.
478 // <closure>: A #GClosure.
479 // <return_gvalue>: A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
480 // <n_param_values>: The length of the @param_values array.
481 // <param_values>: An array of #GValue<!-- -->s holding the arguments on which to invoke the callback of closure.
482 // <invocation_hint>: The invocation hint given as the last argument to g_closure_invoke().
483 // <marshal_data>: Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
484 static void marshal_generic()(Closure* closure, Value* return_gvalue, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
485 g_cclosure_marshal_generic(closure, return_gvalue, n_param_values, param_values, invocation_hint, marshal_data);
488 // Unintrospectable function: new() / g_cclosure_new()
489 // Creates a new closure which invokes @callback_func with @user_data as
490 // the last parameter.
491 // RETURNS: a new #GCClosure
492 // <callback_func>: the function to invoke
493 // <user_data>: user data to pass to @callback_func
494 // <destroy_data>: destroy notify to be called when @user_data is no longer used
495 static Closure* /*new*/ new_()(Callback callback_func, void* user_data, ClosureNotify destroy_data) nothrow {
496 return g_cclosure_new(callback_func, user_data, destroy_data);
499 // Unintrospectable function: new_object() / g_cclosure_new_object()
500 // A variant of g_cclosure_new() which uses @object as @user_data and
501 // calls g_object_watch_closure() on @object and the created
502 // closure. This function is useful when you have a callback closely
503 // associated with a #GObject, and want the callback to no longer run
504 // after the object is is freed.
505 // RETURNS: a new #GCClosure
506 // <callback_func>: the function to invoke
507 // <object>: a #GObject pointer to pass to @callback_func
508 static Closure* /*new*/ new_object()(Callback callback_func, Object* object) nothrow {
509 return g_cclosure_new_object(callback_func, object);
512 // Unintrospectable function: new_object_swap() / g_cclosure_new_object_swap()
513 // A variant of g_cclosure_new_swap() which uses @object as @user_data
514 // and calls g_object_watch_closure() on @object and the created
515 // closure. This function is useful when you have a callback closely
516 // associated with a #GObject, and want the callback to no longer run
517 // after the object is is freed.
518 // RETURNS: a new #GCClosure
519 // <callback_func>: the function to invoke
520 // <object>: a #GObject pointer to pass to @callback_func
521 static Closure* /*new*/ new_object_swap()(Callback callback_func, Object* object) nothrow {
522 return g_cclosure_new_object_swap(callback_func, object);
525 // Unintrospectable function: new_swap() / g_cclosure_new_swap()
526 // Creates a new closure which invokes @callback_func with @user_data as
527 // the first parameter.
528 // RETURNS: a new #GCClosure
529 // <callback_func>: the function to invoke
530 // <user_data>: user data to pass to @callback_func
531 // <destroy_data>: destroy notify to be called when @user_data is no longer used
532 static Closure* /*new*/ new_swap()(Callback callback_func, void* user_data, ClosureNotify destroy_data) nothrow {
533 return g_cclosure_new_swap(callback_func, user_data, destroy_data);
538 // The type used for callback functions in structure definitions and function
539 // signatures. This doesn't mean that all callback functions must take no
540 // parameters and return void. The required signature of a callback function
541 // is determined by the context in which is used (e.g. the signal to which it
542 // is connected). Use G_CALLBACK() to cast the callback function to a #GCallback.
543 extern (C) alias void function () nothrow Callback;
546 // A callback function used by the type system to finalize a class.
547 // This function is rarely needed, as dynamically allocated class resources
548 // should be handled by GBaseInitFunc() and GBaseFinalizeFunc().
549 // Also, specification of a GClassFinalizeFunc() in the #GTypeInfo
550 // structure of a static type is invalid, because classes of static types
551 // will never be finalized (they are artificially kept alive when their
552 // reference count drops to zero).
553 // <g_class>: The #GTypeClass structure to finalize.
554 // <class_data>: The @class_data member supplied via the #GTypeInfo structure.
555 extern (C) alias void function (void* g_class, void* class_data) nothrow ClassFinalizeFunc;
558 // A callback function used by the type system to initialize the class
559 // of a specific type. This function should initialize all static class
560 // members.
561 // The initialization process of a class involves:
562 // <itemizedlist>
563 // <listitem><para>
564 // 1 - Copying common members from the parent class over to the
565 // derived class structure.
566 // </para></listitem>
567 // <listitem><para>
568 // 2 - Zero initialization of the remaining members not copied
569 // over from the parent class.
570 // </para></listitem>
571 // <listitem><para>
572 // 3 - Invocation of the GBaseInitFunc() initializers of all parent
573 // types and the class' type.
574 // </para></listitem>
575 // <listitem><para>
576 // 4 - Invocation of the class' GClassInitFunc() initializer.
577 // </para></listitem>
578 // </itemizedlist>
579 // Since derived classes are partially initialized through a memory copy
580 // of the parent class, the general rule is that GBaseInitFunc() and
581 // GBaseFinalizeFunc() should take care of necessary reinitialization
582 // and release of those class members that were introduced by the type
583 // that specified these GBaseInitFunc()/GBaseFinalizeFunc().
584 // GClassInitFunc() should only care about initializing static
585 // class members, while dynamic class members (such as allocated strings
586 // or reference counted resources) are better handled by a GBaseInitFunc()
587 // for this type, so proper initialization of the dynamic class members
588 // is performed for class initialization of derived types as well.
589 // An example may help to correspond the intend of the different class
590 // initializers:
592 // |[
593 // typedef struct {
594 // GObjectClass parent_class;
595 // gint static_integer;
596 // gchar *dynamic_string;
597 // } TypeAClass;
598 // static void
599 // type_a_base_class_init (TypeAClass *class)
600 // {
601 // class->dynamic_string = g_strdup ("some string");
602 // }
603 // static void
604 // type_a_base_class_finalize (TypeAClass *class)
605 // {
606 // g_free (class->dynamic_string);
607 // }
608 // static void
609 // type_a_class_init (TypeAClass *class)
610 // {
611 // class->static_integer = 42;
612 // }
614 // typedef struct {
615 // TypeAClass parent_class;
616 // gfloat static_float;
617 // GString *dynamic_gstring;
618 // } TypeBClass;
619 // static void
620 // type_b_base_class_init (TypeBClass *class)
621 // {
622 // class->dynamic_gstring = g_string_new ("some other string");
623 // }
624 // static void
625 // type_b_base_class_finalize (TypeBClass *class)
626 // {
627 // g_string_free (class->dynamic_gstring);
628 // }
629 // static void
630 // type_b_class_init (TypeBClass *class)
631 // {
632 // class->static_float = 3.14159265358979323846;
633 // }
634 // ]|
635 // Initialization of TypeBClass will first cause initialization of
636 // TypeAClass (derived classes reference their parent classes, see
637 // g_type_class_ref() on this).
638 // Initialization of TypeAClass roughly involves zero-initializing its fields,
639 // then calling its GBaseInitFunc() type_a_base_class_init() to allocate
640 // its dynamic members (dynamic_string), and finally calling its GClassInitFunc()
641 // type_a_class_init() to initialize its static members (static_integer).
642 // The first step in the initialization process of TypeBClass is then
643 // a plain memory copy of the contents of TypeAClass into TypeBClass and
644 // zero-initialization of the remaining fields in TypeBClass.
645 // The dynamic members of TypeAClass within TypeBClass now need
646 // reinitialization which is performed by calling type_a_base_class_init()
647 // with an argument of TypeBClass.
648 // After that, the GBaseInitFunc() of TypeBClass, type_b_base_class_init()
649 // is called to allocate the dynamic members of TypeBClass (dynamic_gstring),
650 // and finally the GClassInitFunc() of TypeBClass, type_b_class_init(),
651 // is called to complete the initialization process with the static members
652 // (static_float).
653 // Corresponding finalization counter parts to the GBaseInitFunc() functions
654 // have to be provided to release allocated resources at class finalization
655 // time.
656 // <g_class>: The #GTypeClass structure to initialize.
657 // <class_data>: The @class_data member supplied via the #GTypeInfo structure.
658 extern (C) alias void function (void* g_class, void* class_data) nothrow ClassInitFunc;
661 // A #GClosure represents a callback supplied by the programmer. It
662 // will generally comprise a function of some kind and a marshaller
663 // used to call it. It is the reponsibility of the marshaller to
664 // convert the arguments for the invocation from #GValue<!-- -->s into
665 // a suitable form, perform the callback on the converted arguments,
666 // and transform the return value back into a #GValue.
668 // In the case of C programs, a closure usually just holds a pointer
669 // to a function and maybe a data argument, and the marshaller
670 // converts between #GValue<!-- --> and native C types. The GObject
671 // library provides the #GCClosure type for this purpose. Bindings for
672 // other languages need marshallers which convert between #GValue<!--
673 // -->s and suitable representations in the runtime of the language in
674 // order to use functions written in that languages as callbacks.
676 // Within GObject, closures play an important role in the
677 // implementation of signals. When a signal is registered, the
678 // @c_marshaller argument to g_signal_new() specifies the default C
679 // marshaller for any closure which is connected to this
680 // signal. GObject provides a number of C marshallers for this
681 // purpose, see the g_cclosure_marshal_*() functions. Additional C
682 // marshallers can be generated with the <link
683 // linkend="glib-genmarshal">glib-genmarshal</link> utility. Closures
684 // can be explicitly connected to signals with
685 // g_signal_connect_closure(), but it usually more convenient to let
686 // GObject create a closure automatically by using one of the
687 // g_signal_connect_*() functions which take a callback function/user
688 // data pair.
690 // Using closures has a number of important advantages over a simple
691 // callback function/data pointer combination:
692 // <itemizedlist>
693 // <listitem><para>
694 // Closures allow the callee to get the types of the callback parameters,
695 // which means that language bindings don't have to write individual glue
696 // for each callback type.
697 // </para></listitem>
698 // <listitem><para>
699 // The reference counting of #GClosure makes it easy to handle reentrancy
700 // right; if a callback is removed while it is being invoked, the closure
701 // and its parameters won't be freed until the invocation finishes.
702 // </para></listitem>
703 // <listitem><para>
704 // g_closure_invalidate() and invalidation notifiers allow callbacks to be
705 // automatically removed when the objects they point to go away.
706 // </para></listitem>
707 // </itemizedlist>
708 struct Closure {
709 static import std.bitmanip; mixin(std.bitmanip.bitfields!(
710 uint, "ref_count", 15,
711 uint, "meta_marshal", 1,
712 uint, "n_guards", 1,
713 uint, "n_fnotifiers", 2,
714 uint, "n_inotifiers", 8,
715 uint, "in_inotify", 1,
716 uint, "floating", 1,
717 uint, "derivative_flag", 1,
718 uint, "in_marshal", 1,
719 uint, "is_invalid", 1));
720 extern (C) void function (Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow marshal;
721 private void* data;
722 private ClosureNotifyData* notifiers;
725 // A variant of g_closure_new_simple() which stores @object in the
726 // @data field of the closure and calls g_object_watch_closure() on
727 // @object and the created closure. This function is mainly useful
728 // when implementing new types of closures.
729 // RETURNS: a newly allocated #GClosure
730 // <sizeof_closure>: the size of the structure to allocate, must be at least <literal>sizeof (GClosure)</literal>
731 // <object>: a #GObject pointer to store in the @data field of the newly allocated #GClosure
732 static Closure* /*new*/ new_object()(uint sizeof_closure, Object* object) nothrow {
733 return g_closure_new_object(sizeof_closure, object);
735 alias new_object!() opCall;
737 // Allocates a struct of the given size and initializes the initial
738 // part as a #GClosure. This function is mainly useful when
739 // implementing new types of closures.
741 // |[
742 // typedef struct _MyClosure MyClosure;
743 // struct _MyClosure
744 // {
745 // GClosure closure;
746 // // extra data goes here
747 // };
749 // static void
750 // my_closure_finalize (gpointer notify_data,
751 // GClosure *closure)
752 // {
753 // MyClosure *my_closure = (MyClosure *)closure;
755 // // free extra data here
756 // }
758 // MyClosure *my_closure_new (gpointer data)
759 // {
760 // GClosure *closure;
761 // MyClosure *my_closure;
763 // closure = g_closure_new_simple (sizeof (MyClosure), data);
764 // my_closure = (MyClosure *) closure;
766 // // initialize extra data here
768 // g_closure_add_finalize_notifier (closure, notify_data,
769 // my_closure_finalize);
770 // return my_closure;
771 // }
772 // ]|
773 // RETURNS: a newly allocated #GClosure
774 // <sizeof_closure>: the size of the structure to allocate, must be at least <literal>sizeof (GClosure)</literal>
775 // <data>: data to store in the @data field of the newly allocated #GClosure
776 static Closure* /*new*/ new_simple()(uint sizeof_closure, void* data) nothrow {
777 return g_closure_new_simple(sizeof_closure, data);
779 alias new_simple!() opCall;
781 // Unintrospectable method: add_finalize_notifier() / g_closure_add_finalize_notifier()
782 // Registers a finalization notifier which will be called when the
783 // reference count of @closure goes down to 0. Multiple finalization
784 // notifiers on a single closure are invoked in unspecified order. If
785 // a single call to g_closure_unref() results in the closure being
786 // both invalidated and finalized, then the invalidate notifiers will
787 // be run before the finalize notifiers.
788 // <notify_data>: data to pass to @notify_func
789 // <notify_func>: the callback function to register
790 void add_finalize_notifier()(void* notify_data, ClosureNotify notify_func) nothrow {
791 g_closure_add_finalize_notifier(&this, notify_data, notify_func);
794 // Unintrospectable method: add_invalidate_notifier() / g_closure_add_invalidate_notifier()
795 // Registers an invalidation notifier which will be called when the
796 // @closure is invalidated with g_closure_invalidate(). Invalidation
797 // notifiers are invoked before finalization notifiers, in an
798 // unspecified order.
799 // <notify_data>: data to pass to @notify_func
800 // <notify_func>: the callback function to register
801 void add_invalidate_notifier()(void* notify_data, ClosureNotify notify_func) nothrow {
802 g_closure_add_invalidate_notifier(&this, notify_data, notify_func);
805 // Unintrospectable method: add_marshal_guards() / g_closure_add_marshal_guards()
806 // Adds a pair of notifiers which get invoked before and after the
807 // closure callback, respectively. This is typically used to protect
808 // the extra arguments for the duration of the callback. See
809 // g_object_watch_closure() for an example of marshal guards.
810 // <pre_marshal_data>: data to pass to @pre_marshal_notify
811 // <pre_marshal_notify>: a function to call before the closure callback
812 // <post_marshal_data>: data to pass to @post_marshal_notify
813 // <post_marshal_notify>: a function to call after the closure callback
814 void add_marshal_guards()(void* pre_marshal_data, ClosureNotify pre_marshal_notify, void* post_marshal_data, ClosureNotify post_marshal_notify) nothrow {
815 g_closure_add_marshal_guards(&this, pre_marshal_data, pre_marshal_notify, post_marshal_data, post_marshal_notify);
818 // Sets a flag on the closure to indicate that its calling
819 // environment has become invalid, and thus causes any future
820 // invocations of g_closure_invoke() on this @closure to be
821 // ignored. Also, invalidation notifiers installed on the closure will
822 // be called at this point. Note that unless you are holding a
823 // reference to the closure yourself, the invalidation notifiers may
824 // unref the closure and cause it to be destroyed, so if you need to
825 // access the closure after calling g_closure_invalidate(), make sure
826 // that you've previously called g_closure_ref().
828 // Note that g_closure_invalidate() will also be called when the
829 // reference count of a closure drops to zero (unless it has already
830 // been invalidated before).
831 void invalidate()() nothrow {
832 g_closure_invalidate(&this);
835 // Invokes the closure, i.e. executes the callback represented by the @closure.
836 // <return_value>: a #GValue to store the return value. May be %NULL if the callback of @closure doesn't return a value.
837 // <n_param_values>: the length of the @param_values array
838 // <param_values>: an array of #GValue<!-- -->s holding the arguments on which to invoke the callback of @closure
839 // <invocation_hint>: a context-dependent invocation hint
840 void invoke()(Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint=null) nothrow {
841 g_closure_invoke(&this, return_value, n_param_values, param_values, invocation_hint);
844 // Increments the reference count on a closure to force it staying
845 // alive while the caller holds a pointer to it.
846 // RETURNS: The @closure passed in, for convenience
847 Closure* ref_()() nothrow {
848 return g_closure_ref(&this);
851 // Unintrospectable method: remove_finalize_notifier() / g_closure_remove_finalize_notifier()
852 // Removes a finalization notifier.
854 // Notice that notifiers are automatically removed after they are run.
855 // <notify_data>: data which was passed to g_closure_add_finalize_notifier() when registering @notify_func
856 // <notify_func>: the callback function to remove
857 void remove_finalize_notifier()(void* notify_data, ClosureNotify notify_func) nothrow {
858 g_closure_remove_finalize_notifier(&this, notify_data, notify_func);
861 // Unintrospectable method: remove_invalidate_notifier() / g_closure_remove_invalidate_notifier()
862 // Removes an invalidation notifier.
864 // Notice that notifiers are automatically removed after they are run.
865 // <notify_data>: data which was passed to g_closure_add_invalidate_notifier() when registering @notify_func
866 // <notify_func>: the callback function to remove
867 void remove_invalidate_notifier()(void* notify_data, ClosureNotify notify_func) nothrow {
868 g_closure_remove_invalidate_notifier(&this, notify_data, notify_func);
871 // Unintrospectable method: set_marshal() / g_closure_set_marshal()
872 // Sets the marshaller of @closure. The <literal>marshal_data</literal>
873 // of @marshal provides a way for a meta marshaller to provide additional
874 // information to the marshaller. (See g_closure_set_meta_marshal().) For
875 // GObject's C predefined marshallers (the g_cclosure_marshal_*()
876 // functions), what it provides is a callback function to use instead of
877 // @closure->callback.
878 // <marshal>: a #GClosureMarshal function
879 void set_marshal()(ClosureMarshal marshal) nothrow {
880 g_closure_set_marshal(&this, marshal);
883 // Unintrospectable method: set_meta_marshal() / g_closure_set_meta_marshal()
884 // Sets the meta marshaller of @closure. A meta marshaller wraps
885 // @closure->marshal and modifies the way it is called in some
886 // fashion. The most common use of this facility is for C callbacks.
887 // The same marshallers (generated by <link
888 // linkend="glib-genmarshal">glib-genmarshal</link>) are used
889 // everywhere, but the way that we get the callback function
890 // differs. In most cases we want to use @closure->callback, but in
891 // other cases we want to use some different technique to retrieve the
892 // callback function.
894 // For example, class closures for signals (see
895 // g_signal_type_cclosure_new()) retrieve the callback function from a
896 // fixed offset in the class structure. The meta marshaller retrieves
897 // the right callback and passes it to the marshaller as the
898 // @marshal_data argument.
899 // <marshal_data>: context-dependent data to pass to @meta_marshal
900 // <meta_marshal>: a #GClosureMarshal function
901 void set_meta_marshal()(void* marshal_data, ClosureMarshal meta_marshal) nothrow {
902 g_closure_set_meta_marshal(&this, marshal_data, meta_marshal);
905 // Takes over the initial ownership of a closure. Each closure is
906 // initially created in a <firstterm>floating</firstterm> state, which
907 // means that the initial reference count is not owned by any caller.
908 // g_closure_sink() checks to see if the object is still floating, and
909 // if so, unsets the floating state and decreases the reference
910 // count. If the closure is not floating, g_closure_sink() does
911 // nothing. The reason for the existence of the floating state is to
912 // prevent cumbersome code sequences like:
913 // |[
914 // closure = g_cclosure_new (cb_func, cb_data);
915 // g_source_set_closure (source, closure);
916 // g_closure_unref (closure); // XXX GObject doesn't really need this
917 // ]|
918 // Because g_source_set_closure() (and similar functions) take ownership of the
919 // initial reference count, if it is unowned, we instead can write:
920 // |[
921 // g_source_set_closure (source, g_cclosure_new (cb_func, cb_data));
922 // ]|
924 // Generally, this function is used together with g_closure_ref(). Ane example
925 // of storing a closure for later notification looks like:
926 // |[
927 // static GClosure *notify_closure = NULL;
928 // void
929 // foo_notify_set_closure (GClosure *closure)
930 // {
931 // if (notify_closure)
932 // g_closure_unref (notify_closure);
933 // notify_closure = closure;
934 // if (notify_closure)
935 // {
936 // g_closure_ref (notify_closure);
937 // g_closure_sink (notify_closure);
938 // }
939 // }
940 // ]|
942 // Because g_closure_sink() may decrement the reference count of a closure
943 // (if it hasn't been called on @closure yet) just like g_closure_unref(),
944 // g_closure_ref() should be called prior to this function.
945 void sink()() nothrow {
946 g_closure_sink(&this);
949 // Decrements the reference count of a closure after it was previously
950 // incremented by the same caller. If no other callers are using the
951 // closure, then the closure will be destroyed and freed.
952 void unref()() nothrow {
953 g_closure_unref(&this);
958 // The type used for marshaller functions.
959 // <closure>: the #GClosure to which the marshaller belongs
960 // <return_value>: a #GValue to store the return value. May be %NULL if the callback of @closure doesn't return a value.
961 // <n_param_values>: the length of the @param_values array
962 // <param_values>: an array of #GValue<!-- -->s holding the arguments on which to invoke the callback of @closure
963 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
964 // <marshal_data>: additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
965 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) nothrow ClosureMarshal;
968 // The type used for the various notification callbacks which can be registered
969 // on closures.
970 // <data>: data specified when registering the notification callback
971 // <closure>: the #GClosure on which the notification is emitted
972 extern (C) alias void function (void* data, Closure* closure) nothrow ClosureNotify;
974 struct ClosureNotifyData {
975 void* data;
976 ClosureNotify notify;
980 // The connection flags are used to specify the behaviour of a signal's
981 // connection.
982 enum ConnectFlags {
983 AFTER = 1,
984 SWAPPED = 2
987 // The class of an enumeration type holds information about its
988 // possible values.
989 struct EnumClass {
990 TypeClass g_type_class;
991 int minimum, maximum;
992 uint n_values;
993 EnumValue* values;
997 // A structure which contains a single enum value, its name, and its
998 // nickname.
999 struct EnumValue {
1000 int value;
1001 char* value_name, value_nick;
1005 // The class of a flags type holds information about its
1006 // possible values.
1007 struct FlagsClass {
1008 TypeClass g_type_class;
1009 uint mask, n_values;
1010 FlagsValue* values;
1014 // A structure which contains a single flags value, its name, and its
1015 // nickname.
1016 struct FlagsValue {
1017 uint value;
1018 char* value_name, value_nick;
1022 // All the fields in the <structname>GInitiallyUnowned</structname> structure
1023 // are private to the #GInitiallyUnowned implementation and should never be
1024 // accessed directly.
1025 struct InitiallyUnowned /* : Object */ {
1026 TypeInstance g_type_instance;
1027 private uint ref_count;
1028 private GLib2.Data* qdata;
1031 // The class structure for the <structname>GInitiallyUnowned</structname> type.
1032 struct InitiallyUnownedClass {
1033 TypeClass g_type_class;
1034 private GLib2.SList* construct_properties;
1035 // Unintrospectable functionp: constructor() / ()
1036 extern (C) Object* function (Type type, uint n_construct_properties, ObjectConstructParam* construct_properties) nothrow constructor;
1037 extern (C) void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) nothrow set_property;
1038 extern (C) void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) nothrow get_property;
1039 extern (C) void function (Object* object) nothrow dispose;
1040 extern (C) void function (Object* object) nothrow finalize;
1041 extern (C) void function (Object* object, uint n_pspecs, ParamSpec** pspecs) nothrow dispatch_properties_changed;
1042 extern (C) void function (Object* object, ParamSpec* pspec) nothrow notify;
1043 extern (C) void function (Object* object) nothrow constructed;
1044 private size_t flags;
1045 private void*[6] pdummy;
1049 // A callback function used by the type system to initialize a new
1050 // instance of a type. This function initializes all instance members and
1051 // allocates any resources required by it.
1052 // Initialization of a derived instance involves calling all its parent
1053 // types instance initializers, so the class member of the instance
1054 // is altered during its initialization to always point to the class that
1055 // belongs to the type the current initializer was introduced for.
1056 // <instance>: The instance to initialize.
1057 // <g_class>: The class of the type the instance is created for.
1058 extern (C) alias void function (TypeInstance* instance, void* g_class) nothrow InstanceInitFunc;
1061 // A callback function used by the type system to finalize an interface.
1062 // This function should destroy any internal data and release any resources
1063 // allocated by the corresponding GInterfaceInitFunc() function.
1064 // <g_iface>: The interface structure to finalize.
1065 // <iface_data>: The @interface_data supplied via the #GInterfaceInfo structure.
1066 extern (C) alias void function (void* g_iface, void* iface_data) nothrow InterfaceFinalizeFunc;
1069 // A structure that provides information to the type system which is
1070 // used specifically for managing interface types.
1071 struct InterfaceInfo {
1072 InterfaceInitFunc interface_init;
1073 InterfaceFinalizeFunc interface_finalize;
1074 void* interface_data;
1078 // A callback function used by the type system to initialize a new
1079 // interface. This function should initialize all internal data and
1080 // allocate any resources required by the interface.
1081 // <g_iface>: The interface structure to initialize.
1082 // <iface_data>: The @interface_data supplied via the #GInterfaceInfo structure.
1083 extern (C) alias void function (void* g_iface, void* iface_data) nothrow InterfaceInitFunc;
1086 // All the fields in the <structname>GObject</structname> structure are private
1087 // to the #GObject implementation and should never be accessed directly.
1088 struct Object {
1089 TypeInstance g_type_instance;
1090 private uint ref_count;
1091 private GLib2.Data* qdata;
1094 // Unintrospectable constructor: new_valist() / g_object_new_valist()
1095 // Creates a new instance of a #GObject subtype and sets its properties.
1097 // Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY)
1098 // which are not explicitly specified are set to their default values.
1099 // RETURNS: a new instance of @object_type
1100 // <object_type>: the type id of the #GObject subtype to instantiate
1101 // <first_property_name>: the name of the first property
1102 // <var_args>: the value of the first property, followed optionally by more name/value pairs, followed by %NULL
1103 static Object* /*new*/ new_valist()(Type object_type, char* first_property_name, va_list var_args) nothrow {
1104 return g_object_new_valist(object_type, first_property_name, var_args);
1106 alias new_valist!() opCall;
1108 // Creates a new instance of a #GObject subtype and sets its properties.
1110 // Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY)
1111 // which are not explicitly specified are set to their default values.
1113 // @object_type
1114 // RETURNS: a new instance of
1115 // <object_type>: the type id of the #GObject subtype to instantiate
1116 // <n_parameters>: the length of the @parameters array
1117 // <parameters>: an array of #GParameter
1118 static Object* /*new*/ newv()(Type object_type, uint n_parameters, Parameter* parameters) nothrow {
1119 return g_object_newv(object_type, n_parameters, parameters);
1121 alias newv!() opCall;
1122 static size_t compat_control()(size_t what, void* data) nothrow {
1123 return g_object_compat_control(what, data);
1126 // Unintrospectable function: connect() / g_object_connect()
1127 // A convenience function to connect multiple signals at once.
1129 // The signal specs expected by this function have the form
1130 // "modifier::signal_name", where modifier can be one of the following:
1131 // <variablelist>
1132 // <varlistentry>
1133 // <term>signal</term>
1134 // <listitem><para>
1135 // equivalent to <literal>g_signal_connect_data (..., NULL, 0)</literal>
1136 // </para></listitem>
1137 // </varlistentry>
1138 // <varlistentry>
1139 // <term>object_signal</term>
1140 // <term>object-signal</term>
1141 // <listitem><para>
1142 // equivalent to <literal>g_signal_connect_object (..., 0)</literal>
1143 // </para></listitem>
1144 // </varlistentry>
1145 // <varlistentry>
1146 // <term>swapped_signal</term>
1147 // <term>swapped-signal</term>
1148 // <listitem><para>
1149 // equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED)</literal>
1150 // </para></listitem>
1151 // </varlistentry>
1152 // <varlistentry>
1153 // <term>swapped_object_signal</term>
1154 // <term>swapped-object-signal</term>
1155 // <listitem><para>
1156 // equivalent to <literal>g_signal_connect_object (..., G_CONNECT_SWAPPED)</literal>
1157 // </para></listitem>
1158 // </varlistentry>
1159 // <varlistentry>
1160 // <term>signal_after</term>
1161 // <term>signal-after</term>
1162 // <listitem><para>
1163 // equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_AFTER)</literal>
1164 // </para></listitem>
1165 // </varlistentry>
1166 // <varlistentry>
1167 // <term>object_signal_after</term>
1168 // <term>object-signal-after</term>
1169 // <listitem><para>
1170 // equivalent to <literal>g_signal_connect_object (..., G_CONNECT_AFTER)</literal>
1171 // </para></listitem>
1172 // </varlistentry>
1173 // <varlistentry>
1174 // <term>swapped_signal_after</term>
1175 // <term>swapped-signal-after</term>
1176 // <listitem><para>
1177 // equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER)</literal>
1178 // </para></listitem>
1179 // </varlistentry>
1180 // <varlistentry>
1181 // <term>swapped_object_signal_after</term>
1182 // <term>swapped-object-signal-after</term>
1183 // <listitem><para>
1184 // equivalent to <literal>g_signal_connect_object (..., G_CONNECT_SWAPPED | G_CONNECT_AFTER)</literal>
1185 // </para></listitem>
1186 // </varlistentry>
1187 // </variablelist>
1189 // |[
1190 // menu->toplevel = g_object_connect (g_object_new (GTK_TYPE_WINDOW,
1191 // "type", GTK_WINDOW_POPUP,
1192 // "child", menu,
1193 // NULL),
1194 // "signal::event", gtk_menu_window_event, menu,
1195 // "signal::size_request", gtk_menu_window_size_request, menu,
1196 // "signal::destroy", gtk_widget_destroyed, &amp;menu-&gt;toplevel,
1197 // NULL);
1198 // ]|
1199 // RETURNS: @object
1200 // <object>: a #GObject
1201 // <signal_spec>: the spec for the first signal
1202 alias g_object_connect connect; // Variadic
1204 // Unintrospectable function: disconnect() / g_object_disconnect()
1205 // A convenience function to disconnect multiple signals at once.
1207 // The signal specs expected by this function have the form
1208 // "any_signal", which means to disconnect any signal with matching
1209 // callback and data, or "any_signal::signal_name", which only
1210 // disconnects the signal named "signal_name".
1211 // <object>: a #GObject
1212 // <signal_spec>: the spec for the first signal
1213 alias g_object_disconnect disconnect; // Variadic
1215 // Unintrospectable function: get() / g_object_get()
1216 // Gets properties of an object.
1218 // In general, a copy is made of the property contents and the caller
1219 // is responsible for freeing the memory in the appropriate manner for
1220 // the type, for instance by calling g_free() or g_object_unref().
1222 // <example>
1223 // <title>Using g_object_get(<!-- -->)</title>
1224 // An example of using g_object_get() to get the contents
1225 // of three properties - one of type #G_TYPE_INT,
1226 // one of type #G_TYPE_STRING, and one of type #G_TYPE_OBJECT:
1227 // <programlisting>
1228 // gint intval;
1229 // gchar *strval;
1230 // GObject *objval;
1232 // g_object_get (my_object,
1233 // "int-property", &intval,
1234 // "str-property", &strval,
1235 // "obj-property", &objval,
1236 // NULL);
1238 // // Do something with intval, strval, objval
1240 // g_free (strval);
1241 // g_object_unref (objval);
1242 // </programlisting>
1243 // </example>
1244 // <object>: a #GObject
1245 // <first_property_name>: name of the first property to get
1246 alias g_object_get get; // Variadic
1248 // VERSION: 2.4
1249 // Find the #GParamSpec with the given name for an
1250 // interface. Generally, the interface vtable passed in as @g_iface
1251 // will be the default vtable from g_type_default_interface_ref(), or,
1252 // if you know the interface has already been loaded,
1253 // g_type_default_interface_peek().
1256 // interface with the name @property_name, or %NULL if no
1257 // such property exists.
1258 // RETURNS: the #GParamSpec for the property of the
1259 // <g_iface>: any interface vtable for the interface, or the default vtable for the interface
1260 // <property_name>: name of a property to lookup.
1261 static ParamSpec* interface_find_property()(void* g_iface, char* property_name) nothrow {
1262 return g_object_interface_find_property(g_iface, property_name);
1265 // VERSION: 2.4
1266 // Add a property to an interface; this is only useful for interfaces
1267 // that are added to GObject-derived types. Adding a property to an
1268 // interface forces all objects classes with that interface to have a
1269 // compatible property. The compatible property could be a newly
1270 // created #GParamSpec, but normally
1271 // g_object_class_override_property() will be used so that the object
1272 // class only needs to provide an implementation and inherits the
1273 // property description, default value, bounds, and so forth from the
1274 // interface property.
1276 // This function is meant to be called from the interface's default
1277 // vtable initialization function (the @class_init member of
1278 // #GTypeInfo.) It must not be called after after @class_init has
1279 // been called for any object types implementing this interface.
1280 // <g_iface>: any interface vtable for the interface, or the default vtable for the interface.
1281 // <pspec>: the #GParamSpec for the new property
1282 static void interface_install_property()(void* g_iface, ParamSpec* pspec) nothrow {
1283 g_object_interface_install_property(g_iface, pspec);
1286 // VERSION: 2.4
1287 // Lists the properties of an interface.Generally, the interface
1288 // vtable passed in as @g_iface will be the default vtable from
1289 // g_type_default_interface_ref(), or, if you know the interface has
1290 // already been loaded, g_type_default_interface_peek().
1293 // pointer to an array of pointers to #GParamSpec
1294 // structures. The paramspecs are owned by GLib, but the
1295 // array should be freed with g_free() when you are done with
1296 // it.
1297 // RETURNS: a
1298 // <g_iface>: any interface vtable for the interface, or the default vtable for the interface
1299 // <n_properties_p>: location to store number of properties returned.
1300 static ParamSpec** /*new container*/ interface_list_properties()(void* g_iface, /*out*/ uint* n_properties_p) nothrow {
1301 return g_object_interface_list_properties(g_iface, n_properties_p);
1304 // Unintrospectable function: new() / g_object_new()
1305 // Creates a new instance of a #GObject subtype and sets its properties.
1307 // Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY)
1308 // which are not explicitly specified are set to their default values.
1309 // RETURNS: a new instance of @object_type
1310 // <object_type>: the type id of the #GObject subtype to instantiate
1311 // <first_property_name>: the name of the first property
1312 alias g_object_new new_; // Variadic
1314 // Unintrospectable function: set() / g_object_set()
1315 // Sets properties on an object.
1316 // <object>: a #GObject
1317 // <first_property_name>: name of the first property to set
1318 alias g_object_set set; // Variadic
1320 // Unintrospectable method: add_toggle_ref() / g_object_add_toggle_ref()
1321 // VERSION: 2.8
1322 // Increases the reference count of the object by one and sets a
1323 // callback to be called when all other references to the object are
1324 // dropped, or when this is already the last reference to the object
1325 // and another reference is established.
1327 // This functionality is intended for binding @object to a proxy
1328 // object managed by another memory manager. This is done with two
1329 // paired references: the strong reference added by
1330 // g_object_add_toggle_ref() and a reverse reference to the proxy
1331 // object which is either a strong reference or weak reference.
1333 // The setup is that when there are no other references to @object,
1334 // only a weak reference is held in the reverse direction from @object
1335 // to the proxy object, but when there are other references held to
1336 // @object, a strong reference is held. The @notify callback is called
1337 // when the reference from @object to the proxy object should be
1338 // <firstterm>toggled</firstterm> from strong to weak (@is_last_ref
1339 // true) or weak to strong (@is_last_ref false).
1341 // Since a (normal) reference must be held to the object before
1342 // calling g_object_add_toggle_ref(), the initial state of the reverse
1343 // link is always strong.
1345 // Multiple toggle references may be added to the same gobject,
1346 // however if there are multiple toggle references to an object, none
1347 // of them will ever be notified until all but one are removed. For
1348 // this reason, you should only ever use a toggle reference if there
1349 // is important state in the proxy object.
1350 // <notify>: a function to call when this reference is the last reference to the object, or is no longer the last reference.
1351 // <data>: data to pass to @notify
1352 void add_toggle_ref()(ToggleNotify notify, void* data) nothrow {
1353 g_object_add_toggle_ref(&this, notify, data);
1356 // Unintrospectable method: add_weak_pointer() / g_object_add_weak_pointer()
1357 // Adds a weak reference from weak_pointer to @object to indicate that
1358 // the pointer located at @weak_pointer_location is only valid during
1359 // the lifetime of @object. When the @object is finalized,
1360 // @weak_pointer will be set to %NULL.
1362 // Note that as with g_object_weak_ref(), the weak references created by
1363 // this method are not thread-safe: they cannot safely be used in one
1364 // thread if the object's last g_object_unref() might happen in another
1365 // thread. Use #GWeakRef if thread-safety is required.
1366 // <weak_pointer_location>: The memory address of a pointer.
1367 void add_weak_pointer()(/*inout*/ void** weak_pointer_location) nothrow {
1368 g_object_add_weak_pointer(&this, weak_pointer_location);
1371 // VERSION: 2.26
1372 // Creates a binding between @source_property on @source and @target_property
1373 // on @target. Whenever the @source_property is changed the @target_property is
1374 // updated using the same value. For instance:
1376 // |[
1377 // g_object_bind_property (action, "active", widget, "sensitive", 0);
1378 // ]|
1380 // Will result in the "sensitive" property of the widget #GObject instance to be
1381 // updated with the same value of the "active" property of the action #GObject
1382 // instance.
1384 // If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
1385 // if @target_property on @target changes then the @source_property on @source
1386 // will be updated as well.
1388 // The binding will automatically be removed when either the @source or the
1389 // @target instances are finalized. To remove the binding without affecting the
1390 // @source and the @target you can just call g_object_unref() on the returned
1391 // #GBinding instance.
1393 // A #GObject can have multiple bindings.
1395 // binding between the two #GObject instances. The binding is released
1396 // whenever the #GBinding reference count reaches zero.
1397 // RETURNS: the #GBinding instance representing the
1398 // <source_property>: the property on @source to bind
1399 // <target>: the target #GObject
1400 // <target_property>: the property on @target to bind
1401 // <flags>: flags to pass to #GBinding
1402 Binding* bind_property()(char* source_property, Object* target, char* target_property, BindingFlags flags) nothrow {
1403 return g_object_bind_property(&this, source_property, target, target_property, flags);
1406 // VERSION: 2.26
1407 // Complete version of g_object_bind_property().
1409 // Creates a binding between @source_property on @source and @target_property
1410 // on @target, allowing you to set the transformation functions to be used by
1411 // the binding.
1413 // If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
1414 // if @target_property on @target changes then the @source_property on @source
1415 // will be updated as well. The @transform_from function is only used in case
1416 // of bidirectional bindings, otherwise it will be ignored
1418 // The binding will automatically be removed when either the @source or the
1419 // @target instances are finalized. To remove the binding without affecting the
1420 // @source and the @target you can just call g_object_unref() on the returned
1421 // #GBinding instance.
1423 // A #GObject can have multiple bindings.
1425 // <note>The same @user_data parameter will be used for both @transform_to
1426 // and @transform_from transformation functions; the @notify function will
1427 // be called once, when the binding is removed. If you need different data
1428 // for each transformation function, please use
1429 // g_object_bind_property_with_closures() instead.</note>
1431 // binding between the two #GObject instances. The binding is released
1432 // whenever the #GBinding reference count reaches zero.
1433 // RETURNS: the #GBinding instance representing the
1434 // <source_property>: the property on @source to bind
1435 // <target>: the target #GObject
1436 // <target_property>: the property on @target to bind
1437 // <flags>: flags to pass to #GBinding
1438 // <transform_to>: the transformation function from the @source to the @target, or %NULL to use the default
1439 // <transform_from>: the transformation function from the @target to the @source, or %NULL to use the default
1440 // <user_data>: custom data to be passed to the transformation functions, or %NULL
1441 // <notify>: function to be called when disposing the binding, to free the resources used by the transformation functions
1442 Binding* bind_property_full()(char* source_property, Object* target, char* target_property, BindingFlags flags, BindingTransformFunc transform_to, BindingTransformFunc transform_from, void* user_data, GLib2.DestroyNotify notify) nothrow {
1443 return g_object_bind_property_full(&this, source_property, target, target_property, flags, transform_to, transform_from, user_data, notify);
1446 // VERSION: 2.26
1447 // Creates a binding between @source_property on @source and @target_property
1448 // on @target, allowing you to set the transformation functions to be used by
1449 // the binding.
1451 // This function is the language bindings friendly version of
1452 // g_object_bind_property_full(), using #GClosure<!-- -->s instead of
1453 // function pointers.
1456 // binding between the two #GObject instances. The binding is released
1457 // whenever the #GBinding reference count reaches zero.
1458 // RETURNS: the #GBinding instance representing the
1459 // <source_property>: the property on @source to bind
1460 // <target>: the target #GObject
1461 // <target_property>: the property on @target to bind
1462 // <flags>: flags to pass to #GBinding
1463 // <transform_to>: a #GClosure wrapping the transformation function from the @source to the @target, or %NULL to use the default
1464 // <transform_from>: a #GClosure wrapping the transformation function from the @target to the @source, or %NULL to use the default
1465 Binding* bind_property_with_closures()(char* source_property, Object* target, char* target_property, BindingFlags flags, Closure* transform_to, Closure* transform_from) nothrow {
1466 return g_object_bind_property_with_closures(&this, source_property, target, target_property, flags, transform_to, transform_from);
1469 // VERSION: 2.10
1470 // This function is intended for #GObject implementations to re-enforce a
1471 // <link linkend="floating-ref">floating</link> object reference.
1472 // Doing this is seldom required: all
1473 // #GInitiallyUnowned<!-- -->s are created with a floating reference which
1474 // usually just needs to be sunken by calling g_object_ref_sink().
1475 void force_floating()() nothrow {
1476 g_object_force_floating(&this);
1479 // Increases the freeze count on @object. If the freeze count is
1480 // non-zero, the emission of "notify" signals on @object is
1481 // stopped. The signals are queued until the freeze count is decreased
1482 // to zero.
1484 // This is necessary for accessors that modify multiple properties to prevent
1485 // premature notification while the object is still being modified.
1486 void freeze_notify()() nothrow {
1487 g_object_freeze_notify(&this);
1490 // Gets a named field from the objects table of associations (see g_object_set_data()).
1491 // RETURNS: the data if found, or %NULL if no such data exists.
1492 // <key>: name of the key for that association
1493 void* get_data()(char* key) nothrow {
1494 return g_object_get_data(&this, key);
1497 // Gets a property of an object. @value must have been initialized to the
1498 // expected type of the property (or a type to which the expected type can be
1499 // transformed) using g_value_init().
1501 // In general, a copy is made of the property contents and the caller is
1502 // responsible for freeing the memory by calling g_value_unset().
1504 // Note that g_object_get_property() is really intended for language
1505 // bindings, g_object_get() is much more convenient for C programming.
1506 // <property_name>: the name of the property to get
1507 // <value>: return location for the property value
1508 void get_property()(char* property_name, Value* value) nothrow {
1509 g_object_get_property(&this, property_name, value);
1512 // This function gets back user data pointers stored via
1513 // g_object_set_qdata().
1514 // RETURNS: The user data pointer set, or %NULL
1515 // <quark>: A #GQuark, naming the user data pointer
1516 void* get_qdata()(GLib2.Quark quark) nothrow {
1517 return g_object_get_qdata(&this, quark);
1520 // Unintrospectable method: get_valist() / g_object_get_valist()
1521 // Gets properties of an object.
1523 // In general, a copy is made of the property contents and the caller
1524 // is responsible for freeing the memory in the appropriate manner for
1525 // the type, for instance by calling g_free() or g_object_unref().
1527 // See g_object_get().
1528 // <first_property_name>: name of the first property to get
1529 // <var_args>: return location for the first property, followed optionally by more name/return location pairs, followed by %NULL
1530 void get_valist()(char* first_property_name, va_list var_args) nothrow {
1531 g_object_get_valist(&this, first_property_name, var_args);
1534 // VERSION: 2.10
1535 // Checks whether @object has a <link linkend="floating-ref">floating</link>
1536 // reference.
1537 // RETURNS: %TRUE if @object has a floating reference
1538 int is_floating()() nothrow {
1539 return g_object_is_floating(&this);
1542 // Emits a "notify" signal for the property @property_name on @object.
1544 // When possible, eg. when signaling a property change from within the class
1545 // that registered the property, you should use g_object_notify_by_pspec()
1546 // instead.
1547 // <property_name>: the name of a property installed on the class of @object.
1548 void notify()(char* property_name) nothrow {
1549 g_object_notify(&this, property_name);
1552 // VERSION: 2.26
1553 // Emits a "notify" signal for the property specified by @pspec on @object.
1555 // This function omits the property name lookup, hence it is faster than
1556 // g_object_notify().
1558 // One way to avoid using g_object_notify() from within the
1559 // class that registered the properties, and using g_object_notify_by_pspec()
1560 // instead, is to store the GParamSpec used with
1561 // g_object_class_install_property() inside a static array, e.g.:
1563 // |[
1564 // enum
1565 // {
1566 // PROP_0,
1567 // PROP_FOO,
1568 // PROP_LAST
1569 // };
1571 // static GParamSpec *properties[PROP_LAST];
1573 // static void
1574 // my_object_class_init (MyObjectClass *klass)
1575 // {
1576 // properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
1577 // 0, 100,
1578 // 50,
1579 // G_PARAM_READWRITE);
1580 // g_object_class_install_property (gobject_class,
1581 // PROP_FOO,
1582 // properties[PROP_FOO]);
1583 // }
1584 // ]|
1586 // and then notify a change on the "foo" property with:
1588 // |[
1589 // g_object_notify_by_pspec (self, properties[PROP_FOO]);
1590 // ]|
1591 // <pspec>: the #GParamSpec of a property installed on the class of @object.
1592 void notify_by_pspec()(ParamSpec* pspec) nothrow {
1593 g_object_notify_by_pspec(&this, pspec);
1596 // Increases the reference count of @object.
1597 // RETURNS: the same @object
1598 Object* ref_()() nothrow {
1599 return g_object_ref(&this);
1602 // VERSION: 2.10
1603 // Increase the reference count of @object, and possibly remove the
1604 // <link linkend="floating-ref">floating</link> reference, if @object
1605 // has a floating reference.
1607 // In other words, if the object is floating, then this call "assumes
1608 // ownership" of the floating reference, converting it to a normal
1609 // reference by clearing the floating flag while leaving the reference
1610 // count unchanged. If the object is not floating, then this call
1611 // adds a new normal reference increasing the reference count by one.
1612 // RETURNS: @object
1613 Object* ref_sink()() nothrow {
1614 return g_object_ref_sink(&this);
1617 // Unintrospectable method: remove_toggle_ref() / g_object_remove_toggle_ref()
1618 // VERSION: 2.8
1619 // Removes a reference added with g_object_add_toggle_ref(). The
1620 // reference count of the object is decreased by one.
1621 // <notify>: a function to call when this reference is the last reference to the object, or is no longer the last reference.
1622 // <data>: data to pass to @notify
1623 void remove_toggle_ref()(ToggleNotify notify, void* data) nothrow {
1624 g_object_remove_toggle_ref(&this, notify, data);
1627 // Unintrospectable method: remove_weak_pointer() / g_object_remove_weak_pointer()
1628 // Removes a weak reference from @object that was previously added
1629 // using g_object_add_weak_pointer(). The @weak_pointer_location has
1630 // to match the one used with g_object_add_weak_pointer().
1631 // <weak_pointer_location>: The memory address of a pointer.
1632 void remove_weak_pointer()(/*inout*/ void** weak_pointer_location) nothrow {
1633 g_object_remove_weak_pointer(&this, weak_pointer_location);
1636 // Releases all references to other objects. This can be used to break
1637 // reference cycles.
1639 // This functions should only be called from object system implementations.
1640 void run_dispose()() nothrow {
1641 g_object_run_dispose(&this);
1644 // Each object carries around a table of associations from
1645 // strings to pointers. This function lets you set an association.
1647 // If the object already had an association with that name,
1648 // the old association will be destroyed.
1649 // <key>: name of the key
1650 // <data>: data to associate with that key
1651 void set_data()(char* key, void* data) nothrow {
1652 g_object_set_data(&this, key, data);
1655 // Unintrospectable method: set_data_full() / g_object_set_data_full()
1656 // Like g_object_set_data() except it adds notification
1657 // for when the association is destroyed, either by setting it
1658 // to a different value or when the object is destroyed.
1660 // Note that the @destroy callback is not called if @data is %NULL.
1661 // <key>: name of the key
1662 // <data>: data to associate with that key
1663 // <destroy>: function to call when the association is destroyed
1664 void set_data_full()(char* key, void* data, GLib2.DestroyNotify destroy) nothrow {
1665 g_object_set_data_full(&this, key, data, destroy);
1668 // Sets a property on an object.
1669 // <property_name>: the name of the property to set
1670 // <value>: the value
1671 void set_property()(char* property_name, Value* value) nothrow {
1672 g_object_set_property(&this, property_name, value);
1675 // Unintrospectable method: set_qdata() / g_object_set_qdata()
1676 // This sets an opaque, named pointer on an object.
1677 // The name is specified through a #GQuark (retrived e.g. via
1678 // g_quark_from_static_string()), and the pointer
1679 // can be gotten back from the @object with g_object_get_qdata()
1680 // until the @object is finalized.
1681 // Setting a previously set user data pointer, overrides (frees)
1682 // the old pointer set, using #NULL as pointer essentially
1683 // removes the data stored.
1684 // <quark>: A #GQuark, naming the user data pointer
1685 // <data>: An opaque user data pointer
1686 void set_qdata()(GLib2.Quark quark, void* data) nothrow {
1687 g_object_set_qdata(&this, quark, data);
1690 // Unintrospectable method: set_qdata_full() / g_object_set_qdata_full()
1691 // This function works like g_object_set_qdata(), but in addition,
1692 // a void (*destroy) (gpointer) function may be specified which is
1693 // called with @data as argument when the @object is finalized, or
1694 // the data is being overwritten by a call to g_object_set_qdata()
1695 // with the same @quark.
1696 // <quark>: A #GQuark, naming the user data pointer
1697 // <data>: An opaque user data pointer
1698 // <destroy>: Function to invoke with @data as argument, when @data needs to be freed
1699 void set_qdata_full()(GLib2.Quark quark, void* data, GLib2.DestroyNotify destroy) nothrow {
1700 g_object_set_qdata_full(&this, quark, data, destroy);
1703 // Unintrospectable method: set_valist() / g_object_set_valist()
1704 // Sets properties on an object.
1705 // <first_property_name>: name of the first property to set
1706 // <var_args>: value for the first property, followed optionally by more name/value pairs, followed by %NULL
1707 void set_valist()(char* first_property_name, va_list var_args) nothrow {
1708 g_object_set_valist(&this, first_property_name, var_args);
1711 // Remove a specified datum from the object's data associations,
1712 // without invoking the association's destroy handler.
1713 // RETURNS: the data if found, or %NULL if no such data exists.
1714 // <key>: name of the key
1715 void* /*new*/ steal_data()(char* key) nothrow {
1716 return g_object_steal_data(&this, key);
1719 // This function gets back user data pointers stored via
1720 // g_object_set_qdata() and removes the @data from object
1721 // without invoking its destroy() function (if any was
1722 // set).
1723 // Usually, calling this function is only required to update
1724 // user data pointers with a destroy notifier, for example:
1725 // |[
1726 // void
1727 // object_add_to_user_list (GObject *object,
1728 // const gchar *new_string)
1729 // {
1730 // // the quark, naming the object data
1731 // GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
1732 // // retrive the old string list
1733 // GList *list = g_object_steal_qdata (object, quark_string_list);
1735 // // prepend new string
1736 // list = g_list_prepend (list, g_strdup (new_string));
1737 // // this changed 'list', so we need to set it again
1738 // g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
1739 // }
1740 // static void
1741 // free_string_list (gpointer data)
1742 // {
1743 // GList *node, *list = data;
1745 // for (node = list; node; node = node->next)
1746 // g_free (node->data);
1747 // g_list_free (list);
1748 // }
1749 // ]|
1750 // Using g_object_get_qdata() in the above example, instead of
1751 // g_object_steal_qdata() would have left the destroy function set,
1752 // and thus the partial string list would have been freed upon
1753 // g_object_set_qdata_full().
1754 // RETURNS: The user data pointer set, or %NULL
1755 // <quark>: A #GQuark, naming the user data pointer
1756 void* /*new*/ steal_qdata()(GLib2.Quark quark) nothrow {
1757 return g_object_steal_qdata(&this, quark);
1760 // Reverts the effect of a previous call to
1761 // g_object_freeze_notify(). The freeze count is decreased on @object
1762 // and when it reaches zero, all queued "notify" signals are emitted.
1764 // It is an error to call this function when the freeze count is zero.
1765 void thaw_notify()() nothrow {
1766 g_object_thaw_notify(&this);
1769 // Decreases the reference count of @object. When its reference count
1770 // drops to 0, the object is finalized (i.e. its memory is freed).
1771 void unref()() nothrow {
1772 g_object_unref(&this);
1775 // This function essentially limits the life time of the @closure to
1776 // the life time of the object. That is, when the object is finalized,
1777 // the @closure is invalidated by calling g_closure_invalidate() on
1778 // it, in order to prevent invocations of the closure with a finalized
1779 // (nonexisting) object. Also, g_object_ref() and g_object_unref() are
1780 // added as marshal guards to the @closure, to ensure that an extra
1781 // reference count is held on @object during invocation of the
1782 // @closure. Usually, this function will be called on closures that
1783 // use this @object as closure data.
1784 // <closure>: GClosure to watch
1785 void watch_closure()(Closure* closure) nothrow {
1786 g_object_watch_closure(&this, closure);
1789 // Unintrospectable method: weak_ref() / g_object_weak_ref()
1790 // Adds a weak reference callback to an object. Weak references are
1791 // used for notification when an object is finalized. They are called
1792 // "weak references" because they allow you to safely hold a pointer
1793 // to an object without calling g_object_ref() (g_object_ref() adds a
1794 // strong reference, that is, forces the object to stay alive).
1796 // Note that the weak references created by this method are not
1797 // thread-safe: they cannot safely be used in one thread if the
1798 // object's last g_object_unref() might happen in another thread.
1799 // Use #GWeakRef if thread-safety is required.
1800 // <notify>: callback to invoke before the object is freed
1801 // <data>: extra data to pass to notify
1802 void weak_ref()(WeakNotify notify, void* data) nothrow {
1803 g_object_weak_ref(&this, notify, data);
1806 // Unintrospectable method: weak_unref() / g_object_weak_unref()
1807 // Removes a weak reference callback to an object.
1808 // <notify>: callback to search for
1809 // <data>: data to search for
1810 void weak_unref()(WeakNotify notify, void* data) nothrow {
1811 g_object_weak_unref(&this, notify, data);
1814 // The notify signal is emitted on an object when one of its
1815 // properties has been changed. Note that getting this signal
1816 // doesn't guarantee that the value of the property has actually
1817 // changed, it may also be emitted when the setter for the property
1818 // is called to reinstate the previous value.
1820 // This signal is typically used to obtain change notification for a
1821 // single property, by specifying the property name as a detail in the
1822 // g_signal_connect() call, like this:
1823 // |[
1824 // g_signal_connect (text_view->buffer, "notify::paste-target-list",
1825 // G_CALLBACK (gtk_text_view_target_list_notify),
1826 // text_view)
1827 // ]|
1828 // It is important to note that you must use
1829 // <link linkend="canonical-parameter-name">canonical</link> parameter names as
1830 // detail strings for the notify signal.
1831 // <pspec>: the #GParamSpec of the property which changed.
1832 extern (C) alias static void function (Object* this_, ParamSpec* pspec, void* user_data=null) nothrow signal_notify;
1834 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1835 return super_.signal_connect!name(cb, data, cf);
1838 ulong signal_connect(string name:"notify", CB:signal_notify)
1839 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
1840 if (is(typeof(cb)==signal_notify)||_ttmm!(CB, signal_notify)()) {
1841 return signal_connect_data!()(&this, cast(char*)"notify",
1842 cast(GObject2.Callback)cb, data, null, cf);
1847 // The class structure for the <structname>GObject</structname> type.
1849 // <example>
1850 // <title>Implementing singletons using a constructor</title>
1851 // <programlisting>
1852 // static MySingleton *the_singleton = NULL;
1854 // static GObject*
1855 // my_singleton_constructor (GType type,
1856 // guint n_construct_params,
1857 // GObjectConstructParam *construct_params)
1858 // {
1859 // GObject *object;
1861 // if (!the_singleton)
1862 // {
1863 // object = G_OBJECT_CLASS (parent_class)->constructor (type,
1864 // n_construct_params,
1865 // construct_params);
1866 // the_singleton = MY_SINGLETON (object);
1867 // }
1868 // else
1869 // object = g_object_ref (G_OBJECT (the_singleton));
1871 // return object;
1872 // }
1873 // </programlisting></example>
1874 struct ObjectClass {
1875 TypeClass g_type_class;
1876 private GLib2.SList* construct_properties;
1877 // Unintrospectable functionp: constructor() / ()
1878 extern (C) Object* function (Type type, uint n_construct_properties, ObjectConstructParam* construct_properties) nothrow constructor;
1879 extern (C) void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) nothrow set_property;
1880 extern (C) void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) nothrow get_property;
1881 extern (C) void function (Object* object) nothrow dispose;
1882 extern (C) void function (Object* object) nothrow finalize;
1883 extern (C) void function (Object* object, uint n_pspecs, ParamSpec** pspecs) nothrow dispatch_properties_changed;
1884 extern (C) void function (Object* object, ParamSpec* pspec) nothrow notify;
1885 extern (C) void function (Object* object) nothrow constructed;
1886 private size_t flags;
1887 private void*[6] pdummy;
1890 // Looks up the #GParamSpec for a property of a class.
1892 // %NULL if the class doesn't have a property of that name
1893 // RETURNS: the #GParamSpec for the property, or
1894 // <property_name>: the name of the property to look up
1895 ParamSpec* find_property()(char* property_name) nothrow {
1896 return g_object_class_find_property(&this, property_name);
1899 // VERSION: 2.26
1900 // Installs new properties from an array of #GParamSpec<!-- -->s. This is
1901 // usually done in the class initializer.
1903 // The property id of each property is the index of each #GParamSpec in
1904 // the @pspecs array.
1906 // The property id of 0 is treated specially by #GObject and it should not
1907 // be used to store a #GParamSpec.
1909 // This function should be used if you plan to use a static array of
1910 // #GParamSpec<!-- -->s and g_object_notify_by_pspec(). For instance, this
1911 // class initialization:
1913 // |[
1914 // enum {
1915 // PROP_0, PROP_FOO, PROP_BAR, N_PROPERTIES
1916 // };
1918 // static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, };
1920 // static void
1921 // my_object_class_init (MyObjectClass *klass)
1922 // {
1923 // GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
1925 // obj_properties[PROP_FOO] =
1926 // g_param_spec_int ("foo", "Foo", "Foo",
1927 // -1, G_MAXINT,
1928 // 0,
1929 // G_PARAM_READWRITE);
1931 // obj_properties[PROP_BAR] =
1932 // g_param_spec_string ("bar", "Bar", "Bar",
1933 // NULL,
1934 // G_PARAM_READWRITE);
1936 // gobject_class->set_property = my_object_set_property;
1937 // gobject_class->get_property = my_object_get_property;
1938 // g_object_class_install_properties (gobject_class,
1939 // N_PROPERTIES,
1940 // obj_properties);
1941 // }
1942 // ]|
1944 // allows calling g_object_notify_by_pspec() to notify of property changes:
1946 // |[
1947 // void
1948 // my_object_set_foo (MyObject *self, gint foo)
1949 // {
1950 // if (self->foo != foo)
1951 // {
1952 // self->foo = foo;
1953 // g_object_notify_by_pspec (G_OBJECT (self), obj_properties[PROP_FOO]);
1954 // }
1955 // }
1956 // ]|
1957 // <n_pspecs>: the length of the #GParamSpec<!-- -->s array
1958 // <pspecs>: the #GParamSpec<!-- -->s array defining the new properties
1959 void install_properties()(uint n_pspecs, ParamSpec** pspecs) nothrow {
1960 g_object_class_install_properties(&this, n_pspecs, pspecs);
1963 // Installs a new property. This is usually done in the class initializer.
1965 // Note that it is possible to redefine a property in a derived class,
1966 // by installing a property with the same name. This can be useful at times,
1967 // e.g. to change the range of allowed values or the default value.
1968 // <property_id>: the id for the new property
1969 // <pspec>: the #GParamSpec for the new property
1970 void install_property()(uint property_id, ParamSpec* pspec) nothrow {
1971 g_object_class_install_property(&this, property_id, pspec);
1974 // Get an array of #GParamSpec* for all properties of a class.
1976 // #GParamSpec* which should be freed after use
1977 // RETURNS: an array of
1978 // <n_properties>: return location for the length of the returned array
1979 ParamSpec** /*new container*/ list_properties()(/*out*/ uint* n_properties) nothrow {
1980 return g_object_class_list_properties(&this, n_properties);
1983 // VERSION: 2.4
1984 // Registers @property_id as referring to a property with the
1985 // name @name in a parent class or in an interface implemented
1986 // by @oclass. This allows this class to <firstterm>override</firstterm>
1987 // a property implementation in a parent class or to provide
1988 // the implementation of a property from an interface.
1990 // <note>
1991 // Internally, overriding is implemented by creating a property of type
1992 // #GParamSpecOverride; generally operations that query the properties of
1993 // the object class, such as g_object_class_find_property() or
1994 // g_object_class_list_properties() will return the overridden
1995 // property. However, in one case, the @construct_properties argument of
1996 // the @constructor virtual function, the #GParamSpecOverride is passed
1997 // instead, so that the @param_id field of the #GParamSpec will be
1998 // correct. For virtually all uses, this makes no difference. If you
1999 // need to get the overridden property, you can call
2000 // g_param_spec_get_redirect_target().
2001 // </note>
2002 // <property_id>: the new property ID
2003 // <name>: the name of a property registered in a parent class or in an interface of this class.
2004 void override_property()(uint property_id, char* name) nothrow {
2005 g_object_class_override_property(&this, property_id, name);
2010 // The <structname>GObjectConstructParam</structname> struct is an auxiliary
2011 // structure used to hand #GParamSpec/#GValue pairs to the @constructor of
2012 // a #GObjectClass.
2013 struct ObjectConstructParam {
2014 ParamSpec* pspec;
2015 Value* value;
2019 // The type of the @finalize function of #GObjectClass.
2020 // <object>: the #GObject being finalized
2021 extern (C) alias void function (Object* object) nothrow ObjectFinalizeFunc;
2024 // The type of the @get_property function of #GObjectClass.
2025 // <object>: a #GObject
2026 // <property_id>: the numeric id under which the property was registered with g_object_class_install_property().
2027 // <value>: a #GValue to return the property value in
2028 // <pspec>: the #GParamSpec describing the property
2029 extern (C) alias void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) nothrow ObjectGetPropertyFunc;
2032 // The type of the @set_property function of #GObjectClass.
2033 // <object>: a #GObject
2034 // <property_id>: the numeric id under which the property was registered with g_object_class_install_property().
2035 // <value>: the new value for the property
2036 // <pspec>: the #GParamSpec describing the property
2037 extern (C) alias void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) nothrow ObjectSetPropertyFunc;
2039 enum int PARAM_MASK = 255;
2040 enum int PARAM_READWRITE = 0;
2041 enum int PARAM_STATIC_STRINGS = 0;
2042 enum int PARAM_USER_SHIFT = 8;
2044 // Through the #GParamFlags flag values, certain aspects of parameters
2045 // can be configured.
2046 enum ParamFlags {
2047 READABLE = 1,
2048 WRITABLE = 2,
2049 CONSTRUCT = 4,
2050 CONSTRUCT_ONLY = 8,
2051 LAX_VALIDATION = 16,
2052 STATIC_NAME = 32,
2053 PRIVATE = 32,
2054 STATIC_NICK = 64,
2055 STATIC_BLURB = 128,
2056 DEPRECATED = cast(uint)2147483648
2059 // #GParamSpec is an object structure that encapsulates the metadata
2060 // required to specify parameters, such as e.g. #GObject properties.
2062 // <para id="canonical-parameter-name">
2063 // Parameter names need to start with a letter (a-z or A-Z). Subsequent
2064 // characters can be letters, numbers or a '-'.
2065 // All other characters are replaced by a '-' during construction.
2066 // The result of this replacement is called the canonical name of the
2067 // parameter.
2068 // </para>
2069 struct ParamSpec {
2070 TypeInstance g_type_instance;
2071 char* name;
2072 ParamFlags flags;
2073 Type value_type, owner_type;
2074 private char* _nick, _blurb;
2075 private GLib2.Data* qdata;
2076 private uint ref_count, param_id;
2079 // Unintrospectable function: internal() / g_param_spec_internal()
2080 // Creates a new #GParamSpec instance.
2082 // A property name consists of segments consisting of ASCII letters and
2083 // digits, separated by either the '-' or '_' character. The first
2084 // character of a property name must be a letter. Names which violate these
2085 // rules lead to undefined behaviour.
2087 // When creating and looking up a #GParamSpec, either separator can be
2088 // used, but they cannot be mixed. Using '-' is considerably more
2089 // efficient and in fact required when using property names as detail
2090 // strings for signals.
2092 // Beyond the name, #GParamSpec<!-- -->s have two more descriptive
2093 // strings associated with them, the @nick, which should be suitable
2094 // for use as a label for the property in a property editor, and the
2095 // @blurb, which should be a somewhat longer description, suitable for
2096 // e.g. a tooltip. The @nick and @blurb should ideally be localized.
2097 // RETURNS: a newly allocated #GParamSpec instance
2098 // <param_type>: the #GType for the property; must be derived from #G_TYPE_PARAM
2099 // <name>: the canonical name of the property
2100 // <nick>: the nickname of the property
2101 // <blurb>: a short description of the property
2102 // <flags>: a combination of #GParamFlags
2103 static void* internal()(Type param_type, char* name, char* nick, char* blurb, ParamFlags flags) nothrow {
2104 return g_param_spec_internal(param_type, name, nick, blurb, flags);
2107 // Get the short description of a #GParamSpec.
2108 // RETURNS: the short description of @pspec.
2109 char* get_blurb()() nothrow {
2110 return g_param_spec_get_blurb(&this);
2113 // Get the name of a #GParamSpec.
2115 // The name is always an "interned" string (as per g_intern_string()).
2116 // This allows for pointer-value comparisons.
2117 // RETURNS: the name of @pspec.
2118 char* get_name()() nothrow {
2119 return g_param_spec_get_name(&this);
2122 // Get the nickname of a #GParamSpec.
2123 // RETURNS: the nickname of @pspec.
2124 char* get_nick()() nothrow {
2125 return g_param_spec_get_nick(&this);
2128 // Gets back user data pointers stored via g_param_spec_set_qdata().
2129 // RETURNS: the user data pointer set, or %NULL
2130 // <quark>: a #GQuark, naming the user data pointer
2131 void* get_qdata()(GLib2.Quark quark) nothrow {
2132 return g_param_spec_get_qdata(&this, quark);
2135 // VERSION: 2.4
2136 // If the paramspec redirects operations to another paramspec,
2137 // returns that paramspec. Redirect is used typically for
2138 // providing a new implementation of a property in a derived
2139 // type while preserving all the properties from the parent
2140 // type. Redirection is established by creating a property
2141 // of type #GParamSpecOverride. See g_object_class_override_property()
2142 // for an example of the use of this capability.
2145 // paramspec should be redirected, or %NULL if none.
2146 // RETURNS: paramspec to which requests on this
2147 ParamSpec* get_redirect_target()() nothrow {
2148 return g_param_spec_get_redirect_target(&this);
2151 // Unintrospectable method: ref() / g_param_spec_ref()
2152 // Increments the reference count of @pspec.
2153 // RETURNS: the #GParamSpec that was passed into this function
2154 ParamSpec* ref_()() nothrow {
2155 return g_param_spec_ref(&this);
2158 // Unintrospectable method: ref_sink() / g_param_spec_ref_sink()
2159 // VERSION: 2.10
2160 // Convenience function to ref and sink a #GParamSpec.
2161 // RETURNS: the #GParamSpec that was passed into this function
2162 ParamSpec* ref_sink()() nothrow {
2163 return g_param_spec_ref_sink(&this);
2166 // Sets an opaque, named pointer on a #GParamSpec. The name is
2167 // specified through a #GQuark (retrieved e.g. via
2168 // g_quark_from_static_string()), and the pointer can be gotten back
2169 // from the @pspec with g_param_spec_get_qdata(). Setting a
2170 // previously set user data pointer, overrides (frees) the old pointer
2171 // set, using %NULL as pointer essentially removes the data stored.
2172 // <quark>: a #GQuark, naming the user data pointer
2173 // <data>: an opaque user data pointer
2174 void set_qdata()(GLib2.Quark quark, void* data) nothrow {
2175 g_param_spec_set_qdata(&this, quark, data);
2178 // Unintrospectable method: set_qdata_full() / g_param_spec_set_qdata_full()
2179 // This function works like g_param_spec_set_qdata(), but in addition,
2180 // a <literal>void (*destroy) (gpointer)</literal> function may be
2181 // specified which is called with @data as argument when the @pspec is
2182 // finalized, or the data is being overwritten by a call to
2183 // g_param_spec_set_qdata() with the same @quark.
2184 // <quark>: a #GQuark, naming the user data pointer
2185 // <data>: an opaque user data pointer
2186 // <destroy>: function to invoke with @data as argument, when @data needs to be freed
2187 void set_qdata_full()(GLib2.Quark quark, void* data, GLib2.DestroyNotify destroy) nothrow {
2188 g_param_spec_set_qdata_full(&this, quark, data, destroy);
2191 // The initial reference count of a newly created #GParamSpec is 1,
2192 // even though no one has explicitly called g_param_spec_ref() on it
2193 // yet. So the initial reference count is flagged as "floating", until
2194 // someone calls <literal>g_param_spec_ref (pspec); g_param_spec_sink
2195 // (pspec);</literal> in sequence on it, taking over the initial
2196 // reference count (thus ending up with a @pspec that has a reference
2197 // count of 1 still, but is not flagged "floating" anymore).
2198 void sink()() nothrow {
2199 g_param_spec_sink(&this);
2202 // Gets back user data pointers stored via g_param_spec_set_qdata()
2203 // and removes the @data from @pspec without invoking its destroy()
2204 // function (if any was set). Usually, calling this function is only
2205 // required to update user data pointers with a destroy notifier.
2206 // RETURNS: the user data pointer set, or %NULL
2207 // <quark>: a #GQuark, naming the user data pointer
2208 void* steal_qdata()(GLib2.Quark quark) nothrow {
2209 return g_param_spec_steal_qdata(&this, quark);
2212 // Unintrospectable method: unref() / g_param_spec_unref()
2213 // Decrements the reference count of a @pspec.
2214 void unref()() nothrow {
2215 g_param_spec_unref(&this);
2219 // A #GParamSpec derived structure that contains the meta data for boolean properties.
2220 struct ParamSpecBoolean /* : ParamSpec */ {
2221 alias parent_instance this;
2222 alias parent_instance super_;
2223 alias parent_instance paramspec;
2224 ParamSpec parent_instance;
2225 int default_value;
2228 // A #GParamSpec derived structure that contains the meta data for boxed properties.
2229 struct ParamSpecBoxed /* : ParamSpec */ {
2230 alias parent_instance this;
2231 alias parent_instance super_;
2232 alias parent_instance paramspec;
2233 ParamSpec parent_instance;
2236 // A #GParamSpec derived structure that contains the meta data for character properties.
2237 struct ParamSpecChar /* : ParamSpec */ {
2238 alias parent_instance this;
2239 alias parent_instance super_;
2240 alias parent_instance paramspec;
2241 ParamSpec parent_instance;
2242 byte minimum, maximum, default_value;
2246 // The class structure for the <structname>GParamSpec</structname> type.
2247 // Normally, <structname>GParamSpec</structname> classes are filled by
2248 // g_param_type_register_static().
2249 struct ParamSpecClass {
2250 TypeClass g_type_class;
2251 Type value_type;
2252 extern (C) void function (ParamSpec* pspec) nothrow finalize;
2253 extern (C) void function (ParamSpec* pspec, Value* value) nothrow value_set_default;
2254 extern (C) int function (ParamSpec* pspec, Value* value) nothrow value_validate;
2255 extern (C) int function (ParamSpec* pspec, Value* value1, Value* value2) nothrow values_cmp;
2256 private void*[4] dummy;
2259 // A #GParamSpec derived structure that contains the meta data for double properties.
2260 struct ParamSpecDouble /* : ParamSpec */ {
2261 alias parent_instance this;
2262 alias parent_instance super_;
2263 alias parent_instance paramspec;
2264 ParamSpec parent_instance;
2265 double minimum, maximum, default_value, epsilon;
2269 // A #GParamSpec derived structure that contains the meta data for enum
2270 // properties.
2271 struct ParamSpecEnum /* : ParamSpec */ {
2272 alias parent_instance this;
2273 alias parent_instance super_;
2274 alias parent_instance paramspec;
2275 ParamSpec parent_instance;
2276 EnumClass* enum_class;
2277 int default_value;
2281 // A #GParamSpec derived structure that contains the meta data for flags
2282 // properties.
2283 struct ParamSpecFlags /* : ParamSpec */ {
2284 alias parent_instance this;
2285 alias parent_instance super_;
2286 alias parent_instance paramspec;
2287 ParamSpec parent_instance;
2288 FlagsClass* flags_class;
2289 uint default_value;
2292 // A #GParamSpec derived structure that contains the meta data for float properties.
2293 struct ParamSpecFloat /* : ParamSpec */ {
2294 alias parent_instance this;
2295 alias parent_instance super_;
2296 alias parent_instance paramspec;
2297 ParamSpec parent_instance;
2298 float minimum, maximum, default_value, epsilon;
2301 // A #GParamSpec derived structure that contains the meta data for #GType properties.
2302 struct ParamSpecGType /* : ParamSpec */ /* Version 2.10 */ {
2303 alias parent_instance this;
2304 alias parent_instance super_;
2305 alias parent_instance paramspec;
2306 ParamSpec parent_instance;
2307 Type is_a_type;
2310 // A #GParamSpec derived structure that contains the meta data for integer properties.
2311 struct ParamSpecInt /* : ParamSpec */ {
2312 alias parent_instance this;
2313 alias parent_instance super_;
2314 alias parent_instance paramspec;
2315 ParamSpec parent_instance;
2316 int minimum, maximum, default_value;
2319 // A #GParamSpec derived structure that contains the meta data for 64bit integer properties.
2320 struct ParamSpecInt64 /* : ParamSpec */ {
2321 alias parent_instance this;
2322 alias parent_instance super_;
2323 alias parent_instance paramspec;
2324 ParamSpec parent_instance;
2325 long minimum, maximum, default_value;
2328 // A #GParamSpec derived structure that contains the meta data for long integer properties.
2329 struct ParamSpecLong /* : ParamSpec */ {
2330 alias parent_instance this;
2331 alias parent_instance super_;
2332 alias parent_instance paramspec;
2333 ParamSpec parent_instance;
2334 c_long minimum, maximum, default_value;
2337 // A #GParamSpec derived structure that contains the meta data for object properties.
2338 struct ParamSpecObject /* : ParamSpec */ {
2339 alias parent_instance this;
2340 alias parent_instance super_;
2341 alias parent_instance paramspec;
2342 ParamSpec parent_instance;
2346 // This is a type of #GParamSpec type that simply redirects operations to
2347 // another paramspec. All operations other than getting or
2348 // setting the value are redirected, including accessing the nick and
2349 // blurb, validating a value, and so forth. See
2350 // g_param_spec_get_redirect_target() for retrieving the overidden
2351 // property. #GParamSpecOverride is used in implementing
2352 // g_object_class_override_property(), and will not be directly useful
2353 // unless you are implementing a new base type similar to GObject.
2354 struct ParamSpecOverride /* : ParamSpec */ /* Version 2.4 */ {
2355 alias parent_instance this;
2356 alias parent_instance super_;
2357 alias parent_instance paramspec;
2358 ParamSpec parent_instance;
2359 private ParamSpec* overridden;
2363 // A #GParamSpec derived structure that contains the meta data for %G_TYPE_PARAM
2364 // properties.
2365 struct ParamSpecParam /* : ParamSpec */ {
2366 alias parent_instance this;
2367 alias parent_instance super_;
2368 alias parent_instance paramspec;
2369 ParamSpec parent_instance;
2372 // A #GParamSpec derived structure that contains the meta data for pointer properties.
2373 struct ParamSpecPointer /* : ParamSpec */ {
2374 alias parent_instance this;
2375 alias parent_instance super_;
2376 alias parent_instance paramspec;
2377 ParamSpec parent_instance;
2381 // A #GParamSpecPool maintains a collection of #GParamSpec<!-- -->s which can be
2382 // quickly accessed by owner and name. The implementation of the #GObject property
2383 // system uses such a pool to store the #GParamSpecs of the properties all object
2384 // types.
2385 struct ParamSpecPool {
2387 // Inserts a #GParamSpec in the pool.
2388 // <pspec>: the #GParamSpec to insert
2389 // <owner_type>: a #GType identifying the owner of @pspec
2390 void insert()(ParamSpec* pspec, Type owner_type) nothrow {
2391 g_param_spec_pool_insert(&this, pspec, owner_type);
2394 // Gets an array of all #GParamSpec<!-- -->s owned by @owner_type in
2395 // the pool.
2397 // allocated array containing pointers to all #GParamSpecs
2398 // owned by @owner_type in the pool
2399 // RETURNS: a newly
2400 // <owner_type>: the owner to look for
2401 // <n_pspecs_p>: return location for the length of the returned array
2402 ParamSpec** /*new container*/ list()(Type owner_type, /*out*/ uint* n_pspecs_p) nothrow {
2403 return g_param_spec_pool_list(&this, owner_type, n_pspecs_p);
2406 // Gets an #GList of all #GParamSpec<!-- -->s owned by @owner_type in
2407 // the pool.
2409 // #GList of all #GParamSpec<!-- -->s owned by @owner_type in
2410 // the pool#GParamSpec<!-- -->s.
2411 // RETURNS: a
2412 // <owner_type>: the owner to look for
2413 GLib2.List* /*new container*/ list_owned()(Type owner_type) nothrow {
2414 return g_param_spec_pool_list_owned(&this, owner_type);
2417 // Looks up a #GParamSpec in the pool.
2419 // matching #GParamSpec was found.
2420 // RETURNS: The found #GParamSpec, or %NULL if no
2421 // <param_name>: the name to look for
2422 // <owner_type>: the owner to look for
2423 // <walk_ancestors>: If %TRUE, also try to find a #GParamSpec with @param_name owned by an ancestor of @owner_type.
2424 ParamSpec* lookup()(char* param_name, Type owner_type, int walk_ancestors) nothrow {
2425 return g_param_spec_pool_lookup(&this, param_name, owner_type, walk_ancestors);
2428 // Removes a #GParamSpec from the pool.
2429 // <pspec>: the #GParamSpec to remove
2430 void remove()(ParamSpec* pspec) nothrow {
2431 g_param_spec_pool_remove(&this, pspec);
2434 // Creates a new #GParamSpecPool.
2436 // If @type_prefixing is %TRUE, lookups in the newly created pool will
2437 // allow to specify the owner as a colon-separated prefix of the
2438 // property name, like "GtkContainer:border-width". This feature is
2439 // deprecated, so you should always set @type_prefixing to %FALSE.
2440 // RETURNS: a newly allocated #GParamSpecPool.
2441 // <type_prefixing>: Whether the pool will support type-prefixed property names.
2442 static ParamSpecPool* new_()(int type_prefixing) nothrow {
2443 return g_param_spec_pool_new(type_prefixing);
2448 // A #GParamSpec derived structure that contains the meta data for string
2449 // properties.
2450 struct ParamSpecString /* : ParamSpec */ {
2451 alias parent_instance this;
2452 alias parent_instance super_;
2453 alias parent_instance paramspec;
2454 ParamSpec parent_instance;
2455 char* default_value, cset_first, cset_nth;
2456 char substitutor;
2457 static import std.bitmanip; mixin(std.bitmanip.bitfields!(
2458 uint, "null_fold_if_empty", 1,
2459 uint, "ensure_non_null", 1,
2460 uint, "__dummy32A", 30));
2464 // This structure is used to provide the type system with the information
2465 // required to initialize and destruct (finalize) a parameter's class and
2466 // instances thereof.
2467 // The initialized structure is passed to the g_param_type_register_static()
2468 // The type system will perform a deep copy of this structure, so its memory
2469 // does not need to be persistent across invocation of
2470 // g_param_type_register_static().
2471 struct ParamSpecTypeInfo {
2472 ushort instance_size, n_preallocs;
2473 extern (C) void function (ParamSpec* pspec) nothrow instance_init;
2474 Type value_type;
2475 extern (C) void function (ParamSpec* pspec) nothrow finalize;
2476 extern (C) void function (ParamSpec* pspec, Value* value) nothrow value_set_default;
2477 extern (C) int function (ParamSpec* pspec, Value* value) nothrow value_validate;
2478 extern (C) int function (ParamSpec* pspec, Value* value1, Value* value2) nothrow values_cmp;
2481 // A #GParamSpec derived structure that contains the meta data for unsigned character properties.
2482 struct ParamSpecUChar /* : ParamSpec */ {
2483 alias parent_instance this;
2484 alias parent_instance super_;
2485 alias parent_instance paramspec;
2486 ParamSpec parent_instance;
2487 ubyte minimum, maximum, default_value;
2490 // A #GParamSpec derived structure that contains the meta data for unsigned integer properties.
2491 struct ParamSpecUInt /* : ParamSpec */ {
2492 alias parent_instance this;
2493 alias parent_instance super_;
2494 alias parent_instance paramspec;
2495 ParamSpec parent_instance;
2496 uint minimum, maximum, default_value;
2499 // A #GParamSpec derived structure that contains the meta data for unsigned 64bit integer properties.
2500 struct ParamSpecUInt64 /* : ParamSpec */ {
2501 alias parent_instance this;
2502 alias parent_instance super_;
2503 alias parent_instance paramspec;
2504 ParamSpec parent_instance;
2505 ulong minimum, maximum, default_value;
2508 // A #GParamSpec derived structure that contains the meta data for unsigned long integer properties.
2509 struct ParamSpecULong /* : ParamSpec */ {
2510 alias parent_instance this;
2511 alias parent_instance super_;
2512 alias parent_instance paramspec;
2513 ParamSpec parent_instance;
2514 c_ulong minimum, maximum, default_value;
2517 // A #GParamSpec derived structure that contains the meta data for unichar (unsigned integer) properties.
2518 struct ParamSpecUnichar /* : ParamSpec */ {
2519 alias parent_instance this;
2520 alias parent_instance super_;
2521 alias parent_instance paramspec;
2522 ParamSpec parent_instance;
2523 dchar default_value;
2526 // A #GParamSpec derived structure that contains the meta data for #GValueArray properties.
2527 struct ParamSpecValueArray /* : ParamSpec */ {
2528 alias parent_instance this;
2529 alias parent_instance super_;
2530 alias parent_instance paramspec;
2531 ParamSpec parent_instance;
2532 ParamSpec* element_spec;
2533 uint fixed_n_elements;
2536 // A #GParamSpec derived structure that contains the meta data for #GVariant properties.
2537 struct ParamSpecVariant /* : ParamSpec */ /* Version 2.26 */ {
2538 alias parent_instance this;
2539 alias parent_instance super_;
2540 alias parent_instance paramspec;
2541 ParamSpec parent_instance;
2542 GLib2.VariantType* type;
2543 GLib2.Variant* default_value;
2544 private void*[4] padding;
2548 // The <structname>GParameter</structname> struct is an auxiliary structure used
2549 // to hand parameter name/value pairs to g_object_newv().
2550 struct Parameter {
2551 char* name;
2552 Value value;
2555 enum int SIGNAL_FLAGS_MASK = 511;
2556 enum int SIGNAL_MATCH_MASK = 63;
2558 // The signal accumulator is a special callback function that can be used
2559 // to collect return values of the various callbacks that are called
2560 // during a signal emission. The signal accumulator is specified at signal
2561 // creation time, if it is left %NULL, no accumulation of callback return
2562 // values is performed. The return value of signal emissions is then the
2563 // value returned by the last callback.
2565 // should be aborted. Returning %FALSE means to abort the
2566 // current emission and %TRUE is returned for continuation.
2567 // RETURNS: The accumulator function returns whether the signal emission
2568 // <ihint>: Signal invocation hint, see #GSignalInvocationHint.
2569 // <return_accu>: Accumulator to collect callback return values in, this is the return value of the current signal emission.
2570 // <handler_return>: A #GValue holding the return value of the signal handler.
2571 // <data>: Callback data that was specified when creating the signal.
2572 extern (C) alias int function (SignalInvocationHint* ihint, Value* return_accu, Value* handler_return, void* data) nothrow SignalAccumulator;
2575 // A simple function pointer to get invoked when the signal is emitted. This
2576 // allows you to tie a hook to the signal type, so that it will trap all
2577 // emissions of that signal, from any object.
2579 // You may not attach these to signals created with the #G_SIGNAL_NO_HOOKS flag.
2581 // hook is disconnected (and destroyed).
2582 // RETURNS: whether it wants to stay connected. If it returns %FALSE, the signal
2583 // <ihint>: Signal invocation hint, see #GSignalInvocationHint.
2584 // <n_param_values>: the number of parameters to the function, including the instance on which the signal was emitted.
2585 // <param_values>: the instance on which the signal was emitted, followed by the parameters of the emission.
2586 // <data>: user data associated with the hook.
2587 extern (C) alias int function (SignalInvocationHint* ihint, uint n_param_values, Value* param_values, void* data) nothrow SignalEmissionHook;
2590 // The signal flags are used to specify a signal's behaviour, the overall
2591 // signal description outlines how especially the RUN flags control the
2592 // stages of a signal emission.
2593 enum SignalFlags {
2594 RUN_FIRST = 1,
2595 RUN_LAST = 2,
2596 RUN_CLEANUP = 4,
2597 NO_RECURSE = 8,
2598 DETAILED = 16,
2599 ACTION = 32,
2600 NO_HOOKS = 64,
2601 MUST_COLLECT = 128,
2602 DEPRECATED = 256
2605 // The #GSignalInvocationHint structure is used to pass on additional information
2606 // to callbacks during a signal emission.
2607 struct SignalInvocationHint {
2608 uint signal_id;
2609 GLib2.Quark detail;
2610 SignalFlags run_type;
2614 // The match types specify what g_signal_handlers_block_matched(),
2615 // g_signal_handlers_unblock_matched() and g_signal_handlers_disconnect_matched()
2616 // match signals by.
2617 enum SignalMatchType {
2618 ID = 1,
2619 DETAIL = 2,
2620 CLOSURE = 4,
2621 FUNC = 8,
2622 DATA = 16,
2623 UNBLOCKED = 32
2626 // A structure holding in-depth information for a specific signal. It is
2627 // filled in by the g_signal_query() function.
2628 struct SignalQuery {
2629 uint signal_id;
2630 char* signal_name;
2631 Type itype;
2632 SignalFlags signal_flags;
2633 Type return_type;
2634 uint n_params;
2635 Type* param_types;
2638 enum int TYPE_FUNDAMENTAL_MAX = 255;
2639 enum int TYPE_FUNDAMENTAL_SHIFT = 2;
2640 enum int TYPE_RESERVED_BSE_FIRST = 32;
2641 enum int TYPE_RESERVED_BSE_LAST = 48;
2642 enum int TYPE_RESERVED_GLIB_FIRST = 22;
2643 enum int TYPE_RESERVED_GLIB_LAST = 31;
2644 enum int TYPE_RESERVED_USER_FIRST = 49;
2646 // A callback function used for notification when the state
2647 // of a toggle reference changes. See g_object_add_toggle_ref().
2648 // <data>: Callback data passed to g_object_add_toggle_ref()
2649 // <object>: The object on which g_object_add_toggle_ref() was called.
2650 // <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.
2651 extern (C) alias void function (void* data, Object* object, int is_last_ref) nothrow ToggleNotify;
2653 // A union holding one collected value.
2654 union TypeCValue {
2655 int v_int;
2656 c_long v_long;
2657 long v_int64;
2658 double v_double;
2659 void* v_pointer;
2662 // An opaque structure used as the base of all classes.
2663 struct TypeClass {
2664 private Type g_type;
2666 // Unintrospectable method: get_private() / g_type_class_get_private()
2667 void* get_private()(Type private_type) nothrow {
2668 return g_type_class_get_private(&this, private_type);
2671 // This is a convenience function often needed in class initializers.
2672 // It returns the class structure of the immediate parent type of the
2673 // class passed in. Since derived classes hold a reference count on
2674 // their parent classes as long as they are instantiated, the returned
2675 // class will always exist. This function is essentially equivalent
2676 // to:
2678 // <programlisting>
2679 // g_type_class_peek (g_type_parent (G_TYPE_FROM_CLASS (g_class)));
2680 // </programlisting>
2682 // of @g_class.
2683 // RETURNS: The parent class
2684 TypeClass* peek_parent()() nothrow {
2685 return g_type_class_peek_parent(&this);
2688 // Decrements the reference count of the class structure being passed in.
2689 // Once the last reference count of a class has been released, classes
2690 // may be finalized by the type system, so further dereferencing of a
2691 // class pointer after g_type_class_unref() are invalid.
2692 void unref()() nothrow {
2693 g_type_class_unref(&this);
2696 // Unintrospectable method: unref_uncached() / g_type_class_unref_uncached()
2697 // A variant of g_type_class_unref() for use in #GTypeClassCacheFunc
2698 // implementations. It unreferences a class without consulting the chain
2699 // of #GTypeClassCacheFunc<!-- -->s, avoiding the recursion which would occur
2700 // otherwise.
2701 void unref_uncached()() nothrow {
2702 g_type_class_unref_uncached(&this);
2705 // VERSION: 2.4
2706 // Registers a private structure for an instantiatable type.
2708 // When an object is allocated, the private structures for
2709 // the type and all of its parent types are allocated
2710 // sequentially in the same memory block as the public
2711 // structures.
2713 // Note that the accumulated size of the private structures of
2714 // a type and all its parent types cannot excced 64 KiB.
2716 // This function should be called in the type's class_init() function.
2717 // The private structure can be retrieved using the
2718 // G_TYPE_INSTANCE_GET_PRIVATE() macro.
2720 // The following example shows attaching a private structure
2721 // <structname>MyObjectPrivate</structname> to an object
2722 // <structname>MyObject</structname> defined in the standard GObject
2723 // fashion.
2724 // type's class_init() function.
2726 // |[
2727 // typedef struct _MyObject MyObject;
2728 // typedef struct _MyObjectPrivate MyObjectPrivate;
2730 // struct _MyObject {
2731 // GObject parent;
2733 // MyObjectPrivate *priv;
2734 // };
2736 // struct _MyObjectPrivate {
2737 // int some_field;
2738 // };
2740 // static void
2741 // my_object_class_init (MyObjectClass *klass)
2742 // {
2743 // g_type_class_add_private (klass, sizeof (MyObjectPrivate));
2744 // }
2746 // static void
2747 // my_object_init (MyObject *my_object)
2748 // {
2749 // my_object->priv = G_TYPE_INSTANCE_GET_PRIVATE (my_object,
2750 // MY_TYPE_OBJECT,
2751 // MyObjectPrivate);
2752 // }
2754 // static int
2755 // my_object_get_some_field (MyObject *my_object)
2756 // {
2757 // MyObjectPrivate *priv = my_object->priv;
2759 // return priv->some_field;
2760 // }
2761 // ]|
2762 // <g_class>: class structure for an instantiatable type
2763 // <private_size>: size of private structure.
2764 static void add_private()(void* g_class, size_t private_size) nothrow {
2765 g_type_class_add_private(g_class, private_size);
2768 // This function is essentially the same as g_type_class_ref(), except that
2769 // the classes reference count isn't incremented. As a consequence, this function
2770 // may return %NULL if the class of the type passed in does not currently
2771 // exist (hasn't been referenced before).
2773 // structure for the given type ID or %NULL if the class does not
2774 // currently exist.
2775 // RETURNS: The #GTypeClass
2776 // <type>: Type ID of a classed type.
2777 static TypeClass* peek()(Type type) nothrow {
2778 return g_type_class_peek(type);
2781 // VERSION: 2.4
2782 // A more efficient version of g_type_class_peek() which works only for
2783 // static types.
2785 // structure for the given type ID or %NULL if the class does not
2786 // currently exist or is dynamically loaded.
2787 // RETURNS: The #GTypeClass
2788 // <type>: Type ID of a classed type.
2789 static TypeClass* peek_static()(Type type) nothrow {
2790 return g_type_class_peek_static(type);
2793 // Increments the reference count of the class structure belonging to
2794 // @type. This function will demand-create the class if it doesn't
2795 // exist already.
2797 // structure for the given type ID.
2798 // RETURNS: The #GTypeClass
2799 // <type>: Type ID of a classed type.
2800 static TypeClass* ref_()(Type type) nothrow {
2801 return g_type_class_ref(type);
2806 // A callback function which is called when the reference count of a class
2807 // drops to zero. It may use g_type_class_ref() to prevent the class from
2808 // being freed. You should not call g_type_class_unref() from a
2809 // #GTypeClassCacheFunc function to prevent infinite recursion, use
2810 // g_type_class_unref_uncached() instead.
2812 // The functions have to check the class id passed in to figure
2813 // whether they actually want to cache the class of this type, since all
2814 // classes are routed through the same #GTypeClassCacheFunc chain.
2816 // called, %FALSE to continue.
2817 // RETURNS: %TRUE to stop further #GTypeClassCacheFunc<!-- -->s from being
2818 // <cache_data>: data that was given to the g_type_add_class_cache_func() call
2819 // <g_class>: The #GTypeClass structure which is unreferenced
2820 extern (C) alias int function (void* cache_data, TypeClass* g_class) nothrow TypeClassCacheFunc;
2823 // The <type>GTypeDebugFlags</type> enumeration values can be passed to
2824 // g_type_init_with_debug_flags() to trigger debugging messages during runtime.
2825 // Note that the messages can also be triggered by setting the
2826 // <envar>GOBJECT_DEBUG</envar> environment variable to a ':'-separated list of
2827 // "objects" and "signals".
2828 enum TypeDebugFlags {
2829 NONE = 0,
2830 OBJECTS = 1,
2831 SIGNALS = 2,
2832 MASK = 3
2834 // Bit masks used to check or determine characteristics of a type.
2835 enum TypeFlags {
2836 ABSTRACT = 16,
2837 VALUE_ABSTRACT = 32
2840 // Bit masks used to check or determine specific characteristics of a
2841 // fundamental type.
2842 enum TypeFundamentalFlags {
2843 CLASSED = 1,
2844 INSTANTIATABLE = 2,
2845 DERIVABLE = 4,
2846 DEEP_DERIVABLE = 8
2849 // A structure that provides information to the type system which is
2850 // used specifically for managing fundamental types.
2851 struct TypeFundamentalInfo {
2852 TypeFundamentalFlags type_flags;
2856 // This structure is used to provide the type system with the information
2857 // required to initialize and destruct (finalize) a type's class and
2858 // its instances.
2859 // The initialized structure is passed to the g_type_register_static() function
2860 // (or is copied into the provided #GTypeInfo structure in the
2861 // g_type_plugin_complete_type_info()). The type system will perform a deep
2862 // copy of this structure, so its memory does not need to be persistent
2863 // across invocation of g_type_register_static().
2864 struct GTypeInfo {
2865 ushort class_size;
2866 BaseInitFunc base_init;
2867 BaseFinalizeFunc base_finalize;
2868 ClassInitFunc class_init;
2869 ClassFinalizeFunc class_finalize;
2870 const(void)* class_data;
2871 ushort instance_size, n_preallocs;
2872 InstanceInitFunc instance_init;
2873 TypeValueTable* value_table;
2876 // An opaque structure used as the base of all type instances.
2877 struct TypeInstance {
2878 private TypeClass* g_class;
2880 // Unintrospectable method: get_private() / g_type_instance_get_private()
2881 void* get_private()(Type private_type) nothrow {
2882 return g_type_instance_get_private(&this, private_type);
2886 // An opaque structure used as the base of all interface types.
2887 struct TypeInterface {
2888 private Type g_type, g_instance_type;
2891 // Returns the corresponding #GTypeInterface structure of the parent type
2892 // of the instance type to which @g_iface belongs. This is useful when
2893 // deriving the implementation of an interface from the parent type and
2894 // then possibly overriding some methods.
2896 // corresponding #GTypeInterface structure of the parent type of the
2897 // instance type to which @g_iface belongs, or %NULL if the parent
2898 // type doesn't conform to the interface.
2899 // RETURNS: The
2900 TypeInterface* peek_parent()() nothrow {
2901 return g_type_interface_peek_parent(&this);
2904 // Adds @prerequisite_type to the list of prerequisites of @interface_type.
2905 // This means that any type implementing @interface_type must also implement
2906 // @prerequisite_type. Prerequisites can be thought of as an alternative to
2907 // interface derivation (which GType doesn't support). An interface can have
2908 // at most one instantiatable prerequisite type.
2909 // <interface_type>: #GType value of an interface type.
2910 // <prerequisite_type>: #GType value of an interface or instantiatable type.
2911 static void add_prerequisite()(Type interface_type, Type prerequisite_type) nothrow {
2912 g_type_interface_add_prerequisite(interface_type, prerequisite_type);
2915 // Returns the #GTypePlugin structure for the dynamic interface
2916 // @interface_type which has been added to @instance_type, or %NULL if
2917 // @interface_type has not been added to @instance_type or does not
2918 // have a #GTypePlugin structure. See g_type_add_interface_dynamic().
2920 // interface @interface_type of @instance_type.
2921 // RETURNS: the #GTypePlugin for the dynamic
2922 // <instance_type>: the #GType value of an instantiatable type.
2923 // <interface_type>: the #GType value of an interface type.
2924 static TypePlugin* get_plugin()(Type instance_type, Type interface_type) nothrow {
2925 return g_type_interface_get_plugin(instance_type, interface_type);
2928 // Returns the #GTypeInterface structure of an interface to which the
2929 // passed in class conforms.
2931 // structure of iface_type if implemented by @instance_class, %NULL
2932 // otherwise
2933 // RETURNS: The GTypeInterface
2934 // <instance_class>: A #GTypeClass structure.
2935 // <iface_type>: An interface ID which this class conforms to.
2936 static TypeInterface* peek()(TypeClass* instance_class, Type iface_type) nothrow {
2937 return g_type_interface_peek(instance_class, iface_type);
2940 // VERSION: 2.2
2941 // Returns the prerequisites of an interfaces type.
2944 // newly-allocated zero-terminated array of #GType containing
2945 // the prerequisites of @interface_type
2946 // RETURNS: a
2947 // <interface_type>: an interface type
2948 // <n_prerequisites>: location to return the number of prerequisites, or %NULL
2949 static Type* /*new*/ prerequisites()(Type interface_type, /*out*/ uint* n_prerequisites=null) nothrow {
2950 return g_type_interface_prerequisites(interface_type, n_prerequisites);
2955 // VERSION: 2.4
2956 // A callback called after an interface vtable is initialized.
2957 // See g_type_add_interface_check().
2958 // <check_data>: data passed to g_type_add_interface_check().
2959 // <g_iface>: the interface that has been initialized
2960 extern (C) alias void function (void* check_data, void* g_iface) nothrow TypeInterfaceCheckFunc;
2963 // #GTypeModule provides a simple implementation of the #GTypePlugin
2964 // interface. The model of #GTypeModule is a dynamically loaded module
2965 // which implements some number of types and interface
2966 // implementations. When the module is loaded, it registers its types
2967 // and interfaces using g_type_module_register_type() and
2968 // g_type_module_add_interface(). As long as any instances of these
2969 // types and interface implementations are in use, the module is kept
2970 // loaded. When the types and interfaces are gone, the module may be
2971 // unloaded. If the types and interfaces become used again, the module
2972 // will be reloaded. Note that the last unref cannot happen in module
2973 // code, since that would lead to the caller's code being unloaded before
2974 // g_object_unref() returns to it.
2976 // Keeping track of whether the module should be loaded or not is done by
2977 // using a use count - it starts at zero, and whenever it is greater than
2978 // zero, the module is loaded. The use count is maintained internally by
2979 // the type system, but also can be explicitly controlled by
2980 // g_type_module_use() and g_type_module_unuse(). Typically, when loading
2981 // a module for the first type, g_type_module_use() will be used to load
2982 // it so that it can initialize its types. At some later point, when the
2983 // module no longer needs to be loaded except for the type
2984 // implementations it contains, g_type_module_unuse() is called.
2986 // #GTypeModule does not actually provide any implementation of module
2987 // loading and unloading. To create a particular module type you must
2988 // derive from #GTypeModule and implement the load and unload functions
2989 // in #GTypeModuleClass.
2990 struct TypeModule /* : Object */ {
2991 mixin TypePlugin.__interface__;
2992 alias parent_instance this;
2993 alias parent_instance super_;
2994 alias parent_instance object;
2995 Object parent_instance;
2996 uint use_count;
2997 GLib2.SList* type_infos, interface_infos;
2998 char* name;
3001 // Registers an additional interface for a type, whose interface lives
3002 // in the given type plugin. If the interface was already registered
3003 // for the type in this plugin, nothing will be done.
3005 // As long as any instances of the type exist, the type plugin will
3006 // not be unloaded.
3007 // <instance_type>: type to which to add the interface.
3008 // <interface_type>: interface type to add
3009 // <interface_info>: type information structure
3010 void add_interface()(Type instance_type, Type interface_type, InterfaceInfo* interface_info) nothrow {
3011 g_type_module_add_interface(&this, instance_type, interface_type, interface_info);
3014 // VERSION: 2.6
3015 // Looks up or registers an enumeration that is implemented with a particular
3016 // type plugin. If a type with name @type_name was previously registered,
3017 // the #GType identifier for the type is returned, otherwise the type
3018 // is newly registered, and the resulting #GType identifier returned.
3020 // As long as any instances of the type exist, the type plugin will
3021 // not be unloaded.
3022 // RETURNS: the new or existing type ID
3023 // <name>: name for the type
3024 // <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.
3025 Type register_enum()(char* name, EnumValue* const_static_values) nothrow {
3026 return g_type_module_register_enum(&this, name, const_static_values);
3029 // VERSION: 2.6
3030 // Looks up or registers a flags type that is implemented with a particular
3031 // type plugin. If a type with name @type_name was previously registered,
3032 // the #GType identifier for the type is returned, otherwise the type
3033 // is newly registered, and the resulting #GType identifier returned.
3035 // As long as any instances of the type exist, the type plugin will
3036 // not be unloaded.
3037 // RETURNS: the new or existing type ID
3038 // <name>: name for the type
3039 // <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.
3040 Type register_flags()(char* name, FlagsValue* const_static_values) nothrow {
3041 return g_type_module_register_flags(&this, name, const_static_values);
3044 // Looks up or registers a type that is implemented with a particular
3045 // type plugin. If a type with name @type_name was previously registered,
3046 // the #GType identifier for the type is returned, otherwise the type
3047 // is newly registered, and the resulting #GType identifier returned.
3049 // When reregistering a type (typically because a module is unloaded
3050 // then reloaded, and reinitialized), @module and @parent_type must
3051 // be the same as they were previously.
3053 // As long as any instances of the type exist, the type plugin will
3054 // not be unloaded.
3055 // RETURNS: the new or existing type ID
3056 // <parent_type>: the type for the parent class
3057 // <type_name>: name for the type
3058 // <type_info>: type information structure
3059 // <flags>: flags field providing details about the type
3060 Type register_type()(Type parent_type, char* type_name, GTypeInfo* type_info, TypeFlags flags) nothrow {
3061 return g_type_module_register_type(&this, parent_type, type_name, type_info, flags);
3064 // Sets the name for a #GTypeModule
3065 // <name>: a human-readable name to use in error messages.
3066 void set_name()(char* name) nothrow {
3067 g_type_module_set_name(&this, name);
3070 // Decreases the use count of a #GTypeModule by one. If the
3071 // result is zero, the module will be unloaded. (However, the
3072 // #GTypeModule will not be freed, and types associated with the
3073 // #GTypeModule are not unregistered. Once a #GTypeModule is
3074 // initialized, it must exist forever.)
3075 void unuse()() nothrow {
3076 g_type_module_unuse(&this);
3079 // Increases the use count of a #GTypeModule by one. If the
3080 // use count was zero before, the plugin will be loaded.
3081 // If loading the plugin fails, the use count is reset to
3082 // its prior value.
3084 // loading the plugin failed.
3085 // RETURNS: %FALSE if the plugin needed to be loaded and
3086 int use()() nothrow {
3087 return g_type_module_use(&this);
3092 // In order to implement dynamic loading of types based on #GTypeModule,
3093 // the @load and @unload functions in #GTypeModuleClass must be implemented.
3094 struct TypeModuleClass {
3095 ObjectClass parent_class;
3096 extern (C) int function (TypeModule* module_) nothrow load;
3097 extern (C) void function (TypeModule* module_) nothrow unload;
3098 extern (C) void function () nothrow reserved1;
3099 extern (C) void function () nothrow reserved2;
3100 extern (C) void function () nothrow reserved3;
3101 extern (C) void function () nothrow reserved4;
3105 // The GObject type system supports dynamic loading of types. The
3106 // #GTypePlugin interface is used to handle the lifecycle of
3107 // dynamically loaded types. It goes as follows:
3109 // <orderedlist>
3110 // <listitem><para>
3111 // The type is initially introduced (usually upon loading the module
3112 // the first time, or by your main application that knows what modules
3113 // introduces what types), like this:
3114 // |[
3115 // new_type_id = g_type_register_dynamic (parent_type_id,
3116 // "TypeName",
3117 // new_type_plugin,
3118 // type_flags);
3119 // ]|
3120 // where <literal>new_type_plugin</literal> is an implementation of the
3121 // #GTypePlugin interface.
3122 // </para></listitem>
3123 // <listitem><para>
3124 // The type's implementation is referenced, e.g. through
3125 // g_type_class_ref() or through g_type_create_instance() (this is
3126 // being called by g_object_new()) or through one of the above done on
3127 // a type derived from <literal>new_type_id</literal>.
3128 // </para></listitem>
3129 // <listitem><para>
3130 // This causes the type system to load the type's implementation by calling
3131 // g_type_plugin_use() and g_type_plugin_complete_type_info() on
3132 // <literal>new_type_plugin</literal>.
3133 // </para></listitem>
3134 // <listitem><para>
3135 // At some point the type's implementation isn't required anymore, e.g. after
3136 // g_type_class_unref() or g_type_free_instance() (called when the reference
3137 // count of an instance drops to zero).
3138 // </para></listitem>
3139 // <listitem><para>
3140 // This causes the type system to throw away the information retrieved from
3141 // g_type_plugin_complete_type_info() and then it calls
3142 // g_type_plugin_unuse() on <literal>new_type_plugin</literal>.
3143 // </para></listitem>
3144 // <listitem><para>
3145 // Things may repeat from the second step.
3146 // </para></listitem>
3147 // </orderedlist>
3149 // So basically, you need to implement a #GTypePlugin type that
3150 // carries a use_count, once use_count goes from zero to one, you need
3151 // to load the implementation to successfully handle the upcoming
3152 // g_type_plugin_complete_type_info() call. Later, maybe after
3153 // succeeding use/unuse calls, once use_count drops to zero, you can
3154 // unload the implementation again. The type system makes sure to call
3155 // g_type_plugin_use() and g_type_plugin_complete_type_info() again
3156 // when the type is needed again.
3158 // #GTypeModule is an implementation of #GTypePlugin that already
3159 // implements most of this except for the actual module loading and
3160 // unloading. It even handles multiple registered types per module.
3161 struct TypePlugin /* Interface */ {
3162 mixin template __interface__() {
3163 // Calls the @complete_interface_info function from the
3164 // #GTypePluginClass of @plugin. There should be no need to use this
3165 // function outside of the GObject type system itself.
3166 // <instance_type>: the #GType of an instantiable type to which the interface is added
3167 // <interface_type>: the #GType of the interface whose info is completed
3168 // <info>: the #GInterfaceInfo to fill in
3169 void complete_interface_info()(Type instance_type, Type interface_type, InterfaceInfo* info) nothrow {
3170 g_type_plugin_complete_interface_info(cast(TypePlugin*)&this, instance_type, interface_type, info);
3173 // Calls the @complete_type_info function from the #GTypePluginClass of @plugin.
3174 // There should be no need to use this function outside of the GObject
3175 // type system itself.
3176 // <g_type>: the #GType whose info is completed
3177 // <info>: the #GTypeInfo struct to fill in
3178 // <value_table>: the #GTypeValueTable to fill in
3179 void complete_type_info()(Type g_type, GTypeInfo* info, TypeValueTable* value_table) nothrow {
3180 g_type_plugin_complete_type_info(cast(TypePlugin*)&this, g_type, info, value_table);
3183 // Calls the @unuse_plugin function from the #GTypePluginClass of
3184 // @plugin. There should be no need to use this function outside of
3185 // the GObject type system itself.
3186 void unuse()() nothrow {
3187 g_type_plugin_unuse(cast(TypePlugin*)&this);
3190 // Calls the @use_plugin function from the #GTypePluginClass of
3191 // @plugin. There should be no need to use this function outside of
3192 // the GObject type system itself.
3193 void use()() nothrow {
3194 g_type_plugin_use(cast(TypePlugin*)&this);
3197 mixin __interface__;
3201 // The #GTypePlugin interface is used by the type system in order to handle
3202 // the lifecycle of dynamically loaded types.
3203 struct TypePluginClass {
3204 private TypeInterface base_iface;
3205 TypePluginUse use_plugin;
3206 TypePluginUnuse unuse_plugin;
3207 TypePluginCompleteTypeInfo complete_type_info;
3208 TypePluginCompleteInterfaceInfo complete_interface_info;
3212 // The type of the @complete_interface_info function of #GTypePluginClass.
3213 // <plugin>: the #GTypePlugin
3214 // <instance_type>: the #GType of an instantiable type to which the interface is added
3215 // <interface_type>: the #GType of the interface whose info is completed
3216 // <info>: the #GInterfaceInfo to fill in
3217 extern (C) alias void function (TypePlugin* plugin, Type instance_type, Type interface_type, InterfaceInfo* info) nothrow TypePluginCompleteInterfaceInfo;
3220 // The type of the @complete_type_info function of #GTypePluginClass.
3221 // <plugin>: the #GTypePlugin
3222 // <g_type>: the #GType whose info is completed
3223 // <info>: the #GTypeInfo struct to fill in
3224 // <value_table>: the #GTypeValueTable to fill in
3225 extern (C) alias void function (TypePlugin* plugin, Type g_type, GTypeInfo* info, TypeValueTable* value_table) nothrow TypePluginCompleteTypeInfo;
3228 // The type of the @unuse_plugin function of #GTypePluginClass.
3229 // <plugin>: the #GTypePlugin whose use count should be decreased
3230 extern (C) alias void function (TypePlugin* plugin) nothrow TypePluginUnuse;
3233 // The type of the @use_plugin function of #GTypePluginClass, which gets called
3234 // to increase the use count of @plugin.
3235 // <plugin>: the #GTypePlugin whose use count should be increased
3236 extern (C) alias void function (TypePlugin* plugin) nothrow TypePluginUse;
3239 // A structure holding information for a specific type. It is
3240 // filled in by the g_type_query() function.
3241 struct TypeQuery {
3242 Type type;
3243 char* type_name;
3244 uint class_size, instance_size;
3248 // The #GTypeValueTable provides the functions required by the #GValue implementation,
3249 // to serve as a container for values of a type.
3250 struct TypeValueTable {
3251 extern (C) void function (Value* value) nothrow value_init;
3252 extern (C) void function (Value* value) nothrow value_free;
3253 extern (C) void function (Value* src_value, Value* dest_value) nothrow value_copy;
3254 // Unintrospectable functionp: value_peek_pointer() / ()
3255 extern (C) void* function (Value* value) nothrow value_peek_pointer;
3256 char* collect_format;
3257 extern (C) char* /*new*/ function (Value* value, uint n_collect_values, TypeCValue* collect_values, uint collect_flags) nothrow collect_value;
3258 char* lcopy_format;
3259 extern (C) char* /*new*/ function (Value* value, uint n_collect_values, TypeCValue* collect_values, uint collect_flags) nothrow lcopy_value;
3262 // Unintrospectable function: peek() / g_type_value_table_peek()
3263 // Returns the location of the #GTypeValueTable associated with @type.
3264 // <emphasis>Note that this function should only be used from source code
3265 // that implements or has internal knowledge of the implementation of
3266 // @type.</emphasis>
3268 // %NULL if there is no #GTypeValueTable associated with @type.
3269 // RETURNS: Location of the #GTypeValueTable associated with @type or
3270 // <type>: A #GType value.
3271 static TypeValueTable* peek()(Type type) nothrow {
3272 return g_type_value_table_peek(type);
3276 enum int VALUE_COLLECT_FORMAT_MAX_LENGTH = 8;
3277 enum int VALUE_NOCOPY_CONTENTS = 134217728;
3279 // An opaque structure used to hold different types of values.
3280 // The data within the structure has protected scope: it is accessible only
3281 // to functions within a #GTypeValueTable structure, or implementations of
3282 // the g_value_*() API. That is, code portions which implement new fundamental
3283 // types.
3284 // #GValue users cannot make any assumptions about how data is stored
3285 // within the 2 element @data union, and the @g_type member should
3286 // only be accessed through the G_VALUE_TYPE() macro.
3287 struct Value {
3288 private Type g_type;
3289 _Value__data__union[2] data;
3292 // Copies the value of @src_value into @dest_value.
3293 // <dest_value>: An initialized #GValue structure of the same type as @src_value.
3294 void copy()(Value* dest_value) nothrow {
3295 g_value_copy(&this, dest_value);
3298 // Unintrospectable method: dup_boxed() / g_value_dup_boxed()
3299 // Get the contents of a %G_TYPE_BOXED derived #GValue. Upon getting,
3300 // the boxed value is duplicated and needs to be later freed with
3301 // g_boxed_free(), e.g. like: g_boxed_free (G_VALUE_TYPE (@value),
3302 // return_value);
3303 // RETURNS: boxed contents of @value
3304 void* dup_boxed()() nothrow {
3305 return g_value_dup_boxed(&this);
3308 // Get the contents of a %G_TYPE_OBJECT derived #GValue, increasing
3309 // its reference count. If the contents of the #GValue are %NULL, then
3310 // %NULL will be returned.
3312 // should be unreferenced when no longer needed.
3313 // RETURNS: object content of @value,
3314 Object* /*new*/ dup_object()() nothrow {
3315 return g_value_dup_object(&this);
3318 // Unintrospectable method: dup_param() / g_value_dup_param()
3319 // Get the contents of a %G_TYPE_PARAM #GValue, increasing its
3320 // reference count.
3322 // no longer needed.
3323 // RETURNS: #GParamSpec content of @value, should be unreferenced when
3324 ParamSpec* dup_param()() nothrow {
3325 return g_value_dup_param(&this);
3328 // Get a copy the contents of a %G_TYPE_STRING #GValue.
3329 // RETURNS: a newly allocated copy of the string content of @value
3330 char* /*new*/ dup_string()() nothrow {
3331 return g_value_dup_string(&this);
3334 // VERSION: 2.26
3335 // Get the contents of a variant #GValue, increasing its refcount.
3337 // g_variant_unref() when no longer needed
3338 // RETURNS: variant contents of @value, should be unrefed using
3339 GLib2.Variant* /*new*/ dup_variant()() nothrow {
3340 return g_value_dup_variant(&this);
3343 // Determines if @value will fit inside the size of a pointer value.
3344 // This is an internal function introduced mainly for C marshallers.
3345 // RETURNS: %TRUE if @value will fit inside a pointer value.
3346 int fits_pointer()() nothrow {
3347 return g_value_fits_pointer(&this);
3350 // Get the contents of a %G_TYPE_BOOLEAN #GValue.
3351 // RETURNS: boolean contents of @value
3352 int get_boolean()() nothrow {
3353 return g_value_get_boolean(&this);
3356 // Get the contents of a %G_TYPE_BOXED derived #GValue.
3357 // RETURNS: boxed contents of @value
3358 void* get_boxed()() nothrow {
3359 return g_value_get_boxed(&this);
3362 // DEPRECATED (v2.32) method: get_char - This function's return type is broken, see g_value_get_schar()
3363 // Do not use this function; it is broken on platforms where the %char
3364 // type is unsigned, such as ARM and PowerPC. See g_value_get_schar().
3366 // Get the contents of a %G_TYPE_CHAR #GValue.
3367 // RETURNS: character contents of @value
3368 char get_char()() nothrow {
3369 return g_value_get_char(&this);
3372 // Get the contents of a %G_TYPE_DOUBLE #GValue.
3373 // RETURNS: double contents of @value
3374 double get_double()() nothrow {
3375 return g_value_get_double(&this);
3378 // Get the contents of a %G_TYPE_ENUM #GValue.
3379 // RETURNS: enum contents of @value
3380 int get_enum()() nothrow {
3381 return g_value_get_enum(&this);
3384 // Get the contents of a %G_TYPE_FLAGS #GValue.
3385 // RETURNS: flags contents of @value
3386 uint get_flags()() nothrow {
3387 return g_value_get_flags(&this);
3390 // Get the contents of a %G_TYPE_FLOAT #GValue.
3391 // RETURNS: float contents of @value
3392 float get_float()() nothrow {
3393 return g_value_get_float(&this);
3396 // Get the contents of a %G_TYPE_INT #GValue.
3397 // RETURNS: integer contents of @value
3398 int get_int()() nothrow {
3399 return g_value_get_int(&this);
3402 // Get the contents of a %G_TYPE_INT64 #GValue.
3403 // RETURNS: 64bit integer contents of @value
3404 long get_int64()() nothrow {
3405 return g_value_get_int64(&this);
3408 // Get the contents of a %G_TYPE_LONG #GValue.
3409 // RETURNS: long integer contents of @value
3410 c_long get_long()() nothrow {
3411 return g_value_get_long(&this);
3414 // Get the contents of a %G_TYPE_OBJECT derived #GValue.
3415 // RETURNS: object contents of @value
3416 Object* get_object()() nothrow {
3417 return g_value_get_object(&this);
3420 // Get the contents of a %G_TYPE_PARAM #GValue.
3421 // RETURNS: #GParamSpec content of @value
3422 ParamSpec* get_param()() nothrow {
3423 return g_value_get_param(&this);
3426 // Get the contents of a pointer #GValue.
3427 // RETURNS: pointer contents of @value
3428 void* get_pointer()() nothrow {
3429 return g_value_get_pointer(&this);
3432 // VERSION: 2.32
3433 // Get the contents of a %G_TYPE_CHAR #GValue.
3434 // RETURNS: signed 8 bit integer contents of @value
3435 byte get_schar()() nothrow {
3436 return g_value_get_schar(&this);
3439 // Get the contents of a %G_TYPE_STRING #GValue.
3440 // RETURNS: string content of @value
3441 char* get_string()() nothrow {
3442 return g_value_get_string(&this);
3445 // Get the contents of a %G_TYPE_UCHAR #GValue.
3446 // RETURNS: unsigned character contents of @value
3447 ubyte get_uchar()() nothrow {
3448 return g_value_get_uchar(&this);
3451 // Get the contents of a %G_TYPE_UINT #GValue.
3452 // RETURNS: unsigned integer contents of @value
3453 uint get_uint()() nothrow {
3454 return g_value_get_uint(&this);
3457 // Get the contents of a %G_TYPE_UINT64 #GValue.
3458 // RETURNS: unsigned 64bit integer contents of @value
3459 ulong get_uint64()() nothrow {
3460 return g_value_get_uint64(&this);
3463 // Get the contents of a %G_TYPE_ULONG #GValue.
3464 // RETURNS: unsigned long integer contents of @value
3465 c_ulong get_ulong()() nothrow {
3466 return g_value_get_ulong(&this);
3469 // VERSION: 2.26
3470 // Get the contents of a variant #GValue.
3471 // RETURNS: variant contents of @value
3472 GLib2.Variant* /*new*/ get_variant()() nothrow {
3473 return g_value_get_variant(&this);
3476 // Initializes @value with the default value of @type.
3477 // RETURNS: the #GValue structure that has been passed in
3478 // <g_type>: Type the #GValue should hold values of.
3479 Value* init()(Type g_type) nothrow {
3480 return g_value_init(&this, g_type);
3483 // function asserts that g_value_fits_pointer() returned %TRUE for the
3484 // passed in value. This is an internal function introduced mainly
3485 // for C marshallers.
3486 // RETURNS: the value contents as pointer. This
3487 void* peek_pointer()() nothrow {
3488 return g_value_peek_pointer(&this);
3491 // Clears the current value in @value and resets it to the default value
3492 // (as if the value had just been initialized).
3493 // RETURNS: the #GValue structure that has been passed in
3494 Value* /*new*/ reset()() nothrow {
3495 return g_value_reset(&this);
3498 // Set the contents of a %G_TYPE_BOOLEAN #GValue to @v_boolean.
3499 // <v_boolean>: boolean value to be set
3500 void set_boolean()(int v_boolean) nothrow {
3501 g_value_set_boolean(&this, v_boolean);
3504 // Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.
3505 // <v_boxed>: boxed value to be set
3506 void set_boxed()(const(void)* v_boxed=null) nothrow {
3507 g_value_set_boxed(&this, v_boxed);
3510 // DEPRECATED (v2.4) method: set_boxed_take_ownership - Use g_value_take_boxed() instead.
3511 // This is an internal function introduced mainly for C marshallers.
3512 // <v_boxed>: duplicated unowned boxed value to be set
3513 void set_boxed_take_ownership()(const(void)* v_boxed=null) nothrow {
3514 g_value_set_boxed_take_ownership(&this, v_boxed);
3517 // DEPRECATED (v2.32) method: set_char - This function's input type is broken, see g_value_set_schar()
3518 // Set the contents of a %G_TYPE_CHAR #GValue to @v_char.
3519 // <v_char>: character value to be set
3520 void set_char()(char v_char) nothrow {
3521 g_value_set_char(&this, v_char);
3524 // Set the contents of a %G_TYPE_DOUBLE #GValue to @v_double.
3525 // <v_double>: double value to be set
3526 void set_double()(double v_double) nothrow {
3527 g_value_set_double(&this, v_double);
3530 // Set the contents of a %G_TYPE_ENUM #GValue to @v_enum.
3531 // <v_enum>: enum value to be set
3532 void set_enum()(int v_enum) nothrow {
3533 g_value_set_enum(&this, v_enum);
3536 // Set the contents of a %G_TYPE_FLAGS #GValue to @v_flags.
3537 // <v_flags>: flags value to be set
3538 void set_flags()(uint v_flags) nothrow {
3539 g_value_set_flags(&this, v_flags);
3542 // Set the contents of a %G_TYPE_FLOAT #GValue to @v_float.
3543 // <v_float>: float value to be set
3544 void set_float()(float v_float) nothrow {
3545 g_value_set_float(&this, v_float);
3548 // VERSION: 2.12
3549 // Set the contents of a %G_TYPE_GTYPE #GValue to @v_gtype.
3550 // <v_gtype>: #GType to be set
3551 void set_gtype()(Type v_gtype) nothrow {
3552 g_value_set_gtype(&this, v_gtype);
3555 // Sets @value from an instantiatable type via the
3556 // value_table's collect_value() function.
3557 // <instance>: the instance
3558 void set_instance()(void* instance=null) nothrow {
3559 g_value_set_instance(&this, instance);
3562 // Set the contents of a %G_TYPE_INT #GValue to @v_int.
3563 // <v_int>: integer value to be set
3564 void set_int()(int v_int) nothrow {
3565 g_value_set_int(&this, v_int);
3568 // Set the contents of a %G_TYPE_INT64 #GValue to @v_int64.
3569 // <v_int64>: 64bit integer value to be set
3570 void set_int64()(long v_int64) nothrow {
3571 g_value_set_int64(&this, v_int64);
3574 // Set the contents of a %G_TYPE_LONG #GValue to @v_long.
3575 // <v_long>: long integer value to be set
3576 void set_long()(c_long v_long) nothrow {
3577 g_value_set_long(&this, v_long);
3580 // Set the contents of a %G_TYPE_OBJECT derived #GValue to @v_object.
3582 // g_value_set_object() increases the reference count of @v_object
3583 // (the #GValue holds a reference to @v_object). If you do not wish
3584 // to increase the reference count of the object (i.e. you wish to
3585 // pass your current reference to the #GValue because you no longer
3586 // need it), use g_value_take_object() instead.
3588 // It is important that your #GValue holds a reference to @v_object (either its
3589 // own, or one it has taken) to ensure that the object won't be destroyed while
3590 // the #GValue still exists).
3591 // <v_object>: object value to be set
3592 void set_object()(Object* v_object=null) nothrow {
3593 g_value_set_object(&this, v_object);
3596 // Unintrospectable method: set_object_take_ownership() / g_value_set_object_take_ownership()
3597 // DEPRECATED (v2.4) method: set_object_take_ownership - Use g_value_take_object() instead.
3598 // This is an internal function introduced mainly for C marshallers.
3599 // <v_object>: object value to be set
3600 void set_object_take_ownership()(void* v_object=null) nothrow {
3601 g_value_set_object_take_ownership(&this, v_object);
3604 // Set the contents of a %G_TYPE_PARAM #GValue to @param.
3605 // <param>: the #GParamSpec to be set
3606 void set_param()(ParamSpec* param=null) nothrow {
3607 g_value_set_param(&this, param);
3610 // Unintrospectable method: set_param_take_ownership() / g_value_set_param_take_ownership()
3611 // DEPRECATED (v2.4) method: set_param_take_ownership - Use g_value_take_param() instead.
3612 // This is an internal function introduced mainly for C marshallers.
3613 // <param>: the #GParamSpec to be set
3614 void set_param_take_ownership()(ParamSpec* param=null) nothrow {
3615 g_value_set_param_take_ownership(&this, param);
3618 // Set the contents of a pointer #GValue to @v_pointer.
3619 // <v_pointer>: pointer value to be set
3620 void set_pointer()(void* v_pointer) nothrow {
3621 g_value_set_pointer(&this, v_pointer);
3624 // VERSION: 2.32
3625 // Set the contents of a %G_TYPE_CHAR #GValue to @v_char.
3626 // <v_char>: signed 8 bit integer to be set
3627 void set_schar()(byte v_char) nothrow {
3628 g_value_set_schar(&this, v_char);
3631 // Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.
3632 // The boxed value is assumed to be static, and is thus not duplicated
3633 // when setting the #GValue.
3634 // <v_boxed>: static boxed value to be set
3635 void set_static_boxed()(const(void)* v_boxed=null) nothrow {
3636 g_value_set_static_boxed(&this, v_boxed);
3639 // Set the contents of a %G_TYPE_STRING #GValue to @v_string.
3640 // The string is assumed to be static, and is thus not duplicated
3641 // when setting the #GValue.
3642 // <v_string>: static string to be set
3643 void set_static_string()(char* v_string=null) nothrow {
3644 g_value_set_static_string(&this, v_string);
3647 // Set the contents of a %G_TYPE_STRING #GValue to @v_string.
3648 // <v_string>: caller-owned string to be duplicated for the #GValue
3649 void set_string()(char* v_string=null) nothrow {
3650 g_value_set_string(&this, v_string);
3653 // DEPRECATED (v2.4) method: set_string_take_ownership - Use g_value_take_string() instead.
3654 // This is an internal function introduced mainly for C marshallers.
3655 // <v_string>: duplicated unowned string to be set
3656 void set_string_take_ownership()(char* v_string=null) nothrow {
3657 g_value_set_string_take_ownership(&this, v_string);
3660 // Set the contents of a %G_TYPE_UCHAR #GValue to @v_uchar.
3661 // <v_uchar>: unsigned character value to be set
3662 void set_uchar()(ubyte v_uchar) nothrow {
3663 g_value_set_uchar(&this, v_uchar);
3666 // Set the contents of a %G_TYPE_UINT #GValue to @v_uint.
3667 // <v_uint>: unsigned integer value to be set
3668 void set_uint()(uint v_uint) nothrow {
3669 g_value_set_uint(&this, v_uint);
3672 // Set the contents of a %G_TYPE_UINT64 #GValue to @v_uint64.
3673 // <v_uint64>: unsigned 64bit integer value to be set
3674 void set_uint64()(ulong v_uint64) nothrow {
3675 g_value_set_uint64(&this, v_uint64);
3678 // Set the contents of a %G_TYPE_ULONG #GValue to @v_ulong.
3679 // <v_ulong>: unsigned long integer value to be set
3680 void set_ulong()(c_ulong v_ulong) nothrow {
3681 g_value_set_ulong(&this, v_ulong);
3684 // VERSION: 2.26
3685 // Set the contents of a variant #GValue to @variant.
3686 // If the variant is floating, it is consumed.
3687 // <variant>: a #GVariant, or %NULL
3688 void set_variant()(GLib2.Variant* variant=null) nothrow {
3689 g_value_set_variant(&this, variant);
3692 // VERSION: 2.4
3693 // Sets the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed
3694 // and takes over the ownership of the callers reference to @v_boxed;
3695 // the caller doesn't have to unref it any more.
3696 // <v_boxed>: duplicated unowned boxed value to be set
3697 void take_boxed()(const(void)* v_boxed=null) nothrow {
3698 g_value_take_boxed(&this, v_boxed);
3701 // Unintrospectable method: take_object() / g_value_take_object()
3702 // VERSION: 2.4
3703 // Sets the contents of a %G_TYPE_OBJECT derived #GValue to @v_object
3704 // and takes over the ownership of the callers reference to @v_object;
3705 // the caller doesn't have to unref it any more (i.e. the reference
3706 // count of the object is not increased).
3708 // If you want the #GValue to hold its own reference to @v_object, use
3709 // g_value_set_object() instead.
3710 // <v_object>: object value to be set
3711 void take_object()(void* v_object=null) nothrow {
3712 g_value_take_object(&this, v_object);
3715 // Unintrospectable method: take_param() / g_value_take_param()
3716 // VERSION: 2.4
3717 // Sets the contents of a %G_TYPE_PARAM #GValue to @param and takes
3718 // over the ownership of the callers reference to @param; the caller
3719 // doesn't have to unref it any more.
3720 // <param>: the #GParamSpec to be set
3721 void take_param()(ParamSpec* param=null) nothrow {
3722 g_value_take_param(&this, param);
3725 // VERSION: 2.4
3726 // Sets the contents of a %G_TYPE_STRING #GValue to @v_string.
3727 // <v_string>: string to take ownership of
3728 void take_string()(char* v_string=null) nothrow {
3729 g_value_take_string(&this, v_string);
3732 // VERSION: 2.26
3733 // Set the contents of a variant #GValue to @variant, and takes over
3734 // the ownership of the caller's reference to @variant;
3735 // the caller doesn't have to unref it any more (i.e. the reference
3736 // count of the variant is not increased).
3738 // If @variant was floating then its floating reference is converted to
3739 // a hard reference.
3741 // If you want the #GValue to hold its own reference to @variant, use
3742 // g_value_set_variant() instead.
3744 // This is an internal function introduced mainly for C marshallers.
3745 // <variant>: a #GVariant, or %NULL
3746 void take_variant()(GLib2.Variant* variant=null) nothrow {
3747 g_value_take_variant(&this, variant);
3750 // Tries to cast the contents of @src_value into a type appropriate
3751 // to store in @dest_value, e.g. to transform a %G_TYPE_INT value
3752 // into a %G_TYPE_FLOAT value. Performing transformations between
3753 // value types might incur precision lossage. Especially
3754 // transformations into strings might reveal seemingly arbitrary
3755 // results and shouldn't be relied upon for production code (such
3756 // as rcfile value or object property serialization).
3758 // Upon failing transformations, @dest_value is left untouched.
3759 // RETURNS: Whether a transformation rule was found and could be applied.
3760 // <dest_value>: Target value.
3761 int transform()(Value* dest_value) nothrow {
3762 return g_value_transform(&this, dest_value);
3765 // Clears the current value in @value and "unsets" the type,
3766 // this releases all resources associated with this GValue.
3767 // An unset value is the same as an uninitialized (zero-filled)
3768 // #GValue structure.
3769 void unset()() nothrow {
3770 g_value_unset(&this);
3773 // Unintrospectable function: register_transform_func() / g_value_register_transform_func()
3774 // Registers a value transformation function for use in g_value_transform().
3775 // A previously registered transformation function for @src_type and @dest_type
3776 // will be replaced.
3777 // <src_type>: Source type.
3778 // <dest_type>: Target type.
3779 // <transform_func>: a function which transforms values of type @src_type into value of type @dest_type
3780 static void register_transform_func()(Type src_type, Type dest_type, ValueTransform transform_func) nothrow {
3781 g_value_register_transform_func(src_type, dest_type, transform_func);
3784 // Returns whether a #GValue of type @src_type can be copied into
3785 // a #GValue of type @dest_type.
3786 // RETURNS: %TRUE if g_value_copy() is possible with @src_type and @dest_type.
3787 // <src_type>: source type to be copied.
3788 // <dest_type>: destination type for copying.
3789 static int type_compatible()(Type src_type, Type dest_type) nothrow {
3790 return g_value_type_compatible(src_type, dest_type);
3793 // Check whether g_value_transform() is able to transform values
3794 // of type @src_type into values of type @dest_type.
3795 // RETURNS: %TRUE if the transformation is possible, %FALSE otherwise.
3796 // <src_type>: Source type.
3797 // <dest_type>: Target type.
3798 static int type_transformable()(Type src_type, Type dest_type) nothrow {
3799 return g_value_type_transformable(src_type, dest_type);
3803 // A #GValueArray contains an array of #GValue elements.
3804 struct ValueArray {
3805 uint n_values;
3806 Value* values;
3807 private uint n_prealloced;
3810 // Allocate and initialize a new #GValueArray, optionally preserve space
3811 // for @n_prealloced elements. New arrays always contain 0 elements,
3812 // regardless of the value of @n_prealloced.
3813 // RETURNS: a newly allocated #GValueArray with 0 values
3814 // <n_prealloced>: number of values to preallocate space for
3815 static ValueArray* /*new*/ new_()(uint n_prealloced) nothrow {
3816 return g_value_array_new(n_prealloced);
3818 alias new_!() opCall;
3820 // Insert a copy of @value as last element of @value_array. If @value is
3821 // %NULL, an uninitialized value is appended.
3822 // RETURNS: the #GValueArray passed in as @value_array
3823 // <value>: #GValue to copy into #GValueArray, or %NULL
3824 ValueArray* append()(Value* value=null) nothrow {
3825 return g_value_array_append(&this, value);
3828 // Construct an exact copy of a #GValueArray by duplicating all its
3829 // contents.
3830 // RETURNS: Newly allocated copy of #GValueArray
3831 ValueArray* /*new*/ copy()() nothrow {
3832 return g_value_array_copy(&this);
3834 // Free a #GValueArray including its contents.
3835 void free()() nothrow {
3836 g_value_array_free(&this);
3839 // Return a pointer to the value at @index_ containd in @value_array.
3840 // RETURNS: pointer to a value at @index_ in @value_array
3841 // <index_>: index of the value of interest
3842 Value* get_nth()(uint index_) nothrow {
3843 return g_value_array_get_nth(&this, index_);
3846 // Insert a copy of @value at specified position into @value_array. If @value
3847 // is %NULL, an uninitialized value is inserted.
3848 // RETURNS: the #GValueArray passed in as @value_array
3849 // <index_>: insertion position, must be &lt;= value_array-&gt;n_values
3850 // <value>: #GValue to copy into #GValueArray, or %NULL
3851 ValueArray* insert()(uint index_, Value* value=null) nothrow {
3852 return g_value_array_insert(&this, index_, value);
3855 // Insert a copy of @value as first element of @value_array. If @value is
3856 // %NULL, an uninitialized value is prepended.
3857 // RETURNS: the #GValueArray passed in as @value_array
3858 // <value>: #GValue to copy into #GValueArray, or %NULL
3859 ValueArray* prepend()(Value* value=null) nothrow {
3860 return g_value_array_prepend(&this, value);
3863 // Remove the value at position @index_ from @value_array.
3864 // RETURNS: the #GValueArray passed in as @value_array
3865 // <index_>: position of value to remove, which must be less than <code>value_array-><link linkend="GValueArray.n-values">n_values</link></code>
3866 ValueArray* remove()(uint index_) nothrow {
3867 return g_value_array_remove(&this, index_);
3870 // Sort @value_array using @compare_func to compare the elements according to
3871 // the semantics of #GCompareFunc.
3873 // The current implementation uses Quick-Sort as sorting algorithm.
3874 // RETURNS: the #GValueArray passed in as @value_array
3875 // <compare_func>: function to compare elements
3876 ValueArray* sort()(GLib2.CompareFunc compare_func) nothrow {
3877 return g_value_array_sort(&this, compare_func);
3880 // Sort @value_array using @compare_func to compare the elements according
3881 // to the semantics of #GCompareDataFunc.
3883 // The current implementation uses Quick-Sort as sorting algorithm.
3884 // RETURNS: the #GValueArray passed in as @value_array
3885 // <compare_func>: function to compare elements
3886 // <user_data>: extra data argument provided for @compare_func
3887 ValueArray* sort_with_data()(GLib2.CompareDataFunc compare_func, void* user_data) nothrow {
3888 return g_value_array_sort_with_data(&this, compare_func, user_data);
3893 // The type of value transformation functions which can be registered with
3894 // g_value_register_transform_func().
3895 // <src_value>: Source value.
3896 // <dest_value>: Target value.
3897 extern (C) alias void function (Value* src_value, Value* dest_value) nothrow ValueTransform;
3900 // A #GWeakNotify function can be added to an object as a callback that gets
3901 // triggered when the object is finalized. Since the object is already being
3902 // finalized when the #GWeakNotify is called, there's not much you could do
3903 // with the object, apart from e.g. using its address as hash-index or the like.
3904 // <data>: data that was provided when the weak reference was established
3905 // <where_the_object_was>: the object being finalized
3906 extern (C) alias void function (void* data, Object* where_the_object_was) nothrow WeakNotify;
3909 // A structure containing a weak reference to a #GObject. It can either
3910 // be empty (i.e. point to %NULL), or point to an object for as long as
3911 // at least one "strong" reference to that object exists. Before the
3912 // object's #GObjectClass.dispose method is called, every #GWeakRef
3913 // associated with becomes empty (i.e. points to %NULL).
3915 // Like #GValue, #GWeakRef can be statically allocated, stack- or
3916 // heap-allocated, or embedded in larger structures.
3918 // Unlike g_object_weak_ref() and g_object_add_weak_pointer(), this weak
3919 // reference is thread-safe: converting a weak pointer to a reference is
3920 // atomic with respect to invalidation of weak pointers to destroyed
3921 // objects.
3923 // If the object's #GObjectClass.dispose method results in additional
3924 // references to the object being held, any #GWeakRef<!-- -->s taken
3925 // before it was disposed will continue to point to %NULL. If
3926 // #GWeakRef<!-- -->s are taken after the object is disposed and
3927 // re-referenced, they will continue to point to it until its refcount
3928 // goes back to zero, at which point they too will be invalidated.
3929 struct WeakRef {
3932 union priv {
3933 void* p;
3937 // Unintrospectable method: clear() / g_weak_ref_clear()
3938 // VERSION: 2.32
3939 // Frees resources associated with a non-statically-allocated #GWeakRef.
3940 // After this call, the #GWeakRef is left in an undefined state.
3942 // You should only call this on a #GWeakRef that previously had
3943 // g_weak_ref_init() called on it.
3944 void clear()() nothrow {
3945 g_weak_ref_clear(&this);
3948 // Unintrospectable method: get() / g_weak_ref_get()
3949 // VERSION: 2.32
3950 // If @weak_ref is not empty, atomically acquire a strong
3951 // reference to the object it points to, and return that reference.
3953 // This function is needed because of the potential race between taking
3954 // the pointer value and g_object_ref() on it, if the object was losing
3955 // its last reference at the same time in a different thread.
3957 // The caller should release the resulting reference in the usual way,
3958 // by using g_object_unref().
3960 // by @weak_ref, or %NULL if it was empty
3961 // RETURNS: the object pointed to
3962 Object* /*new*/ get()() nothrow {
3963 return g_weak_ref_get(&this);
3966 // Unintrospectable method: init() / g_weak_ref_init()
3967 // VERSION: 2.32
3968 // Initialise a non-statically-allocated #GWeakRef.
3970 // This function also calls g_weak_ref_set() with @object on the
3971 // freshly-initialised weak reference.
3973 // This function should always be matched with a call to
3974 // g_weak_ref_clear(). It is not necessary to use this function for a
3975 // #GWeakRef in static storage because it will already be
3976 // properly initialised. Just use g_weak_ref_set() directly.
3977 // <object>: a #GObject or %NULL
3978 void init()(void* object=null) nothrow {
3979 g_weak_ref_init(&this, object);
3982 // Unintrospectable method: set() / g_weak_ref_set()
3983 // VERSION: 2.32
3984 // Change the object to which @weak_ref points, or set it to
3985 // %NULL.
3987 // You must own a strong reference on @object while calling this
3988 // function.
3989 // <object>: a #GObject or %NULL
3990 void set()(void* object=null) nothrow {
3991 g_weak_ref_set(&this, object);
3995 union _Value__data__union {
3996 int v_int;
3997 uint v_uint;
3998 c_long v_long;
3999 c_ulong v_ulong;
4000 long v_int64;
4001 ulong v_uint64;
4002 float v_float;
4003 double v_double;
4004 void* v_pointer;
4008 // Unintrospectable function: boxed_copy() / g_boxed_copy()
4009 // Provide a copy of a boxed structure @src_boxed which is of type @boxed_type.
4010 // RETURNS: The newly created copy of the boxed structure.
4011 // <boxed_type>: The type of @src_boxed.
4012 // <src_boxed>: The boxed structure to be copied.
4013 static void* boxed_copy()(Type boxed_type, const(void)* src_boxed) nothrow {
4014 return g_boxed_copy(boxed_type, src_boxed);
4018 // Free the boxed structure @boxed which is of type @boxed_type.
4019 // <boxed_type>: The type of @boxed.
4020 // <boxed>: The boxed structure to be freed.
4021 static void boxed_free()(Type boxed_type, void* boxed) nothrow {
4022 g_boxed_free(boxed_type, boxed);
4026 // Unintrospectable function: boxed_type_register_static() / g_boxed_type_register_static()
4027 // This function creates a new %G_TYPE_BOXED derived type id for a new
4028 // boxed type with name @name. Boxed type handling functions have to be
4029 // provided to copy and free opaque boxed structures of this type.
4030 // RETURNS: New %G_TYPE_BOXED derived type id for @name.
4031 // <name>: Name of the new boxed type.
4032 // <boxed_copy>: Boxed structure copy function.
4033 // <boxed_free>: Boxed structure free function.
4034 static Type boxed_type_register_static()(char* name, BoxedCopyFunc boxed_copy, BoxedFreeFunc boxed_free) nothrow {
4035 return g_boxed_type_register_static(name, boxed_copy, boxed_free);
4038 // MOVED TO: CClosure.marshal_BOOLEAN__BOXED_BOXED
4039 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) nothrow {
4040 g_cclosure_marshal_BOOLEAN__BOXED_BOXED(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4044 // MOVED TO: CClosure.marshal_BOOLEAN__FLAGS
4045 // A marshaller for a #GCClosure with a callback of type
4046 // <literal>gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter
4047 // denotes a flags type.
4048 // <closure>: the #GClosure to which the marshaller belongs
4049 // <return_value>: a #GValue which can store the returned #gboolean
4050 // <n_param_values>: 2
4051 // <param_values>: a #GValue array holding instance and arg1
4052 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4053 // <marshal_data>: additional data specified when registering the marshaller
4054 static void cclosure_marshal_BOOLEAN__FLAGS()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4055 g_cclosure_marshal_BOOLEAN__FLAGS(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4059 // MOVED TO: CClosure.marshal_STRING__OBJECT_POINTER
4060 // A marshaller for a #GCClosure with a callback of type
4061 // <literal>gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data)</literal>.
4062 // <closure>: the #GClosure to which the marshaller belongs
4063 // <return_value>: a #GValue, which can store the returned string
4064 // <n_param_values>: 3
4065 // <param_values>: a #GValue array holding instance, arg1 and arg2
4066 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4067 // <marshal_data>: additional data specified when registering the marshaller
4068 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) nothrow {
4069 g_cclosure_marshal_STRING__OBJECT_POINTER(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4073 // MOVED TO: CClosure.marshal_VOID__BOOLEAN
4074 // A marshaller for a #GCClosure with a callback of type
4075 // <literal>void (*callback) (gpointer instance, gboolean arg1, gpointer user_data)</literal>.
4076 // <closure>: the #GClosure to which the marshaller belongs
4077 // <return_value>: ignored
4078 // <n_param_values>: 2
4079 // <param_values>: a #GValue array holding the instance and the #gboolean parameter
4080 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4081 // <marshal_data>: additional data specified when registering the marshaller
4082 static void cclosure_marshal_VOID__BOOLEAN()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4083 g_cclosure_marshal_VOID__BOOLEAN(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4087 // MOVED TO: CClosure.marshal_VOID__BOXED
4088 // A marshaller for a #GCClosure with a callback of type
4089 // <literal>void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data)</literal>.
4090 // <closure>: the #GClosure to which the marshaller belongs
4091 // <return_value>: ignored
4092 // <n_param_values>: 2
4093 // <param_values>: a #GValue array holding the instance and the #GBoxed* parameter
4094 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4095 // <marshal_data>: additional data specified when registering the marshaller
4096 static void cclosure_marshal_VOID__BOXED()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4097 g_cclosure_marshal_VOID__BOXED(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4101 // MOVED TO: CClosure.marshal_VOID__CHAR
4102 // A marshaller for a #GCClosure with a callback of type
4103 // <literal>void (*callback) (gpointer instance, gchar arg1, gpointer user_data)</literal>.
4104 // <closure>: the #GClosure to which the marshaller belongs
4105 // <return_value>: ignored
4106 // <n_param_values>: 2
4107 // <param_values>: a #GValue array holding the instance and the #gchar parameter
4108 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4109 // <marshal_data>: additional data specified when registering the marshaller
4110 static void cclosure_marshal_VOID__CHAR()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4111 g_cclosure_marshal_VOID__CHAR(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4115 // MOVED TO: CClosure.marshal_VOID__DOUBLE
4116 // A marshaller for a #GCClosure with a callback of type
4117 // <literal>void (*callback) (gpointer instance, gdouble arg1, gpointer user_data)</literal>.
4118 // <closure>: the #GClosure to which the marshaller belongs
4119 // <return_value>: ignored
4120 // <n_param_values>: 2
4121 // <param_values>: a #GValue array holding the instance and the #gdouble parameter
4122 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4123 // <marshal_data>: additional data specified when registering the marshaller
4124 static void cclosure_marshal_VOID__DOUBLE()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4125 g_cclosure_marshal_VOID__DOUBLE(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4129 // MOVED TO: CClosure.marshal_VOID__ENUM
4130 // A marshaller for a #GCClosure with a callback of type
4131 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter denotes an enumeration type..
4132 // <closure>: the #GClosure to which the marshaller belongs
4133 // <return_value>: ignored
4134 // <n_param_values>: 2
4135 // <param_values>: a #GValue array holding the instance and the enumeration parameter
4136 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4137 // <marshal_data>: additional data specified when registering the marshaller
4138 static void cclosure_marshal_VOID__ENUM()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4139 g_cclosure_marshal_VOID__ENUM(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4143 // MOVED TO: CClosure.marshal_VOID__FLAGS
4144 // A marshaller for a #GCClosure with a callback of type
4145 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter denotes a flags type.
4146 // <closure>: the #GClosure to which the marshaller belongs
4147 // <return_value>: ignored
4148 // <n_param_values>: 2
4149 // <param_values>: a #GValue array holding the instance and the flags parameter
4150 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4151 // <marshal_data>: additional data specified when registering the marshaller
4152 static void cclosure_marshal_VOID__FLAGS()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4153 g_cclosure_marshal_VOID__FLAGS(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4157 // MOVED TO: CClosure.marshal_VOID__FLOAT
4158 // A marshaller for a #GCClosure with a callback of type
4159 // <literal>void (*callback) (gpointer instance, gfloat arg1, gpointer user_data)</literal>.
4160 // <closure>: the #GClosure to which the marshaller belongs
4161 // <return_value>: ignored
4162 // <n_param_values>: 2
4163 // <param_values>: a #GValue array holding the instance and the #gfloat parameter
4164 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4165 // <marshal_data>: additional data specified when registering the marshaller
4166 static void cclosure_marshal_VOID__FLOAT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4167 g_cclosure_marshal_VOID__FLOAT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4171 // MOVED TO: CClosure.marshal_VOID__INT
4172 // A marshaller for a #GCClosure with a callback of type
4173 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal>.
4174 // <closure>: the #GClosure to which the marshaller belongs
4175 // <return_value>: ignored
4176 // <n_param_values>: 2
4177 // <param_values>: a #GValue array holding the instance and the #gint parameter
4178 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4179 // <marshal_data>: additional data specified when registering the marshaller
4180 static void cclosure_marshal_VOID__INT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4181 g_cclosure_marshal_VOID__INT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4185 // MOVED TO: CClosure.marshal_VOID__LONG
4186 // A marshaller for a #GCClosure with a callback of type
4187 // <literal>void (*callback) (gpointer instance, glong arg1, gpointer user_data)</literal>.
4188 // <closure>: the #GClosure to which the marshaller belongs
4189 // <return_value>: ignored
4190 // <n_param_values>: 2
4191 // <param_values>: a #GValue array holding the instance and the #glong parameter
4192 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4193 // <marshal_data>: additional data specified when registering the marshaller
4194 static void cclosure_marshal_VOID__LONG()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4195 g_cclosure_marshal_VOID__LONG(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4199 // MOVED TO: CClosure.marshal_VOID__OBJECT
4200 // A marshaller for a #GCClosure with a callback of type
4201 // <literal>void (*callback) (gpointer instance, GObject *arg1, gpointer user_data)</literal>.
4202 // <closure>: the #GClosure to which the marshaller belongs
4203 // <return_value>: ignored
4204 // <n_param_values>: 2
4205 // <param_values>: a #GValue array holding the instance and the #GObject* parameter
4206 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4207 // <marshal_data>: additional data specified when registering the marshaller
4208 static void cclosure_marshal_VOID__OBJECT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4209 g_cclosure_marshal_VOID__OBJECT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4213 // MOVED TO: CClosure.marshal_VOID__PARAM
4214 // A marshaller for a #GCClosure with a callback of type
4215 // <literal>void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data)</literal>.
4216 // <closure>: the #GClosure to which the marshaller belongs
4217 // <return_value>: ignored
4218 // <n_param_values>: 2
4219 // <param_values>: a #GValue array holding the instance and the #GParamSpec* parameter
4220 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4221 // <marshal_data>: additional data specified when registering the marshaller
4222 static void cclosure_marshal_VOID__PARAM()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4223 g_cclosure_marshal_VOID__PARAM(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4227 // MOVED TO: CClosure.marshal_VOID__POINTER
4228 // A marshaller for a #GCClosure with a callback of type
4229 // <literal>void (*callback) (gpointer instance, gpointer arg1, gpointer user_data)</literal>.
4230 // <closure>: the #GClosure to which the marshaller belongs
4231 // <return_value>: ignored
4232 // <n_param_values>: 2
4233 // <param_values>: a #GValue array holding the instance and the #gpointer parameter
4234 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4235 // <marshal_data>: additional data specified when registering the marshaller
4236 static void cclosure_marshal_VOID__POINTER()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4237 g_cclosure_marshal_VOID__POINTER(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4241 // MOVED TO: CClosure.marshal_VOID__STRING
4242 // A marshaller for a #GCClosure with a callback of type
4243 // <literal>void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data)</literal>.
4244 // <closure>: the #GClosure to which the marshaller belongs
4245 // <return_value>: ignored
4246 // <n_param_values>: 2
4247 // <param_values>: a #GValue array holding the instance and the #gchar* parameter
4248 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4249 // <marshal_data>: additional data specified when registering the marshaller
4250 static void cclosure_marshal_VOID__STRING()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4251 g_cclosure_marshal_VOID__STRING(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4255 // MOVED TO: CClosure.marshal_VOID__UCHAR
4256 // A marshaller for a #GCClosure with a callback of type
4257 // <literal>void (*callback) (gpointer instance, guchar arg1, gpointer user_data)</literal>.
4258 // <closure>: the #GClosure to which the marshaller belongs
4259 // <return_value>: ignored
4260 // <n_param_values>: 2
4261 // <param_values>: a #GValue array holding the instance and the #guchar parameter
4262 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4263 // <marshal_data>: additional data specified when registering the marshaller
4264 static void cclosure_marshal_VOID__UCHAR()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4265 g_cclosure_marshal_VOID__UCHAR(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4269 // MOVED TO: CClosure.marshal_VOID__UINT
4270 // A marshaller for a #GCClosure with a callback of type
4271 // <literal>void (*callback) (gpointer instance, guint arg1, gpointer user_data)</literal>.
4272 // <closure>: the #GClosure to which the marshaller belongs
4273 // <return_value>: ignored
4274 // <n_param_values>: 2
4275 // <param_values>: a #GValue array holding the instance and the #guint parameter
4276 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4277 // <marshal_data>: additional data specified when registering the marshaller
4278 static void cclosure_marshal_VOID__UINT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4279 g_cclosure_marshal_VOID__UINT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4283 // MOVED TO: CClosure.marshal_VOID__UINT_POINTER
4284 // A marshaller for a #GCClosure with a callback of type
4285 // <literal>void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data)</literal>.
4286 // <closure>: the #GClosure to which the marshaller belongs
4287 // <return_value>: ignored
4288 // <n_param_values>: 3
4289 // <param_values>: a #GValue array holding instance, arg1 and arg2
4290 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4291 // <marshal_data>: additional data specified when registering the marshaller
4292 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) nothrow {
4293 g_cclosure_marshal_VOID__UINT_POINTER(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4297 // MOVED TO: CClosure.marshal_VOID__ULONG
4298 // A marshaller for a #GCClosure with a callback of type
4299 // <literal>void (*callback) (gpointer instance, gulong arg1, gpointer user_data)</literal>.
4300 // <closure>: the #GClosure to which the marshaller belongs
4301 // <return_value>: ignored
4302 // <n_param_values>: 2
4303 // <param_values>: a #GValue array holding the instance and the #gulong parameter
4304 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4305 // <marshal_data>: additional data specified when registering the marshaller
4306 static void cclosure_marshal_VOID__ULONG()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4307 g_cclosure_marshal_VOID__ULONG(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4311 // VERSION: 2.26
4312 // MOVED TO: CClosure.marshal_VOID__VARIANT
4313 // A marshaller for a #GCClosure with a callback of type
4314 // <literal>void (*callback) (gpointer instance, GVariant *arg1, gpointer user_data)</literal>.
4315 // <closure>: the #GClosure to which the marshaller belongs
4316 // <return_value>: ignored
4317 // <n_param_values>: 2
4318 // <param_values>: a #GValue array holding the instance and the #GVariant* parameter
4319 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4320 // <marshal_data>: additional data specified when registering the marshaller
4321 static void cclosure_marshal_VOID__VARIANT()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4322 g_cclosure_marshal_VOID__VARIANT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4326 // MOVED TO: CClosure.marshal_VOID__VOID
4327 // A marshaller for a #GCClosure with a callback of type
4328 // <literal>void (*callback) (gpointer instance, gpointer user_data)</literal>.
4329 // <closure>: the #GClosure to which the marshaller belongs
4330 // <return_value>: ignored
4331 // <n_param_values>: 1
4332 // <param_values>: a #GValue array holding only the instance
4333 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4334 // <marshal_data>: additional data specified when registering the marshaller
4335 static void cclosure_marshal_VOID__VOID()(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4336 g_cclosure_marshal_VOID__VOID(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data);
4340 // VERSION: 2.30
4341 // MOVED TO: CClosure.marshal_generic
4342 // A generic marshaller function implemented via <ulink
4343 // url="http://sourceware.org/libffi/">libffi</ulink>.
4344 // <closure>: A #GClosure.
4345 // <return_gvalue>: A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
4346 // <n_param_values>: The length of the @param_values array.
4347 // <param_values>: An array of #GValue<!-- -->s holding the arguments on which to invoke the callback of closure.
4348 // <invocation_hint>: The invocation hint given as the last argument to g_closure_invoke().
4349 // <marshal_data>: Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
4350 static void cclosure_marshal_generic()(Closure* closure, Value* return_gvalue, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow {
4351 g_cclosure_marshal_generic(closure, return_gvalue, n_param_values, param_values, invocation_hint, marshal_data);
4355 // Unintrospectable function: cclosure_new() / g_cclosure_new()
4356 // MOVED TO: CClosure.new
4357 // Creates a new closure which invokes @callback_func with @user_data as
4358 // the last parameter.
4359 // RETURNS: a new #GCClosure
4360 // <callback_func>: the function to invoke
4361 // <user_data>: user data to pass to @callback_func
4362 // <destroy_data>: destroy notify to be called when @user_data is no longer used
4363 static Closure* /*new*/ cclosure_new()(Callback callback_func, void* user_data, ClosureNotify destroy_data) nothrow {
4364 return g_cclosure_new(callback_func, user_data, destroy_data);
4368 // Unintrospectable function: cclosure_new_object() / g_cclosure_new_object()
4369 // MOVED TO: CClosure.new_object
4370 // A variant of g_cclosure_new() which uses @object as @user_data and
4371 // calls g_object_watch_closure() on @object and the created
4372 // closure. This function is useful when you have a callback closely
4373 // associated with a #GObject, and want the callback to no longer run
4374 // after the object is is freed.
4375 // RETURNS: a new #GCClosure
4376 // <callback_func>: the function to invoke
4377 // <object>: a #GObject pointer to pass to @callback_func
4378 static Closure* /*new*/ cclosure_new_object()(Callback callback_func, Object* object) nothrow {
4379 return g_cclosure_new_object(callback_func, object);
4383 // Unintrospectable function: cclosure_new_object_swap() / g_cclosure_new_object_swap()
4384 // MOVED TO: CClosure.new_object_swap
4385 // A variant of g_cclosure_new_swap() which uses @object as @user_data
4386 // and calls g_object_watch_closure() on @object and the created
4387 // closure. This function is useful when you have a callback closely
4388 // associated with a #GObject, and want the callback to no longer run
4389 // after the object is is freed.
4390 // RETURNS: a new #GCClosure
4391 // <callback_func>: the function to invoke
4392 // <object>: a #GObject pointer to pass to @callback_func
4393 static Closure* /*new*/ cclosure_new_object_swap()(Callback callback_func, Object* object) nothrow {
4394 return g_cclosure_new_object_swap(callback_func, object);
4398 // Unintrospectable function: cclosure_new_swap() / g_cclosure_new_swap()
4399 // MOVED TO: CClosure.new_swap
4400 // Creates a new closure which invokes @callback_func with @user_data as
4401 // the first parameter.
4402 // RETURNS: a new #GCClosure
4403 // <callback_func>: the function to invoke
4404 // <user_data>: user data to pass to @callback_func
4405 // <destroy_data>: destroy notify to be called when @user_data is no longer used
4406 static Closure* /*new*/ cclosure_new_swap()(Callback callback_func, void* user_data, ClosureNotify destroy_data) nothrow {
4407 return g_cclosure_new_swap(callback_func, user_data, destroy_data);
4411 // Unintrospectable function: clear_object() / g_clear_object()
4412 // VERSION: 2.28
4413 // Clears a reference to a #GObject.
4415 // @object_ptr must not be %NULL.
4417 // If the reference is %NULL then this function does nothing.
4418 // Otherwise, the reference count of the object is decreased and the
4419 // pointer is set to %NULL.
4421 // This function is threadsafe and modifies the pointer atomically,
4422 // using memory barriers where needed.
4424 // A macro is also included that allows this function to be used without
4425 // pointer casts.
4426 // <object_ptr>: a pointer to a #GObject reference
4427 static void clear_object()(Object** object_ptr) nothrow {
4428 g_clear_object(object_ptr);
4432 // This function is meant to be called from the <literal>complete_type_info</literal>
4433 // function of a #GTypePlugin implementation, as in the following
4434 // example:
4436 // |[
4437 // static void
4438 // my_enum_complete_type_info (GTypePlugin *plugin,
4439 // GType g_type,
4440 // GTypeInfo *info,
4441 // GTypeValueTable *value_table)
4442 // {
4443 // static const GEnumValue values[] = {
4444 // { MY_ENUM_FOO, "MY_ENUM_FOO", "foo" },
4445 // { MY_ENUM_BAR, "MY_ENUM_BAR", "bar" },
4446 // { 0, NULL, NULL }
4447 // };
4449 // g_enum_complete_type_info (type, info, values);
4450 // }
4451 // ]|
4452 // <g_enum_type>: the type identifier of the type being completed
4453 // <info>: the #GTypeInfo struct to be filled in
4454 // <const_values>: An array of #GEnumValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0.
4455 static void enum_complete_type_info()(Type g_enum_type, GTypeInfo* info, EnumValue* const_values) nothrow {
4456 g_enum_complete_type_info(g_enum_type, info, const_values);
4460 // Unintrospectable function: enum_get_value() / g_enum_get_value()
4461 // Returns the #GEnumValue for a value.
4463 // member of the enumeration
4464 // RETURNS: the #GEnumValue for @value, or %NULL if @value is not a
4465 // <enum_class>: a #GEnumClass
4466 // <value>: the value to look up
4467 static EnumValue* enum_get_value()(EnumClass* enum_class, int value) nothrow {
4468 return g_enum_get_value(enum_class, value);
4472 // Unintrospectable function: enum_get_value_by_name() / g_enum_get_value_by_name()
4473 // Looks up a #GEnumValue by name.
4475 // enumeration doesn't have a member with that name
4476 // RETURNS: the #GEnumValue with name @name, or %NULL if the
4477 // <enum_class>: a #GEnumClass
4478 // <name>: the name to look up
4479 static EnumValue* enum_get_value_by_name()(EnumClass* enum_class, char* name) nothrow {
4480 return g_enum_get_value_by_name(enum_class, name);
4484 // Unintrospectable function: enum_get_value_by_nick() / g_enum_get_value_by_nick()
4485 // Looks up a #GEnumValue by nickname.
4487 // enumeration doesn't have a member with that nickname
4488 // RETURNS: the #GEnumValue with nickname @nick, or %NULL if the
4489 // <enum_class>: a #GEnumClass
4490 // <nick>: the nickname to look up
4491 static EnumValue* enum_get_value_by_nick()(EnumClass* enum_class, char* nick) nothrow {
4492 return g_enum_get_value_by_nick(enum_class, nick);
4496 // Registers a new static enumeration type with the name @name.
4498 // It is normally more convenient to let <link
4499 // linkend="glib-mkenums">glib-mkenums</link> generate a
4500 // my_enum_get_type() function from a usual C enumeration definition
4501 // than to write one yourself using g_enum_register_static().
4502 // RETURNS: The new type identifier.
4503 // <name>: A nul-terminated string used as the name of the new type.
4504 // <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.
4505 static Type enum_register_static()(char* name, EnumValue* const_static_values) nothrow {
4506 return g_enum_register_static(name, const_static_values);
4510 // This function is meant to be called from the complete_type_info()
4511 // function of a #GTypePlugin implementation, see the example for
4512 // g_enum_complete_type_info() above.
4513 // <g_flags_type>: the type identifier of the type being completed
4514 // <info>: the #GTypeInfo struct to be filled in
4515 // <const_values>: An array of #GFlagsValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0.
4516 static void flags_complete_type_info()(Type g_flags_type, GTypeInfo* info, FlagsValue* const_values) nothrow {
4517 g_flags_complete_type_info(g_flags_type, info, const_values);
4521 // Unintrospectable function: flags_get_first_value() / g_flags_get_first_value()
4522 // Returns the first #GFlagsValue which is set in @value.
4524 // none is set
4525 // RETURNS: the first #GFlagsValue which is set in @value, or %NULL if
4526 // <flags_class>: a #GFlagsClass
4527 // <value>: the value
4528 static FlagsValue* flags_get_first_value()(FlagsClass* flags_class, uint value) nothrow {
4529 return g_flags_get_first_value(flags_class, value);
4533 // Unintrospectable function: flags_get_value_by_name() / g_flags_get_value_by_name()
4534 // Looks up a #GFlagsValue by name.
4536 // flag with that name
4537 // RETURNS: the #GFlagsValue with name @name, or %NULL if there is no
4538 // <flags_class>: a #GFlagsClass
4539 // <name>: the name to look up
4540 static FlagsValue* flags_get_value_by_name()(FlagsClass* flags_class, char* name) nothrow {
4541 return g_flags_get_value_by_name(flags_class, name);
4545 // Unintrospectable function: flags_get_value_by_nick() / g_flags_get_value_by_nick()
4546 // Looks up a #GFlagsValue by nickname.
4548 // no flag with that nickname
4549 // RETURNS: the #GFlagsValue with nickname @nick, or %NULL if there is
4550 // <flags_class>: a #GFlagsClass
4551 // <nick>: the nickname to look up
4552 static FlagsValue* flags_get_value_by_nick()(FlagsClass* flags_class, char* nick) nothrow {
4553 return g_flags_get_value_by_nick(flags_class, nick);
4557 // Registers a new static flags type with the name @name.
4559 // It is normally more convenient to let <link
4560 // linkend="glib-mkenums">glib-mkenums</link> generate a
4561 // my_flags_get_type() function from a usual C enumeration definition
4562 // than to write one yourself using g_flags_register_static().
4563 // RETURNS: The new type identifier.
4564 // <name>: A nul-terminated string used as the name of the new type.
4565 // <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.
4566 static Type flags_register_static()(char* name, FlagsValue* const_static_values) nothrow {
4567 return g_flags_register_static(name, const_static_values);
4570 static Type gtype_get_type()() nothrow {
4571 return g_gtype_get_type();
4575 // Unintrospectable function: param_spec_boolean() / g_param_spec_boolean()
4576 // Creates a new #GParamSpecBoolean instance specifying a %G_TYPE_BOOLEAN
4577 // property.
4579 // See g_param_spec_internal() for details on property names.
4580 // RETURNS: a newly created parameter specification
4581 // <name>: canonical name of the property specified
4582 // <nick>: nick name for the property specified
4583 // <blurb>: description of the property specified
4584 // <default_value>: default value for the property specified
4585 // <flags>: flags for the property specified
4586 static ParamSpec* param_spec_boolean()(char* name, char* nick, char* blurb, int default_value, ParamFlags flags) nothrow {
4587 return g_param_spec_boolean(name, nick, blurb, default_value, flags);
4591 // Unintrospectable function: param_spec_boxed() / g_param_spec_boxed()
4592 // Creates a new #GParamSpecBoxed instance specifying a %G_TYPE_BOXED
4593 // derived property.
4595 // See g_param_spec_internal() for details on property names.
4596 // RETURNS: a newly created parameter specification
4597 // <name>: canonical name of the property specified
4598 // <nick>: nick name for the property specified
4599 // <blurb>: description of the property specified
4600 // <boxed_type>: %G_TYPE_BOXED derived type of this property
4601 // <flags>: flags for the property specified
4602 static ParamSpec* param_spec_boxed()(char* name, char* nick, char* blurb, Type boxed_type, ParamFlags flags) nothrow {
4603 return g_param_spec_boxed(name, nick, blurb, boxed_type, flags);
4607 // Unintrospectable function: param_spec_char() / g_param_spec_char()
4608 // Creates a new #GParamSpecChar instance specifying a %G_TYPE_CHAR property.
4609 // RETURNS: a newly created parameter specification
4610 // <name>: canonical name of the property specified
4611 // <nick>: nick name for the property specified
4612 // <blurb>: description of the property specified
4613 // <minimum>: minimum value for the property specified
4614 // <maximum>: maximum value for the property specified
4615 // <default_value>: default value for the property specified
4616 // <flags>: flags for the property specified
4617 static ParamSpec* param_spec_char()(char* name, char* nick, char* blurb, byte minimum, byte maximum, byte default_value, ParamFlags flags) nothrow {
4618 return g_param_spec_char(name, nick, blurb, minimum, maximum, default_value, flags);
4622 // Unintrospectable function: param_spec_double() / g_param_spec_double()
4623 // Creates a new #GParamSpecDouble instance specifying a %G_TYPE_DOUBLE
4624 // property.
4626 // See g_param_spec_internal() for details on property names.
4627 // RETURNS: a newly created parameter specification
4628 // <name>: canonical name of the property specified
4629 // <nick>: nick name for the property specified
4630 // <blurb>: description of the property specified
4631 // <minimum>: minimum value for the property specified
4632 // <maximum>: maximum value for the property specified
4633 // <default_value>: default value for the property specified
4634 // <flags>: flags for the property specified
4635 static ParamSpec* param_spec_double()(char* name, char* nick, char* blurb, double minimum, double maximum, double default_value, ParamFlags flags) nothrow {
4636 return g_param_spec_double(name, nick, blurb, minimum, maximum, default_value, flags);
4640 // Unintrospectable function: param_spec_enum() / g_param_spec_enum()
4641 // Creates a new #GParamSpecEnum instance specifying a %G_TYPE_ENUM
4642 // property.
4644 // See g_param_spec_internal() for details on property names.
4645 // RETURNS: a newly created parameter specification
4646 // <name>: canonical name of the property specified
4647 // <nick>: nick name for the property specified
4648 // <blurb>: description of the property specified
4649 // <enum_type>: a #GType derived from %G_TYPE_ENUM
4650 // <default_value>: default value for the property specified
4651 // <flags>: flags for the property specified
4652 static ParamSpec* param_spec_enum()(char* name, char* nick, char* blurb, Type enum_type, int default_value, ParamFlags flags) nothrow {
4653 return g_param_spec_enum(name, nick, blurb, enum_type, default_value, flags);
4657 // Unintrospectable function: param_spec_flags() / g_param_spec_flags()
4658 // Creates a new #GParamSpecFlags instance specifying a %G_TYPE_FLAGS
4659 // property.
4661 // See g_param_spec_internal() for details on property names.
4662 // RETURNS: a newly created parameter specification
4663 // <name>: canonical name of the property specified
4664 // <nick>: nick name for the property specified
4665 // <blurb>: description of the property specified
4666 // <flags_type>: a #GType derived from %G_TYPE_FLAGS
4667 // <default_value>: default value for the property specified
4668 // <flags>: flags for the property specified
4669 static ParamSpec* param_spec_flags()(char* name, char* nick, char* blurb, Type flags_type, uint default_value, ParamFlags flags) nothrow {
4670 return g_param_spec_flags(name, nick, blurb, flags_type, default_value, flags);
4674 // Unintrospectable function: param_spec_float() / g_param_spec_float()
4675 // Creates a new #GParamSpecFloat instance specifying a %G_TYPE_FLOAT property.
4677 // See g_param_spec_internal() for details on property names.
4678 // RETURNS: a newly created parameter specification
4679 // <name>: canonical name of the property specified
4680 // <nick>: nick name for the property specified
4681 // <blurb>: description of the property specified
4682 // <minimum>: minimum value for the property specified
4683 // <maximum>: maximum value for the property specified
4684 // <default_value>: default value for the property specified
4685 // <flags>: flags for the property specified
4686 static ParamSpec* param_spec_float()(char* name, char* nick, char* blurb, float minimum, float maximum, float default_value, ParamFlags flags) nothrow {
4687 return g_param_spec_float(name, nick, blurb, minimum, maximum, default_value, flags);
4691 // Unintrospectable function: param_spec_gtype() / g_param_spec_gtype()
4692 // VERSION: 2.10
4693 // Creates a new #GParamSpecGType instance specifying a
4694 // %G_TYPE_GTYPE property.
4696 // See g_param_spec_internal() for details on property names.
4697 // RETURNS: a newly created parameter specification
4698 // <name>: canonical name of the property specified
4699 // <nick>: nick name for the property specified
4700 // <blurb>: description of the property specified
4701 // <is_a_type>: a #GType whose subtypes are allowed as values of the property (use %G_TYPE_NONE for any type)
4702 // <flags>: flags for the property specified
4703 static ParamSpec* param_spec_gtype()(char* name, char* nick, char* blurb, Type is_a_type, ParamFlags flags) nothrow {
4704 return g_param_spec_gtype(name, nick, blurb, is_a_type, flags);
4708 // Unintrospectable function: param_spec_int() / g_param_spec_int()
4709 // Creates a new #GParamSpecInt instance specifying a %G_TYPE_INT property.
4711 // See g_param_spec_internal() for details on property names.
4712 // RETURNS: a newly created parameter specification
4713 // <name>: canonical name of the property specified
4714 // <nick>: nick name for the property specified
4715 // <blurb>: description of the property specified
4716 // <minimum>: minimum value for the property specified
4717 // <maximum>: maximum value for the property specified
4718 // <default_value>: default value for the property specified
4719 // <flags>: flags for the property specified
4720 static ParamSpec* param_spec_int()(char* name, char* nick, char* blurb, int minimum, int maximum, int default_value, ParamFlags flags) nothrow {
4721 return g_param_spec_int(name, nick, blurb, minimum, maximum, default_value, flags);
4725 // Unintrospectable function: param_spec_int64() / g_param_spec_int64()
4726 // Creates a new #GParamSpecInt64 instance specifying a %G_TYPE_INT64 property.
4728 // See g_param_spec_internal() for details on property names.
4729 // RETURNS: a newly created parameter specification
4730 // <name>: canonical name of the property specified
4731 // <nick>: nick name for the property specified
4732 // <blurb>: description of the property specified
4733 // <minimum>: minimum value for the property specified
4734 // <maximum>: maximum value for the property specified
4735 // <default_value>: default value for the property specified
4736 // <flags>: flags for the property specified
4737 static ParamSpec* param_spec_int64()(char* name, char* nick, char* blurb, long minimum, long maximum, long default_value, ParamFlags flags) nothrow {
4738 return g_param_spec_int64(name, nick, blurb, minimum, maximum, default_value, flags);
4742 // Unintrospectable function: param_spec_long() / g_param_spec_long()
4743 // Creates a new #GParamSpecLong instance specifying a %G_TYPE_LONG property.
4745 // See g_param_spec_internal() for details on property names.
4746 // RETURNS: a newly created parameter specification
4747 // <name>: canonical name of the property specified
4748 // <nick>: nick name for the property specified
4749 // <blurb>: description of the property specified
4750 // <minimum>: minimum value for the property specified
4751 // <maximum>: maximum value for the property specified
4752 // <default_value>: default value for the property specified
4753 // <flags>: flags for the property specified
4754 static ParamSpec* param_spec_long()(char* name, char* nick, char* blurb, c_long minimum, c_long maximum, c_long default_value, ParamFlags flags) nothrow {
4755 return g_param_spec_long(name, nick, blurb, minimum, maximum, default_value, flags);
4759 // Unintrospectable function: param_spec_object() / g_param_spec_object()
4760 // Creates a new #GParamSpecBoxed instance specifying a %G_TYPE_OBJECT
4761 // derived property.
4763 // See g_param_spec_internal() for details on property names.
4764 // RETURNS: a newly created parameter specification
4765 // <name>: canonical name of the property specified
4766 // <nick>: nick name for the property specified
4767 // <blurb>: description of the property specified
4768 // <object_type>: %G_TYPE_OBJECT derived type of this property
4769 // <flags>: flags for the property specified
4770 static ParamSpec* param_spec_object()(char* name, char* nick, char* blurb, Type object_type, ParamFlags flags) nothrow {
4771 return g_param_spec_object(name, nick, blurb, object_type, flags);
4775 // Unintrospectable function: param_spec_override() / g_param_spec_override()
4776 // VERSION: 2.4
4777 // Creates a new property of type #GParamSpecOverride. This is used
4778 // to direct operations to another paramspec, and will not be directly
4779 // useful unless you are implementing a new base type similar to GObject.
4780 // RETURNS: the newly created #GParamSpec
4781 // <name>: the name of the property.
4782 // <overridden>: The property that is being overridden
4783 static ParamSpec* param_spec_override()(char* name, ParamSpec* overridden) nothrow {
4784 return g_param_spec_override(name, overridden);
4788 // Unintrospectable function: param_spec_param() / g_param_spec_param()
4789 // Creates a new #GParamSpecParam instance specifying a %G_TYPE_PARAM
4790 // property.
4792 // See g_param_spec_internal() for details on property names.
4793 // RETURNS: a newly created parameter specification
4794 // <name>: canonical name of the property specified
4795 // <nick>: nick name for the property specified
4796 // <blurb>: description of the property specified
4797 // <param_type>: a #GType derived from %G_TYPE_PARAM
4798 // <flags>: flags for the property specified
4799 static ParamSpec* param_spec_param()(char* name, char* nick, char* blurb, Type param_type, ParamFlags flags) nothrow {
4800 return g_param_spec_param(name, nick, blurb, param_type, flags);
4804 // Unintrospectable function: param_spec_pointer() / g_param_spec_pointer()
4805 // Creates a new #GParamSpecPointer instance specifying a pointer property.
4807 // See g_param_spec_internal() for details on property names.
4808 // RETURNS: a newly created parameter specification
4809 // <name>: canonical name of the property specified
4810 // <nick>: nick name for the property specified
4811 // <blurb>: description of the property specified
4812 // <flags>: flags for the property specified
4813 static ParamSpec* param_spec_pointer()(char* name, char* nick, char* blurb, ParamFlags flags) nothrow {
4814 return g_param_spec_pointer(name, nick, blurb, flags);
4818 // MOVED TO: ParamSpecPool.new
4819 // Creates a new #GParamSpecPool.
4821 // If @type_prefixing is %TRUE, lookups in the newly created pool will
4822 // allow to specify the owner as a colon-separated prefix of the
4823 // property name, like "GtkContainer:border-width". This feature is
4824 // deprecated, so you should always set @type_prefixing to %FALSE.
4825 // RETURNS: a newly allocated #GParamSpecPool.
4826 // <type_prefixing>: Whether the pool will support type-prefixed property names.
4827 static ParamSpecPool* param_spec_pool_new()(int type_prefixing) nothrow {
4828 return g_param_spec_pool_new(type_prefixing);
4832 // Unintrospectable function: param_spec_string() / g_param_spec_string()
4833 // Creates a new #GParamSpecString instance.
4835 // See g_param_spec_internal() for details on property names.
4836 // RETURNS: a newly created parameter specification
4837 // <name>: canonical name of the property specified
4838 // <nick>: nick name for the property specified
4839 // <blurb>: description of the property specified
4840 // <default_value>: default value for the property specified
4841 // <flags>: flags for the property specified
4842 static ParamSpec* param_spec_string()(char* name, char* nick, char* blurb, char* default_value, ParamFlags flags) nothrow {
4843 return g_param_spec_string(name, nick, blurb, default_value, flags);
4847 // Unintrospectable function: param_spec_uchar() / g_param_spec_uchar()
4848 // Creates a new #GParamSpecUChar instance specifying a %G_TYPE_UCHAR property.
4849 // RETURNS: a newly created parameter specification
4850 // <name>: canonical name of the property specified
4851 // <nick>: nick name for the property specified
4852 // <blurb>: description of the property specified
4853 // <minimum>: minimum value for the property specified
4854 // <maximum>: maximum value for the property specified
4855 // <default_value>: default value for the property specified
4856 // <flags>: flags for the property specified
4857 static ParamSpec* param_spec_uchar()(char* name, char* nick, char* blurb, ubyte minimum, ubyte maximum, ubyte default_value, ParamFlags flags) nothrow {
4858 return g_param_spec_uchar(name, nick, blurb, minimum, maximum, default_value, flags);
4862 // Unintrospectable function: param_spec_uint() / g_param_spec_uint()
4863 // Creates a new #GParamSpecUInt instance specifying a %G_TYPE_UINT property.
4865 // See g_param_spec_internal() for details on property names.
4866 // RETURNS: a newly created parameter specification
4867 // <name>: canonical name of the property specified
4868 // <nick>: nick name for the property specified
4869 // <blurb>: description of the property specified
4870 // <minimum>: minimum value for the property specified
4871 // <maximum>: maximum value for the property specified
4872 // <default_value>: default value for the property specified
4873 // <flags>: flags for the property specified
4874 static ParamSpec* param_spec_uint()(char* name, char* nick, char* blurb, uint minimum, uint maximum, uint default_value, ParamFlags flags) nothrow {
4875 return g_param_spec_uint(name, nick, blurb, minimum, maximum, default_value, flags);
4879 // Unintrospectable function: param_spec_uint64() / g_param_spec_uint64()
4880 // Creates a new #GParamSpecUInt64 instance specifying a %G_TYPE_UINT64
4881 // property.
4883 // See g_param_spec_internal() for details on property names.
4884 // RETURNS: a newly created parameter specification
4885 // <name>: canonical name of the property specified
4886 // <nick>: nick name for the property specified
4887 // <blurb>: description of the property specified
4888 // <minimum>: minimum value for the property specified
4889 // <maximum>: maximum value for the property specified
4890 // <default_value>: default value for the property specified
4891 // <flags>: flags for the property specified
4892 static ParamSpec* param_spec_uint64()(char* name, char* nick, char* blurb, ulong minimum, ulong maximum, ulong default_value, ParamFlags flags) nothrow {
4893 return g_param_spec_uint64(name, nick, blurb, minimum, maximum, default_value, flags);
4897 // Unintrospectable function: param_spec_ulong() / g_param_spec_ulong()
4898 // Creates a new #GParamSpecULong instance specifying a %G_TYPE_ULONG
4899 // property.
4901 // See g_param_spec_internal() for details on property names.
4902 // RETURNS: a newly created parameter specification
4903 // <name>: canonical name of the property specified
4904 // <nick>: nick name for the property specified
4905 // <blurb>: description of the property specified
4906 // <minimum>: minimum value for the property specified
4907 // <maximum>: maximum value for the property specified
4908 // <default_value>: default value for the property specified
4909 // <flags>: flags for the property specified
4910 static ParamSpec* param_spec_ulong()(char* name, char* nick, char* blurb, c_ulong minimum, c_ulong maximum, c_ulong default_value, ParamFlags flags) nothrow {
4911 return g_param_spec_ulong(name, nick, blurb, minimum, maximum, default_value, flags);
4915 // Unintrospectable function: param_spec_unichar() / g_param_spec_unichar()
4916 // Creates a new #GParamSpecUnichar instance specifying a %G_TYPE_UINT
4917 // property. #GValue structures for this property can be accessed with
4918 // g_value_set_uint() and g_value_get_uint().
4920 // See g_param_spec_internal() for details on property names.
4921 // RETURNS: a newly created parameter specification
4922 // <name>: canonical name of the property specified
4923 // <nick>: nick name for the property specified
4924 // <blurb>: description of the property specified
4925 // <default_value>: default value for the property specified
4926 // <flags>: flags for the property specified
4927 static ParamSpec* param_spec_unichar()(char* name, char* nick, char* blurb, dchar default_value, ParamFlags flags) nothrow {
4928 return g_param_spec_unichar(name, nick, blurb, default_value, flags);
4932 // Unintrospectable function: param_spec_value_array() / g_param_spec_value_array()
4933 // Creates a new #GParamSpecValueArray instance specifying a
4934 // %G_TYPE_VALUE_ARRAY property. %G_TYPE_VALUE_ARRAY is a
4935 // %G_TYPE_BOXED type, as such, #GValue structures for this property
4936 // can be accessed with g_value_set_boxed() and g_value_get_boxed().
4938 // See g_param_spec_internal() for details on property names.
4939 // RETURNS: a newly created parameter specification
4940 // <name>: canonical name of the property specified
4941 // <nick>: nick name for the property specified
4942 // <blurb>: description of the property specified
4943 // <element_spec>: a #GParamSpec describing the elements contained in arrays of this property, may be %NULL
4944 // <flags>: flags for the property specified
4945 static ParamSpec* param_spec_value_array()(char* name, char* nick, char* blurb, ParamSpec* element_spec, ParamFlags flags) nothrow {
4946 return g_param_spec_value_array(name, nick, blurb, element_spec, flags);
4950 // Unintrospectable function: param_spec_variant() / g_param_spec_variant()
4951 // VERSION: 2.26
4952 // Creates a new #GParamSpecVariant instance specifying a #GVariant
4953 // property.
4955 // If @default_value is floating, it is consumed.
4957 // See g_param_spec_internal() for details on property names.
4958 // RETURNS: the newly created #GParamSpec
4959 // <name>: canonical name of the property specified
4960 // <nick>: nick name for the property specified
4961 // <blurb>: description of the property specified
4962 // <type>: a #GVariantType
4963 // <default_value>: a #GVariant of type @type to use as the default value, or %NULL
4964 // <flags>: flags for the property specified
4965 static ParamSpec* param_spec_variant()(char* name, char* nick, char* blurb, GLib2.VariantType* type, GLib2.Variant* default_value, ParamFlags flags) nothrow {
4966 return g_param_spec_variant(name, nick, blurb, type, default_value, flags);
4970 // Registers @name as the name of a new static type derived from
4971 // #G_TYPE_PARAM. The type system uses the information contained in
4972 // the #GParamSpecTypeInfo structure pointed to by @info to manage the
4973 // #GParamSpec type and its instances.
4974 // RETURNS: The new type identifier.
4975 // <name>: 0-terminated string used as the name of the new #GParamSpec type.
4976 // <pspec_info>: The #GParamSpecTypeInfo for this #GParamSpec type.
4977 static Type param_type_register_static()(char* name, ParamSpecTypeInfo* pspec_info) nothrow {
4978 return g_param_type_register_static(name, pspec_info);
4982 // Transforms @src_value into @dest_value if possible, and then
4983 // validates @dest_value, in order for it to conform to @pspec. If
4984 // @strict_validation is %TRUE this function will only succeed if the
4985 // transformed @dest_value complied to @pspec without modifications.
4987 // See also g_value_type_transformable(), g_value_transform() and
4988 // g_param_value_validate().
4990 // %FALSE otherwise and @dest_value is left untouched.
4991 // RETURNS: %TRUE if transformation and validation were successful,
4992 // <pspec>: a valid #GParamSpec
4993 // <src_value>: souce #GValue
4994 // <dest_value>: destination #GValue of correct type for @pspec
4995 // <strict_validation>: %TRUE requires @dest_value to conform to @pspec without modifications
4996 static int param_value_convert()(ParamSpec* pspec, Value* src_value, Value* dest_value, int strict_validation) nothrow {
4997 return g_param_value_convert(pspec, src_value, dest_value, strict_validation);
5001 // Checks whether @value contains the default value as specified in @pspec.
5002 // RETURNS: whether @value contains the canonical default for this @pspec
5003 // <pspec>: a valid #GParamSpec
5004 // <value>: a #GValue of correct type for @pspec
5005 static int param_value_defaults()(ParamSpec* pspec, Value* value) nothrow {
5006 return g_param_value_defaults(pspec, value);
5010 // Sets @value to its default value as specified in @pspec.
5011 // <pspec>: a valid #GParamSpec
5012 // <value>: a #GValue of correct type for @pspec
5013 static void param_value_set_default()(ParamSpec* pspec, Value* value) nothrow {
5014 g_param_value_set_default(pspec, value);
5018 // Ensures that the contents of @value comply with the specifications
5019 // set out by @pspec. For example, a #GParamSpecInt might require
5020 // that integers stored in @value may not be smaller than -42 and not be
5021 // greater than +42. If @value contains an integer outside of this range,
5022 // it is modified accordingly, so the resulting value will fit into the
5023 // range -42 .. +42.
5024 // RETURNS: whether modifying @value was necessary to ensure validity
5025 // <pspec>: a valid #GParamSpec
5026 // <value>: a #GValue of correct type for @pspec
5027 static int param_value_validate()(ParamSpec* pspec, Value* value) nothrow {
5028 return g_param_value_validate(pspec, value);
5032 // Compares @value1 with @value2 according to @pspec, and return -1, 0 or +1,
5033 // if @value1 is found to be less than, equal to or greater than @value2,
5034 // respectively.
5035 // RETURNS: -1, 0 or +1, for a less than, equal to or greater than result
5036 // <pspec>: a valid #GParamSpec
5037 // <value1>: a #GValue of correct type for @pspec
5038 // <value2>: a #GValue of correct type for @pspec
5039 static int param_values_cmp()(ParamSpec* pspec, Value* value1, Value* value2) nothrow {
5040 return g_param_values_cmp(pspec, value1, value2);
5044 // Creates a new %G_TYPE_POINTER derived type id for a new
5045 // pointer type with name @name.
5046 // RETURNS: a new %G_TYPE_POINTER derived type id for @name.
5047 // <name>: the name of the new pointer type.
5048 static Type pointer_type_register_static()(char* name) nothrow {
5049 return g_pointer_type_register_static(name);
5053 // VERSION: 2.28
5054 // A predefined #GSignalAccumulator for signals intended to be used as a
5055 // hook for application code to provide a particular value. Usually
5056 // only one such value is desired and multiple handlers for the same
5057 // signal don't make much sense (except for the case of the default
5058 // handler defined in the class structure, in which case you will
5059 // usually want the signal connection to override the class handler).
5061 // This accumulator will use the return value from the first signal
5062 // handler that is run as the return value for the signal and not run
5063 // any further handlers (ie: the first handler "wins").
5064 // RETURNS: standard #GSignalAccumulator result
5065 // <ihint>: standard #GSignalAccumulator parameter
5066 // <return_accu>: standard #GSignalAccumulator parameter
5067 // <handler_return>: standard #GSignalAccumulator parameter
5068 // <dummy>: standard #GSignalAccumulator parameter
5069 static int signal_accumulator_first_wins()(SignalInvocationHint* ihint, Value* return_accu, Value* handler_return, void* dummy) nothrow {
5070 return g_signal_accumulator_first_wins(ihint, return_accu, handler_return, dummy);
5074 // VERSION: 2.4
5075 // A predefined #GSignalAccumulator for signals that return a
5076 // boolean values. The behavior that this accumulator gives is
5077 // that a return of %TRUE stops the signal emission: no further
5078 // callbacks will be invoked, while a return of %FALSE allows
5079 // the emission to continue. The idea here is that a %TRUE return
5080 // indicates that the callback <emphasis>handled</emphasis> the signal,
5081 // and no further handling is needed.
5082 // RETURNS: standard #GSignalAccumulator result
5083 // <ihint>: standard #GSignalAccumulator parameter
5084 // <return_accu>: standard #GSignalAccumulator parameter
5085 // <handler_return>: standard #GSignalAccumulator parameter
5086 // <dummy>: standard #GSignalAccumulator parameter
5087 static int signal_accumulator_true_handled()(SignalInvocationHint* ihint, Value* return_accu, Value* handler_return, void* dummy) nothrow {
5088 return g_signal_accumulator_true_handled(ihint, return_accu, handler_return, dummy);
5092 // Adds an emission hook for a signal, which will get called for any emission
5093 // of that signal, independent of the instance. This is possible only
5094 // for signals which don't have #G_SIGNAL_NO_HOOKS flag set.
5095 // RETURNS: the hook id, for later use with g_signal_remove_emission_hook().
5096 // <signal_id>: the signal identifier, as returned by g_signal_lookup().
5097 // <detail>: the detail on which to call the hook.
5098 // <hook_func>: a #GSignalEmissionHook function.
5099 // <hook_data>: user data for @hook_func.
5100 // <data_destroy>: a #GDestroyNotify for @hook_data.
5101 static c_ulong signal_add_emission_hook()(uint signal_id, GLib2.Quark detail, SignalEmissionHook hook_func, void* hook_data, GLib2.DestroyNotify data_destroy) nothrow {
5102 return g_signal_add_emission_hook(signal_id, detail, hook_func, hook_data, data_destroy);
5106 // Calls the original class closure of a signal. This function should only
5107 // be called from an overridden class closure; see
5108 // g_signal_override_class_closure() and
5109 // g_signal_override_class_handler().
5110 // <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.
5111 // <return_value>: Location for the return value.
5112 static void signal_chain_from_overridden()(Value* instance_and_params, Value* return_value) nothrow {
5113 g_signal_chain_from_overridden(instance_and_params, return_value);
5117 // Unintrospectable function: signal_chain_from_overridden_handler() / g_signal_chain_from_overridden_handler()
5118 // VERSION: 2.18
5119 // Calls the original class closure of a signal. This function should
5120 // only be called from an overridden class closure; see
5121 // g_signal_override_class_closure() and
5122 // g_signal_override_class_handler().
5123 // <instance>: the instance the signal is being emitted on.
5124 alias g_signal_chain_from_overridden_handler signal_chain_from_overridden_handler; // Variadic
5127 // Connects a closure to a signal for a particular object.
5128 // RETURNS: the handler id
5129 // <instance>: the instance to connect to.
5130 // <detailed_signal>: a string of the form "signal-name::detail".
5131 // <closure>: the closure to connect.
5132 // <after>: whether the handler should be called before or after the default handler of the signal.
5133 static c_ulong signal_connect_closure()(void* instance, char* detailed_signal, Closure* closure, int after) nothrow {
5134 return g_signal_connect_closure(instance, detailed_signal, closure, after);
5138 // Connects a closure to a signal for a particular object.
5139 // RETURNS: the handler id
5140 // <instance>: the instance to connect to.
5141 // <signal_id>: the id of the signal.
5142 // <detail>: the detail.
5143 // <closure>: the closure to connect.
5144 // <after>: whether the handler should be called before or after the default handler of the signal.
5145 static c_ulong signal_connect_closure_by_id()(void* instance, uint signal_id, GLib2.Quark detail, Closure* closure, int after) nothrow {
5146 return g_signal_connect_closure_by_id(instance, signal_id, detail, closure, after);
5150 // Unintrospectable function: signal_connect_data() / g_signal_connect_data()
5151 // Connects a #GCallback function to a signal for a particular object. Similar
5152 // to g_signal_connect(), but allows to provide a #GClosureNotify for the data
5153 // which will be called when the signal handler is disconnected and no longer
5154 // used. Specify @connect_flags if you need <literal>..._after()</literal> or
5155 // <literal>..._swapped()</literal> variants of this function.
5156 // RETURNS: the handler id
5157 // <instance>: the instance to connect to.
5158 // <detailed_signal>: a string of the form "signal-name::detail".
5159 // <c_handler>: the #GCallback to connect.
5160 // <data>: data to pass to @c_handler calls.
5161 // <destroy_data>: a #GClosureNotify for @data.
5162 // <connect_flags>: a combination of #GConnectFlags.
5163 static c_ulong signal_connect_data()(void* instance, char* detailed_signal, Callback c_handler, void* data, ClosureNotify destroy_data, ConnectFlags connect_flags) nothrow {
5164 return g_signal_connect_data(instance, detailed_signal, c_handler, data, destroy_data, connect_flags);
5168 // Unintrospectable function: signal_connect_object() / g_signal_connect_object()
5169 // This is similar to g_signal_connect_data(), but uses a closure which
5170 // ensures that the @gobject stays alive during the call to @c_handler
5171 // by temporarily adding a reference count to @gobject.
5173 // Note that there is a bug in GObject that makes this function
5174 // much less useful than it might seem otherwise. Once @gobject is
5175 // disposed, the callback will no longer be called, but, the signal
5176 // handler is <emphasis>not</emphasis> currently disconnected. If the
5177 // @instance is itself being freed at the same time than this doesn't
5178 // matter, since the signal will automatically be removed, but
5179 // if @instance persists, then the signal handler will leak. You
5180 // should not remove the signal yourself because in a future versions of
5181 // GObject, the handler <emphasis>will</emphasis> automatically
5182 // be disconnected.
5184 // It's possible to work around this problem in a way that will
5185 // continue to work with future versions of GObject by checking
5186 // that the signal handler is still connected before disconnected it:
5187 // <informalexample><programlisting>
5188 // if (g_signal_handler_is_connected (instance, id))
5189 // g_signal_handler_disconnect (instance, id);
5190 // </programlisting></informalexample>
5191 // RETURNS: the handler id.
5192 // <instance>: the instance to connect to.
5193 // <detailed_signal>: a string of the form "signal-name::detail".
5194 // <c_handler>: the #GCallback to connect.
5195 // <gobject>: the object to pass as data to @c_handler.
5196 // <connect_flags>: a combination of #GConnectFlags.
5197 static c_ulong signal_connect_object()(void* instance, char* detailed_signal, Callback c_handler, void* gobject, ConnectFlags connect_flags) nothrow {
5198 return g_signal_connect_object(instance, detailed_signal, c_handler, gobject, connect_flags);
5202 // Unintrospectable function: signal_emit() / g_signal_emit()
5203 // Emits a signal.
5205 // Note that g_signal_emit() resets the return value to the default
5206 // if no handlers are connected, in contrast to g_signal_emitv().
5207 // <instance>: the instance the signal is being emitted on.
5208 // <signal_id>: the signal id
5209 // <detail>: the detail
5210 alias g_signal_emit signal_emit; // Variadic
5213 // Unintrospectable function: signal_emit_by_name() / g_signal_emit_by_name()
5214 // Emits a signal.
5216 // Note that g_signal_emit_by_name() resets the return value to the default
5217 // if no handlers are connected, in contrast to g_signal_emitv().
5218 // <instance>: the instance the signal is being emitted on.
5219 // <detailed_signal>: a string of the form "signal-name::detail".
5220 alias g_signal_emit_by_name signal_emit_by_name; // Variadic
5223 // Unintrospectable function: signal_emit_valist() / g_signal_emit_valist()
5224 // Emits a signal.
5226 // Note that g_signal_emit_valist() resets the return value to the default
5227 // if no handlers are connected, in contrast to g_signal_emitv().
5228 // <instance>: the instance the signal is being emitted on.
5229 // <signal_id>: the signal id
5230 // <detail>: the detail
5231 // <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.
5232 static void signal_emit_valist()(void* instance, uint signal_id, GLib2.Quark detail, va_list var_args) nothrow {
5233 g_signal_emit_valist(instance, signal_id, detail, var_args);
5237 // Emits a signal.
5239 // Note that g_signal_emitv() doesn't change @return_value if no handlers are
5240 // connected, in contrast to g_signal_emit() and g_signal_emit_valist().
5241 // <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.
5242 // <signal_id>: the signal id
5243 // <detail>: the detail
5244 // <return_value>: Location to store the return value of the signal emission.
5245 static void signal_emitv()(Value* instance_and_params, uint signal_id, GLib2.Quark detail, Value* return_value) nothrow {
5246 g_signal_emitv(instance_and_params, signal_id, detail, return_value);
5250 // Returns the invocation hint of the innermost signal emission of instance.
5251 // RETURNS: the invocation hint of the innermost signal emission.
5252 // <instance>: the instance to query
5253 static SignalInvocationHint* signal_get_invocation_hint()(void* instance) nothrow {
5254 return g_signal_get_invocation_hint(instance);
5258 // Blocks a handler of an instance so it will not be called during any
5259 // signal emissions unless it is unblocked again. Thus "blocking" a
5260 // signal handler means to temporarily deactive it, a signal handler
5261 // has to be unblocked exactly the same amount of times it has been
5262 // blocked before to become active again.
5264 // The @handler_id has to be a valid signal handler id, connected to a
5265 // signal of @instance.
5266 // <instance>: The instance to block the signal handler of.
5267 // <handler_id>: Handler id of the handler to be blocked.
5268 static void signal_handler_block()(void* instance, c_ulong handler_id) nothrow {
5269 g_signal_handler_block(instance, handler_id);
5273 // Disconnects a handler from an instance so it will not be called during
5274 // any future or currently ongoing emissions of the signal it has been
5275 // connected to. The @handler_id becomes invalid and may be reused.
5277 // The @handler_id has to be a valid signal handler id, connected to a
5278 // signal of @instance.
5279 // <instance>: The instance to remove the signal handler from.
5280 // <handler_id>: Handler id of the handler to be disconnected.
5281 static void signal_handler_disconnect()(void* instance, c_ulong handler_id) nothrow {
5282 g_signal_handler_disconnect(instance, handler_id);
5286 // Finds the first signal handler that matches certain selection criteria.
5287 // The criteria mask is passed as an OR-ed combination of #GSignalMatchType
5288 // flags, and the criteria values are passed as arguments.
5289 // The match @mask has to be non-0 for successful matches.
5290 // If no handler was found, 0 is returned.
5291 // RETURNS: A valid non-0 signal handler id for a successful match.
5292 // <instance>: The instance owning the signal handler to be found.
5293 // <mask>: Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handler has to match.
5294 // <signal_id>: Signal the handler has to be connected to.
5295 // <detail>: Signal detail the handler has to be connected to.
5296 // <closure>: The closure the handler will invoke.
5297 // <func>: The C closure callback of the handler (useless for non-C closures).
5298 // <data>: The closure data of the handler's closure.
5299 static c_ulong signal_handler_find()(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data) nothrow {
5300 return g_signal_handler_find(instance, mask, signal_id, detail, closure, func, data);
5304 // Returns whether @handler_id is the id of a handler connected to @instance.
5305 // RETURNS: whether @handler_id identifies a handler connected to @instance.
5306 // <instance>: The instance where a signal handler is sought.
5307 // <handler_id>: the handler id.
5308 static int signal_handler_is_connected()(void* instance, c_ulong handler_id) nothrow {
5309 return g_signal_handler_is_connected(instance, handler_id);
5313 // Undoes the effect of a previous g_signal_handler_block() call. A
5314 // blocked handler is skipped during signal emissions and will not be
5315 // invoked, unblocking it (for exactly the amount of times it has been
5316 // blocked before) reverts its "blocked" state, so the handler will be
5317 // recognized by the signal system and is called upon future or
5318 // currently ongoing signal emissions (since the order in which
5319 // handlers are called during signal emissions is deterministic,
5320 // whether the unblocked handler in question is called as part of a
5321 // currently ongoing emission depends on how far that emission has
5322 // proceeded yet).
5324 // The @handler_id has to be a valid id of a signal handler that is
5325 // connected to a signal of @instance and is currently blocked.
5326 // <instance>: The instance to unblock the signal handler of.
5327 // <handler_id>: Handler id of the handler to be unblocked.
5328 static void signal_handler_unblock()(void* instance, c_ulong handler_id) nothrow {
5329 g_signal_handler_unblock(instance, handler_id);
5333 // Blocks all handlers on an instance that match a certain selection criteria.
5334 // The criteria mask is passed as an OR-ed combination of #GSignalMatchType
5335 // flags, and the criteria values are passed as arguments.
5336 // Passing at least one of the %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC
5337 // or %G_SIGNAL_MATCH_DATA match flags is required for successful matches.
5338 // If no handlers were found, 0 is returned, the number of blocked handlers
5339 // otherwise.
5340 // RETURNS: The number of handlers that matched.
5341 // <instance>: The instance to block handlers from.
5342 // <mask>: Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handlers have to match.
5343 // <signal_id>: Signal the handlers have to be connected to.
5344 // <detail>: Signal detail the handlers have to be connected to.
5345 // <closure>: The closure the handlers will invoke.
5346 // <func>: The C closure callback of the handlers (useless for non-C closures).
5347 // <data>: The closure data of the handlers' closures.
5348 static uint signal_handlers_block_matched()(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data) nothrow {
5349 return g_signal_handlers_block_matched(instance, mask, signal_id, detail, closure, func, data);
5352 static void signal_handlers_destroy()(void* instance) nothrow {
5353 g_signal_handlers_destroy(instance);
5357 // Disconnects all handlers on an instance that match a certain
5358 // selection criteria. The criteria mask is passed as an OR-ed
5359 // combination of #GSignalMatchType flags, and the criteria values are
5360 // passed as arguments. Passing at least one of the
5361 // %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC or
5362 // %G_SIGNAL_MATCH_DATA match flags is required for successful
5363 // matches. If no handlers were found, 0 is returned, the number of
5364 // disconnected handlers otherwise.
5365 // RETURNS: The number of handlers that matched.
5366 // <instance>: The instance to remove handlers from.
5367 // <mask>: Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handlers have to match.
5368 // <signal_id>: Signal the handlers have to be connected to.
5369 // <detail>: Signal detail the handlers have to be connected to.
5370 // <closure>: The closure the handlers will invoke.
5371 // <func>: The C closure callback of the handlers (useless for non-C closures).
5372 // <data>: The closure data of the handlers' closures.
5373 static uint signal_handlers_disconnect_matched()(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data) nothrow {
5374 return g_signal_handlers_disconnect_matched(instance, mask, signal_id, detail, closure, func, data);
5378 // Unblocks all handlers on an instance that match a certain selection
5379 // criteria. The criteria mask is passed as an OR-ed combination of
5380 // #GSignalMatchType flags, and the criteria values are passed as arguments.
5381 // Passing at least one of the %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC
5382 // or %G_SIGNAL_MATCH_DATA match flags is required for successful matches.
5383 // If no handlers were found, 0 is returned, the number of unblocked handlers
5384 // otherwise. The match criteria should not apply to any handlers that are
5385 // not currently blocked.
5386 // RETURNS: The number of handlers that matched.
5387 // <instance>: The instance to unblock handlers from.
5388 // <mask>: Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handlers have to match.
5389 // <signal_id>: Signal the handlers have to be connected to.
5390 // <detail>: Signal detail the handlers have to be connected to.
5391 // <closure>: The closure the handlers will invoke.
5392 // <func>: The C closure callback of the handlers (useless for non-C closures).
5393 // <data>: The closure data of the handlers' closures.
5394 static uint signal_handlers_unblock_matched()(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data) nothrow {
5395 return g_signal_handlers_unblock_matched(instance, mask, signal_id, detail, closure, func, data);
5399 // Returns whether there are any handlers connected to @instance for the
5400 // given signal id and detail.
5402 // One example of when you might use this is when the arguments to the
5403 // signal are difficult to compute. A class implementor may opt to not
5404 // emit the signal if no one is attached anyway, thus saving the cost
5405 // of building the arguments.
5407 // otherwise.
5408 // RETURNS: %TRUE if a handler is connected to the signal, %FALSE
5409 // <instance>: the object whose signal handlers are sought.
5410 // <signal_id>: the signal id.
5411 // <detail>: the detail.
5412 // <may_be_blocked>: whether blocked handlers should count as match.
5413 static int signal_has_handler_pending()(void* instance, uint signal_id, GLib2.Quark detail, int may_be_blocked) nothrow {
5414 return g_signal_has_handler_pending(instance, signal_id, detail, may_be_blocked);
5418 // Lists the signals by id that a certain instance or interface type
5419 // created. Further information about the signals can be acquired through
5420 // g_signal_query().
5421 // RETURNS: Newly allocated array of signal IDs.
5422 // <itype>: Instance or interface type.
5423 // <n_ids>: Location to store the number of signal ids for @itype.
5424 static uint* signal_list_ids()(Type itype, /*out*/ uint* n_ids) nothrow {
5425 return g_signal_list_ids(itype, n_ids);
5429 // Given the name of the signal and the type of object it connects to, gets
5430 // the signal's identifying integer. Emitting the signal by number is
5431 // somewhat faster than using the name each time.
5433 // Also tries the ancestors of the given type.
5435 // See g_signal_new() for details on allowed signal names.
5436 // RETURNS: the signal's identifying number, or 0 if no signal was found.
5437 // <name>: the signal's name.
5438 // <itype>: the type that the signal operates on.
5439 static uint signal_lookup()(char* name, Type itype) nothrow {
5440 return g_signal_lookup(name, itype);
5444 // Given the signal's identifier, finds its name.
5446 // Two different signals may have the same name, if they have differing types.
5447 // RETURNS: the signal name, or %NULL if the signal number was invalid.
5448 // <signal_id>: the signal's identifying number.
5449 static char* signal_name()(uint signal_id) nothrow {
5450 return g_signal_name(signal_id);
5454 // Unintrospectable function: signal_new() / g_signal_new()
5455 // Creates a new signal. (This is usually done in the class initializer.)
5457 // A signal name consists of segments consisting of ASCII letters and
5458 // digits, separated by either the '-' or '_' character. The first
5459 // character of a signal name must be a letter. Names which violate these
5460 // rules lead to undefined behaviour of the GSignal system.
5462 // When registering a signal and looking up a signal, either separator can
5463 // be used, but they cannot be mixed.
5465 // If 0 is used for @class_offset subclasses cannot override the class handler
5466 // in their <code>class_init</code> method by doing
5467 // <code>super_class->signal_handler = my_signal_handler</code>. Instead they
5468 // will have to use g_signal_override_class_handler().
5470 // If c_marshaller is %NULL, g_cclosure_marshal_generic() will be used as
5471 // the marshaller for this signal.
5472 // RETURNS: the signal id
5473 // <signal_name>: the name for the signal
5474 // <itype>: the type this signal pertains to. It will also pertain to types which are derived from this type.
5475 // <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.
5476 // <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.
5477 // <accumulator>: the accumulator for this signal; may be %NULL.
5478 // <accu_data>: user data for the @accumulator.
5479 // <c_marshaller>: the function to translate arrays of parameter values to signal emissions into C language callback invocations or %NULL.
5480 // <return_type>: the type of return value, or #G_TYPE_NONE for a signal without a return value.
5481 // <n_params>: the number of parameter types to follow.
5482 alias g_signal_new signal_new; // Variadic
5485 // Unintrospectable function: signal_new_class_handler() / g_signal_new_class_handler()
5486 // VERSION: 2.18
5487 // Creates a new signal. (This is usually done in the class initializer.)
5489 // This is a variant of g_signal_new() that takes a C callback instead
5490 // off a class offset for the signal's class handler. This function
5491 // doesn't need a function pointer exposed in the class structure of
5492 // an object definition, instead the function pointer is passed
5493 // directly and can be overriden by derived classes with
5494 // g_signal_override_class_closure() or
5495 // g_signal_override_class_handler()and chained to with
5496 // g_signal_chain_from_overridden() or
5497 // g_signal_chain_from_overridden_handler().
5499 // See g_signal_new() for information about signal names.
5501 // If c_marshaller is %NULL @g_cclosure_marshal_generic will be used as
5502 // the marshaller for this signal.
5503 // RETURNS: the signal id
5504 // <signal_name>: the name for the signal
5505 // <itype>: the type this signal pertains to. It will also pertain to types which are derived from this type.
5506 // <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.
5507 // <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.
5508 // <accumulator>: the accumulator for this signal; may be %NULL.
5509 // <accu_data>: user data for the @accumulator.
5510 // <c_marshaller>: the function to translate arrays of parameter values to signal emissions into C language callback invocations or %NULL.
5511 // <return_type>: the type of return value, or #G_TYPE_NONE for a signal without a return value.
5512 // <n_params>: the number of parameter types to follow.
5513 alias g_signal_new_class_handler signal_new_class_handler; // Variadic
5516 // Unintrospectable function: signal_new_valist() / g_signal_new_valist()
5517 // Creates a new signal. (This is usually done in the class initializer.)
5519 // See g_signal_new() for details on allowed signal names.
5521 // If c_marshaller is %NULL, g_cclosure_marshal_generic() will be used as
5522 // the marshaller for this signal.
5523 // RETURNS: the signal id
5524 // <signal_name>: the name for the signal
5525 // <itype>: the type this signal pertains to. It will also pertain to types which are derived from this type.
5526 // <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.
5527 // <class_closure>: The closure to invoke on signal emission; may be %NULL.
5528 // <accumulator>: the accumulator for this signal; may be %NULL.
5529 // <accu_data>: user data for the @accumulator.
5530 // <c_marshaller>: the function to translate arrays of parameter values to signal emissions into C language callback invocations or %NULL.
5531 // <return_type>: the type of return value, or #G_TYPE_NONE for a signal without a return value.
5532 // <n_params>: the number of parameter types in @args.
5533 // <args>: va_list of #GType, one for each parameter.
5534 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) nothrow {
5535 return g_signal_new_valist(signal_name, itype, signal_flags, class_closure, accumulator, accu_data, c_marshaller, return_type, n_params, args);
5539 // Unintrospectable function: signal_newv() / g_signal_newv()
5540 // Creates a new signal. (This is usually done in the class initializer.)
5542 // See g_signal_new() for details on allowed signal names.
5544 // If c_marshaller is %NULL @g_cclosure_marshal_generic will be used as
5545 // the marshaller for this signal.
5546 // RETURNS: the signal id
5547 // <signal_name>: the name for the signal
5548 // <itype>: the type this signal pertains to. It will also pertain to types which are derived from this type
5549 // <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
5550 // <class_closure>: The closure to invoke on signal emission; may be %NULL
5551 // <accumulator>: the accumulator for this signal; may be %NULL
5552 // <accu_data>: user data for the @accumulator
5553 // <c_marshaller>: the function to translate arrays of parameter values to signal emissions into C language callback invocations or %NULL
5554 // <return_type>: the type of return value, or #G_TYPE_NONE for a signal without a return value
5555 // <n_params>: the length of @param_types
5556 // <param_types>: an array of types, one for each parameter
5557 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) nothrow {
5558 return g_signal_newv(signal_name, itype, signal_flags, class_closure, accumulator, accu_data, c_marshaller, return_type, n_params, param_types);
5562 // Overrides the class closure (i.e. the default handler) for the given signal
5563 // for emissions on instances of @instance_type. @instance_type must be derived
5564 // from the type to which the signal belongs.
5566 // See g_signal_chain_from_overridden() and
5567 // g_signal_chain_from_overridden_handler() for how to chain up to the
5568 // parent class closure from inside the overridden one.
5569 // <signal_id>: the signal id
5570 // <instance_type>: the instance type on which to override the class closure for the signal.
5571 // <class_closure>: the closure.
5572 static void signal_override_class_closure()(uint signal_id, Type instance_type, Closure* class_closure) nothrow {
5573 g_signal_override_class_closure(signal_id, instance_type, class_closure);
5577 // Unintrospectable function: signal_override_class_handler() / g_signal_override_class_handler()
5578 // VERSION: 2.18
5579 // Overrides the class closure (i.e. the default handler) for the
5580 // given signal for emissions on instances of @instance_type with
5581 // callabck @class_handler. @instance_type must be derived from the
5582 // type to which the signal belongs.
5584 // See g_signal_chain_from_overridden() and
5585 // g_signal_chain_from_overridden_handler() for how to chain up to the
5586 // parent class closure from inside the overridden one.
5587 // <signal_name>: the name for the signal
5588 // <instance_type>: the instance type on which to override the class handler for the signal.
5589 // <class_handler>: the handler.
5590 static void signal_override_class_handler()(char* signal_name, Type instance_type, Callback class_handler) nothrow {
5591 g_signal_override_class_handler(signal_name, instance_type, class_handler);
5595 // Internal function to parse a signal name into its @signal_id
5596 // and @detail quark.
5597 // RETURNS: Whether the signal name could successfully be parsed and @signal_id_p and @detail_p contain valid return values.
5598 // <detailed_signal>: a string of the form "signal-name::detail".
5599 // <itype>: The interface/instance type that introduced "signal-name".
5600 // <signal_id_p>: Location to store the signal id.
5601 // <detail_p>: Location to store the detail quark.
5602 // <force_detail_quark>: %TRUE forces creation of a #GQuark for the detail.
5603 static int signal_parse_name()(char* detailed_signal, Type itype, /*out*/ uint* signal_id_p, /*out*/ GLib2.Quark* detail_p, int force_detail_quark) nothrow {
5604 return g_signal_parse_name(detailed_signal, itype, signal_id_p, detail_p, force_detail_quark);
5608 // Queries the signal system for in-depth information about a
5609 // specific signal. This function will fill in a user-provided
5610 // structure to hold signal-specific information. If an invalid
5611 // signal id is passed in, the @signal_id member of the #GSignalQuery
5612 // is 0. All members filled into the #GSignalQuery structure should
5613 // be considered constant and have to be left untouched.
5614 // <signal_id>: The signal id of the signal to query information for.
5615 // <query>: A user provided structure that is filled in with constant values upon success.
5616 static void signal_query()(uint signal_id, /*out*/ SignalQuery* query) nothrow {
5617 g_signal_query(signal_id, query);
5621 // Deletes an emission hook.
5622 // <signal_id>: the id of the signal
5623 // <hook_id>: the id of the emission hook, as returned by g_signal_add_emission_hook()
5624 static void signal_remove_emission_hook()(uint signal_id, c_ulong hook_id) nothrow {
5625 g_signal_remove_emission_hook(signal_id, hook_id);
5629 // Stops a signal's current emission.
5631 // This will prevent the default method from running, if the signal was
5632 // %G_SIGNAL_RUN_LAST and you connected normally (i.e. without the "after"
5633 // flag).
5635 // Prints a warning if used on a signal which isn't being emitted.
5636 // <instance>: the object whose signal handlers you wish to stop.
5637 // <signal_id>: the signal identifier, as returned by g_signal_lookup().
5638 // <detail>: the detail which the signal was emitted with.
5639 static void signal_stop_emission()(void* instance, uint signal_id, GLib2.Quark detail) nothrow {
5640 g_signal_stop_emission(instance, signal_id, detail);
5644 // Stops a signal's current emission.
5646 // This is just like g_signal_stop_emission() except it will look up the
5647 // signal id for you.
5648 // <instance>: the object whose signal handlers you wish to stop.
5649 // <detailed_signal>: a string of the form "signal-name::detail".
5650 static void signal_stop_emission_by_name()(void* instance, char* detailed_signal) nothrow {
5651 g_signal_stop_emission_by_name(instance, detailed_signal);
5655 // Creates a new closure which invokes the function found at the offset
5656 // @struct_offset in the class structure of the interface or classed type
5657 // identified by @itype.
5658 // RETURNS: a new #GCClosure
5659 // <itype>: the #GType identifier of an interface or classed type
5660 // <struct_offset>: the offset of the member function of @itype's class structure which is to be invoked by the new closure
5661 static Closure* /*new*/ signal_type_cclosure_new()(Type itype, uint struct_offset) nothrow {
5662 return g_signal_type_cclosure_new(itype, struct_offset);
5666 // Set the callback for a source as a #GClosure.
5668 // If the source is not one of the standard GLib types, the @closure_callback
5669 // and @closure_marshal fields of the #GSourceFuncs structure must have been
5670 // filled in with pointers to appropriate functions.
5671 // <source>: the source
5672 // <closure>: a #GClosure
5673 static void source_set_closure()(GLib2.Source* source, Closure* closure) nothrow {
5674 g_source_set_closure(source, closure);
5678 // Sets a dummy callback for @source. The callback will do nothing, and
5679 // if the source expects a #gboolean return value, it will return %TRUE.
5680 // (If the source expects any other type of return value, it will return
5681 // a 0/%NULL value; whatever g_value_init() initializes a #GValue to for
5682 // that type.)
5684 // If the source is not one of the standard GLib types, the
5685 // @closure_callback and @closure_marshal fields of the #GSourceFuncs
5686 // structure must have been filled in with pointers to appropriate
5687 // functions.
5688 // <source>: the source
5689 static void source_set_dummy_callback()(GLib2.Source* source) nothrow {
5690 g_source_set_dummy_callback(source);
5694 // Return a newly allocated string, which describes the contents of a
5695 // #GValue. The main purpose of this function is to describe #GValue
5696 // contents for debugging output, the way in which the contents are
5697 // described may change between different GLib versions.
5698 // RETURNS: Newly allocated string.
5699 // <value>: #GValue which contents are to be described.
5700 static char* /*new*/ strdup_value_contents()(Value* value) nothrow {
5701 return g_strdup_value_contents(value);
5705 // Unintrospectable function: type_add_class_cache_func() / g_type_add_class_cache_func()
5706 // Adds a #GTypeClassCacheFunc to be called before the reference count of a
5707 // class goes from one to zero. This can be used to prevent premature class
5708 // destruction. All installed #GTypeClassCacheFunc functions will be chained
5709 // until one of them returns %TRUE. The functions have to check the class id
5710 // passed in to figure whether they actually want to cache the class of this
5711 // type, since all classes are routed through the same #GTypeClassCacheFunc
5712 // chain.
5713 // <cache_data>: data to be passed to @cache_func
5714 // <cache_func>: a #GTypeClassCacheFunc
5715 static void type_add_class_cache_func()(void* cache_data, TypeClassCacheFunc cache_func) nothrow {
5716 g_type_add_class_cache_func(cache_data, cache_func);
5720 // VERSION: 2.24
5721 // Registers a private class structure for a classed type;
5722 // when the class is allocated, the private structures for
5723 // the class and all of its parent types are allocated
5724 // sequentially in the same memory block as the public
5725 // structures. This function should be called in the
5726 // type's get_type() function after the type is registered.
5727 // The private structure can be retrieved using the
5728 // G_TYPE_CLASS_GET_PRIVATE() macro.
5729 // <class_type>: GType of an classed type.
5730 // <private_size>: size of private structure.
5731 static void type_add_class_private()(Type class_type, size_t private_size) nothrow {
5732 g_type_add_class_private(class_type, private_size);
5736 // Unintrospectable function: type_add_interface_check() / g_type_add_interface_check()
5737 // VERSION: 2.4
5738 // Adds a function to be called after an interface vtable is
5739 // initialized for any class (i.e. after the @interface_init member of
5740 // #GInterfaceInfo has been called).
5742 // This function is useful when you want to check an invariant that
5743 // depends on the interfaces of a class. For instance, the
5744 // implementation of #GObject uses this facility to check that an
5745 // object implements all of the properties that are defined on its
5746 // interfaces.
5747 // <check_data>: data to pass to @check_func
5748 // <check_func>: function to be called after each interface is initialized.
5749 static void type_add_interface_check()(void* check_data, TypeInterfaceCheckFunc check_func) nothrow {
5750 g_type_add_interface_check(check_data, check_func);
5754 // Adds the dynamic @interface_type to @instantiable_type. The information
5755 // contained in the #GTypePlugin structure pointed to by @plugin
5756 // is used to manage the relationship.
5757 // <instance_type>: the #GType value of an instantiable type.
5758 // <interface_type>: the #GType value of an interface type.
5759 // <plugin>: the #GTypePlugin structure to retrieve the #GInterfaceInfo from.
5760 static void type_add_interface_dynamic()(Type instance_type, Type interface_type, TypePlugin* plugin) nothrow {
5761 g_type_add_interface_dynamic(instance_type, interface_type, plugin);
5765 // Adds the static @interface_type to @instantiable_type. The
5766 // information contained in the #GInterfaceInfo structure pointed to by
5767 // @info is used to manage the relationship.
5768 // <instance_type>: #GType value of an instantiable type.
5769 // <interface_type>: #GType value of an interface type.
5770 // <info>: The #GInterfaceInfo structure for this (@instance_type, @interface_type) combination.
5771 static void type_add_interface_static()(Type instance_type, Type interface_type, InterfaceInfo* info) nothrow {
5772 g_type_add_interface_static(instance_type, interface_type, info);
5775 // Unintrospectable function: type_check_class_cast() / g_type_check_class_cast()
5776 static TypeClass* type_check_class_cast()(TypeClass* g_class, Type is_a_type) nothrow {
5777 return g_type_check_class_cast(g_class, is_a_type);
5780 static int type_check_class_is_a()(TypeClass* g_class, Type is_a_type) nothrow {
5781 return g_type_check_class_is_a(g_class, is_a_type);
5785 // Private helper function to aid implementation of the G_TYPE_CHECK_INSTANCE()
5786 // macro.
5787 // <instance>: A valid #GTypeInstance structure.
5788 static int type_check_instance()(TypeInstance* instance) nothrow {
5789 return g_type_check_instance(instance);
5792 // Unintrospectable function: type_check_instance_cast() / g_type_check_instance_cast()
5793 static TypeInstance* type_check_instance_cast()(TypeInstance* instance, Type iface_type) nothrow {
5794 return g_type_check_instance_cast(instance, iface_type);
5797 static int type_check_instance_is_a()(TypeInstance* instance, Type iface_type) nothrow {
5798 return g_type_check_instance_is_a(instance, iface_type);
5801 static int type_check_is_value_type()(Type type) nothrow {
5802 return g_type_check_is_value_type(type);
5805 static int type_check_value()(Value* value) nothrow {
5806 return g_type_check_value(value);
5809 static int type_check_value_holds()(Value* value, Type type) nothrow {
5810 return g_type_check_value_holds(value, type);
5814 // Return a newly allocated and 0-terminated array of type IDs, listing the
5815 // child types of @type. The return value has to be g_free()ed after use.
5817 // and 0-terminated array of child types.
5818 // RETURNS: Newly allocated
5819 // <type>: The parent type.
5820 // <n_children>: Optional #guint pointer to contain the number of child types.
5821 static Type* /*new*/ type_children()(Type type, /*out*/ uint* n_children=null) nothrow {
5822 return g_type_children(type, n_children);
5826 // VERSION: 2.4
5827 // MOVED TO: TypeClass.add_private
5828 // Registers a private structure for an instantiatable type.
5830 // When an object is allocated, the private structures for
5831 // the type and all of its parent types are allocated
5832 // sequentially in the same memory block as the public
5833 // structures.
5835 // Note that the accumulated size of the private structures of
5836 // a type and all its parent types cannot excced 64 KiB.
5838 // This function should be called in the type's class_init() function.
5839 // The private structure can be retrieved using the
5840 // G_TYPE_INSTANCE_GET_PRIVATE() macro.
5842 // The following example shows attaching a private structure
5843 // <structname>MyObjectPrivate</structname> to an object
5844 // <structname>MyObject</structname> defined in the standard GObject
5845 // fashion.
5846 // type's class_init() function.
5848 // |[
5849 // typedef struct _MyObject MyObject;
5850 // typedef struct _MyObjectPrivate MyObjectPrivate;
5852 // struct _MyObject {
5853 // GObject parent;
5855 // MyObjectPrivate *priv;
5856 // };
5858 // struct _MyObjectPrivate {
5859 // int some_field;
5860 // };
5862 // static void
5863 // my_object_class_init (MyObjectClass *klass)
5864 // {
5865 // g_type_class_add_private (klass, sizeof (MyObjectPrivate));
5866 // }
5868 // static void
5869 // my_object_init (MyObject *my_object)
5870 // {
5871 // my_object->priv = G_TYPE_INSTANCE_GET_PRIVATE (my_object,
5872 // MY_TYPE_OBJECT,
5873 // MyObjectPrivate);
5874 // }
5876 // static int
5877 // my_object_get_some_field (MyObject *my_object)
5878 // {
5879 // MyObjectPrivate *priv = my_object->priv;
5881 // return priv->some_field;
5882 // }
5883 // ]|
5884 // <g_class>: class structure for an instantiatable type
5885 // <private_size>: size of private structure.
5886 static void type_class_add_private()(void* g_class, size_t private_size) nothrow {
5887 g_type_class_add_private(g_class, private_size);
5891 // MOVED TO: TypeClass.peek
5892 // This function is essentially the same as g_type_class_ref(), except that
5893 // the classes reference count isn't incremented. As a consequence, this function
5894 // may return %NULL if the class of the type passed in does not currently
5895 // exist (hasn't been referenced before).
5897 // structure for the given type ID or %NULL if the class does not
5898 // currently exist.
5899 // RETURNS: The #GTypeClass
5900 // <type>: Type ID of a classed type.
5901 static TypeClass* type_class_peek()(Type type) nothrow {
5902 return g_type_class_peek(type);
5906 // VERSION: 2.4
5907 // MOVED TO: TypeClass.peek_static
5908 // A more efficient version of g_type_class_peek() which works only for
5909 // static types.
5911 // structure for the given type ID or %NULL if the class does not
5912 // currently exist or is dynamically loaded.
5913 // RETURNS: The #GTypeClass
5914 // <type>: Type ID of a classed type.
5915 static TypeClass* type_class_peek_static()(Type type) nothrow {
5916 return g_type_class_peek_static(type);
5920 // MOVED TO: TypeClass.ref
5921 // Increments the reference count of the class structure belonging to
5922 // @type. This function will demand-create the class if it doesn't
5923 // exist already.
5925 // structure for the given type ID.
5926 // RETURNS: The #GTypeClass
5927 // <type>: Type ID of a classed type.
5928 static TypeClass* type_class_ref()(Type type) nothrow {
5929 return g_type_class_ref(type);
5933 // Unintrospectable function: type_create_instance() / g_type_create_instance()
5934 // Creates and initializes an instance of @type if @type is valid and
5935 // can be instantiated. The type system only performs basic allocation
5936 // and structure setups for instances: actual instance creation should
5937 // happen through functions supplied by the type's fundamental type
5938 // implementation. So use of g_type_create_instance() is reserved for
5939 // implementators of fundamental types only. E.g. instances of the
5940 // #GObject hierarchy should be created via g_object_new() and
5941 // <emphasis>never</emphasis> directly through
5942 // g_type_create_instance() which doesn't handle things like singleton
5943 // objects or object construction. Note: Do <emphasis>not</emphasis>
5944 // use this function, unless you're implementing a fundamental
5945 // type. Also language bindings should <emphasis>not</emphasis> use
5946 // this function but g_object_new() instead.
5948 // treatment by the fundamental type implementation.
5949 // RETURNS: An allocated and initialized instance, subject to further
5950 // <type>: An instantiatable type to create an instance for.
5951 static TypeInstance* type_create_instance()(Type type) nothrow {
5952 return g_type_create_instance(type);
5956 // VERSION: 2.4
5957 // If the interface type @g_type is currently in use, returns its
5958 // default interface vtable.
5961 // vtable for the interface, or %NULL if the type is not currently in
5962 // use.
5963 // RETURNS: the default
5964 // <g_type>: an interface type
5965 static TypeInterface* type_default_interface_peek()(Type g_type) nothrow {
5966 return g_type_default_interface_peek(g_type);
5970 // VERSION: 2.4
5971 // Increments the reference count for the interface type @g_type,
5972 // and returns the default interface vtable for the type.
5974 // If the type is not currently in use, then the default vtable
5975 // for the type will be created and initalized by calling
5976 // the base interface init and default vtable init functions for
5977 // the type (the @<structfield>base_init</structfield>
5978 // and <structfield>class_init</structfield> members of #GTypeInfo).
5979 // Calling g_type_default_interface_ref() is useful when you
5980 // want to make sure that signals and properties for an interface
5981 // have been installed.
5984 // vtable for the interface; call g_type_default_interface_unref()
5985 // when you are done using the interface.
5986 // RETURNS: the default
5987 // <g_type>: an interface type
5988 static TypeInterface* type_default_interface_ref()(Type g_type) nothrow {
5989 return g_type_default_interface_ref(g_type);
5993 // VERSION: 2.4
5994 // Decrements the reference count for the type corresponding to the
5995 // interface default vtable @g_iface. If the type is dynamic, then
5996 // when no one is using the interface and all references have
5997 // been released, the finalize function for the interface's default
5998 // vtable (the <structfield>class_finalize</structfield> member of
5999 // #GTypeInfo) will be called.
6000 // <g_iface>: the default vtable structure for a interface, as returned by g_type_default_interface_ref()
6001 static void type_default_interface_unref()(TypeInterface* g_iface) nothrow {
6002 g_type_default_interface_unref(g_iface);
6006 // Returns the length of the ancestry of the passed in type. This
6007 // includes the type itself, so that e.g. a fundamental type has depth 1.
6008 // RETURNS: The depth of @type.
6009 // <type>: A #GType value.
6010 static uint type_depth()(Type type) nothrow {
6011 return g_type_depth(type);
6015 // Frees an instance of a type, returning it to the instance pool for
6016 // the type, if there is one.
6018 // Like g_type_create_instance(), this function is reserved for
6019 // implementors of fundamental types.
6020 // <instance>: an instance of a type.
6021 static void type_free_instance()(TypeInstance* instance) nothrow {
6022 g_type_free_instance(instance);
6026 // Lookup the type ID from a given type name, returning 0 if no type
6027 // has been registered under this name (this is the preferred method
6028 // to find out by name whether a specific type has been registered
6029 // yet).
6030 // RETURNS: Corresponding type ID or 0.
6031 // <name>: Type name to lookup.
6032 static Type type_from_name()(char* name) nothrow {
6033 return g_type_from_name(name);
6037 // Internal function, used to extract the fundamental type ID portion.
6038 // use G_TYPE_FUNDAMENTAL() instead.
6039 // RETURNS: fundamental type ID
6040 // <type_id>: valid type ID
6041 static Type type_fundamental()(Type type_id) nothrow {
6042 return g_type_fundamental(type_id);
6046 // Returns the next free fundamental type id which can be used to
6047 // register a new fundamental type with g_type_register_fundamental().
6048 // The returned type ID represents the highest currently registered
6049 // fundamental type identifier.
6051 // or 0 if the type system ran out of fundamental type IDs.
6052 // RETURNS: The nextmost fundamental type ID to be registered,
6053 static Type type_fundamental_next()() nothrow {
6054 return g_type_fundamental_next();
6058 // Returns the #GTypePlugin structure for @type or
6059 // %NULL if @type does not have a #GTypePlugin structure.
6061 // dynamic type, %NULL otherwise.
6062 // RETURNS: The corresponding plugin if @type is a
6063 // <type>: The #GType to retrieve the plugin for.
6064 static TypePlugin* type_get_plugin()(Type type) nothrow {
6065 return g_type_get_plugin(type);
6069 // Obtains data which has previously been attached to @type
6070 // with g_type_set_qdata().
6072 // Note that this does not take subtyping into account; data
6073 // attached to one type with g_type_set_qdata() cannot
6074 // be retrieved from a subtype using g_type_get_qdata().
6075 // RETURNS: the data, or %NULL if no data was found
6076 // <type>: a #GType
6077 // <quark>: a #GQuark id to identify the data
6078 static void* type_get_qdata()(Type type, GLib2.Quark quark) nothrow {
6079 return g_type_get_qdata(type, quark);
6083 // Prior to any use of the type system, g_type_init() has to be called
6084 // to initialize the type system and assorted other code portions
6085 // (such as the various fundamental type implementations or the signal
6086 // system).
6088 // Since version 2.24 this also initializes the thread system
6089 static void type_init()() nothrow {
6090 g_type_init();
6094 // Similar to g_type_init(), but additionally sets debug flags.
6095 // <debug_flags>: Bitwise combination of #GTypeDebugFlags values for debugging purposes.
6096 static void type_init_with_debug_flags()(TypeDebugFlags debug_flags) nothrow {
6097 g_type_init_with_debug_flags(debug_flags);
6101 // MOVED TO: TypeInterface.add_prerequisite
6102 // Adds @prerequisite_type to the list of prerequisites of @interface_type.
6103 // This means that any type implementing @interface_type must also implement
6104 // @prerequisite_type. Prerequisites can be thought of as an alternative to
6105 // interface derivation (which GType doesn't support). An interface can have
6106 // at most one instantiatable prerequisite type.
6107 // <interface_type>: #GType value of an interface type.
6108 // <prerequisite_type>: #GType value of an interface or instantiatable type.
6109 static void type_interface_add_prerequisite()(Type interface_type, Type prerequisite_type) nothrow {
6110 g_type_interface_add_prerequisite(interface_type, prerequisite_type);
6114 // MOVED TO: TypeInterface.get_plugin
6115 // Returns the #GTypePlugin structure for the dynamic interface
6116 // @interface_type which has been added to @instance_type, or %NULL if
6117 // @interface_type has not been added to @instance_type or does not
6118 // have a #GTypePlugin structure. See g_type_add_interface_dynamic().
6120 // interface @interface_type of @instance_type.
6121 // RETURNS: the #GTypePlugin for the dynamic
6122 // <instance_type>: the #GType value of an instantiatable type.
6123 // <interface_type>: the #GType value of an interface type.
6124 static TypePlugin* type_interface_get_plugin()(Type instance_type, Type interface_type) nothrow {
6125 return g_type_interface_get_plugin(instance_type, interface_type);
6129 // MOVED TO: TypeInterface.peek
6130 // Returns the #GTypeInterface structure of an interface to which the
6131 // passed in class conforms.
6133 // structure of iface_type if implemented by @instance_class, %NULL
6134 // otherwise
6135 // RETURNS: The GTypeInterface
6136 // <instance_class>: A #GTypeClass structure.
6137 // <iface_type>: An interface ID which this class conforms to.
6138 static TypeInterface* type_interface_peek()(TypeClass* instance_class, Type iface_type) nothrow {
6139 return g_type_interface_peek(instance_class, iface_type);
6143 // VERSION: 2.2
6144 // MOVED TO: TypeInterface.prerequisites
6145 // Returns the prerequisites of an interfaces type.
6148 // newly-allocated zero-terminated array of #GType containing
6149 // the prerequisites of @interface_type
6150 // RETURNS: a
6151 // <interface_type>: an interface type
6152 // <n_prerequisites>: location to return the number of prerequisites, or %NULL
6153 static Type* /*new*/ type_interface_prerequisites()(Type interface_type, /*out*/ uint* n_prerequisites=null) nothrow {
6154 return g_type_interface_prerequisites(interface_type, n_prerequisites);
6158 // Return a newly allocated and 0-terminated array of type IDs, listing the
6159 // interface types that @type conforms to. The return value has to be
6160 // g_free()ed after use.
6162 // allocated and 0-terminated array of interface types.
6163 // RETURNS: Newly
6164 // <type>: The type to list interface types for.
6165 // <n_interfaces>: Optional #guint pointer to contain the number of interface types.
6166 static Type* /*new*/ type_interfaces()(Type type, /*out*/ uint* n_interfaces=null) nothrow {
6167 return g_type_interfaces(type, n_interfaces);
6171 // If @is_a_type is a derivable type, check whether @type is a
6172 // descendant of @is_a_type. If @is_a_type is an interface, check
6173 // whether @type conforms to it.
6174 // RETURNS: %TRUE if @type is_a @is_a_type holds true.
6175 // <type>: Type to check anchestry for.
6176 // <is_a_type>: Possible anchestor of @type or interface @type could conform to.
6177 static int type_is_a()(Type type, Type is_a_type) nothrow {
6178 return g_type_is_a(type, is_a_type);
6182 // Get the unique name that is assigned to a type ID. Note that this
6183 // function (like all other GType API) cannot cope with invalid type
6184 // IDs. %G_TYPE_INVALID may be passed to this function, as may be any
6185 // other validly registered type ID, but randomized type IDs should
6186 // not be passed in and will most likely lead to a crash.
6187 // RETURNS: Static type name or %NULL.
6188 // <type>: Type to return name for.
6189 static char* type_name()(Type type) nothrow {
6190 return g_type_name(type);
6193 static char* type_name_from_class()(TypeClass* g_class) nothrow {
6194 return g_type_name_from_class(g_class);
6197 static char* type_name_from_instance()(TypeInstance* instance) nothrow {
6198 return g_type_name_from_instance(instance);
6202 // Given a @leaf_type and a @root_type which is contained in its
6203 // anchestry, return the type that @root_type is the immediate parent
6204 // of. In other words, this function determines the type that is
6205 // derived directly from @root_type which is also a base class of
6206 // @leaf_type. Given a root type and a leaf type, this function can
6207 // be used to determine the types and order in which the leaf type is
6208 // descended from the root type.
6209 // RETURNS: Immediate child of @root_type and anchestor of @leaf_type.
6210 // <leaf_type>: Descendant of @root_type and the type to be returned.
6211 // <root_type>: Immediate parent of the returned type.
6212 static Type type_next_base()(Type leaf_type, Type root_type) nothrow {
6213 return g_type_next_base(leaf_type, root_type);
6217 // Return the direct parent type of the passed in type. If the passed
6218 // in type has no parent, i.e. is a fundamental type, 0 is returned.
6219 // RETURNS: The parent type.
6220 // <type>: The derived type.
6221 static Type type_parent()(Type type) nothrow {
6222 return g_type_parent(type);
6226 // Get the corresponding quark of the type IDs name.
6227 // RETURNS: The type names quark or 0.
6228 // <type>: Type to return quark of type name for.
6229 static GLib2.Quark type_qname()(Type type) nothrow {
6230 return g_type_qname(type);
6234 // Queries the type system for information about a specific type.
6235 // This function will fill in a user-provided structure to hold
6236 // type-specific information. If an invalid #GType is passed in, the
6237 // @type member of the #GTypeQuery is 0. All members filled into the
6238 // #GTypeQuery structure should be considered constant and have to be
6239 // left untouched.
6240 // <type>: the #GType value of a static, classed type.
6241 // <query>: A user provided structure that is filled in with constant values upon success.
6242 static void type_query()(Type type, /*out*/ TypeQuery* query) nothrow {
6243 g_type_query(type, query);
6247 // Registers @type_name as the name of a new dynamic type derived from
6248 // @parent_type. The type system uses the information contained in the
6249 // #GTypePlugin structure pointed to by @plugin to manage the type and its
6250 // instances (if not abstract). The value of @flags determines the nature
6251 // (e.g. abstract or not) of the type.
6252 // RETURNS: The new type identifier or #G_TYPE_INVALID if registration failed.
6253 // <parent_type>: Type from which this type will be derived.
6254 // <type_name>: 0-terminated string used as the name of the new type.
6255 // <plugin>: The #GTypePlugin structure to retrieve the #GTypeInfo from.
6256 // <flags>: Bitwise combination of #GTypeFlags values.
6257 static Type type_register_dynamic()(Type parent_type, char* type_name, TypePlugin* plugin, TypeFlags flags) nothrow {
6258 return g_type_register_dynamic(parent_type, type_name, plugin, flags);
6262 // Registers @type_id as the predefined identifier and @type_name as the
6263 // name of a fundamental type. The type system uses the information
6264 // contained in the #GTypeInfo structure pointed to by @info and the
6265 // #GTypeFundamentalInfo structure pointed to by @finfo to manage the
6266 // type and its instances. The value of @flags determines additional
6267 // characteristics of the fundamental type.
6268 // RETURNS: The predefined type identifier.
6269 // <type_id>: A predefined type identifier.
6270 // <type_name>: 0-terminated string used as the name of the new type.
6271 // <info>: The #GTypeInfo structure for this type.
6272 // <finfo>: The #GTypeFundamentalInfo structure for this type.
6273 // <flags>: Bitwise combination of #GTypeFlags values.
6274 static Type type_register_fundamental()(Type type_id, char* type_name, GTypeInfo* info, TypeFundamentalInfo* finfo, TypeFlags flags) nothrow {
6275 return g_type_register_fundamental(type_id, type_name, info, finfo, flags);
6279 // Registers @type_name as the name of a new static type derived from
6280 // @parent_type. The type system uses the information contained in the
6281 // #GTypeInfo structure pointed to by @info to manage the type and its
6282 // instances (if not abstract). The value of @flags determines the nature
6283 // (e.g. abstract or not) of the type.
6284 // RETURNS: The new type identifier.
6285 // <parent_type>: Type from which this type will be derived.
6286 // <type_name>: 0-terminated string used as the name of the new type.
6287 // <info>: The #GTypeInfo structure for this type.
6288 // <flags>: Bitwise combination of #GTypeFlags values.
6289 static Type type_register_static()(Type parent_type, char* type_name, GTypeInfo* info, TypeFlags flags) nothrow {
6290 return g_type_register_static(parent_type, type_name, info, flags);
6294 // Unintrospectable function: type_register_static_simple() / g_type_register_static_simple()
6295 // VERSION: 2.12
6296 // Registers @type_name as the name of a new static type derived from
6297 // @parent_type. The value of @flags determines the nature (e.g.
6298 // abstract or not) of the type. It works by filling a #GTypeInfo
6299 // struct and calling g_type_register_static().
6300 // RETURNS: The new type identifier.
6301 // <parent_type>: Type from which this type will be derived.
6302 // <type_name>: 0-terminated string used as the name of the new type.
6303 // <class_size>: Size of the class structure (see #GTypeInfo)
6304 // <class_init>: Location of the class initialization function (see #GTypeInfo)
6305 // <instance_size>: Size of the instance structure (see #GTypeInfo)
6306 // <instance_init>: Location of the instance initialization function (see #GTypeInfo)
6307 // <flags>: Bitwise combination of #GTypeFlags values.
6308 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) nothrow {
6309 return g_type_register_static_simple(parent_type, type_name, class_size, class_init, instance_size, instance_init, flags);
6313 // Unintrospectable function: type_remove_class_cache_func() / g_type_remove_class_cache_func()
6314 // Removes a previously installed #GTypeClassCacheFunc. The cache
6315 // maintained by @cache_func has to be empty when calling
6316 // g_type_remove_class_cache_func() to avoid leaks.
6317 // <cache_data>: data that was given when adding @cache_func
6318 // <cache_func>: a #GTypeClassCacheFunc
6319 static void type_remove_class_cache_func()(void* cache_data, TypeClassCacheFunc cache_func) nothrow {
6320 g_type_remove_class_cache_func(cache_data, cache_func);
6324 // Unintrospectable function: type_remove_interface_check() / g_type_remove_interface_check()
6325 // VERSION: 2.4
6326 // Removes an interface check function added with
6327 // g_type_add_interface_check().
6328 // <check_data>: callback data passed to g_type_add_interface_check()
6329 // <check_func>: callback function passed to g_type_add_interface_check()
6330 static void type_remove_interface_check()(void* check_data, TypeInterfaceCheckFunc check_func) nothrow {
6331 g_type_remove_interface_check(check_data, check_func);
6335 // Attaches arbitrary data to a type.
6336 // <type>: a #GType
6337 // <quark>: a #GQuark id to identify the data
6338 // <data>: the data
6339 static void type_set_qdata()(Type type, GLib2.Quark quark, void* data) nothrow {
6340 g_type_set_qdata(type, quark, data);
6343 static int type_test_flags()(Type type, uint flags) nothrow {
6344 return g_type_test_flags(type, flags);
6348 // Unintrospectable function: type_value_table_peek() / g_type_value_table_peek()
6349 // MOVED TO: TypeValueTable.peek
6350 // Returns the location of the #GTypeValueTable associated with @type.
6351 // <emphasis>Note that this function should only be used from source code
6352 // that implements or has internal knowledge of the implementation of
6353 // @type.</emphasis>
6355 // %NULL if there is no #GTypeValueTable associated with @type.
6356 // RETURNS: Location of the #GTypeValueTable associated with @type or
6357 // <type>: A #GType value.
6358 static TypeValueTable* type_value_table_peek()(Type type) nothrow {
6359 return g_type_value_table_peek(type);
6363 // VERSION: 2.12
6364 // Get the contents of a %G_TYPE_GTYPE #GValue.
6365 // RETURNS: the #GType stored in @value
6366 // <value>: a valid #GValue of type %G_TYPE_GTYPE
6367 static Type value_get_gtype()(Value* value) nothrow {
6368 return g_value_get_gtype(value);
6372 // Unintrospectable function: value_register_transform_func() / g_value_register_transform_func()
6373 // MOVED TO: Value.register_transform_func
6374 // Registers a value transformation function for use in g_value_transform().
6375 // A previously registered transformation function for @src_type and @dest_type
6376 // will be replaced.
6377 // <src_type>: Source type.
6378 // <dest_type>: Target type.
6379 // <transform_func>: a function which transforms values of type @src_type into value of type @dest_type
6380 static void value_register_transform_func()(Type src_type, Type dest_type, ValueTransform transform_func) nothrow {
6381 g_value_register_transform_func(src_type, dest_type, transform_func);
6385 // MOVED TO: Value.type_compatible
6386 // Returns whether a #GValue of type @src_type can be copied into
6387 // a #GValue of type @dest_type.
6388 // RETURNS: %TRUE if g_value_copy() is possible with @src_type and @dest_type.
6389 // <src_type>: source type to be copied.
6390 // <dest_type>: destination type for copying.
6391 static int value_type_compatible()(Type src_type, Type dest_type) nothrow {
6392 return g_value_type_compatible(src_type, dest_type);
6396 // MOVED TO: Value.type_transformable
6397 // Check whether g_value_transform() is able to transform values
6398 // of type @src_type into values of type @dest_type.
6399 // RETURNS: %TRUE if the transformation is possible, %FALSE otherwise.
6400 // <src_type>: Source type.
6401 // <dest_type>: Target type.
6402 static int value_type_transformable()(Type src_type, Type dest_type) nothrow {
6403 return g_value_type_transformable(src_type, dest_type);
6407 // C prototypes:
6409 extern (C) {
6410 BindingFlags g_binding_get_flags(Binding* this_) nothrow;
6411 Object* g_binding_get_source(Binding* this_) nothrow;
6412 char* g_binding_get_source_property(Binding* this_) nothrow;
6413 Object* g_binding_get_target(Binding* this_) nothrow;
6414 char* g_binding_get_target_property(Binding* this_) nothrow;
6415 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) nothrow;
6416 void g_cclosure_marshal_BOOLEAN__FLAGS(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6417 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) nothrow;
6418 void g_cclosure_marshal_VOID__BOOLEAN(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6419 void g_cclosure_marshal_VOID__BOXED(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6420 void g_cclosure_marshal_VOID__CHAR(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6421 void g_cclosure_marshal_VOID__DOUBLE(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6422 void g_cclosure_marshal_VOID__ENUM(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6423 void g_cclosure_marshal_VOID__FLAGS(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6424 void g_cclosure_marshal_VOID__FLOAT(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6425 void g_cclosure_marshal_VOID__INT(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6426 void g_cclosure_marshal_VOID__LONG(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6427 void g_cclosure_marshal_VOID__OBJECT(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6428 void g_cclosure_marshal_VOID__PARAM(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6429 void g_cclosure_marshal_VOID__POINTER(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6430 void g_cclosure_marshal_VOID__STRING(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6431 void g_cclosure_marshal_VOID__UCHAR(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6432 void g_cclosure_marshal_VOID__UINT(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6433 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) nothrow;
6434 void g_cclosure_marshal_VOID__ULONG(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6435 void g_cclosure_marshal_VOID__VARIANT(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6436 void g_cclosure_marshal_VOID__VOID(Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6437 void g_cclosure_marshal_generic(Closure* closure, Value* return_gvalue, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6438 Closure* /*new*/ g_cclosure_new(Callback callback_func, void* user_data, ClosureNotify destroy_data) nothrow;
6439 Closure* /*new*/ g_cclosure_new_object(Callback callback_func, Object* object) nothrow;
6440 Closure* /*new*/ g_cclosure_new_object_swap(Callback callback_func, Object* object) nothrow;
6441 Closure* /*new*/ g_cclosure_new_swap(Callback callback_func, void* user_data, ClosureNotify destroy_data) nothrow;
6442 Closure* /*new*/ g_closure_new_object(uint sizeof_closure, Object* object) nothrow;
6443 Closure* /*new*/ g_closure_new_simple(uint sizeof_closure, void* data) nothrow;
6444 void g_closure_add_finalize_notifier(Closure* this_, void* notify_data, ClosureNotify notify_func) nothrow;
6445 void g_closure_add_invalidate_notifier(Closure* this_, void* notify_data, ClosureNotify notify_func) nothrow;
6446 void g_closure_add_marshal_guards(Closure* this_, void* pre_marshal_data, ClosureNotify pre_marshal_notify, void* post_marshal_data, ClosureNotify post_marshal_notify) nothrow;
6447 void g_closure_invalidate(Closure* this_) nothrow;
6448 void g_closure_invoke(Closure* this_, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint=null) nothrow;
6449 Closure* g_closure_ref(Closure* this_) nothrow;
6450 void g_closure_remove_finalize_notifier(Closure* this_, void* notify_data, ClosureNotify notify_func) nothrow;
6451 void g_closure_remove_invalidate_notifier(Closure* this_, void* notify_data, ClosureNotify notify_func) nothrow;
6452 void g_closure_set_marshal(Closure* this_, ClosureMarshal marshal) nothrow;
6453 void g_closure_set_meta_marshal(Closure* this_, void* marshal_data, ClosureMarshal meta_marshal) nothrow;
6454 void g_closure_sink(Closure* this_) nothrow;
6455 void g_closure_unref(Closure* this_) nothrow;
6456 Object* /*new*/ g_object_new_valist(Type object_type, char* first_property_name, va_list var_args) nothrow;
6457 Object* /*new*/ g_object_newv(Type object_type, uint n_parameters, Parameter* parameters) nothrow;
6458 size_t g_object_compat_control(size_t what, void* data) nothrow;
6459 void* g_object_connect(void* object, char* signal_spec, ...) nothrow;
6460 void g_object_disconnect(void* object, char* signal_spec, ...) nothrow;
6461 void g_object_get(void* object, char* first_property_name, ...) nothrow;
6462 ParamSpec* g_object_interface_find_property(void* g_iface, char* property_name) nothrow;
6463 void g_object_interface_install_property(void* g_iface, ParamSpec* pspec) nothrow;
6464 ParamSpec** /*new container*/ g_object_interface_list_properties(void* g_iface, /*out*/ uint* n_properties_p) nothrow;
6465 void* /*new*/ g_object_new(Type object_type, char* first_property_name, ...) nothrow;
6466 void g_object_set(void* object, char* first_property_name, ...) nothrow;
6467 void g_object_add_toggle_ref(Object* this_, ToggleNotify notify, void* data) nothrow;
6468 void g_object_add_weak_pointer(Object* this_, /*inout*/ void** weak_pointer_location) nothrow;
6469 Binding* g_object_bind_property(Object* this_, char* source_property, Object* target, char* target_property, BindingFlags flags) nothrow;
6470 Binding* g_object_bind_property_full(Object* this_, char* source_property, Object* target, char* target_property, BindingFlags flags, BindingTransformFunc transform_to, BindingTransformFunc transform_from, void* user_data, GLib2.DestroyNotify notify) nothrow;
6471 Binding* g_object_bind_property_with_closures(Object* this_, char* source_property, Object* target, char* target_property, BindingFlags flags, Closure* transform_to, Closure* transform_from) nothrow;
6472 void g_object_force_floating(Object* this_) nothrow;
6473 void g_object_freeze_notify(Object* this_) nothrow;
6474 void* g_object_get_data(Object* this_, char* key) nothrow;
6475 void g_object_get_property(Object* this_, char* property_name, Value* value) nothrow;
6476 void* g_object_get_qdata(Object* this_, GLib2.Quark quark) nothrow;
6477 void g_object_get_valist(Object* this_, char* first_property_name, va_list var_args) nothrow;
6478 int g_object_is_floating(Object* this_) nothrow;
6479 void g_object_notify(Object* this_, char* property_name) nothrow;
6480 void g_object_notify_by_pspec(Object* this_, ParamSpec* pspec) nothrow;
6481 Object* g_object_ref(Object* this_) nothrow;
6482 Object* g_object_ref_sink(Object* this_) nothrow;
6483 void g_object_remove_toggle_ref(Object* this_, ToggleNotify notify, void* data) nothrow;
6484 void g_object_remove_weak_pointer(Object* this_, /*inout*/ void** weak_pointer_location) nothrow;
6485 void g_object_run_dispose(Object* this_) nothrow;
6486 void g_object_set_data(Object* this_, char* key, void* data) nothrow;
6487 void g_object_set_data_full(Object* this_, char* key, void* data, GLib2.DestroyNotify destroy) nothrow;
6488 void g_object_set_property(Object* this_, char* property_name, Value* value) nothrow;
6489 void g_object_set_qdata(Object* this_, GLib2.Quark quark, void* data) nothrow;
6490 void g_object_set_qdata_full(Object* this_, GLib2.Quark quark, void* data, GLib2.DestroyNotify destroy) nothrow;
6491 void g_object_set_valist(Object* this_, char* first_property_name, va_list var_args) nothrow;
6492 void* /*new*/ g_object_steal_data(Object* this_, char* key) nothrow;
6493 void* /*new*/ g_object_steal_qdata(Object* this_, GLib2.Quark quark) nothrow;
6494 void g_object_thaw_notify(Object* this_) nothrow;
6495 void g_object_unref(Object* this_) nothrow;
6496 void g_object_watch_closure(Object* this_, Closure* closure) nothrow;
6497 void g_object_weak_ref(Object* this_, WeakNotify notify, void* data) nothrow;
6498 void g_object_weak_unref(Object* this_, WeakNotify notify, void* data) nothrow;
6499 ParamSpec* g_object_class_find_property(ObjectClass* this_, char* property_name) nothrow;
6500 void g_object_class_install_properties(ObjectClass* this_, uint n_pspecs, ParamSpec** pspecs) nothrow;
6501 void g_object_class_install_property(ObjectClass* this_, uint property_id, ParamSpec* pspec) nothrow;
6502 ParamSpec** /*new container*/ g_object_class_list_properties(ObjectClass* this_, /*out*/ uint* n_properties) nothrow;
6503 void g_object_class_override_property(ObjectClass* this_, uint property_id, char* name) nothrow;
6504 void* g_param_spec_internal(Type param_type, char* name, char* nick, char* blurb, ParamFlags flags) nothrow;
6505 char* g_param_spec_get_blurb(ParamSpec* this_) nothrow;
6506 char* g_param_spec_get_name(ParamSpec* this_) nothrow;
6507 char* g_param_spec_get_nick(ParamSpec* this_) nothrow;
6508 void* g_param_spec_get_qdata(ParamSpec* this_, GLib2.Quark quark) nothrow;
6509 ParamSpec* g_param_spec_get_redirect_target(ParamSpec* this_) nothrow;
6510 ParamSpec* g_param_spec_ref(ParamSpec* this_) nothrow;
6511 ParamSpec* g_param_spec_ref_sink(ParamSpec* this_) nothrow;
6512 void g_param_spec_set_qdata(ParamSpec* this_, GLib2.Quark quark, void* data) nothrow;
6513 void g_param_spec_set_qdata_full(ParamSpec* this_, GLib2.Quark quark, void* data, GLib2.DestroyNotify destroy) nothrow;
6514 void g_param_spec_sink(ParamSpec* this_) nothrow;
6515 void* g_param_spec_steal_qdata(ParamSpec* this_, GLib2.Quark quark) nothrow;
6516 void g_param_spec_unref(ParamSpec* this_) nothrow;
6517 void g_param_spec_pool_insert(ParamSpecPool* this_, ParamSpec* pspec, Type owner_type) nothrow;
6518 ParamSpec** /*new container*/ g_param_spec_pool_list(ParamSpecPool* this_, Type owner_type, /*out*/ uint* n_pspecs_p) nothrow;
6519 GLib2.List* /*new container*/ g_param_spec_pool_list_owned(ParamSpecPool* this_, Type owner_type) nothrow;
6520 ParamSpec* g_param_spec_pool_lookup(ParamSpecPool* this_, char* param_name, Type owner_type, int walk_ancestors) nothrow;
6521 void g_param_spec_pool_remove(ParamSpecPool* this_, ParamSpec* pspec) nothrow;
6522 ParamSpecPool* g_param_spec_pool_new(int type_prefixing) nothrow;
6523 void* g_type_class_get_private(TypeClass* this_, Type private_type) nothrow;
6524 TypeClass* g_type_class_peek_parent(TypeClass* this_) nothrow;
6525 void g_type_class_unref(TypeClass* this_) nothrow;
6526 void g_type_class_unref_uncached(TypeClass* this_) nothrow;
6527 void g_type_class_add_private(void* g_class, size_t private_size) nothrow;
6528 TypeClass* g_type_class_peek(Type type) nothrow;
6529 TypeClass* g_type_class_peek_static(Type type) nothrow;
6530 TypeClass* g_type_class_ref(Type type) nothrow;
6531 void* g_type_instance_get_private(TypeInstance* this_, Type private_type) nothrow;
6532 TypeInterface* g_type_interface_peek_parent(TypeInterface* this_) nothrow;
6533 void g_type_interface_add_prerequisite(Type interface_type, Type prerequisite_type) nothrow;
6534 TypePlugin* g_type_interface_get_plugin(Type instance_type, Type interface_type) nothrow;
6535 TypeInterface* g_type_interface_peek(TypeClass* instance_class, Type iface_type) nothrow;
6536 Type* /*new*/ g_type_interface_prerequisites(Type interface_type, /*out*/ uint* n_prerequisites=null) nothrow;
6537 void g_type_module_add_interface(TypeModule* this_, Type instance_type, Type interface_type, InterfaceInfo* interface_info) nothrow;
6538 Type g_type_module_register_enum(TypeModule* this_, char* name, EnumValue* const_static_values) nothrow;
6539 Type g_type_module_register_flags(TypeModule* this_, char* name, FlagsValue* const_static_values) nothrow;
6540 Type g_type_module_register_type(TypeModule* this_, Type parent_type, char* type_name, GTypeInfo* type_info, TypeFlags flags) nothrow;
6541 void g_type_module_set_name(TypeModule* this_, char* name) nothrow;
6542 void g_type_module_unuse(TypeModule* this_) nothrow;
6543 int g_type_module_use(TypeModule* this_) nothrow;
6544 void g_type_plugin_complete_interface_info(TypePlugin* this_, Type instance_type, Type interface_type, InterfaceInfo* info) nothrow;
6545 void g_type_plugin_complete_type_info(TypePlugin* this_, Type g_type, GTypeInfo* info, TypeValueTable* value_table) nothrow;
6546 void g_type_plugin_unuse(TypePlugin* this_) nothrow;
6547 void g_type_plugin_use(TypePlugin* this_) nothrow;
6548 TypeValueTable* g_type_value_table_peek(Type type) nothrow;
6549 void g_value_copy(Value* this_, Value* dest_value) nothrow;
6550 void* g_value_dup_boxed(Value* this_) nothrow;
6551 Object* /*new*/ g_value_dup_object(Value* this_) nothrow;
6552 ParamSpec* g_value_dup_param(Value* this_) nothrow;
6553 char* /*new*/ g_value_dup_string(Value* this_) nothrow;
6554 GLib2.Variant* /*new*/ g_value_dup_variant(Value* this_) nothrow;
6555 int g_value_fits_pointer(Value* this_) nothrow;
6556 int g_value_get_boolean(Value* this_) nothrow;
6557 void* g_value_get_boxed(Value* this_) nothrow;
6558 char g_value_get_char(Value* this_) nothrow;
6559 double g_value_get_double(Value* this_) nothrow;
6560 int g_value_get_enum(Value* this_) nothrow;
6561 uint g_value_get_flags(Value* this_) nothrow;
6562 float g_value_get_float(Value* this_) nothrow;
6563 int g_value_get_int(Value* this_) nothrow;
6564 long g_value_get_int64(Value* this_) nothrow;
6565 c_long g_value_get_long(Value* this_) nothrow;
6566 Object* g_value_get_object(Value* this_) nothrow;
6567 ParamSpec* g_value_get_param(Value* this_) nothrow;
6568 void* g_value_get_pointer(Value* this_) nothrow;
6569 byte g_value_get_schar(Value* this_) nothrow;
6570 char* g_value_get_string(Value* this_) nothrow;
6571 ubyte g_value_get_uchar(Value* this_) nothrow;
6572 uint g_value_get_uint(Value* this_) nothrow;
6573 ulong g_value_get_uint64(Value* this_) nothrow;
6574 c_ulong g_value_get_ulong(Value* this_) nothrow;
6575 GLib2.Variant* /*new*/ g_value_get_variant(Value* this_) nothrow;
6576 Value* g_value_init(Value* this_, Type g_type) nothrow;
6577 void* g_value_peek_pointer(Value* this_) nothrow;
6578 Value* /*new*/ g_value_reset(Value* this_) nothrow;
6579 void g_value_set_boolean(Value* this_, int v_boolean) nothrow;
6580 void g_value_set_boxed(Value* this_, const(void)* v_boxed=null) nothrow;
6581 void g_value_set_boxed_take_ownership(Value* this_, const(void)* v_boxed=null) nothrow;
6582 void g_value_set_char(Value* this_, char v_char) nothrow;
6583 void g_value_set_double(Value* this_, double v_double) nothrow;
6584 void g_value_set_enum(Value* this_, int v_enum) nothrow;
6585 void g_value_set_flags(Value* this_, uint v_flags) nothrow;
6586 void g_value_set_float(Value* this_, float v_float) nothrow;
6587 void g_value_set_gtype(Value* this_, Type v_gtype) nothrow;
6588 void g_value_set_instance(Value* this_, void* instance=null) nothrow;
6589 void g_value_set_int(Value* this_, int v_int) nothrow;
6590 void g_value_set_int64(Value* this_, long v_int64) nothrow;
6591 void g_value_set_long(Value* this_, c_long v_long) nothrow;
6592 void g_value_set_object(Value* this_, Object* v_object=null) nothrow;
6593 void g_value_set_object_take_ownership(Value* this_, void* v_object=null) nothrow;
6594 void g_value_set_param(Value* this_, ParamSpec* param=null) nothrow;
6595 void g_value_set_param_take_ownership(Value* this_, ParamSpec* param=null) nothrow;
6596 void g_value_set_pointer(Value* this_, void* v_pointer) nothrow;
6597 void g_value_set_schar(Value* this_, byte v_char) nothrow;
6598 void g_value_set_static_boxed(Value* this_, const(void)* v_boxed=null) nothrow;
6599 void g_value_set_static_string(Value* this_, char* v_string=null) nothrow;
6600 void g_value_set_string(Value* this_, char* v_string=null) nothrow;
6601 void g_value_set_string_take_ownership(Value* this_, char* v_string=null) nothrow;
6602 void g_value_set_uchar(Value* this_, ubyte v_uchar) nothrow;
6603 void g_value_set_uint(Value* this_, uint v_uint) nothrow;
6604 void g_value_set_uint64(Value* this_, ulong v_uint64) nothrow;
6605 void g_value_set_ulong(Value* this_, c_ulong v_ulong) nothrow;
6606 void g_value_set_variant(Value* this_, GLib2.Variant* variant=null) nothrow;
6607 void g_value_take_boxed(Value* this_, const(void)* v_boxed=null) nothrow;
6608 void g_value_take_object(Value* this_, void* v_object=null) nothrow;
6609 void g_value_take_param(Value* this_, ParamSpec* param=null) nothrow;
6610 void g_value_take_string(Value* this_, char* v_string=null) nothrow;
6611 void g_value_take_variant(Value* this_, GLib2.Variant* variant=null) nothrow;
6612 int g_value_transform(Value* this_, Value* dest_value) nothrow;
6613 void g_value_unset(Value* this_) nothrow;
6614 void g_value_register_transform_func(Type src_type, Type dest_type, ValueTransform transform_func) nothrow;
6615 int g_value_type_compatible(Type src_type, Type dest_type) nothrow;
6616 int g_value_type_transformable(Type src_type, Type dest_type) nothrow;
6617 ValueArray* /*new*/ g_value_array_new(uint n_prealloced) nothrow;
6618 ValueArray* g_value_array_append(ValueArray* this_, Value* value=null) nothrow;
6619 ValueArray* /*new*/ g_value_array_copy(ValueArray* this_) nothrow;
6620 void g_value_array_free(ValueArray* this_) nothrow;
6621 Value* g_value_array_get_nth(ValueArray* this_, uint index_) nothrow;
6622 ValueArray* g_value_array_insert(ValueArray* this_, uint index_, Value* value=null) nothrow;
6623 ValueArray* g_value_array_prepend(ValueArray* this_, Value* value=null) nothrow;
6624 ValueArray* g_value_array_remove(ValueArray* this_, uint index_) nothrow;
6625 ValueArray* g_value_array_sort(ValueArray* this_, GLib2.CompareFunc compare_func) nothrow;
6626 ValueArray* g_value_array_sort_with_data(ValueArray* this_, GLib2.CompareDataFunc compare_func, void* user_data) nothrow;
6627 void g_weak_ref_clear(WeakRef* this_) nothrow;
6628 Object* /*new*/ g_weak_ref_get(WeakRef* this_) nothrow;
6629 void g_weak_ref_init(WeakRef* this_, void* object=null) nothrow;
6630 void g_weak_ref_set(WeakRef* this_, void* object=null) nothrow;
6631 void* g_boxed_copy(Type boxed_type, const(void)* src_boxed) nothrow;
6632 void g_boxed_free(Type boxed_type, void* boxed) nothrow;
6633 Type g_boxed_type_register_static(char* name, BoxedCopyFunc boxed_copy, BoxedFreeFunc boxed_free) nothrow;
6634 void g_clear_object(Object** object_ptr) nothrow;
6635 void g_enum_complete_type_info(Type g_enum_type, GTypeInfo* info, EnumValue* const_values) nothrow;
6636 EnumValue* g_enum_get_value(EnumClass* enum_class, int value) nothrow;
6637 EnumValue* g_enum_get_value_by_name(EnumClass* enum_class, char* name) nothrow;
6638 EnumValue* g_enum_get_value_by_nick(EnumClass* enum_class, char* nick) nothrow;
6639 Type g_enum_register_static(char* name, EnumValue* const_static_values) nothrow;
6640 void g_flags_complete_type_info(Type g_flags_type, GTypeInfo* info, FlagsValue* const_values) nothrow;
6641 FlagsValue* g_flags_get_first_value(FlagsClass* flags_class, uint value) nothrow;
6642 FlagsValue* g_flags_get_value_by_name(FlagsClass* flags_class, char* name) nothrow;
6643 FlagsValue* g_flags_get_value_by_nick(FlagsClass* flags_class, char* nick) nothrow;
6644 Type g_flags_register_static(char* name, FlagsValue* const_static_values) nothrow;
6645 Type g_gtype_get_type() nothrow;
6646 ParamSpec* g_param_spec_boolean(char* name, char* nick, char* blurb, int default_value, ParamFlags flags) nothrow;
6647 ParamSpec* g_param_spec_boxed(char* name, char* nick, char* blurb, Type boxed_type, ParamFlags flags) nothrow;
6648 ParamSpec* g_param_spec_char(char* name, char* nick, char* blurb, byte minimum, byte maximum, byte default_value, ParamFlags flags) nothrow;
6649 ParamSpec* g_param_spec_double(char* name, char* nick, char* blurb, double minimum, double maximum, double default_value, ParamFlags flags) nothrow;
6650 ParamSpec* g_param_spec_enum(char* name, char* nick, char* blurb, Type enum_type, int default_value, ParamFlags flags) nothrow;
6651 ParamSpec* g_param_spec_flags(char* name, char* nick, char* blurb, Type flags_type, uint default_value, ParamFlags flags) nothrow;
6652 ParamSpec* g_param_spec_float(char* name, char* nick, char* blurb, float minimum, float maximum, float default_value, ParamFlags flags) nothrow;
6653 ParamSpec* g_param_spec_gtype(char* name, char* nick, char* blurb, Type is_a_type, ParamFlags flags) nothrow;
6654 ParamSpec* g_param_spec_int(char* name, char* nick, char* blurb, int minimum, int maximum, int default_value, ParamFlags flags) nothrow;
6655 ParamSpec* g_param_spec_int64(char* name, char* nick, char* blurb, long minimum, long maximum, long default_value, ParamFlags flags) nothrow;
6656 ParamSpec* g_param_spec_long(char* name, char* nick, char* blurb, c_long minimum, c_long maximum, c_long default_value, ParamFlags flags) nothrow;
6657 ParamSpec* g_param_spec_object(char* name, char* nick, char* blurb, Type object_type, ParamFlags flags) nothrow;
6658 ParamSpec* g_param_spec_override(char* name, ParamSpec* overridden) nothrow;
6659 ParamSpec* g_param_spec_param(char* name, char* nick, char* blurb, Type param_type, ParamFlags flags) nothrow;
6660 ParamSpec* g_param_spec_pointer(char* name, char* nick, char* blurb, ParamFlags flags) nothrow;
6661 ParamSpec* g_param_spec_string(char* name, char* nick, char* blurb, char* default_value, ParamFlags flags) nothrow;
6662 ParamSpec* g_param_spec_uchar(char* name, char* nick, char* blurb, ubyte minimum, ubyte maximum, ubyte default_value, ParamFlags flags) nothrow;
6663 ParamSpec* g_param_spec_uint(char* name, char* nick, char* blurb, uint minimum, uint maximum, uint default_value, ParamFlags flags) nothrow;
6664 ParamSpec* g_param_spec_uint64(char* name, char* nick, char* blurb, ulong minimum, ulong maximum, ulong default_value, ParamFlags flags) nothrow;
6665 ParamSpec* g_param_spec_ulong(char* name, char* nick, char* blurb, c_ulong minimum, c_ulong maximum, c_ulong default_value, ParamFlags flags) nothrow;
6666 ParamSpec* g_param_spec_unichar(char* name, char* nick, char* blurb, dchar default_value, ParamFlags flags) nothrow;
6667 ParamSpec* g_param_spec_value_array(char* name, char* nick, char* blurb, ParamSpec* element_spec, ParamFlags flags) nothrow;
6668 ParamSpec* g_param_spec_variant(char* name, char* nick, char* blurb, GLib2.VariantType* type, GLib2.Variant* default_value, ParamFlags flags) nothrow;
6669 Type g_param_type_register_static(char* name, ParamSpecTypeInfo* pspec_info) nothrow;
6670 int g_param_value_convert(ParamSpec* pspec, Value* src_value, Value* dest_value, int strict_validation) nothrow;
6671 int g_param_value_defaults(ParamSpec* pspec, Value* value) nothrow;
6672 void g_param_value_set_default(ParamSpec* pspec, Value* value) nothrow;
6673 int g_param_value_validate(ParamSpec* pspec, Value* value) nothrow;
6674 int g_param_values_cmp(ParamSpec* pspec, Value* value1, Value* value2) nothrow;
6675 Type g_pointer_type_register_static(char* name) nothrow;
6676 int g_signal_accumulator_first_wins(SignalInvocationHint* ihint, Value* return_accu, Value* handler_return, void* dummy) nothrow;
6677 int g_signal_accumulator_true_handled(SignalInvocationHint* ihint, Value* return_accu, Value* handler_return, void* dummy) nothrow;
6678 c_ulong g_signal_add_emission_hook(uint signal_id, GLib2.Quark detail, SignalEmissionHook hook_func, void* hook_data, GLib2.DestroyNotify data_destroy) nothrow;
6679 void g_signal_chain_from_overridden(Value* instance_and_params, Value* return_value) nothrow;
6680 void g_signal_chain_from_overridden_handler(void* instance, ...) nothrow;
6681 c_ulong g_signal_connect_closure(void* instance, char* detailed_signal, Closure* closure, int after) nothrow;
6682 c_ulong g_signal_connect_closure_by_id(void* instance, uint signal_id, GLib2.Quark detail, Closure* closure, int after) nothrow;
6683 c_ulong g_signal_connect_data(void* instance, char* detailed_signal, Callback c_handler, void* data, ClosureNotify destroy_data, ConnectFlags connect_flags) nothrow;
6684 c_ulong g_signal_connect_object(void* instance, char* detailed_signal, Callback c_handler, void* gobject, ConnectFlags connect_flags) nothrow;
6685 void g_signal_emit(void* instance, uint signal_id, GLib2.Quark detail, ...) nothrow;
6686 void g_signal_emit_by_name(void* instance, char* detailed_signal, ...) nothrow;
6687 void g_signal_emit_valist(void* instance, uint signal_id, GLib2.Quark detail, va_list var_args) nothrow;
6688 void g_signal_emitv(Value* instance_and_params, uint signal_id, GLib2.Quark detail, Value* return_value) nothrow;
6689 SignalInvocationHint* g_signal_get_invocation_hint(void* instance) nothrow;
6690 void g_signal_handler_block(void* instance, c_ulong handler_id) nothrow;
6691 void g_signal_handler_disconnect(void* instance, c_ulong handler_id) nothrow;
6692 c_ulong g_signal_handler_find(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data) nothrow;
6693 int g_signal_handler_is_connected(void* instance, c_ulong handler_id) nothrow;
6694 void g_signal_handler_unblock(void* instance, c_ulong handler_id) nothrow;
6695 uint g_signal_handlers_block_matched(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data) nothrow;
6696 void g_signal_handlers_destroy(void* instance) nothrow;
6697 uint g_signal_handlers_disconnect_matched(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data) nothrow;
6698 uint g_signal_handlers_unblock_matched(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data) nothrow;
6699 int g_signal_has_handler_pending(void* instance, uint signal_id, GLib2.Quark detail, int may_be_blocked) nothrow;
6700 uint* g_signal_list_ids(Type itype, /*out*/ uint* n_ids) nothrow;
6701 uint g_signal_lookup(char* name, Type itype) nothrow;
6702 char* g_signal_name(uint signal_id) nothrow;
6703 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, ...) nothrow;
6704 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, ...) nothrow;
6705 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) nothrow;
6706 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) nothrow;
6707 void g_signal_override_class_closure(uint signal_id, Type instance_type, Closure* class_closure) nothrow;
6708 void g_signal_override_class_handler(char* signal_name, Type instance_type, Callback class_handler) nothrow;
6709 int g_signal_parse_name(char* detailed_signal, Type itype, /*out*/ uint* signal_id_p, /*out*/ GLib2.Quark* detail_p, int force_detail_quark) nothrow;
6710 void g_signal_query(uint signal_id, /*out*/ SignalQuery* query) nothrow;
6711 void g_signal_remove_emission_hook(uint signal_id, c_ulong hook_id) nothrow;
6712 void g_signal_stop_emission(void* instance, uint signal_id, GLib2.Quark detail) nothrow;
6713 void g_signal_stop_emission_by_name(void* instance, char* detailed_signal) nothrow;
6714 Closure* /*new*/ g_signal_type_cclosure_new(Type itype, uint struct_offset) nothrow;
6715 void g_source_set_closure(GLib2.Source* source, Closure* closure) nothrow;
6716 void g_source_set_dummy_callback(GLib2.Source* source) nothrow;
6717 char* /*new*/ g_strdup_value_contents(Value* value) nothrow;
6718 void g_type_add_class_cache_func(void* cache_data, TypeClassCacheFunc cache_func) nothrow;
6719 void g_type_add_class_private(Type class_type, size_t private_size) nothrow;
6720 void g_type_add_interface_check(void* check_data, TypeInterfaceCheckFunc check_func) nothrow;
6721 void g_type_add_interface_dynamic(Type instance_type, Type interface_type, TypePlugin* plugin) nothrow;
6722 void g_type_add_interface_static(Type instance_type, Type interface_type, InterfaceInfo* info) nothrow;
6723 TypeClass* g_type_check_class_cast(TypeClass* g_class, Type is_a_type) nothrow;
6724 int g_type_check_class_is_a(TypeClass* g_class, Type is_a_type) nothrow;
6725 int g_type_check_instance(TypeInstance* instance) nothrow;
6726 TypeInstance* g_type_check_instance_cast(TypeInstance* instance, Type iface_type) nothrow;
6727 int g_type_check_instance_is_a(TypeInstance* instance, Type iface_type) nothrow;
6728 int g_type_check_is_value_type(Type type) nothrow;
6729 int g_type_check_value(Value* value) nothrow;
6730 int g_type_check_value_holds(Value* value, Type type) nothrow;
6731 Type* /*new*/ g_type_children(Type type, /*out*/ uint* n_children=null) nothrow;
6732 TypeInstance* g_type_create_instance(Type type) nothrow;
6733 TypeInterface* g_type_default_interface_peek(Type g_type) nothrow;
6734 TypeInterface* g_type_default_interface_ref(Type g_type) nothrow;
6735 void g_type_default_interface_unref(TypeInterface* g_iface) nothrow;
6736 uint g_type_depth(Type type) nothrow;
6737 void g_type_free_instance(TypeInstance* instance) nothrow;
6738 Type g_type_from_name(char* name) nothrow;
6739 Type g_type_fundamental(Type type_id) nothrow;
6740 Type g_type_fundamental_next() nothrow;
6741 TypePlugin* g_type_get_plugin(Type type) nothrow;
6742 void* g_type_get_qdata(Type type, GLib2.Quark quark) nothrow;
6743 void g_type_init() nothrow;
6744 void g_type_init_with_debug_flags(TypeDebugFlags debug_flags) nothrow;
6745 Type* /*new*/ g_type_interfaces(Type type, /*out*/ uint* n_interfaces=null) nothrow;
6746 int g_type_is_a(Type type, Type is_a_type) nothrow;
6747 char* g_type_name(Type type) nothrow;
6748 char* g_type_name_from_class(TypeClass* g_class) nothrow;
6749 char* g_type_name_from_instance(TypeInstance* instance) nothrow;
6750 Type g_type_next_base(Type leaf_type, Type root_type) nothrow;
6751 Type g_type_parent(Type type) nothrow;
6752 GLib2.Quark g_type_qname(Type type) nothrow;
6753 void g_type_query(Type type, /*out*/ TypeQuery* query) nothrow;
6754 Type g_type_register_dynamic(Type parent_type, char* type_name, TypePlugin* plugin, TypeFlags flags) nothrow;
6755 Type g_type_register_fundamental(Type type_id, char* type_name, GTypeInfo* info, TypeFundamentalInfo* finfo, TypeFlags flags) nothrow;
6756 Type g_type_register_static(Type parent_type, char* type_name, GTypeInfo* info, TypeFlags flags) nothrow;
6757 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) nothrow;
6758 void g_type_remove_class_cache_func(void* cache_data, TypeClassCacheFunc cache_func) nothrow;
6759 void g_type_remove_interface_check(void* check_data, TypeInterfaceCheckFunc check_func) nothrow;
6760 void g_type_set_qdata(Type type, GLib2.Quark quark, void* data) nothrow;
6761 int g_type_test_flags(Type type, uint flags) nothrow;
6762 Type g_value_get_gtype(Value* value) nothrow;