Regenerate, restoring full UpCast functionality.
[girtod.git] / gtk2 / gobject2.d
blob449599c73d3a7e36e55978521b9b2f7015b17fcd
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 // This is the signature of va_list marshaller functions, an optional
33 // marshaller that can be used in some situations to avoid
34 // marshalling the signal argument into GValues.
35 alias VaClosureMarshal SignalCVaMarshaller;
37 // alias "Type" removed: Defined in glib
40 // A callback function used by the type system to finalize those portions
41 // of a derived types class structure that were setup from the corresponding
42 // GBaseInitFunc() function. Class finalization basically works the inverse
43 // way in which class intialization is performed.
44 // See GClassInitFunc() for a discussion of the class intialization process.
45 // <g_class>: The #GTypeClass structure to finalize.
46 extern (C) alias void function (void* g_class) nothrow BaseFinalizeFunc;
49 // A callback function used by the type system to do base initialization
50 // of the class structures of derived types. It is called as part of the
51 // initialization process of all derived classes and should reallocate
52 // or reset all dynamic class members copied over from the parent class.
53 // For example, class members (such as strings) that are not sufficiently
54 // handled by a plain memory copy of the parent class into the derived class
55 // have to be altered. See GClassInitFunc() for a discussion of the class
56 // intialization process.
57 // <g_class>: The #GTypeClass structure to initialize.
58 extern (C) alias void function (void* g_class) nothrow BaseInitFunc;
61 // #GBinding is the representation of a binding between a property on a
62 // #GObject instance (or source) and another property on another #GObject
63 // instance (or target). Whenever the source property changes, the same
64 // value is applied to the target property; for instance, the following
65 // binding:
66 //
67 // |[
68 // g_object_bind_property (object1, "property-a",
69 // object2, "property-b",
70 // G_BINDING_DEFAULT);
71 // ]|
72 //
73 // will cause <emphasis>object2:property-b</emphasis> to be updated every
74 // time g_object_set() or the specific accessor changes the value of
75 // <emphasis>object1:property-a</emphasis>.
76 //
77 // It is possible to create a bidirectional binding between two properties
78 // of two #GObject instances, so that if either property changes, the
79 // other is updated as well, for instance:
80 //
81 // |[
82 // g_object_bind_property (object1, "property-a",
83 // object2, "property-b",
84 // G_BINDING_BIDIRECTIONAL);
85 // ]|
86 //
87 // will keep the two properties in sync.
88 //
89 // It is also possible to set a custom transformation function (in both
90 // directions, in case of a bidirectional binding) to apply a custom
91 // transformation from the source value to the target value before
92 // applying it; for instance, the following binding:
93 //
94 // |[
95 // g_object_bind_property_full (adjustment1, "value",
96 // adjustment2, "value",
97 // G_BINDING_BIDIRECTIONAL,
98 // celsius_to_fahrenheit,
99 // fahrenheit_to_celsius,
100 // NULL, NULL);
101 // ]|
103 // will keep the <emphasis>value</emphasis> property of the two adjustments
104 // in sync; the <function>celsius_to_fahrenheit</function> function will be
105 // called whenever the <emphasis>adjustment1:value</emphasis> property changes
106 // and will transform the current value of the property before applying it
107 // to the <emphasis>adjustment2:value</emphasis> property; vice versa, the
108 // <function>fahrenheit_to_celsius</function> function will be called whenever
109 // the <emphasis>adjustment2:value</emphasis> property changes, and will
110 // transform the current value of the property before applying it to the
111 // <emphasis>adjustment1:value</emphasis>.
113 // Note that #GBinding does not resolve cycles by itself; a cycle like
115 // |[
116 // object1:propertyA -> object2:propertyB
117 // object2:propertyB -> object3:propertyC
118 // object3:propertyC -> object1:propertyA
119 // ]|
121 // might lead to an infinite loop. The loop, in this particular case,
122 // can be avoided if the objects emit the #GObject::notify signal only
123 // if the value has effectively been changed. A binding is implemented
124 // using the #GObject::notify signal, so it is susceptible to all the
125 // various ways of blocking a signal emission, like g_signal_stop_emission()
126 // or g_signal_handler_block().
128 // A binding will be severed, and the resources it allocates freed, whenever
129 // either one of the #GObject instances it refers to are finalized, or when
130 // the #GBinding instance loses its last reference.
132 // #GBinding is available since GObject 2.26
133 struct Binding /* : Object */ /* Version 2.26 */ {
134 alias method_parent this;
135 alias method_parent super_;
136 alias method_parent object;
137 Object method_parent;
140 // VERSION: 2.26
141 // Retrieves the flags passed when constructing the #GBinding
142 // RETURNS: the #GBindingFlags used by the #GBinding
143 BindingFlags get_flags()() nothrow {
144 return g_binding_get_flags(&this);
147 // VERSION: 2.26
148 // Retrieves the #GObject instance used as the source of the binding
149 // RETURNS: the source #GObject
150 Object* get_source()() nothrow {
151 return g_binding_get_source(&this);
154 // VERSION: 2.26
155 // Retrieves the name of the property of #GBinding:source used as the source
156 // of the binding
157 // RETURNS: the name of the source property
158 char* get_source_property()() nothrow {
159 return g_binding_get_source_property(&this);
162 // VERSION: 2.26
163 // Retrieves the #GObject instance used as the target of the binding
164 // RETURNS: the target #GObject
165 Object* get_target()() nothrow {
166 return g_binding_get_target(&this);
169 // VERSION: 2.26
170 // Retrieves the name of the property of #GBinding:target used as the target
171 // of the binding
172 // RETURNS: the name of the target property
173 char* get_target_property()() nothrow {
174 return g_binding_get_target_property(&this);
179 // Flags to be passed to g_object_bind_property() or
180 // g_object_bind_property_full().
182 // This enumeration can be extended at later date.
183 enum BindingFlags /* Version 2.26 */ {
184 DEFAULT = 0,
185 BIDIRECTIONAL = 1,
186 SYNC_CREATE = 2,
187 INVERT_BOOLEAN = 4
190 // VERSION: 2.26
191 // A function to be called to transform the source property of @source
192 // from @source_value into the target property of @target
193 // using @target_value.
195 // otherwise
196 // RETURNS: %TRUE if the transformation was successful, and %FALSE
197 // <binding>: a #GBinding
198 // <source_value>: the value of the source property
199 // <target_value>: the value of the target property
200 // <user_data>: data passed to the transform function
201 extern (C) alias int function (Binding* binding, Value* source_value, Value* target_value, void* user_data) nothrow BindingTransformFunc;
204 // Unintrospectable callback: BoxedCopyFunc() / ()
205 // This function is provided by the user and should produce a copy
206 // of the passed in boxed structure.
207 // RETURNS: The newly created copy of the boxed structure.
208 // <boxed>: The boxed structure to be copied.
209 extern (C) alias void* function (void* boxed) nothrow BoxedCopyFunc;
212 // This function is provided by the user and should free the boxed
213 // structure passed.
214 // <boxed>: The boxed structure to be freed.
215 extern (C) alias void function (void* boxed) nothrow BoxedFreeFunc;
217 // A #GCClosure is a specialization of #GClosure for C function callbacks.
218 struct CClosure {
219 Closure closure;
220 void* callback;
222 static void marshal_BOOLEAN__BOXED_BOXED(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
223 g_cclosure_marshal_BOOLEAN__BOXED_BOXED(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
225 // Unintrospectable function: marshal_BOOLEAN__BOXED_BOXEDv() / g_cclosure_marshal_BOOLEAN__BOXED_BOXEDv()
226 static void marshal_BOOLEAN__BOXED_BOXEDv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
227 g_cclosure_marshal_BOOLEAN__BOXED_BOXEDv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
230 // A marshaller for a #GCClosure with a callback of type
231 // <literal>gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter
232 // denotes a flags type.
233 // <closure>: the #GClosure to which the marshaller belongs
234 // <return_value>: a #GValue which can store the returned #gboolean
235 // <n_param_values>: 2
236 // <param_values>: a #GValue array holding instance and arg1
237 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
238 // <marshal_data>: additional data specified when registering the marshaller
239 static void marshal_BOOLEAN__FLAGS(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
240 g_cclosure_marshal_BOOLEAN__FLAGS(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
242 // Unintrospectable function: marshal_BOOLEAN__FLAGSv() / g_cclosure_marshal_BOOLEAN__FLAGSv()
243 static void marshal_BOOLEAN__FLAGSv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
244 g_cclosure_marshal_BOOLEAN__FLAGSv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
247 // A marshaller for a #GCClosure with a callback of type
248 // <literal>gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data)</literal>.
249 // <closure>: the #GClosure to which the marshaller belongs
250 // <return_value>: a #GValue, which can store the returned string
251 // <n_param_values>: 3
252 // <param_values>: a #GValue array holding instance, arg1 and arg2
253 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
254 // <marshal_data>: additional data specified when registering the marshaller
255 static void marshal_STRING__OBJECT_POINTER(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
256 g_cclosure_marshal_STRING__OBJECT_POINTER(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
258 // Unintrospectable function: marshal_STRING__OBJECT_POINTERv() / g_cclosure_marshal_STRING__OBJECT_POINTERv()
259 static void marshal_STRING__OBJECT_POINTERv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
260 g_cclosure_marshal_STRING__OBJECT_POINTERv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
263 // A marshaller for a #GCClosure with a callback of type
264 // <literal>void (*callback) (gpointer instance, gboolean arg1, gpointer user_data)</literal>.
265 // <closure>: the #GClosure to which the marshaller belongs
266 // <return_value>: ignored
267 // <n_param_values>: 2
268 // <param_values>: a #GValue array holding the instance and the #gboolean parameter
269 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
270 // <marshal_data>: additional data specified when registering the marshaller
271 static void marshal_VOID__BOOLEAN(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
272 g_cclosure_marshal_VOID__BOOLEAN(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
274 // Unintrospectable function: marshal_VOID__BOOLEANv() / g_cclosure_marshal_VOID__BOOLEANv()
275 static void marshal_VOID__BOOLEANv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
276 g_cclosure_marshal_VOID__BOOLEANv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
279 // A marshaller for a #GCClosure with a callback of type
280 // <literal>void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data)</literal>.
281 // <closure>: the #GClosure to which the marshaller belongs
282 // <return_value>: ignored
283 // <n_param_values>: 2
284 // <param_values>: a #GValue array holding the instance and the #GBoxed* parameter
285 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
286 // <marshal_data>: additional data specified when registering the marshaller
287 static void marshal_VOID__BOXED(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
288 g_cclosure_marshal_VOID__BOXED(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
290 // Unintrospectable function: marshal_VOID__BOXEDv() / g_cclosure_marshal_VOID__BOXEDv()
291 static void marshal_VOID__BOXEDv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
292 g_cclosure_marshal_VOID__BOXEDv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
295 // A marshaller for a #GCClosure with a callback of type
296 // <literal>void (*callback) (gpointer instance, gchar arg1, gpointer user_data)</literal>.
297 // <closure>: the #GClosure to which the marshaller belongs
298 // <return_value>: ignored
299 // <n_param_values>: 2
300 // <param_values>: a #GValue array holding the instance and the #gchar parameter
301 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
302 // <marshal_data>: additional data specified when registering the marshaller
303 static void marshal_VOID__CHAR(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
304 g_cclosure_marshal_VOID__CHAR(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
306 // Unintrospectable function: marshal_VOID__CHARv() / g_cclosure_marshal_VOID__CHARv()
307 static void marshal_VOID__CHARv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
308 g_cclosure_marshal_VOID__CHARv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
311 // A marshaller for a #GCClosure with a callback of type
312 // <literal>void (*callback) (gpointer instance, gdouble arg1, gpointer user_data)</literal>.
313 // <closure>: the #GClosure to which the marshaller belongs
314 // <return_value>: ignored
315 // <n_param_values>: 2
316 // <param_values>: a #GValue array holding the instance and the #gdouble parameter
317 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
318 // <marshal_data>: additional data specified when registering the marshaller
319 static void marshal_VOID__DOUBLE(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
320 g_cclosure_marshal_VOID__DOUBLE(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
322 // Unintrospectable function: marshal_VOID__DOUBLEv() / g_cclosure_marshal_VOID__DOUBLEv()
323 static void marshal_VOID__DOUBLEv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
324 g_cclosure_marshal_VOID__DOUBLEv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
327 // A marshaller for a #GCClosure with a callback of type
328 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter denotes an enumeration type..
329 // <closure>: the #GClosure to which the marshaller belongs
330 // <return_value>: ignored
331 // <n_param_values>: 2
332 // <param_values>: a #GValue array holding the instance and the enumeration parameter
333 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
334 // <marshal_data>: additional data specified when registering the marshaller
335 static void marshal_VOID__ENUM(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
336 g_cclosure_marshal_VOID__ENUM(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
338 // Unintrospectable function: marshal_VOID__ENUMv() / g_cclosure_marshal_VOID__ENUMv()
339 static void marshal_VOID__ENUMv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
340 g_cclosure_marshal_VOID__ENUMv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
343 // A marshaller for a #GCClosure with a callback of type
344 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter denotes a flags type.
345 // <closure>: the #GClosure to which the marshaller belongs
346 // <return_value>: ignored
347 // <n_param_values>: 2
348 // <param_values>: a #GValue array holding the instance and the flags parameter
349 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
350 // <marshal_data>: additional data specified when registering the marshaller
351 static void marshal_VOID__FLAGS(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
352 g_cclosure_marshal_VOID__FLAGS(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
354 // Unintrospectable function: marshal_VOID__FLAGSv() / g_cclosure_marshal_VOID__FLAGSv()
355 static void marshal_VOID__FLAGSv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
356 g_cclosure_marshal_VOID__FLAGSv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
359 // A marshaller for a #GCClosure with a callback of type
360 // <literal>void (*callback) (gpointer instance, gfloat arg1, gpointer user_data)</literal>.
361 // <closure>: the #GClosure to which the marshaller belongs
362 // <return_value>: ignored
363 // <n_param_values>: 2
364 // <param_values>: a #GValue array holding the instance and the #gfloat parameter
365 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
366 // <marshal_data>: additional data specified when registering the marshaller
367 static void marshal_VOID__FLOAT(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
368 g_cclosure_marshal_VOID__FLOAT(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
370 // Unintrospectable function: marshal_VOID__FLOATv() / g_cclosure_marshal_VOID__FLOATv()
371 static void marshal_VOID__FLOATv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
372 g_cclosure_marshal_VOID__FLOATv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
375 // A marshaller for a #GCClosure with a callback of type
376 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal>.
377 // <closure>: the #GClosure to which the marshaller belongs
378 // <return_value>: ignored
379 // <n_param_values>: 2
380 // <param_values>: a #GValue array holding the instance and the #gint parameter
381 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
382 // <marshal_data>: additional data specified when registering the marshaller
383 static void marshal_VOID__INT(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
384 g_cclosure_marshal_VOID__INT(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
386 // Unintrospectable function: marshal_VOID__INTv() / g_cclosure_marshal_VOID__INTv()
387 static void marshal_VOID__INTv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
388 g_cclosure_marshal_VOID__INTv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
391 // A marshaller for a #GCClosure with a callback of type
392 // <literal>void (*callback) (gpointer instance, glong arg1, gpointer user_data)</literal>.
393 // <closure>: the #GClosure to which the marshaller belongs
394 // <return_value>: ignored
395 // <n_param_values>: 2
396 // <param_values>: a #GValue array holding the instance and the #glong parameter
397 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
398 // <marshal_data>: additional data specified when registering the marshaller
399 static void marshal_VOID__LONG(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
400 g_cclosure_marshal_VOID__LONG(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
402 // Unintrospectable function: marshal_VOID__LONGv() / g_cclosure_marshal_VOID__LONGv()
403 static void marshal_VOID__LONGv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
404 g_cclosure_marshal_VOID__LONGv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
407 // A marshaller for a #GCClosure with a callback of type
408 // <literal>void (*callback) (gpointer instance, GObject *arg1, gpointer user_data)</literal>.
409 // <closure>: the #GClosure to which the marshaller belongs
410 // <return_value>: ignored
411 // <n_param_values>: 2
412 // <param_values>: a #GValue array holding the instance and the #GObject* parameter
413 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
414 // <marshal_data>: additional data specified when registering the marshaller
415 static void marshal_VOID__OBJECT(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
416 g_cclosure_marshal_VOID__OBJECT(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
418 // Unintrospectable function: marshal_VOID__OBJECTv() / g_cclosure_marshal_VOID__OBJECTv()
419 static void marshal_VOID__OBJECTv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
420 g_cclosure_marshal_VOID__OBJECTv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
423 // A marshaller for a #GCClosure with a callback of type
424 // <literal>void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data)</literal>.
425 // <closure>: the #GClosure to which the marshaller belongs
426 // <return_value>: ignored
427 // <n_param_values>: 2
428 // <param_values>: a #GValue array holding the instance and the #GParamSpec* parameter
429 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
430 // <marshal_data>: additional data specified when registering the marshaller
431 static void marshal_VOID__PARAM(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
432 g_cclosure_marshal_VOID__PARAM(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
434 // Unintrospectable function: marshal_VOID__PARAMv() / g_cclosure_marshal_VOID__PARAMv()
435 static void marshal_VOID__PARAMv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
436 g_cclosure_marshal_VOID__PARAMv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
439 // A marshaller for a #GCClosure with a callback of type
440 // <literal>void (*callback) (gpointer instance, gpointer arg1, gpointer user_data)</literal>.
441 // <closure>: the #GClosure to which the marshaller belongs
442 // <return_value>: ignored
443 // <n_param_values>: 2
444 // <param_values>: a #GValue array holding the instance and the #gpointer parameter
445 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
446 // <marshal_data>: additional data specified when registering the marshaller
447 static void marshal_VOID__POINTER(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
448 g_cclosure_marshal_VOID__POINTER(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
450 // Unintrospectable function: marshal_VOID__POINTERv() / g_cclosure_marshal_VOID__POINTERv()
451 static void marshal_VOID__POINTERv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
452 g_cclosure_marshal_VOID__POINTERv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
455 // A marshaller for a #GCClosure with a callback of type
456 // <literal>void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data)</literal>.
457 // <closure>: the #GClosure to which the marshaller belongs
458 // <return_value>: ignored
459 // <n_param_values>: 2
460 // <param_values>: a #GValue array holding the instance and the #gchar* parameter
461 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
462 // <marshal_data>: additional data specified when registering the marshaller
463 static void marshal_VOID__STRING(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
464 g_cclosure_marshal_VOID__STRING(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
466 // Unintrospectable function: marshal_VOID__STRINGv() / g_cclosure_marshal_VOID__STRINGv()
467 static void marshal_VOID__STRINGv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
468 g_cclosure_marshal_VOID__STRINGv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
471 // A marshaller for a #GCClosure with a callback of type
472 // <literal>void (*callback) (gpointer instance, guchar arg1, gpointer user_data)</literal>.
473 // <closure>: the #GClosure to which the marshaller belongs
474 // <return_value>: ignored
475 // <n_param_values>: 2
476 // <param_values>: a #GValue array holding the instance and the #guchar parameter
477 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
478 // <marshal_data>: additional data specified when registering the marshaller
479 static void marshal_VOID__UCHAR(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
480 g_cclosure_marshal_VOID__UCHAR(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
482 // Unintrospectable function: marshal_VOID__UCHARv() / g_cclosure_marshal_VOID__UCHARv()
483 static void marshal_VOID__UCHARv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
484 g_cclosure_marshal_VOID__UCHARv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
487 // A marshaller for a #GCClosure with a callback of type
488 // <literal>void (*callback) (gpointer instance, guint arg1, gpointer user_data)</literal>.
489 // <closure>: the #GClosure to which the marshaller belongs
490 // <return_value>: ignored
491 // <n_param_values>: 2
492 // <param_values>: a #GValue array holding the instance and the #guint parameter
493 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
494 // <marshal_data>: additional data specified when registering the marshaller
495 static void marshal_VOID__UINT(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
496 g_cclosure_marshal_VOID__UINT(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
499 // A marshaller for a #GCClosure with a callback of type
500 // <literal>void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data)</literal>.
501 // <closure>: the #GClosure to which the marshaller belongs
502 // <return_value>: ignored
503 // <n_param_values>: 3
504 // <param_values>: a #GValue array holding instance, arg1 and arg2
505 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
506 // <marshal_data>: additional data specified when registering the marshaller
507 static void marshal_VOID__UINT_POINTER(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
508 g_cclosure_marshal_VOID__UINT_POINTER(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
510 // Unintrospectable function: marshal_VOID__UINT_POINTERv() / g_cclosure_marshal_VOID__UINT_POINTERv()
511 static void marshal_VOID__UINT_POINTERv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
512 g_cclosure_marshal_VOID__UINT_POINTERv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
514 // Unintrospectable function: marshal_VOID__UINTv() / g_cclosure_marshal_VOID__UINTv()
515 static void marshal_VOID__UINTv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
516 g_cclosure_marshal_VOID__UINTv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
519 // A marshaller for a #GCClosure with a callback of type
520 // <literal>void (*callback) (gpointer instance, gulong arg1, gpointer user_data)</literal>.
521 // <closure>: the #GClosure to which the marshaller belongs
522 // <return_value>: ignored
523 // <n_param_values>: 2
524 // <param_values>: a #GValue array holding the instance and the #gulong parameter
525 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
526 // <marshal_data>: additional data specified when registering the marshaller
527 static void marshal_VOID__ULONG(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
528 g_cclosure_marshal_VOID__ULONG(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
530 // Unintrospectable function: marshal_VOID__ULONGv() / g_cclosure_marshal_VOID__ULONGv()
531 static void marshal_VOID__ULONGv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
532 g_cclosure_marshal_VOID__ULONGv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
535 // VERSION: 2.26
536 // A marshaller for a #GCClosure with a callback of type
537 // <literal>void (*callback) (gpointer instance, GVariant *arg1, gpointer user_data)</literal>.
538 // <closure>: the #GClosure to which the marshaller belongs
539 // <return_value>: ignored
540 // <n_param_values>: 2
541 // <param_values>: a #GValue array holding the instance and the #GVariant* parameter
542 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
543 // <marshal_data>: additional data specified when registering the marshaller
544 static void marshal_VOID__VARIANT(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
545 g_cclosure_marshal_VOID__VARIANT(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
547 // Unintrospectable function: marshal_VOID__VARIANTv() / g_cclosure_marshal_VOID__VARIANTv()
548 static void marshal_VOID__VARIANTv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
549 g_cclosure_marshal_VOID__VARIANTv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
552 // A marshaller for a #GCClosure with a callback of type
553 // <literal>void (*callback) (gpointer instance, gpointer user_data)</literal>.
554 // <closure>: the #GClosure to which the marshaller belongs
555 // <return_value>: ignored
556 // <n_param_values>: 1
557 // <param_values>: a #GValue array holding only the instance
558 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
559 // <marshal_data>: additional data specified when registering the marshaller
560 static void marshal_VOID__VOID(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
561 g_cclosure_marshal_VOID__VOID(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
563 // Unintrospectable function: marshal_VOID__VOIDv() / g_cclosure_marshal_VOID__VOIDv()
564 static void marshal_VOID__VOIDv(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
565 g_cclosure_marshal_VOID__VOIDv(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
568 // VERSION: 2.30
569 // A generic marshaller function implemented via <ulink
570 // url="http://sourceware.org/libffi/">libffi</ulink>.
571 // <closure>: A #GClosure.
572 // <return_gvalue>: A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
573 // <n_param_values>: The length of the @param_values array.
574 // <param_values>: An array of #GValue<!-- -->s holding the arguments on which to invoke the callback of closure.
575 // <invocation_hint>: The invocation hint given as the last argument to g_closure_invoke().
576 // <marshal_data>: Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
577 static void marshal_generic(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_gvalue, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
578 g_cclosure_marshal_generic(UpCast!(Closure*)(closure), UpCast!(Value*)(return_gvalue), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
580 // Unintrospectable function: marshal_generic_va() / g_cclosure_marshal_generic_va()
581 static void marshal_generic_va(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, AT2 /*void*/ instance, va_list args_list, AT3 /*void*/ marshal_data, int n_params, AT4 /*Type*/ param_types) nothrow {
582 g_cclosure_marshal_generic_va(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), UpCast!(void*)(instance), args_list, UpCast!(void*)(marshal_data), n_params, UpCast!(Type*)(param_types));
585 // Unintrospectable function: new() / g_cclosure_new()
586 // Creates a new closure which invokes @callback_func with @user_data as
587 // the last parameter.
588 // RETURNS: a new #GCClosure
589 // <callback_func>: the function to invoke
590 // <user_data>: user data to pass to @callback_func
591 // <destroy_data>: destroy notify to be called when @user_data is no longer used
592 static Closure* /*new*/ new_(AT0)(Callback callback_func, AT0 /*void*/ user_data, ClosureNotify destroy_data) nothrow {
593 return g_cclosure_new(callback_func, UpCast!(void*)(user_data), destroy_data);
596 // Unintrospectable function: new_object() / g_cclosure_new_object()
597 // A variant of g_cclosure_new() which uses @object as @user_data and
598 // calls g_object_watch_closure() on @object and the created
599 // closure. This function is useful when you have a callback closely
600 // associated with a #GObject, and want the callback to no longer run
601 // after the object is is freed.
602 // RETURNS: a new #GCClosure
603 // <callback_func>: the function to invoke
604 // <object>: a #GObject pointer to pass to @callback_func
605 static Closure* /*new*/ new_object(AT0)(Callback callback_func, AT0 /*Object*/ object) nothrow {
606 return g_cclosure_new_object(callback_func, UpCast!(Object*)(object));
609 // Unintrospectable function: new_object_swap() / g_cclosure_new_object_swap()
610 // A variant of g_cclosure_new_swap() which uses @object as @user_data
611 // and calls g_object_watch_closure() on @object and the created
612 // closure. This function is useful when you have a callback closely
613 // associated with a #GObject, and want the callback to no longer run
614 // after the object is is freed.
615 // RETURNS: a new #GCClosure
616 // <callback_func>: the function to invoke
617 // <object>: a #GObject pointer to pass to @callback_func
618 static Closure* /*new*/ new_object_swap(AT0)(Callback callback_func, AT0 /*Object*/ object) nothrow {
619 return g_cclosure_new_object_swap(callback_func, UpCast!(Object*)(object));
622 // Unintrospectable function: new_swap() / g_cclosure_new_swap()
623 // Creates a new closure which invokes @callback_func with @user_data as
624 // the first parameter.
625 // RETURNS: a new #GCClosure
626 // <callback_func>: the function to invoke
627 // <user_data>: user data to pass to @callback_func
628 // <destroy_data>: destroy notify to be called when @user_data is no longer used
629 static Closure* /*new*/ new_swap(AT0)(Callback callback_func, AT0 /*void*/ user_data, ClosureNotify destroy_data) nothrow {
630 return g_cclosure_new_swap(callback_func, UpCast!(void*)(user_data), destroy_data);
635 // The type used for callback functions in structure definitions and function
636 // signatures. This doesn't mean that all callback functions must take no
637 // parameters and return void. The required signature of a callback function
638 // is determined by the context in which is used (e.g. the signal to which it
639 // is connected). Use G_CALLBACK() to cast the callback function to a #GCallback.
640 extern (C) alias void function () nothrow Callback;
643 // A callback function used by the type system to finalize a class.
644 // This function is rarely needed, as dynamically allocated class resources
645 // should be handled by GBaseInitFunc() and GBaseFinalizeFunc().
646 // Also, specification of a GClassFinalizeFunc() in the #GTypeInfo
647 // structure of a static type is invalid, because classes of static types
648 // will never be finalized (they are artificially kept alive when their
649 // reference count drops to zero).
650 // <g_class>: The #GTypeClass structure to finalize.
651 // <class_data>: The @class_data member supplied via the #GTypeInfo structure.
652 extern (C) alias void function (void* g_class, void* class_data) nothrow ClassFinalizeFunc;
655 // A callback function used by the type system to initialize the class
656 // of a specific type. This function should initialize all static class
657 // members.
658 // The initialization process of a class involves:
659 // <itemizedlist>
660 // <listitem><para>
661 // 1 - Copying common members from the parent class over to the
662 // derived class structure.
663 // </para></listitem>
664 // <listitem><para>
665 // 2 - Zero initialization of the remaining members not copied
666 // over from the parent class.
667 // </para></listitem>
668 // <listitem><para>
669 // 3 - Invocation of the GBaseInitFunc() initializers of all parent
670 // types and the class' type.
671 // </para></listitem>
672 // <listitem><para>
673 // 4 - Invocation of the class' GClassInitFunc() initializer.
674 // </para></listitem>
675 // </itemizedlist>
676 // Since derived classes are partially initialized through a memory copy
677 // of the parent class, the general rule is that GBaseInitFunc() and
678 // GBaseFinalizeFunc() should take care of necessary reinitialization
679 // and release of those class members that were introduced by the type
680 // that specified these GBaseInitFunc()/GBaseFinalizeFunc().
681 // GClassInitFunc() should only care about initializing static
682 // class members, while dynamic class members (such as allocated strings
683 // or reference counted resources) are better handled by a GBaseInitFunc()
684 // for this type, so proper initialization of the dynamic class members
685 // is performed for class initialization of derived types as well.
686 // An example may help to correspond the intend of the different class
687 // initializers:
689 // |[
690 // typedef struct {
691 // GObjectClass parent_class;
692 // gint static_integer;
693 // gchar *dynamic_string;
694 // } TypeAClass;
695 // static void
696 // type_a_base_class_init (TypeAClass *class)
697 // {
698 // class->dynamic_string = g_strdup ("some string");
699 // }
700 // static void
701 // type_a_base_class_finalize (TypeAClass *class)
702 // {
703 // g_free (class->dynamic_string);
704 // }
705 // static void
706 // type_a_class_init (TypeAClass *class)
707 // {
708 // class->static_integer = 42;
709 // }
711 // typedef struct {
712 // TypeAClass parent_class;
713 // gfloat static_float;
714 // GString *dynamic_gstring;
715 // } TypeBClass;
716 // static void
717 // type_b_base_class_init (TypeBClass *class)
718 // {
719 // class->dynamic_gstring = g_string_new ("some other string");
720 // }
721 // static void
722 // type_b_base_class_finalize (TypeBClass *class)
723 // {
724 // g_string_free (class->dynamic_gstring);
725 // }
726 // static void
727 // type_b_class_init (TypeBClass *class)
728 // {
729 // class->static_float = 3.14159265358979323846;
730 // }
731 // ]|
732 // Initialization of TypeBClass will first cause initialization of
733 // TypeAClass (derived classes reference their parent classes, see
734 // g_type_class_ref() on this).
735 // Initialization of TypeAClass roughly involves zero-initializing its fields,
736 // then calling its GBaseInitFunc() type_a_base_class_init() to allocate
737 // its dynamic members (dynamic_string), and finally calling its GClassInitFunc()
738 // type_a_class_init() to initialize its static members (static_integer).
739 // The first step in the initialization process of TypeBClass is then
740 // a plain memory copy of the contents of TypeAClass into TypeBClass and
741 // zero-initialization of the remaining fields in TypeBClass.
742 // The dynamic members of TypeAClass within TypeBClass now need
743 // reinitialization which is performed by calling type_a_base_class_init()
744 // with an argument of TypeBClass.
745 // After that, the GBaseInitFunc() of TypeBClass, type_b_base_class_init()
746 // is called to allocate the dynamic members of TypeBClass (dynamic_gstring),
747 // and finally the GClassInitFunc() of TypeBClass, type_b_class_init(),
748 // is called to complete the initialization process with the static members
749 // (static_float).
750 // Corresponding finalization counter parts to the GBaseInitFunc() functions
751 // have to be provided to release allocated resources at class finalization
752 // time.
753 // <g_class>: The #GTypeClass structure to initialize.
754 // <class_data>: The @class_data member supplied via the #GTypeInfo structure.
755 extern (C) alias void function (void* g_class, void* class_data) nothrow ClassInitFunc;
758 // A #GClosure represents a callback supplied by the programmer. It
759 // will generally comprise a function of some kind and a marshaller
760 // used to call it. It is the reponsibility of the marshaller to
761 // convert the arguments for the invocation from #GValue<!-- -->s into
762 // a suitable form, perform the callback on the converted arguments,
763 // and transform the return value back into a #GValue.
765 // In the case of C programs, a closure usually just holds a pointer
766 // to a function and maybe a data argument, and the marshaller
767 // converts between #GValue<!-- --> and native C types. The GObject
768 // library provides the #GCClosure type for this purpose. Bindings for
769 // other languages need marshallers which convert between #GValue<!--
770 // -->s and suitable representations in the runtime of the language in
771 // order to use functions written in that languages as callbacks.
773 // Within GObject, closures play an important role in the
774 // implementation of signals. When a signal is registered, the
775 // @c_marshaller argument to g_signal_new() specifies the default C
776 // marshaller for any closure which is connected to this
777 // signal. GObject provides a number of C marshallers for this
778 // purpose, see the g_cclosure_marshal_*() functions. Additional C
779 // marshallers can be generated with the <link
780 // linkend="glib-genmarshal">glib-genmarshal</link> utility. Closures
781 // can be explicitly connected to signals with
782 // g_signal_connect_closure(), but it usually more convenient to let
783 // GObject create a closure automatically by using one of the
784 // g_signal_connect_*() functions which take a callback function/user
785 // data pair.
787 // Using closures has a number of important advantages over a simple
788 // callback function/data pointer combination:
789 // <itemizedlist>
790 // <listitem><para>
791 // Closures allow the callee to get the types of the callback parameters,
792 // which means that language bindings don't have to write individual glue
793 // for each callback type.
794 // </para></listitem>
795 // <listitem><para>
796 // The reference counting of #GClosure makes it easy to handle reentrancy
797 // right; if a callback is removed while it is being invoked, the closure
798 // and its parameters won't be freed until the invocation finishes.
799 // </para></listitem>
800 // <listitem><para>
801 // g_closure_invalidate() and invalidation notifiers allow callbacks to be
802 // automatically removed when the objects they point to go away.
803 // </para></listitem>
804 // </itemizedlist>
805 struct Closure {
806 static import std.bitmanip; mixin(std.bitmanip.bitfields!(
807 uint, "ref_count", 15,
808 uint, "meta_marshal_nouse", 1,
809 uint, "n_guards", 1,
810 uint, "n_fnotifiers", 2,
811 uint, "n_inotifiers", 8,
812 uint, "in_inotify", 1,
813 uint, "floating", 1,
814 uint, "derivative_flag", 1,
815 uint, "in_marshal", 1,
816 uint, "is_invalid", 1));
817 extern (C) void function (Closure* closure, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow marshal;
818 private void* data;
819 private ClosureNotifyData* notifiers;
822 // A variant of g_closure_new_simple() which stores @object in the
823 // @data field of the closure and calls g_object_watch_closure() on
824 // @object and the created closure. This function is mainly useful
825 // when implementing new types of closures.
826 // RETURNS: a newly allocated #GClosure
827 // <sizeof_closure>: the size of the structure to allocate, must be at least <literal>sizeof (GClosure)</literal>
828 // <object>: a #GObject pointer to store in the @data field of the newly allocated #GClosure
829 static Closure* /*new*/ new_object(AT0)(uint sizeof_closure, AT0 /*Object*/ object) nothrow {
830 return g_closure_new_object(sizeof_closure, UpCast!(Object*)(object));
832 static auto opCall(AT0)(uint sizeof_closure, AT0 /*Object*/ object) {
833 return g_closure_new_object(sizeof_closure, UpCast!(Object*)(object));
836 // Allocates a struct of the given size and initializes the initial
837 // part as a #GClosure. This function is mainly useful when
838 // implementing new types of closures.
840 // |[
841 // typedef struct _MyClosure MyClosure;
842 // struct _MyClosure
843 // {
844 // GClosure closure;
845 // // extra data goes here
846 // };
848 // static void
849 // my_closure_finalize (gpointer notify_data,
850 // GClosure *closure)
851 // {
852 // MyClosure *my_closure = (MyClosure *)closure;
854 // // free extra data here
855 // }
857 // MyClosure *my_closure_new (gpointer data)
858 // {
859 // GClosure *closure;
860 // MyClosure *my_closure;
862 // closure = g_closure_new_simple (sizeof (MyClosure), data);
863 // my_closure = (MyClosure *) closure;
865 // // initialize extra data here
867 // g_closure_add_finalize_notifier (closure, notify_data,
868 // my_closure_finalize);
869 // return my_closure;
870 // }
871 // ]|
872 // RETURNS: a newly allocated #GClosure
873 // <sizeof_closure>: the size of the structure to allocate, must be at least <literal>sizeof (GClosure)</literal>
874 // <data>: data to store in the @data field of the newly allocated #GClosure
875 static Closure* /*new*/ new_simple(AT0)(uint sizeof_closure, AT0 /*void*/ data) nothrow {
876 return g_closure_new_simple(sizeof_closure, UpCast!(void*)(data));
878 static auto opCall(AT0)(uint sizeof_closure, AT0 /*void*/ data) {
879 return g_closure_new_simple(sizeof_closure, UpCast!(void*)(data));
882 // Unintrospectable method: add_finalize_notifier() / g_closure_add_finalize_notifier()
883 // Registers a finalization notifier which will be called when the
884 // reference count of @closure goes down to 0. Multiple finalization
885 // notifiers on a single closure are invoked in unspecified order. If
886 // a single call to g_closure_unref() results in the closure being
887 // both invalidated and finalized, then the invalidate notifiers will
888 // be run before the finalize notifiers.
889 // <notify_data>: data to pass to @notify_func
890 // <notify_func>: the callback function to register
891 void add_finalize_notifier(AT0)(AT0 /*void*/ notify_data, ClosureNotify notify_func) nothrow {
892 g_closure_add_finalize_notifier(&this, UpCast!(void*)(notify_data), notify_func);
895 // Unintrospectable method: add_invalidate_notifier() / g_closure_add_invalidate_notifier()
896 // Registers an invalidation notifier which will be called when the
897 // @closure is invalidated with g_closure_invalidate(). Invalidation
898 // notifiers are invoked before finalization notifiers, in an
899 // unspecified order.
900 // <notify_data>: data to pass to @notify_func
901 // <notify_func>: the callback function to register
902 void add_invalidate_notifier(AT0)(AT0 /*void*/ notify_data, ClosureNotify notify_func) nothrow {
903 g_closure_add_invalidate_notifier(&this, UpCast!(void*)(notify_data), notify_func);
906 // Unintrospectable method: add_marshal_guards() / g_closure_add_marshal_guards()
907 // Adds a pair of notifiers which get invoked before and after the
908 // closure callback, respectively. This is typically used to protect
909 // the extra arguments for the duration of the callback. See
910 // g_object_watch_closure() for an example of marshal guards.
911 // <pre_marshal_data>: data to pass to @pre_marshal_notify
912 // <pre_marshal_notify>: a function to call before the closure callback
913 // <post_marshal_data>: data to pass to @post_marshal_notify
914 // <post_marshal_notify>: a function to call after the closure callback
915 void add_marshal_guards(AT0, AT1)(AT0 /*void*/ pre_marshal_data, ClosureNotify pre_marshal_notify, AT1 /*void*/ post_marshal_data, ClosureNotify post_marshal_notify) nothrow {
916 g_closure_add_marshal_guards(&this, UpCast!(void*)(pre_marshal_data), pre_marshal_notify, UpCast!(void*)(post_marshal_data), post_marshal_notify);
919 // Sets a flag on the closure to indicate that its calling
920 // environment has become invalid, and thus causes any future
921 // invocations of g_closure_invoke() on this @closure to be
922 // ignored. Also, invalidation notifiers installed on the closure will
923 // be called at this point. Note that unless you are holding a
924 // reference to the closure yourself, the invalidation notifiers may
925 // unref the closure and cause it to be destroyed, so if you need to
926 // access the closure after calling g_closure_invalidate(), make sure
927 // that you've previously called g_closure_ref().
929 // Note that g_closure_invalidate() will also be called when the
930 // reference count of a closure drops to zero (unless it has already
931 // been invalidated before).
932 void invalidate()() nothrow {
933 g_closure_invalidate(&this);
936 // Invokes the closure, i.e. executes the callback represented by the @closure.
937 // <return_value>: a #GValue to store the return value. May be %NULL if the callback of @closure doesn't return a value.
938 // <n_param_values>: the length of the @param_values array
939 // <param_values>: an array of #GValue<!-- -->s holding the arguments on which to invoke the callback of @closure
940 // <invocation_hint>: a context-dependent invocation hint
941 void invoke(AT0, AT1, AT2)(AT0 /*Value*/ return_value, uint n_param_values, AT1 /*Value*/ param_values, AT2 /*void*/ invocation_hint=null) nothrow {
942 g_closure_invoke(&this, UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint));
945 // Increments the reference count on a closure to force it staying
946 // alive while the caller holds a pointer to it.
947 // RETURNS: The @closure passed in, for convenience
948 Closure* ref_()() nothrow {
949 return g_closure_ref(&this);
952 // Unintrospectable method: remove_finalize_notifier() / g_closure_remove_finalize_notifier()
953 // Removes a finalization notifier.
955 // Notice that notifiers are automatically removed after they are run.
956 // <notify_data>: data which was passed to g_closure_add_finalize_notifier() when registering @notify_func
957 // <notify_func>: the callback function to remove
958 void remove_finalize_notifier(AT0)(AT0 /*void*/ notify_data, ClosureNotify notify_func) nothrow {
959 g_closure_remove_finalize_notifier(&this, UpCast!(void*)(notify_data), notify_func);
962 // Unintrospectable method: remove_invalidate_notifier() / g_closure_remove_invalidate_notifier()
963 // Removes an invalidation notifier.
965 // Notice that notifiers are automatically removed after they are run.
966 // <notify_data>: data which was passed to g_closure_add_invalidate_notifier() when registering @notify_func
967 // <notify_func>: the callback function to remove
968 void remove_invalidate_notifier(AT0)(AT0 /*void*/ notify_data, ClosureNotify notify_func) nothrow {
969 g_closure_remove_invalidate_notifier(&this, UpCast!(void*)(notify_data), notify_func);
972 // Unintrospectable method: set_marshal() / g_closure_set_marshal()
973 // Sets the marshaller of @closure. The <literal>marshal_data</literal>
974 // of @marshal provides a way for a meta marshaller to provide additional
975 // information to the marshaller. (See g_closure_set_meta_marshal().) For
976 // GObject's C predefined marshallers (the g_cclosure_marshal_*()
977 // functions), what it provides is a callback function to use instead of
978 // @closure->callback.
979 // <marshal>: a #GClosureMarshal function
980 void set_marshal()(ClosureMarshal marshal) nothrow {
981 g_closure_set_marshal(&this, marshal);
984 // Unintrospectable method: set_meta_marshal() / g_closure_set_meta_marshal()
985 // Sets the meta marshaller of @closure. A meta marshaller wraps
986 // @closure->marshal and modifies the way it is called in some
987 // fashion. The most common use of this facility is for C callbacks.
988 // The same marshallers (generated by <link
989 // linkend="glib-genmarshal">glib-genmarshal</link>) are used
990 // everywhere, but the way that we get the callback function
991 // differs. In most cases we want to use @closure->callback, but in
992 // other cases we want to use some different technique to retrieve the
993 // callback function.
995 // For example, class closures for signals (see
996 // g_signal_type_cclosure_new()) retrieve the callback function from a
997 // fixed offset in the class structure. The meta marshaller retrieves
998 // the right callback and passes it to the marshaller as the
999 // @marshal_data argument.
1000 // <marshal_data>: context-dependent data to pass to @meta_marshal
1001 // <meta_marshal>: a #GClosureMarshal function
1002 void set_meta_marshal(AT0)(AT0 /*void*/ marshal_data, ClosureMarshal meta_marshal) nothrow {
1003 g_closure_set_meta_marshal(&this, UpCast!(void*)(marshal_data), meta_marshal);
1006 // Takes over the initial ownership of a closure. Each closure is
1007 // initially created in a <firstterm>floating</firstterm> state, which
1008 // means that the initial reference count is not owned by any caller.
1009 // g_closure_sink() checks to see if the object is still floating, and
1010 // if so, unsets the floating state and decreases the reference
1011 // count. If the closure is not floating, g_closure_sink() does
1012 // nothing. The reason for the existence of the floating state is to
1013 // prevent cumbersome code sequences like:
1014 // |[
1015 // closure = g_cclosure_new (cb_func, cb_data);
1016 // g_source_set_closure (source, closure);
1017 // g_closure_unref (closure); // XXX GObject doesn't really need this
1018 // ]|
1019 // Because g_source_set_closure() (and similar functions) take ownership of the
1020 // initial reference count, if it is unowned, we instead can write:
1021 // |[
1022 // g_source_set_closure (source, g_cclosure_new (cb_func, cb_data));
1023 // ]|
1025 // Generally, this function is used together with g_closure_ref(). Ane example
1026 // of storing a closure for later notification looks like:
1027 // |[
1028 // static GClosure *notify_closure = NULL;
1029 // void
1030 // foo_notify_set_closure (GClosure *closure)
1031 // {
1032 // if (notify_closure)
1033 // g_closure_unref (notify_closure);
1034 // notify_closure = closure;
1035 // if (notify_closure)
1036 // {
1037 // g_closure_ref (notify_closure);
1038 // g_closure_sink (notify_closure);
1039 // }
1040 // }
1041 // ]|
1043 // Because g_closure_sink() may decrement the reference count of a closure
1044 // (if it hasn't been called on @closure yet) just like g_closure_unref(),
1045 // g_closure_ref() should be called prior to this function.
1046 void sink()() nothrow {
1047 g_closure_sink(&this);
1050 // Decrements the reference count of a closure after it was previously
1051 // incremented by the same caller. If no other callers are using the
1052 // closure, then the closure will be destroyed and freed.
1053 void unref()() nothrow {
1054 g_closure_unref(&this);
1059 // The type used for marshaller functions.
1060 // <closure>: the #GClosure to which the marshaller belongs
1061 // <return_value>: a #GValue to store the return value. May be %NULL if the callback of @closure doesn't return a value.
1062 // <n_param_values>: the length of the @param_values array
1063 // <param_values>: an array of #GValue<!-- -->s holding the arguments on which to invoke the callback of @closure
1064 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
1065 // <marshal_data>: additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
1066 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;
1069 // The type used for the various notification callbacks which can be registered
1070 // on closures.
1071 // <data>: data specified when registering the notification callback
1072 // <closure>: the #GClosure on which the notification is emitted
1073 extern (C) alias void function (void* data, Closure* closure) nothrow ClosureNotify;
1075 struct ClosureNotifyData {
1076 void* data;
1077 ClosureNotify notify;
1081 // The connection flags are used to specify the behaviour of a signal's
1082 // connection.
1083 enum ConnectFlags {
1084 AFTER = 1,
1085 SWAPPED = 2
1088 // The class of an enumeration type holds information about its
1089 // possible values.
1090 struct EnumClass {
1091 TypeClass g_type_class;
1092 int minimum, maximum;
1093 uint n_values;
1094 EnumValue* values;
1098 // A structure which contains a single enum value, its name, and its
1099 // nickname.
1100 struct EnumValue {
1101 int value;
1102 char* value_name, value_nick;
1106 // The class of a flags type holds information about its
1107 // possible values.
1108 struct FlagsClass {
1109 TypeClass g_type_class;
1110 uint mask, n_values;
1111 FlagsValue* values;
1115 // A structure which contains a single flags value, its name, and its
1116 // nickname.
1117 struct FlagsValue {
1118 uint value;
1119 char* value_name, value_nick;
1123 // All the fields in the <structname>GInitiallyUnowned</structname> structure
1124 // are private to the #GInitiallyUnowned implementation and should never be
1125 // accessed directly.
1126 struct InitiallyUnowned /* : Object */ {
1127 TypeInstance g_type_instance;
1128 private uint ref_count;
1129 private GLib2.Data* qdata;
1132 // The class structure for the <structname>GInitiallyUnowned</structname> type.
1133 struct InitiallyUnownedClass {
1134 TypeClass g_type_class;
1135 private GLib2.SList* construct_properties;
1136 // Unintrospectable functionp: constructor() / ()
1137 extern (C) Object* function (Type type, uint n_construct_properties, ObjectConstructParam* construct_properties) nothrow constructor;
1138 extern (C) void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) nothrow set_property;
1139 extern (C) void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) nothrow get_property;
1140 extern (C) void function (Object* object) nothrow dispose;
1141 extern (C) void function (Object* object) nothrow finalize;
1142 extern (C) void function (Object* object, uint n_pspecs, ParamSpec** pspecs) nothrow dispatch_properties_changed;
1143 extern (C) void function (Object* object, ParamSpec* pspec) nothrow notify;
1144 extern (C) void function (Object* object) nothrow constructed;
1145 private size_t flags;
1146 private void*[6] pdummy;
1150 // A callback function used by the type system to initialize a new
1151 // instance of a type. This function initializes all instance members and
1152 // allocates any resources required by it.
1153 // Initialization of a derived instance involves calling all its parent
1154 // types instance initializers, so the class member of the instance
1155 // is altered during its initialization to always point to the class that
1156 // belongs to the type the current initializer was introduced for.
1157 // <instance>: The instance to initialize.
1158 // <g_class>: The class of the type the instance is created for.
1159 extern (C) alias void function (TypeInstance* instance, void* g_class) nothrow InstanceInitFunc;
1162 // A callback function used by the type system to finalize an interface.
1163 // This function should destroy any internal data and release any resources
1164 // allocated by the corresponding GInterfaceInitFunc() function.
1165 // <g_iface>: The interface structure to finalize.
1166 // <iface_data>: The @interface_data supplied via the #GInterfaceInfo structure.
1167 extern (C) alias void function (void* g_iface, void* iface_data) nothrow InterfaceFinalizeFunc;
1170 // A structure that provides information to the type system which is
1171 // used specifically for managing interface types.
1172 struct InterfaceInfo {
1173 InterfaceInitFunc interface_init;
1174 InterfaceFinalizeFunc interface_finalize;
1175 void* interface_data;
1179 // A callback function used by the type system to initialize a new
1180 // interface. This function should initialize all internal data and
1181 // allocate any resources required by the interface.
1182 // <g_iface>: The interface structure to initialize.
1183 // <iface_data>: The @interface_data supplied via the #GInterfaceInfo structure.
1184 extern (C) alias void function (void* g_iface, void* iface_data) nothrow InterfaceInitFunc;
1187 // All the fields in the <structname>GObject</structname> structure are private
1188 // to the #GObject implementation and should never be accessed directly.
1189 struct Object {
1190 TypeInstance g_type_instance;
1191 private uint ref_count;
1192 private GLib2.Data* qdata;
1195 // Unintrospectable constructor: new_valist() / g_object_new_valist()
1196 // Creates a new instance of a #GObject subtype and sets its properties.
1198 // Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY)
1199 // which are not explicitly specified are set to their default values.
1200 // RETURNS: a new instance of @object_type
1201 // <object_type>: the type id of the #GObject subtype to instantiate
1202 // <first_property_name>: the name of the first property
1203 // <var_args>: the value of the first property, followed optionally by more name/value pairs, followed by %NULL
1204 static Object* /*new*/ new_valist(AT0)(Type object_type, AT0 /*char*/ first_property_name, va_list var_args) nothrow {
1205 return g_object_new_valist(object_type, toCString!(char*)(first_property_name), var_args);
1207 static auto opCall(AT0)(Type object_type, AT0 /*char*/ first_property_name, va_list var_args) {
1208 return g_object_new_valist(object_type, toCString!(char*)(first_property_name), var_args);
1211 // Creates a new instance of a #GObject subtype and sets its properties.
1213 // Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY)
1214 // which are not explicitly specified are set to their default values.
1216 // @object_type
1217 // RETURNS: a new instance of
1218 // <object_type>: the type id of the #GObject subtype to instantiate
1219 // <n_parameters>: the length of the @parameters array
1220 // <parameters>: an array of #GParameter
1221 static Object* /*new*/ newv(AT0)(Type object_type, uint n_parameters, AT0 /*Parameter*/ parameters) nothrow {
1222 return g_object_newv(object_type, n_parameters, UpCast!(Parameter*)(parameters));
1224 static auto opCall(AT0)(Type object_type, uint n_parameters, AT0 /*Parameter*/ parameters) {
1225 return g_object_newv(object_type, n_parameters, UpCast!(Parameter*)(parameters));
1227 static size_t compat_control(AT0)(size_t what, AT0 /*void*/ data) nothrow {
1228 return g_object_compat_control(what, UpCast!(void*)(data));
1231 // Unintrospectable function: connect() / g_object_connect()
1232 // A convenience function to connect multiple signals at once.
1234 // The signal specs expected by this function have the form
1235 // "modifier::signal_name", where modifier can be one of the following:
1236 // <variablelist>
1237 // <varlistentry>
1238 // <term>signal</term>
1239 // <listitem><para>
1240 // equivalent to <literal>g_signal_connect_data (..., NULL, 0)</literal>
1241 // </para></listitem>
1242 // </varlistentry>
1243 // <varlistentry>
1244 // <term>object_signal</term>
1245 // <term>object-signal</term>
1246 // <listitem><para>
1247 // equivalent to <literal>g_signal_connect_object (..., 0)</literal>
1248 // </para></listitem>
1249 // </varlistentry>
1250 // <varlistentry>
1251 // <term>swapped_signal</term>
1252 // <term>swapped-signal</term>
1253 // <listitem><para>
1254 // equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED)</literal>
1255 // </para></listitem>
1256 // </varlistentry>
1257 // <varlistentry>
1258 // <term>swapped_object_signal</term>
1259 // <term>swapped-object-signal</term>
1260 // <listitem><para>
1261 // equivalent to <literal>g_signal_connect_object (..., G_CONNECT_SWAPPED)</literal>
1262 // </para></listitem>
1263 // </varlistentry>
1264 // <varlistentry>
1265 // <term>signal_after</term>
1266 // <term>signal-after</term>
1267 // <listitem><para>
1268 // equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_AFTER)</literal>
1269 // </para></listitem>
1270 // </varlistentry>
1271 // <varlistentry>
1272 // <term>object_signal_after</term>
1273 // <term>object-signal-after</term>
1274 // <listitem><para>
1275 // equivalent to <literal>g_signal_connect_object (..., G_CONNECT_AFTER)</literal>
1276 // </para></listitem>
1277 // </varlistentry>
1278 // <varlistentry>
1279 // <term>swapped_signal_after</term>
1280 // <term>swapped-signal-after</term>
1281 // <listitem><para>
1282 // equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER)</literal>
1283 // </para></listitem>
1284 // </varlistentry>
1285 // <varlistentry>
1286 // <term>swapped_object_signal_after</term>
1287 // <term>swapped-object-signal-after</term>
1288 // <listitem><para>
1289 // equivalent to <literal>g_signal_connect_object (..., G_CONNECT_SWAPPED | G_CONNECT_AFTER)</literal>
1290 // </para></listitem>
1291 // </varlistentry>
1292 // </variablelist>
1294 // |[
1295 // menu->toplevel = g_object_connect (g_object_new (GTK_TYPE_WINDOW,
1296 // "type", GTK_WINDOW_POPUP,
1297 // "child", menu,
1298 // NULL),
1299 // "signal::event", gtk_menu_window_event, menu,
1300 // "signal::size_request", gtk_menu_window_size_request, menu,
1301 // "signal::destroy", gtk_widget_destroyed, &amp;menu-&gt;toplevel,
1302 // NULL);
1303 // ]|
1304 // RETURNS: @object
1305 // <object>: a #GObject
1306 // <signal_spec>: the spec for the first signal
1307 alias g_object_connect connect; // Variadic
1309 // Unintrospectable function: disconnect() / g_object_disconnect()
1310 // A convenience function to disconnect multiple signals at once.
1312 // The signal specs expected by this function have the form
1313 // "any_signal", which means to disconnect any signal with matching
1314 // callback and data, or "any_signal::signal_name", which only
1315 // disconnects the signal named "signal_name".
1316 // <object>: a #GObject
1317 // <signal_spec>: the spec for the first signal
1318 alias g_object_disconnect disconnect; // Variadic
1320 // Unintrospectable function: get() / g_object_get()
1321 // Gets properties of an object.
1323 // In general, a copy is made of the property contents and the caller
1324 // is responsible for freeing the memory in the appropriate manner for
1325 // the type, for instance by calling g_free() or g_object_unref().
1327 // <example>
1328 // <title>Using g_object_get(<!-- -->)</title>
1329 // An example of using g_object_get() to get the contents
1330 // of three properties - one of type #G_TYPE_INT,
1331 // one of type #G_TYPE_STRING, and one of type #G_TYPE_OBJECT:
1332 // <programlisting>
1333 // gint intval;
1334 // gchar *strval;
1335 // GObject *objval;
1337 // g_object_get (my_object,
1338 // "int-property", &intval,
1339 // "str-property", &strval,
1340 // "obj-property", &objval,
1341 // NULL);
1343 // // Do something with intval, strval, objval
1345 // g_free (strval);
1346 // g_object_unref (objval);
1347 // </programlisting>
1348 // </example>
1349 // <object>: a #GObject
1350 // <first_property_name>: name of the first property to get
1351 alias g_object_get get; // Variadic
1353 // VERSION: 2.4
1354 // Find the #GParamSpec with the given name for an
1355 // interface. Generally, the interface vtable passed in as @g_iface
1356 // will be the default vtable from g_type_default_interface_ref(), or,
1357 // if you know the interface has already been loaded,
1358 // g_type_default_interface_peek().
1361 // interface with the name @property_name, or %NULL if no
1362 // such property exists.
1363 // RETURNS: the #GParamSpec for the property of the
1364 // <g_iface>: any interface vtable for the interface, or the default vtable for the interface
1365 // <property_name>: name of a property to lookup.
1366 static ParamSpec* interface_find_property(AT0, AT1)(AT0 /*void*/ g_iface, AT1 /*char*/ property_name) nothrow {
1367 return g_object_interface_find_property(UpCast!(void*)(g_iface), toCString!(char*)(property_name));
1370 // VERSION: 2.4
1371 // Add a property to an interface; this is only useful for interfaces
1372 // that are added to GObject-derived types. Adding a property to an
1373 // interface forces all objects classes with that interface to have a
1374 // compatible property. The compatible property could be a newly
1375 // created #GParamSpec, but normally
1376 // g_object_class_override_property() will be used so that the object
1377 // class only needs to provide an implementation and inherits the
1378 // property description, default value, bounds, and so forth from the
1379 // interface property.
1381 // This function is meant to be called from the interface's default
1382 // vtable initialization function (the @class_init member of
1383 // #GTypeInfo.) It must not be called after after @class_init has
1384 // been called for any object types implementing this interface.
1385 // <g_iface>: any interface vtable for the interface, or the default vtable for the interface.
1386 // <pspec>: the #GParamSpec for the new property
1387 static void interface_install_property(AT0, AT1)(AT0 /*void*/ g_iface, AT1 /*ParamSpec*/ pspec) nothrow {
1388 g_object_interface_install_property(UpCast!(void*)(g_iface), UpCast!(ParamSpec*)(pspec));
1391 // VERSION: 2.4
1392 // Lists the properties of an interface.Generally, the interface
1393 // vtable passed in as @g_iface will be the default vtable from
1394 // g_type_default_interface_ref(), or, if you know the interface has
1395 // already been loaded, g_type_default_interface_peek().
1398 // pointer to an array of pointers to #GParamSpec
1399 // structures. The paramspecs are owned by GLib, but the
1400 // array should be freed with g_free() when you are done with
1401 // it.
1402 // RETURNS: a
1403 // <g_iface>: any interface vtable for the interface, or the default vtable for the interface
1404 // <n_properties_p>: location to store number of properties returned.
1405 static ParamSpec** /*new container*/ interface_list_properties(AT0, AT1)(AT0 /*void*/ g_iface, /*out*/ AT1 /*uint*/ n_properties_p) nothrow {
1406 return g_object_interface_list_properties(UpCast!(void*)(g_iface), UpCast!(uint*)(n_properties_p));
1409 // Unintrospectable function: new() / g_object_new()
1410 // Creates a new instance of a #GObject subtype and sets its properties.
1412 // Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY)
1413 // which are not explicitly specified are set to their default values.
1414 // RETURNS: a new instance of @object_type
1415 // <object_type>: the type id of the #GObject subtype to instantiate
1416 // <first_property_name>: the name of the first property
1417 alias g_object_new new_; // Variadic
1419 // Unintrospectable function: set() / g_object_set()
1420 // Sets properties on an object.
1421 // <object>: a #GObject
1422 // <first_property_name>: name of the first property to set
1423 alias g_object_set set; // Variadic
1425 // Unintrospectable method: add_toggle_ref() / g_object_add_toggle_ref()
1426 // VERSION: 2.8
1427 // Increases the reference count of the object by one and sets a
1428 // callback to be called when all other references to the object are
1429 // dropped, or when this is already the last reference to the object
1430 // and another reference is established.
1432 // This functionality is intended for binding @object to a proxy
1433 // object managed by another memory manager. This is done with two
1434 // paired references: the strong reference added by
1435 // g_object_add_toggle_ref() and a reverse reference to the proxy
1436 // object which is either a strong reference or weak reference.
1438 // The setup is that when there are no other references to @object,
1439 // only a weak reference is held in the reverse direction from @object
1440 // to the proxy object, but when there are other references held to
1441 // @object, a strong reference is held. The @notify callback is called
1442 // when the reference from @object to the proxy object should be
1443 // <firstterm>toggled</firstterm> from strong to weak (@is_last_ref
1444 // true) or weak to strong (@is_last_ref false).
1446 // Since a (normal) reference must be held to the object before
1447 // calling g_object_add_toggle_ref(), the initial state of the reverse
1448 // link is always strong.
1450 // Multiple toggle references may be added to the same gobject,
1451 // however if there are multiple toggle references to an object, none
1452 // of them will ever be notified until all but one are removed. For
1453 // this reason, you should only ever use a toggle reference if there
1454 // is important state in the proxy object.
1455 // <notify>: a function to call when this reference is the last reference to the object, or is no longer the last reference.
1456 // <data>: data to pass to @notify
1457 void add_toggle_ref(AT0)(ToggleNotify notify, AT0 /*void*/ data) nothrow {
1458 g_object_add_toggle_ref(&this, notify, UpCast!(void*)(data));
1461 // Unintrospectable method: add_weak_pointer() / g_object_add_weak_pointer()
1462 // Adds a weak reference from weak_pointer to @object to indicate that
1463 // the pointer located at @weak_pointer_location is only valid during
1464 // the lifetime of @object. When the @object is finalized,
1465 // @weak_pointer will be set to %NULL.
1467 // Note that as with g_object_weak_ref(), the weak references created by
1468 // this method are not thread-safe: they cannot safely be used in one
1469 // thread if the object's last g_object_unref() might happen in another
1470 // thread. Use #GWeakRef if thread-safety is required.
1471 // <weak_pointer_location>: The memory address of a pointer.
1472 void add_weak_pointer(AT0)(/*inout*/ AT0 /*void**/ weak_pointer_location) nothrow {
1473 g_object_add_weak_pointer(&this, UpCast!(void**)(weak_pointer_location));
1476 // VERSION: 2.26
1477 // Creates a binding between @source_property on @source and @target_property
1478 // on @target. Whenever the @source_property is changed the @target_property is
1479 // updated using the same value. For instance:
1481 // |[
1482 // g_object_bind_property (action, "active", widget, "sensitive", 0);
1483 // ]|
1485 // Will result in the "sensitive" property of the widget #GObject instance to be
1486 // updated with the same value of the "active" property of the action #GObject
1487 // instance.
1489 // If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
1490 // if @target_property on @target changes then the @source_property on @source
1491 // will be updated as well.
1493 // The binding will automatically be removed when either the @source or the
1494 // @target instances are finalized. To remove the binding without affecting the
1495 // @source and the @target you can just call g_object_unref() on the returned
1496 // #GBinding instance.
1498 // A #GObject can have multiple bindings.
1500 // binding between the two #GObject instances. The binding is released
1501 // whenever the #GBinding reference count reaches zero.
1502 // RETURNS: the #GBinding instance representing the
1503 // <source_property>: the property on @source to bind
1504 // <target>: the target #GObject
1505 // <target_property>: the property on @target to bind
1506 // <flags>: flags to pass to #GBinding
1507 Binding* bind_property(AT0, AT1, AT2)(AT0 /*char*/ source_property, AT1 /*Object*/ target, AT2 /*char*/ target_property, BindingFlags flags) nothrow {
1508 return g_object_bind_property(&this, toCString!(char*)(source_property), UpCast!(Object*)(target), toCString!(char*)(target_property), flags);
1511 // VERSION: 2.26
1512 // Complete version of g_object_bind_property().
1514 // Creates a binding between @source_property on @source and @target_property
1515 // on @target, allowing you to set the transformation functions to be used by
1516 // the binding.
1518 // If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
1519 // if @target_property on @target changes then the @source_property on @source
1520 // will be updated as well. The @transform_from function is only used in case
1521 // of bidirectional bindings, otherwise it will be ignored
1523 // The binding will automatically be removed when either the @source or the
1524 // @target instances are finalized. To remove the binding without affecting the
1525 // @source and the @target you can just call g_object_unref() on the returned
1526 // #GBinding instance.
1528 // A #GObject can have multiple bindings.
1530 // <note>The same @user_data parameter will be used for both @transform_to
1531 // and @transform_from transformation functions; the @notify function will
1532 // be called once, when the binding is removed. If you need different data
1533 // for each transformation function, please use
1534 // g_object_bind_property_with_closures() instead.</note>
1536 // binding between the two #GObject instances. The binding is released
1537 // whenever the #GBinding reference count reaches zero.
1538 // RETURNS: the #GBinding instance representing the
1539 // <source_property>: the property on @source to bind
1540 // <target>: the target #GObject
1541 // <target_property>: the property on @target to bind
1542 // <flags>: flags to pass to #GBinding
1543 // <transform_to>: the transformation function from the @source to the @target, or %NULL to use the default
1544 // <transform_from>: the transformation function from the @target to the @source, or %NULL to use the default
1545 // <user_data>: custom data to be passed to the transformation functions, or %NULL
1546 // <notify>: function to be called when disposing the binding, to free the resources used by the transformation functions
1547 Binding* bind_property_full(AT0, AT1, AT2, AT3)(AT0 /*char*/ source_property, AT1 /*Object*/ target, AT2 /*char*/ target_property, BindingFlags flags, BindingTransformFunc transform_to, BindingTransformFunc transform_from, AT3 /*void*/ user_data, GLib2.DestroyNotify notify) nothrow {
1548 return g_object_bind_property_full(&this, toCString!(char*)(source_property), UpCast!(Object*)(target), toCString!(char*)(target_property), flags, transform_to, transform_from, UpCast!(void*)(user_data), notify);
1551 // VERSION: 2.26
1552 // Creates a binding between @source_property on @source and @target_property
1553 // on @target, allowing you to set the transformation functions to be used by
1554 // the binding.
1556 // This function is the language bindings friendly version of
1557 // g_object_bind_property_full(), using #GClosure<!-- -->s instead of
1558 // function pointers.
1561 // binding between the two #GObject instances. The binding is released
1562 // whenever the #GBinding reference count reaches zero.
1563 // RETURNS: the #GBinding instance representing the
1564 // <source_property>: the property on @source to bind
1565 // <target>: the target #GObject
1566 // <target_property>: the property on @target to bind
1567 // <flags>: flags to pass to #GBinding
1568 // <transform_to>: a #GClosure wrapping the transformation function from the @source to the @target, or %NULL to use the default
1569 // <transform_from>: a #GClosure wrapping the transformation function from the @target to the @source, or %NULL to use the default
1570 Binding* bind_property_with_closures(AT0, AT1, AT2, AT3, AT4)(AT0 /*char*/ source_property, AT1 /*Object*/ target, AT2 /*char*/ target_property, BindingFlags flags, AT3 /*Closure*/ transform_to, AT4 /*Closure*/ transform_from) nothrow {
1571 return g_object_bind_property_with_closures(&this, toCString!(char*)(source_property), UpCast!(Object*)(target), toCString!(char*)(target_property), flags, UpCast!(Closure*)(transform_to), UpCast!(Closure*)(transform_from));
1574 // VERSION: 2.10
1575 // This function is intended for #GObject implementations to re-enforce a
1576 // <link linkend="floating-ref">floating</link> object reference.
1577 // Doing this is seldom required: all
1578 // #GInitiallyUnowned<!-- -->s are created with a floating reference which
1579 // usually just needs to be sunken by calling g_object_ref_sink().
1580 void force_floating()() nothrow {
1581 g_object_force_floating(&this);
1584 // Increases the freeze count on @object. If the freeze count is
1585 // non-zero, the emission of "notify" signals on @object is
1586 // stopped. The signals are queued until the freeze count is decreased
1587 // to zero.
1589 // This is necessary for accessors that modify multiple properties to prevent
1590 // premature notification while the object is still being modified.
1591 void freeze_notify()() nothrow {
1592 g_object_freeze_notify(&this);
1595 // Gets a named field from the objects table of associations (see g_object_set_data()).
1596 // RETURNS: the data if found, or %NULL if no such data exists.
1597 // <key>: name of the key for that association
1598 void* get_data(AT0)(AT0 /*char*/ key) nothrow {
1599 return g_object_get_data(&this, toCString!(char*)(key));
1602 // Gets a property of an object. @value must have been initialized to the
1603 // expected type of the property (or a type to which the expected type can be
1604 // transformed) using g_value_init().
1606 // In general, a copy is made of the property contents and the caller is
1607 // responsible for freeing the memory by calling g_value_unset().
1609 // Note that g_object_get_property() is really intended for language
1610 // bindings, g_object_get() is much more convenient for C programming.
1611 // <property_name>: the name of the property to get
1612 // <value>: return location for the property value
1613 void get_property(AT0, AT1)(AT0 /*char*/ property_name, AT1 /*Value*/ value) nothrow {
1614 g_object_get_property(&this, toCString!(char*)(property_name), UpCast!(Value*)(value));
1617 // This function gets back user data pointers stored via
1618 // g_object_set_qdata().
1619 // RETURNS: The user data pointer set, or %NULL
1620 // <quark>: A #GQuark, naming the user data pointer
1621 void* get_qdata()(GLib2.Quark quark) nothrow {
1622 return g_object_get_qdata(&this, quark);
1625 // Unintrospectable method: get_valist() / g_object_get_valist()
1626 // Gets properties of an object.
1628 // In general, a copy is made of the property contents and the caller
1629 // is responsible for freeing the memory in the appropriate manner for
1630 // the type, for instance by calling g_free() or g_object_unref().
1632 // See g_object_get().
1633 // <first_property_name>: name of the first property to get
1634 // <var_args>: return location for the first property, followed optionally by more name/return location pairs, followed by %NULL
1635 void get_valist(AT0)(AT0 /*char*/ first_property_name, va_list var_args) nothrow {
1636 g_object_get_valist(&this, toCString!(char*)(first_property_name), var_args);
1639 // VERSION: 2.10
1640 // Checks whether @object has a <link linkend="floating-ref">floating</link>
1641 // reference.
1642 // RETURNS: %TRUE if @object has a floating reference
1643 int is_floating()() nothrow {
1644 return g_object_is_floating(&this);
1647 // Emits a "notify" signal for the property @property_name on @object.
1649 // When possible, eg. when signaling a property change from within the class
1650 // that registered the property, you should use g_object_notify_by_pspec()
1651 // instead.
1652 // <property_name>: the name of a property installed on the class of @object.
1653 void notify(AT0)(AT0 /*char*/ property_name) nothrow {
1654 g_object_notify(&this, toCString!(char*)(property_name));
1657 // VERSION: 2.26
1658 // Emits a "notify" signal for the property specified by @pspec on @object.
1660 // This function omits the property name lookup, hence it is faster than
1661 // g_object_notify().
1663 // One way to avoid using g_object_notify() from within the
1664 // class that registered the properties, and using g_object_notify_by_pspec()
1665 // instead, is to store the GParamSpec used with
1666 // g_object_class_install_property() inside a static array, e.g.:
1668 // |[
1669 // enum
1670 // {
1671 // PROP_0,
1672 // PROP_FOO,
1673 // PROP_LAST
1674 // };
1676 // static GParamSpec *properties[PROP_LAST];
1678 // static void
1679 // my_object_class_init (MyObjectClass *klass)
1680 // {
1681 // properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
1682 // 0, 100,
1683 // 50,
1684 // G_PARAM_READWRITE);
1685 // g_object_class_install_property (gobject_class,
1686 // PROP_FOO,
1687 // properties[PROP_FOO]);
1688 // }
1689 // ]|
1691 // and then notify a change on the "foo" property with:
1693 // |[
1694 // g_object_notify_by_pspec (self, properties[PROP_FOO]);
1695 // ]|
1696 // <pspec>: the #GParamSpec of a property installed on the class of @object.
1697 void notify_by_pspec(AT0)(AT0 /*ParamSpec*/ pspec) nothrow {
1698 g_object_notify_by_pspec(&this, UpCast!(ParamSpec*)(pspec));
1701 // Increases the reference count of @object.
1702 // RETURNS: the same @object
1703 Object* ref_()() nothrow {
1704 return g_object_ref(&this);
1707 // VERSION: 2.10
1708 // Increase the reference count of @object, and possibly remove the
1709 // <link linkend="floating-ref">floating</link> reference, if @object
1710 // has a floating reference.
1712 // In other words, if the object is floating, then this call "assumes
1713 // ownership" of the floating reference, converting it to a normal
1714 // reference by clearing the floating flag while leaving the reference
1715 // count unchanged. If the object is not floating, then this call
1716 // adds a new normal reference increasing the reference count by one.
1717 // RETURNS: @object
1718 Object* ref_sink()() nothrow {
1719 return g_object_ref_sink(&this);
1722 // Unintrospectable method: remove_toggle_ref() / g_object_remove_toggle_ref()
1723 // VERSION: 2.8
1724 // Removes a reference added with g_object_add_toggle_ref(). The
1725 // reference count of the object is decreased by one.
1726 // <notify>: a function to call when this reference is the last reference to the object, or is no longer the last reference.
1727 // <data>: data to pass to @notify
1728 void remove_toggle_ref(AT0)(ToggleNotify notify, AT0 /*void*/ data) nothrow {
1729 g_object_remove_toggle_ref(&this, notify, UpCast!(void*)(data));
1732 // Unintrospectable method: remove_weak_pointer() / g_object_remove_weak_pointer()
1733 // Removes a weak reference from @object that was previously added
1734 // using g_object_add_weak_pointer(). The @weak_pointer_location has
1735 // to match the one used with g_object_add_weak_pointer().
1736 // <weak_pointer_location>: The memory address of a pointer.
1737 void remove_weak_pointer(AT0)(/*inout*/ AT0 /*void**/ weak_pointer_location) nothrow {
1738 g_object_remove_weak_pointer(&this, UpCast!(void**)(weak_pointer_location));
1741 // Releases all references to other objects. This can be used to break
1742 // reference cycles.
1744 // This functions should only be called from object system implementations.
1745 void run_dispose()() nothrow {
1746 g_object_run_dispose(&this);
1749 // Each object carries around a table of associations from
1750 // strings to pointers. This function lets you set an association.
1752 // If the object already had an association with that name,
1753 // the old association will be destroyed.
1754 // <key>: name of the key
1755 // <data>: data to associate with that key
1756 void set_data(AT0, AT1)(AT0 /*char*/ key, AT1 /*void*/ data) nothrow {
1757 g_object_set_data(&this, toCString!(char*)(key), UpCast!(void*)(data));
1760 // Unintrospectable method: set_data_full() / g_object_set_data_full()
1761 // Like g_object_set_data() except it adds notification
1762 // for when the association is destroyed, either by setting it
1763 // to a different value or when the object is destroyed.
1765 // Note that the @destroy callback is not called if @data is %NULL.
1766 // <key>: name of the key
1767 // <data>: data to associate with that key
1768 // <destroy>: function to call when the association is destroyed
1769 void set_data_full(AT0, AT1)(AT0 /*char*/ key, AT1 /*void*/ data, GLib2.DestroyNotify destroy) nothrow {
1770 g_object_set_data_full(&this, toCString!(char*)(key), UpCast!(void*)(data), destroy);
1773 // Sets a property on an object.
1774 // <property_name>: the name of the property to set
1775 // <value>: the value
1776 void set_property(AT0, AT1)(AT0 /*char*/ property_name, AT1 /*Value*/ value) nothrow {
1777 g_object_set_property(&this, toCString!(char*)(property_name), UpCast!(Value*)(value));
1780 // Unintrospectable method: set_qdata() / g_object_set_qdata()
1781 // This sets an opaque, named pointer on an object.
1782 // The name is specified through a #GQuark (retrived e.g. via
1783 // g_quark_from_static_string()), and the pointer
1784 // can be gotten back from the @object with g_object_get_qdata()
1785 // until the @object is finalized.
1786 // Setting a previously set user data pointer, overrides (frees)
1787 // the old pointer set, using #NULL as pointer essentially
1788 // removes the data stored.
1789 // <quark>: A #GQuark, naming the user data pointer
1790 // <data>: An opaque user data pointer
1791 void set_qdata(AT0)(GLib2.Quark quark, AT0 /*void*/ data) nothrow {
1792 g_object_set_qdata(&this, quark, UpCast!(void*)(data));
1795 // Unintrospectable method: set_qdata_full() / g_object_set_qdata_full()
1796 // This function works like g_object_set_qdata(), but in addition,
1797 // a void (*destroy) (gpointer) function may be specified which is
1798 // called with @data as argument when the @object is finalized, or
1799 // the data is being overwritten by a call to g_object_set_qdata()
1800 // with the same @quark.
1801 // <quark>: A #GQuark, naming the user data pointer
1802 // <data>: An opaque user data pointer
1803 // <destroy>: Function to invoke with @data as argument, when @data needs to be freed
1804 void set_qdata_full(AT0)(GLib2.Quark quark, AT0 /*void*/ data, GLib2.DestroyNotify destroy) nothrow {
1805 g_object_set_qdata_full(&this, quark, UpCast!(void*)(data), destroy);
1808 // Unintrospectable method: set_valist() / g_object_set_valist()
1809 // Sets properties on an object.
1810 // <first_property_name>: name of the first property to set
1811 // <var_args>: value for the first property, followed optionally by more name/value pairs, followed by %NULL
1812 void set_valist(AT0)(AT0 /*char*/ first_property_name, va_list var_args) nothrow {
1813 g_object_set_valist(&this, toCString!(char*)(first_property_name), var_args);
1816 // Remove a specified datum from the object's data associations,
1817 // without invoking the association's destroy handler.
1818 // RETURNS: the data if found, or %NULL if no such data exists.
1819 // <key>: name of the key
1820 void* /*new*/ steal_data(AT0)(AT0 /*char*/ key) nothrow {
1821 return g_object_steal_data(&this, toCString!(char*)(key));
1824 // This function gets back user data pointers stored via
1825 // g_object_set_qdata() and removes the @data from object
1826 // without invoking its destroy() function (if any was
1827 // set).
1828 // Usually, calling this function is only required to update
1829 // user data pointers with a destroy notifier, for example:
1830 // |[
1831 // void
1832 // object_add_to_user_list (GObject *object,
1833 // const gchar *new_string)
1834 // {
1835 // // the quark, naming the object data
1836 // GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
1837 // // retrive the old string list
1838 // GList *list = g_object_steal_qdata (object, quark_string_list);
1840 // // prepend new string
1841 // list = g_list_prepend (list, g_strdup (new_string));
1842 // // this changed 'list', so we need to set it again
1843 // g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
1844 // }
1845 // static void
1846 // free_string_list (gpointer data)
1847 // {
1848 // GList *node, *list = data;
1850 // for (node = list; node; node = node->next)
1851 // g_free (node->data);
1852 // g_list_free (list);
1853 // }
1854 // ]|
1855 // Using g_object_get_qdata() in the above example, instead of
1856 // g_object_steal_qdata() would have left the destroy function set,
1857 // and thus the partial string list would have been freed upon
1858 // g_object_set_qdata_full().
1859 // RETURNS: The user data pointer set, or %NULL
1860 // <quark>: A #GQuark, naming the user data pointer
1861 void* /*new*/ steal_qdata()(GLib2.Quark quark) nothrow {
1862 return g_object_steal_qdata(&this, quark);
1865 // Reverts the effect of a previous call to
1866 // g_object_freeze_notify(). The freeze count is decreased on @object
1867 // and when it reaches zero, all queued "notify" signals are emitted.
1869 // It is an error to call this function when the freeze count is zero.
1870 void thaw_notify()() nothrow {
1871 g_object_thaw_notify(&this);
1874 // Decreases the reference count of @object. When its reference count
1875 // drops to 0, the object is finalized (i.e. its memory is freed).
1876 void unref()() nothrow {
1877 g_object_unref(&this);
1880 // This function essentially limits the life time of the @closure to
1881 // the life time of the object. That is, when the object is finalized,
1882 // the @closure is invalidated by calling g_closure_invalidate() on
1883 // it, in order to prevent invocations of the closure with a finalized
1884 // (nonexisting) object. Also, g_object_ref() and g_object_unref() are
1885 // added as marshal guards to the @closure, to ensure that an extra
1886 // reference count is held on @object during invocation of the
1887 // @closure. Usually, this function will be called on closures that
1888 // use this @object as closure data.
1889 // <closure>: GClosure to watch
1890 void watch_closure(AT0)(AT0 /*Closure*/ closure) nothrow {
1891 g_object_watch_closure(&this, UpCast!(Closure*)(closure));
1894 // Unintrospectable method: weak_ref() / g_object_weak_ref()
1895 // Adds a weak reference callback to an object. Weak references are
1896 // used for notification when an object is finalized. They are called
1897 // "weak references" because they allow you to safely hold a pointer
1898 // to an object without calling g_object_ref() (g_object_ref() adds a
1899 // strong reference, that is, forces the object to stay alive).
1901 // Note that the weak references created by this method are not
1902 // thread-safe: they cannot safely be used in one thread if the
1903 // object's last g_object_unref() might happen in another thread.
1904 // Use #GWeakRef if thread-safety is required.
1905 // <notify>: callback to invoke before the object is freed
1906 // <data>: extra data to pass to notify
1907 void weak_ref(AT0)(WeakNotify notify, AT0 /*void*/ data) nothrow {
1908 g_object_weak_ref(&this, notify, UpCast!(void*)(data));
1911 // Unintrospectable method: weak_unref() / g_object_weak_unref()
1912 // Removes a weak reference callback to an object.
1913 // <notify>: callback to search for
1914 // <data>: data to search for
1915 void weak_unref(AT0)(WeakNotify notify, AT0 /*void*/ data) nothrow {
1916 g_object_weak_unref(&this, notify, UpCast!(void*)(data));
1919 // The notify signal is emitted on an object when one of its
1920 // properties has been changed. Note that getting this signal
1921 // doesn't guarantee that the value of the property has actually
1922 // changed, it may also be emitted when the setter for the property
1923 // is called to reinstate the previous value.
1925 // This signal is typically used to obtain change notification for a
1926 // single property, by specifying the property name as a detail in the
1927 // g_signal_connect() call, like this:
1928 // |[
1929 // g_signal_connect (text_view->buffer, "notify::paste-target-list",
1930 // G_CALLBACK (gtk_text_view_target_list_notify),
1931 // text_view)
1932 // ]|
1933 // It is important to note that you must use
1934 // <link linkend="canonical-parameter-name">canonical</link> parameter names as
1935 // detail strings for the notify signal.
1936 // <pspec>: the #GParamSpec of the property which changed.
1937 extern (C) alias static void function (Object* this_, ParamSpec* pspec, void* user_data=null) nothrow signal_notify;
1939 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1940 return super_.signal_connect!name(cb, data, cf);
1943 ulong signal_connect(string name:"notify", CB/*:signal_notify*/)
1944 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
1945 if (is(typeof(cb)==signal_notify)||_ttmm!(CB, signal_notify)()) {
1946 return signal_connect_data!()(&this, cast(char*)"notify",
1947 cast(GObject2.Callback)cb, data, null, cf);
1952 // The class structure for the <structname>GObject</structname> type.
1954 // <example>
1955 // <title>Implementing singletons using a constructor</title>
1956 // <programlisting>
1957 // static MySingleton *the_singleton = NULL;
1959 // static GObject*
1960 // my_singleton_constructor (GType type,
1961 // guint n_construct_params,
1962 // GObjectConstructParam *construct_params)
1963 // {
1964 // GObject *object;
1966 // if (!the_singleton)
1967 // {
1968 // object = G_OBJECT_CLASS (parent_class)->constructor (type,
1969 // n_construct_params,
1970 // construct_params);
1971 // the_singleton = MY_SINGLETON (object);
1972 // }
1973 // else
1974 // object = g_object_ref (G_OBJECT (the_singleton));
1976 // return object;
1977 // }
1978 // </programlisting></example>
1979 struct ObjectClass {
1980 TypeClass g_type_class;
1981 private GLib2.SList* construct_properties;
1982 // Unintrospectable functionp: constructor() / ()
1983 extern (C) Object* function (Type type, uint n_construct_properties, ObjectConstructParam* construct_properties) nothrow constructor;
1984 extern (C) void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) nothrow set_property;
1985 extern (C) void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) nothrow get_property;
1986 extern (C) void function (Object* object) nothrow dispose;
1987 extern (C) void function (Object* object) nothrow finalize;
1988 extern (C) void function (Object* object, uint n_pspecs, ParamSpec** pspecs) nothrow dispatch_properties_changed;
1989 extern (C) void function (Object* object, ParamSpec* pspec) nothrow notify;
1990 extern (C) void function (Object* object) nothrow constructed;
1991 private size_t flags;
1992 private void*[6] pdummy;
1995 // Looks up the #GParamSpec for a property of a class.
1997 // %NULL if the class doesn't have a property of that name
1998 // RETURNS: the #GParamSpec for the property, or
1999 // <property_name>: the name of the property to look up
2000 ParamSpec* find_property(AT0)(AT0 /*char*/ property_name) nothrow {
2001 return g_object_class_find_property(&this, toCString!(char*)(property_name));
2004 // VERSION: 2.26
2005 // Installs new properties from an array of #GParamSpec<!-- -->s. This is
2006 // usually done in the class initializer.
2008 // The property id of each property is the index of each #GParamSpec in
2009 // the @pspecs array.
2011 // The property id of 0 is treated specially by #GObject and it should not
2012 // be used to store a #GParamSpec.
2014 // This function should be used if you plan to use a static array of
2015 // #GParamSpec<!-- -->s and g_object_notify_by_pspec(). For instance, this
2016 // class initialization:
2018 // |[
2019 // enum {
2020 // PROP_0, PROP_FOO, PROP_BAR, N_PROPERTIES
2021 // };
2023 // static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, };
2025 // static void
2026 // my_object_class_init (MyObjectClass *klass)
2027 // {
2028 // GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
2030 // obj_properties[PROP_FOO] =
2031 // g_param_spec_int ("foo", "Foo", "Foo",
2032 // -1, G_MAXINT,
2033 // 0,
2034 // G_PARAM_READWRITE);
2036 // obj_properties[PROP_BAR] =
2037 // g_param_spec_string ("bar", "Bar", "Bar",
2038 // NULL,
2039 // G_PARAM_READWRITE);
2041 // gobject_class->set_property = my_object_set_property;
2042 // gobject_class->get_property = my_object_get_property;
2043 // g_object_class_install_properties (gobject_class,
2044 // N_PROPERTIES,
2045 // obj_properties);
2046 // }
2047 // ]|
2049 // allows calling g_object_notify_by_pspec() to notify of property changes:
2051 // |[
2052 // void
2053 // my_object_set_foo (MyObject *self, gint foo)
2054 // {
2055 // if (self->foo != foo)
2056 // {
2057 // self->foo = foo;
2058 // g_object_notify_by_pspec (G_OBJECT (self), obj_properties[PROP_FOO]);
2059 // }
2060 // }
2061 // ]|
2062 // <n_pspecs>: the length of the #GParamSpec<!-- -->s array
2063 // <pspecs>: the #GParamSpec<!-- -->s array defining the new properties
2064 void install_properties(AT0)(uint n_pspecs, AT0 /*ParamSpec**/ pspecs) nothrow {
2065 g_object_class_install_properties(&this, n_pspecs, UpCast!(ParamSpec**)(pspecs));
2068 // Installs a new property. This is usually done in the class initializer.
2070 // Note that it is possible to redefine a property in a derived class,
2071 // by installing a property with the same name. This can be useful at times,
2072 // e.g. to change the range of allowed values or the default value.
2073 // <property_id>: the id for the new property
2074 // <pspec>: the #GParamSpec for the new property
2075 void install_property(AT0)(uint property_id, AT0 /*ParamSpec*/ pspec) nothrow {
2076 g_object_class_install_property(&this, property_id, UpCast!(ParamSpec*)(pspec));
2079 // Get an array of #GParamSpec* for all properties of a class.
2081 // #GParamSpec* which should be freed after use
2082 // RETURNS: an array of
2083 // <n_properties>: return location for the length of the returned array
2084 ParamSpec** /*new container*/ list_properties(AT0)(/*out*/ AT0 /*uint*/ n_properties) nothrow {
2085 return g_object_class_list_properties(&this, UpCast!(uint*)(n_properties));
2088 // VERSION: 2.4
2089 // Registers @property_id as referring to a property with the
2090 // name @name in a parent class or in an interface implemented
2091 // by @oclass. This allows this class to <firstterm>override</firstterm>
2092 // a property implementation in a parent class or to provide
2093 // the implementation of a property from an interface.
2095 // <note>
2096 // Internally, overriding is implemented by creating a property of type
2097 // #GParamSpecOverride; generally operations that query the properties of
2098 // the object class, such as g_object_class_find_property() or
2099 // g_object_class_list_properties() will return the overridden
2100 // property. However, in one case, the @construct_properties argument of
2101 // the @constructor virtual function, the #GParamSpecOverride is passed
2102 // instead, so that the @param_id field of the #GParamSpec will be
2103 // correct. For virtually all uses, this makes no difference. If you
2104 // need to get the overridden property, you can call
2105 // g_param_spec_get_redirect_target().
2106 // </note>
2107 // <property_id>: the new property ID
2108 // <name>: the name of a property registered in a parent class or in an interface of this class.
2109 void override_property(AT0)(uint property_id, AT0 /*char*/ name) nothrow {
2110 g_object_class_override_property(&this, property_id, toCString!(char*)(name));
2115 // The <structname>GObjectConstructParam</structname> struct is an auxiliary
2116 // structure used to hand #GParamSpec/#GValue pairs to the @constructor of
2117 // a #GObjectClass.
2118 struct ObjectConstructParam {
2119 ParamSpec* pspec;
2120 Value* value;
2124 // The type of the @finalize function of #GObjectClass.
2125 // <object>: the #GObject being finalized
2126 extern (C) alias void function (Object* object) nothrow ObjectFinalizeFunc;
2129 // The type of the @get_property function of #GObjectClass.
2130 // <object>: a #GObject
2131 // <property_id>: the numeric id under which the property was registered with g_object_class_install_property().
2132 // <value>: a #GValue to return the property value in
2133 // <pspec>: the #GParamSpec describing the property
2134 extern (C) alias void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) nothrow ObjectGetPropertyFunc;
2137 // The type of the @set_property function of #GObjectClass.
2138 // <object>: a #GObject
2139 // <property_id>: the numeric id under which the property was registered with g_object_class_install_property().
2140 // <value>: the new value for the property
2141 // <pspec>: the #GParamSpec describing the property
2142 extern (C) alias void function (Object* object, uint property_id, Value* value, ParamSpec* pspec) nothrow ObjectSetPropertyFunc;
2144 enum int PARAM_MASK = 255;
2145 enum int PARAM_READWRITE = 0;
2146 enum int PARAM_STATIC_STRINGS = 0;
2147 enum int PARAM_USER_SHIFT = 8;
2149 // Through the #GParamFlags flag values, certain aspects of parameters
2150 // can be configured.
2151 enum ParamFlags {
2152 READABLE = 1,
2153 WRITABLE = 2,
2154 CONSTRUCT = 4,
2155 CONSTRUCT_ONLY = 8,
2156 LAX_VALIDATION = 16,
2157 STATIC_NAME = 32,
2158 PRIVATE = 32,
2159 STATIC_NICK = 64,
2160 STATIC_BLURB = 128,
2161 DEPRECATED = cast(uint)2147483648
2164 // #GParamSpec is an object structure that encapsulates the metadata
2165 // required to specify parameters, such as e.g. #GObject properties.
2167 // <para id="canonical-parameter-name">
2168 // Parameter names need to start with a letter (a-z or A-Z). Subsequent
2169 // characters can be letters, numbers or a '-'.
2170 // All other characters are replaced by a '-' during construction.
2171 // The result of this replacement is called the canonical name of the
2172 // parameter.
2173 // </para>
2174 struct ParamSpec {
2175 TypeInstance g_type_instance;
2176 char* name;
2177 ParamFlags flags;
2178 Type value_type, owner_type;
2179 private char* _nick, _blurb;
2180 private GLib2.Data* qdata;
2181 private uint ref_count, param_id;
2184 // Unintrospectable function: internal() / g_param_spec_internal()
2185 // Creates a new #GParamSpec instance.
2187 // A property name consists of segments consisting of ASCII letters and
2188 // digits, separated by either the '-' or '_' character. The first
2189 // character of a property name must be a letter. Names which violate these
2190 // rules lead to undefined behaviour.
2192 // When creating and looking up a #GParamSpec, either separator can be
2193 // used, but they cannot be mixed. Using '-' is considerably more
2194 // efficient and in fact required when using property names as detail
2195 // strings for signals.
2197 // Beyond the name, #GParamSpec<!-- -->s have two more descriptive
2198 // strings associated with them, the @nick, which should be suitable
2199 // for use as a label for the property in a property editor, and the
2200 // @blurb, which should be a somewhat longer description, suitable for
2201 // e.g. a tooltip. The @nick and @blurb should ideally be localized.
2202 // RETURNS: a newly allocated #GParamSpec instance
2203 // <param_type>: the #GType for the property; must be derived from #G_TYPE_PARAM
2204 // <name>: the canonical name of the property
2205 // <nick>: the nickname of the property
2206 // <blurb>: a short description of the property
2207 // <flags>: a combination of #GParamFlags
2208 static void* internal(AT0, AT1, AT2)(Type param_type, AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, ParamFlags flags) nothrow {
2209 return g_param_spec_internal(param_type, toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), flags);
2212 // Get the short description of a #GParamSpec.
2213 // RETURNS: the short description of @pspec.
2214 char* get_blurb()() nothrow {
2215 return g_param_spec_get_blurb(&this);
2218 // Get the name of a #GParamSpec.
2220 // The name is always an "interned" string (as per g_intern_string()).
2221 // This allows for pointer-value comparisons.
2222 // RETURNS: the name of @pspec.
2223 char* get_name()() nothrow {
2224 return g_param_spec_get_name(&this);
2227 // Get the nickname of a #GParamSpec.
2228 // RETURNS: the nickname of @pspec.
2229 char* get_nick()() nothrow {
2230 return g_param_spec_get_nick(&this);
2233 // Gets back user data pointers stored via g_param_spec_set_qdata().
2234 // RETURNS: the user data pointer set, or %NULL
2235 // <quark>: a #GQuark, naming the user data pointer
2236 void* get_qdata()(GLib2.Quark quark) nothrow {
2237 return g_param_spec_get_qdata(&this, quark);
2240 // VERSION: 2.4
2241 // If the paramspec redirects operations to another paramspec,
2242 // returns that paramspec. Redirect is used typically for
2243 // providing a new implementation of a property in a derived
2244 // type while preserving all the properties from the parent
2245 // type. Redirection is established by creating a property
2246 // of type #GParamSpecOverride. See g_object_class_override_property()
2247 // for an example of the use of this capability.
2250 // paramspec should be redirected, or %NULL if none.
2251 // RETURNS: paramspec to which requests on this
2252 ParamSpec* get_redirect_target()() nothrow {
2253 return g_param_spec_get_redirect_target(&this);
2256 // Unintrospectable method: ref() / g_param_spec_ref()
2257 // Increments the reference count of @pspec.
2258 // RETURNS: the #GParamSpec that was passed into this function
2259 ParamSpec* ref_()() nothrow {
2260 return g_param_spec_ref(&this);
2263 // Unintrospectable method: ref_sink() / g_param_spec_ref_sink()
2264 // VERSION: 2.10
2265 // Convenience function to ref and sink a #GParamSpec.
2266 // RETURNS: the #GParamSpec that was passed into this function
2267 ParamSpec* ref_sink()() nothrow {
2268 return g_param_spec_ref_sink(&this);
2271 // Sets an opaque, named pointer on a #GParamSpec. The name is
2272 // specified through a #GQuark (retrieved e.g. via
2273 // g_quark_from_static_string()), and the pointer can be gotten back
2274 // from the @pspec with g_param_spec_get_qdata(). Setting a
2275 // previously set user data pointer, overrides (frees) the old pointer
2276 // set, using %NULL as pointer essentially removes the data stored.
2277 // <quark>: a #GQuark, naming the user data pointer
2278 // <data>: an opaque user data pointer
2279 void set_qdata(AT0)(GLib2.Quark quark, AT0 /*void*/ data) nothrow {
2280 g_param_spec_set_qdata(&this, quark, UpCast!(void*)(data));
2283 // Unintrospectable method: set_qdata_full() / g_param_spec_set_qdata_full()
2284 // This function works like g_param_spec_set_qdata(), but in addition,
2285 // a <literal>void (*destroy) (gpointer)</literal> function may be
2286 // specified which is called with @data as argument when the @pspec is
2287 // finalized, or the data is being overwritten by a call to
2288 // g_param_spec_set_qdata() with the same @quark.
2289 // <quark>: a #GQuark, naming the user data pointer
2290 // <data>: an opaque user data pointer
2291 // <destroy>: function to invoke with @data as argument, when @data needs to be freed
2292 void set_qdata_full(AT0)(GLib2.Quark quark, AT0 /*void*/ data, GLib2.DestroyNotify destroy) nothrow {
2293 g_param_spec_set_qdata_full(&this, quark, UpCast!(void*)(data), destroy);
2296 // The initial reference count of a newly created #GParamSpec is 1,
2297 // even though no one has explicitly called g_param_spec_ref() on it
2298 // yet. So the initial reference count is flagged as "floating", until
2299 // someone calls <literal>g_param_spec_ref (pspec); g_param_spec_sink
2300 // (pspec);</literal> in sequence on it, taking over the initial
2301 // reference count (thus ending up with a @pspec that has a reference
2302 // count of 1 still, but is not flagged "floating" anymore).
2303 void sink()() nothrow {
2304 g_param_spec_sink(&this);
2307 // Gets back user data pointers stored via g_param_spec_set_qdata()
2308 // and removes the @data from @pspec without invoking its destroy()
2309 // function (if any was set). Usually, calling this function is only
2310 // required to update user data pointers with a destroy notifier.
2311 // RETURNS: the user data pointer set, or %NULL
2312 // <quark>: a #GQuark, naming the user data pointer
2313 void* steal_qdata()(GLib2.Quark quark) nothrow {
2314 return g_param_spec_steal_qdata(&this, quark);
2317 // Unintrospectable method: unref() / g_param_spec_unref()
2318 // Decrements the reference count of a @pspec.
2319 void unref()() nothrow {
2320 g_param_spec_unref(&this);
2324 // A #GParamSpec derived structure that contains the meta data for boolean properties.
2325 struct ParamSpecBoolean /* : ParamSpec */ {
2326 alias parent_instance this;
2327 alias parent_instance super_;
2328 alias parent_instance paramspec;
2329 ParamSpec parent_instance;
2330 int default_value;
2333 // A #GParamSpec derived structure that contains the meta data for boxed properties.
2334 struct ParamSpecBoxed /* : ParamSpec */ {
2335 alias parent_instance this;
2336 alias parent_instance super_;
2337 alias parent_instance paramspec;
2338 ParamSpec parent_instance;
2341 // A #GParamSpec derived structure that contains the meta data for character properties.
2342 struct ParamSpecChar /* : ParamSpec */ {
2343 alias parent_instance this;
2344 alias parent_instance super_;
2345 alias parent_instance paramspec;
2346 ParamSpec parent_instance;
2347 byte minimum, maximum, default_value;
2351 // The class structure for the <structname>GParamSpec</structname> type.
2352 // Normally, <structname>GParamSpec</structname> classes are filled by
2353 // g_param_type_register_static().
2354 struct ParamSpecClass {
2355 TypeClass g_type_class;
2356 Type value_type;
2357 extern (C) void function (ParamSpec* pspec) nothrow finalize;
2358 extern (C) void function (ParamSpec* pspec, Value* value) nothrow value_set_default;
2359 extern (C) int function (ParamSpec* pspec, Value* value) nothrow value_validate;
2360 extern (C) int function (ParamSpec* pspec, Value* value1, Value* value2) nothrow values_cmp;
2361 private void*[4] dummy;
2364 // A #GParamSpec derived structure that contains the meta data for double properties.
2365 struct ParamSpecDouble /* : ParamSpec */ {
2366 alias parent_instance this;
2367 alias parent_instance super_;
2368 alias parent_instance paramspec;
2369 ParamSpec parent_instance;
2370 double minimum, maximum, default_value, epsilon;
2374 // A #GParamSpec derived structure that contains the meta data for enum
2375 // properties.
2376 struct ParamSpecEnum /* : ParamSpec */ {
2377 alias parent_instance this;
2378 alias parent_instance super_;
2379 alias parent_instance paramspec;
2380 ParamSpec parent_instance;
2381 EnumClass* enum_class;
2382 int default_value;
2386 // A #GParamSpec derived structure that contains the meta data for flags
2387 // properties.
2388 struct ParamSpecFlags /* : ParamSpec */ {
2389 alias parent_instance this;
2390 alias parent_instance super_;
2391 alias parent_instance paramspec;
2392 ParamSpec parent_instance;
2393 FlagsClass* flags_class;
2394 uint default_value;
2397 // A #GParamSpec derived structure that contains the meta data for float properties.
2398 struct ParamSpecFloat /* : ParamSpec */ {
2399 alias parent_instance this;
2400 alias parent_instance super_;
2401 alias parent_instance paramspec;
2402 ParamSpec parent_instance;
2403 float minimum, maximum, default_value, epsilon;
2406 // A #GParamSpec derived structure that contains the meta data for #GType properties.
2407 struct ParamSpecGType /* : ParamSpec */ /* Version 2.10 */ {
2408 alias parent_instance this;
2409 alias parent_instance super_;
2410 alias parent_instance paramspec;
2411 ParamSpec parent_instance;
2412 Type is_a_type;
2415 // A #GParamSpec derived structure that contains the meta data for integer properties.
2416 struct ParamSpecInt /* : ParamSpec */ {
2417 alias parent_instance this;
2418 alias parent_instance super_;
2419 alias parent_instance paramspec;
2420 ParamSpec parent_instance;
2421 int minimum, maximum, default_value;
2424 // A #GParamSpec derived structure that contains the meta data for 64bit integer properties.
2425 struct ParamSpecInt64 /* : ParamSpec */ {
2426 alias parent_instance this;
2427 alias parent_instance super_;
2428 alias parent_instance paramspec;
2429 ParamSpec parent_instance;
2430 long minimum, maximum, default_value;
2433 // A #GParamSpec derived structure that contains the meta data for long integer properties.
2434 struct ParamSpecLong /* : ParamSpec */ {
2435 alias parent_instance this;
2436 alias parent_instance super_;
2437 alias parent_instance paramspec;
2438 ParamSpec parent_instance;
2439 c_long minimum, maximum, default_value;
2442 // A #GParamSpec derived structure that contains the meta data for object properties.
2443 struct ParamSpecObject /* : ParamSpec */ {
2444 alias parent_instance this;
2445 alias parent_instance super_;
2446 alias parent_instance paramspec;
2447 ParamSpec parent_instance;
2451 // This is a type of #GParamSpec type that simply redirects operations to
2452 // another paramspec. All operations other than getting or
2453 // setting the value are redirected, including accessing the nick and
2454 // blurb, validating a value, and so forth. See
2455 // g_param_spec_get_redirect_target() for retrieving the overidden
2456 // property. #GParamSpecOverride is used in implementing
2457 // g_object_class_override_property(), and will not be directly useful
2458 // unless you are implementing a new base type similar to GObject.
2459 struct ParamSpecOverride /* : ParamSpec */ /* Version 2.4 */ {
2460 alias parent_instance this;
2461 alias parent_instance super_;
2462 alias parent_instance paramspec;
2463 ParamSpec parent_instance;
2464 private ParamSpec* overridden;
2468 // A #GParamSpec derived structure that contains the meta data for %G_TYPE_PARAM
2469 // properties.
2470 struct ParamSpecParam /* : ParamSpec */ {
2471 alias parent_instance this;
2472 alias parent_instance super_;
2473 alias parent_instance paramspec;
2474 ParamSpec parent_instance;
2477 // A #GParamSpec derived structure that contains the meta data for pointer properties.
2478 struct ParamSpecPointer /* : ParamSpec */ {
2479 alias parent_instance this;
2480 alias parent_instance super_;
2481 alias parent_instance paramspec;
2482 ParamSpec parent_instance;
2486 // A #GParamSpecPool maintains a collection of #GParamSpec<!-- -->s which can be
2487 // quickly accessed by owner and name. The implementation of the #GObject property
2488 // system uses such a pool to store the #GParamSpecs of the properties all object
2489 // types.
2490 struct ParamSpecPool {
2492 // Inserts a #GParamSpec in the pool.
2493 // <pspec>: the #GParamSpec to insert
2494 // <owner_type>: a #GType identifying the owner of @pspec
2495 void insert(AT0)(AT0 /*ParamSpec*/ pspec, Type owner_type) nothrow {
2496 g_param_spec_pool_insert(&this, UpCast!(ParamSpec*)(pspec), owner_type);
2499 // Gets an array of all #GParamSpec<!-- -->s owned by @owner_type in
2500 // the pool.
2502 // allocated array containing pointers to all #GParamSpecs
2503 // owned by @owner_type in the pool
2504 // RETURNS: a newly
2505 // <owner_type>: the owner to look for
2506 // <n_pspecs_p>: return location for the length of the returned array
2507 ParamSpec** /*new container*/ list(AT0)(Type owner_type, /*out*/ AT0 /*uint*/ n_pspecs_p) nothrow {
2508 return g_param_spec_pool_list(&this, owner_type, UpCast!(uint*)(n_pspecs_p));
2511 // Gets an #GList of all #GParamSpec<!-- -->s owned by @owner_type in
2512 // the pool.
2514 // #GList of all #GParamSpec<!-- -->s owned by @owner_type in
2515 // the pool#GParamSpec<!-- -->s.
2516 // RETURNS: a
2517 // <owner_type>: the owner to look for
2518 GLib2.List* /*new container*/ list_owned()(Type owner_type) nothrow {
2519 return g_param_spec_pool_list_owned(&this, owner_type);
2522 // Looks up a #GParamSpec in the pool.
2524 // matching #GParamSpec was found.
2525 // RETURNS: The found #GParamSpec, or %NULL if no
2526 // <param_name>: the name to look for
2527 // <owner_type>: the owner to look for
2528 // <walk_ancestors>: If %TRUE, also try to find a #GParamSpec with @param_name owned by an ancestor of @owner_type.
2529 ParamSpec* lookup(AT0)(AT0 /*char*/ param_name, Type owner_type, int walk_ancestors) nothrow {
2530 return g_param_spec_pool_lookup(&this, toCString!(char*)(param_name), owner_type, walk_ancestors);
2533 // Removes a #GParamSpec from the pool.
2534 // <pspec>: the #GParamSpec to remove
2535 void remove(AT0)(AT0 /*ParamSpec*/ pspec) nothrow {
2536 g_param_spec_pool_remove(&this, UpCast!(ParamSpec*)(pspec));
2539 // Creates a new #GParamSpecPool.
2541 // If @type_prefixing is %TRUE, lookups in the newly created pool will
2542 // allow to specify the owner as a colon-separated prefix of the
2543 // property name, like "GtkContainer:border-width". This feature is
2544 // deprecated, so you should always set @type_prefixing to %FALSE.
2545 // RETURNS: a newly allocated #GParamSpecPool.
2546 // <type_prefixing>: Whether the pool will support type-prefixed property names.
2547 static ParamSpecPool* new_()(int type_prefixing) nothrow {
2548 return g_param_spec_pool_new(type_prefixing);
2553 // A #GParamSpec derived structure that contains the meta data for string
2554 // properties.
2555 struct ParamSpecString /* : ParamSpec */ {
2556 alias parent_instance this;
2557 alias parent_instance super_;
2558 alias parent_instance paramspec;
2559 ParamSpec parent_instance;
2560 char* default_value, cset_first, cset_nth;
2561 char substitutor;
2562 static import std.bitmanip; mixin(std.bitmanip.bitfields!(
2563 uint, "null_fold_if_empty", 1,
2564 uint, "ensure_non_null", 1,
2565 uint, "__dummy32A", 30));
2569 // This structure is used to provide the type system with the information
2570 // required to initialize and destruct (finalize) a parameter's class and
2571 // instances thereof.
2572 // The initialized structure is passed to the g_param_type_register_static()
2573 // The type system will perform a deep copy of this structure, so its memory
2574 // does not need to be persistent across invocation of
2575 // g_param_type_register_static().
2576 struct ParamSpecTypeInfo {
2577 ushort instance_size, n_preallocs;
2578 extern (C) void function (ParamSpec* pspec) nothrow instance_init;
2579 Type value_type;
2580 extern (C) void function (ParamSpec* pspec) nothrow finalize;
2581 extern (C) void function (ParamSpec* pspec, Value* value) nothrow value_set_default;
2582 extern (C) int function (ParamSpec* pspec, Value* value) nothrow value_validate;
2583 extern (C) int function (ParamSpec* pspec, Value* value1, Value* value2) nothrow values_cmp;
2586 // A #GParamSpec derived structure that contains the meta data for unsigned character properties.
2587 struct ParamSpecUChar /* : ParamSpec */ {
2588 alias parent_instance this;
2589 alias parent_instance super_;
2590 alias parent_instance paramspec;
2591 ParamSpec parent_instance;
2592 ubyte minimum, maximum, default_value;
2595 // A #GParamSpec derived structure that contains the meta data for unsigned integer properties.
2596 struct ParamSpecUInt /* : ParamSpec */ {
2597 alias parent_instance this;
2598 alias parent_instance super_;
2599 alias parent_instance paramspec;
2600 ParamSpec parent_instance;
2601 uint minimum, maximum, default_value;
2604 // A #GParamSpec derived structure that contains the meta data for unsigned 64bit integer properties.
2605 struct ParamSpecUInt64 /* : ParamSpec */ {
2606 alias parent_instance this;
2607 alias parent_instance super_;
2608 alias parent_instance paramspec;
2609 ParamSpec parent_instance;
2610 ulong minimum, maximum, default_value;
2613 // A #GParamSpec derived structure that contains the meta data for unsigned long integer properties.
2614 struct ParamSpecULong /* : ParamSpec */ {
2615 alias parent_instance this;
2616 alias parent_instance super_;
2617 alias parent_instance paramspec;
2618 ParamSpec parent_instance;
2619 c_ulong minimum, maximum, default_value;
2622 // A #GParamSpec derived structure that contains the meta data for unichar (unsigned integer) properties.
2623 struct ParamSpecUnichar /* : ParamSpec */ {
2624 alias parent_instance this;
2625 alias parent_instance super_;
2626 alias parent_instance paramspec;
2627 ParamSpec parent_instance;
2628 dchar default_value;
2631 // A #GParamSpec derived structure that contains the meta data for #GValueArray properties.
2632 struct ParamSpecValueArray /* : ParamSpec */ {
2633 alias parent_instance this;
2634 alias parent_instance super_;
2635 alias parent_instance paramspec;
2636 ParamSpec parent_instance;
2637 ParamSpec* element_spec;
2638 uint fixed_n_elements;
2641 // A #GParamSpec derived structure that contains the meta data for #GVariant properties.
2642 struct ParamSpecVariant /* : ParamSpec */ /* Version 2.26 */ {
2643 alias parent_instance this;
2644 alias parent_instance super_;
2645 alias parent_instance paramspec;
2646 ParamSpec parent_instance;
2647 GLib2.VariantType* type;
2648 GLib2.Variant* default_value;
2649 private void*[4] padding;
2653 // The <structname>GParameter</structname> struct is an auxiliary structure used
2654 // to hand parameter name/value pairs to g_object_newv().
2655 struct Parameter {
2656 char* name;
2657 Value value;
2660 enum int SIGNAL_FLAGS_MASK = 511;
2661 enum int SIGNAL_MATCH_MASK = 63;
2663 // The signal accumulator is a special callback function that can be used
2664 // to collect return values of the various callbacks that are called
2665 // during a signal emission. The signal accumulator is specified at signal
2666 // creation time, if it is left %NULL, no accumulation of callback return
2667 // values is performed. The return value of signal emissions is then the
2668 // value returned by the last callback.
2670 // should be aborted. Returning %FALSE means to abort the
2671 // current emission and %TRUE is returned for continuation.
2672 // RETURNS: The accumulator function returns whether the signal emission
2673 // <ihint>: Signal invocation hint, see #GSignalInvocationHint.
2674 // <return_accu>: Accumulator to collect callback return values in, this is the return value of the current signal emission.
2675 // <handler_return>: A #GValue holding the return value of the signal handler.
2676 // <data>: Callback data that was specified when creating the signal.
2677 extern (C) alias int function (SignalInvocationHint* ihint, Value* return_accu, Value* handler_return, void* data) nothrow SignalAccumulator;
2680 // A simple function pointer to get invoked when the signal is emitted. This
2681 // allows you to tie a hook to the signal type, so that it will trap all
2682 // emissions of that signal, from any object.
2684 // You may not attach these to signals created with the #G_SIGNAL_NO_HOOKS flag.
2686 // hook is disconnected (and destroyed).
2687 // RETURNS: whether it wants to stay connected. If it returns %FALSE, the signal
2688 // <ihint>: Signal invocation hint, see #GSignalInvocationHint.
2689 // <n_param_values>: the number of parameters to the function, including the instance on which the signal was emitted.
2690 // <param_values>: the instance on which the signal was emitted, followed by the parameters of the emission.
2691 // <data>: user data associated with the hook.
2692 extern (C) alias int function (SignalInvocationHint* ihint, uint n_param_values, Value* param_values, void* data) nothrow SignalEmissionHook;
2695 // The signal flags are used to specify a signal's behaviour, the overall
2696 // signal description outlines how especially the RUN flags control the
2697 // stages of a signal emission.
2698 enum SignalFlags {
2699 RUN_FIRST = 1,
2700 RUN_LAST = 2,
2701 RUN_CLEANUP = 4,
2702 NO_RECURSE = 8,
2703 DETAILED = 16,
2704 ACTION = 32,
2705 NO_HOOKS = 64,
2706 MUST_COLLECT = 128,
2707 DEPRECATED = 256
2710 // The #GSignalInvocationHint structure is used to pass on additional information
2711 // to callbacks during a signal emission.
2712 struct SignalInvocationHint {
2713 uint signal_id;
2714 GLib2.Quark detail;
2715 SignalFlags run_type;
2719 // The match types specify what g_signal_handlers_block_matched(),
2720 // g_signal_handlers_unblock_matched() and g_signal_handlers_disconnect_matched()
2721 // match signals by.
2722 enum SignalMatchType {
2723 ID = 1,
2724 DETAIL = 2,
2725 CLOSURE = 4,
2726 FUNC = 8,
2727 DATA = 16,
2728 UNBLOCKED = 32
2731 // A structure holding in-depth information for a specific signal. It is
2732 // filled in by the g_signal_query() function.
2733 struct SignalQuery {
2734 uint signal_id;
2735 char* signal_name;
2736 Type itype;
2737 SignalFlags signal_flags;
2738 Type return_type;
2739 uint n_params;
2740 Type* param_types;
2743 enum int TYPE_FUNDAMENTAL_MAX = 255;
2744 enum int TYPE_FUNDAMENTAL_SHIFT = 2;
2745 enum int TYPE_RESERVED_BSE_FIRST = 32;
2746 enum int TYPE_RESERVED_BSE_LAST = 48;
2747 enum int TYPE_RESERVED_GLIB_FIRST = 22;
2748 enum int TYPE_RESERVED_GLIB_LAST = 31;
2749 enum int TYPE_RESERVED_USER_FIRST = 49;
2751 // A callback function used for notification when the state
2752 // of a toggle reference changes. See g_object_add_toggle_ref().
2753 // <data>: Callback data passed to g_object_add_toggle_ref()
2754 // <object>: The object on which g_object_add_toggle_ref() was called.
2755 // <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.
2756 extern (C) alias void function (void* data, Object* object, int is_last_ref) nothrow ToggleNotify;
2758 // A union holding one collected value.
2759 union TypeCValue {
2760 int v_int;
2761 c_long v_long;
2762 long v_int64;
2763 double v_double;
2764 void* v_pointer;
2767 // An opaque structure used as the base of all classes.
2768 struct TypeClass {
2769 private Type g_type;
2771 // Unintrospectable method: get_private() / g_type_class_get_private()
2772 void* get_private()(Type private_type) nothrow {
2773 return g_type_class_get_private(&this, private_type);
2776 // This is a convenience function often needed in class initializers.
2777 // It returns the class structure of the immediate parent type of the
2778 // class passed in. Since derived classes hold a reference count on
2779 // their parent classes as long as they are instantiated, the returned
2780 // class will always exist. This function is essentially equivalent
2781 // to:
2783 // <programlisting>
2784 // g_type_class_peek (g_type_parent (G_TYPE_FROM_CLASS (g_class)));
2785 // </programlisting>
2787 // of @g_class.
2788 // RETURNS: The parent class
2789 TypeClass* peek_parent()() nothrow {
2790 return g_type_class_peek_parent(&this);
2793 // Decrements the reference count of the class structure being passed in.
2794 // Once the last reference count of a class has been released, classes
2795 // may be finalized by the type system, so further dereferencing of a
2796 // class pointer after g_type_class_unref() are invalid.
2797 void unref()() nothrow {
2798 g_type_class_unref(&this);
2801 // Unintrospectable method: unref_uncached() / g_type_class_unref_uncached()
2802 // A variant of g_type_class_unref() for use in #GTypeClassCacheFunc
2803 // implementations. It unreferences a class without consulting the chain
2804 // of #GTypeClassCacheFunc<!-- -->s, avoiding the recursion which would occur
2805 // otherwise.
2806 void unref_uncached()() nothrow {
2807 g_type_class_unref_uncached(&this);
2810 // VERSION: 2.4
2811 // Registers a private structure for an instantiatable type.
2813 // When an object is allocated, the private structures for
2814 // the type and all of its parent types are allocated
2815 // sequentially in the same memory block as the public
2816 // structures.
2818 // Note that the accumulated size of the private structures of
2819 // a type and all its parent types cannot excced 64 KiB.
2821 // This function should be called in the type's class_init() function.
2822 // The private structure can be retrieved using the
2823 // G_TYPE_INSTANCE_GET_PRIVATE() macro.
2825 // The following example shows attaching a private structure
2826 // <structname>MyObjectPrivate</structname> to an object
2827 // <structname>MyObject</structname> defined in the standard GObject
2828 // fashion.
2829 // type's class_init() function.
2830 // Note the use of a structure member "priv" to avoid the overhead
2831 // of repeatedly calling MY_OBJECT_GET_PRIVATE().
2833 // |[
2834 // typedef struct _MyObject MyObject;
2835 // typedef struct _MyObjectPrivate MyObjectPrivate;
2837 // struct _MyObject {
2838 // GObject parent;
2840 // MyObjectPrivate *priv;
2841 // };
2843 // struct _MyObjectPrivate {
2844 // int some_field;
2845 // };
2847 // static void
2848 // my_object_class_init (MyObjectClass *klass)
2849 // {
2850 // g_type_class_add_private (klass, sizeof (MyObjectPrivate));
2851 // }
2853 // static void
2854 // my_object_init (MyObject *my_object)
2855 // {
2856 // my_object->priv = G_TYPE_INSTANCE_GET_PRIVATE (my_object,
2857 // MY_TYPE_OBJECT,
2858 // MyObjectPrivate);
2859 // }
2861 // static int
2862 // my_object_get_some_field (MyObject *my_object)
2863 // {
2864 // MyObjectPrivate *priv;
2866 // g_return_val_if_fail (MY_IS_OBJECT (my_object), 0);
2868 // priv = my_object->priv;
2870 // return priv->some_field;
2871 // }
2872 // ]|
2873 // <g_class>: class structure for an instantiatable type
2874 // <private_size>: size of private structure.
2875 static void add_private(AT0)(AT0 /*void*/ g_class, size_t private_size) nothrow {
2876 g_type_class_add_private(UpCast!(void*)(g_class), private_size);
2879 // This function is essentially the same as g_type_class_ref(), except that
2880 // the classes reference count isn't incremented. As a consequence, this function
2881 // may return %NULL if the class of the type passed in does not currently
2882 // exist (hasn't been referenced before).
2884 // structure for the given type ID or %NULL if the class does not
2885 // currently exist.
2886 // RETURNS: The #GTypeClass
2887 // <type>: Type ID of a classed type.
2888 static TypeClass* peek()(Type type) nothrow {
2889 return g_type_class_peek(type);
2892 // VERSION: 2.4
2893 // A more efficient version of g_type_class_peek() which works only for
2894 // static types.
2896 // structure for the given type ID or %NULL if the class does not
2897 // currently exist or is dynamically loaded.
2898 // RETURNS: The #GTypeClass
2899 // <type>: Type ID of a classed type.
2900 static TypeClass* peek_static()(Type type) nothrow {
2901 return g_type_class_peek_static(type);
2904 // Increments the reference count of the class structure belonging to
2905 // @type. This function will demand-create the class if it doesn't
2906 // exist already.
2908 // structure for the given type ID.
2909 // RETURNS: The #GTypeClass
2910 // <type>: Type ID of a classed type.
2911 static TypeClass* ref_()(Type type) nothrow {
2912 return g_type_class_ref(type);
2917 // A callback function which is called when the reference count of a class
2918 // drops to zero. It may use g_type_class_ref() to prevent the class from
2919 // being freed. You should not call g_type_class_unref() from a
2920 // #GTypeClassCacheFunc function to prevent infinite recursion, use
2921 // g_type_class_unref_uncached() instead.
2923 // The functions have to check the class id passed in to figure
2924 // whether they actually want to cache the class of this type, since all
2925 // classes are routed through the same #GTypeClassCacheFunc chain.
2927 // called, %FALSE to continue.
2928 // RETURNS: %TRUE to stop further #GTypeClassCacheFunc<!-- -->s from being
2929 // <cache_data>: data that was given to the g_type_add_class_cache_func() call
2930 // <g_class>: The #GTypeClass structure which is unreferenced
2931 extern (C) alias int function (void* cache_data, TypeClass* g_class) nothrow TypeClassCacheFunc;
2934 // The <type>GTypeDebugFlags</type> enumeration values can be passed to
2935 // g_type_init_with_debug_flags() to trigger debugging messages during runtime.
2936 // Note that the messages can also be triggered by setting the
2937 // <envar>GOBJECT_DEBUG</envar> environment variable to a ':'-separated list of
2938 // "objects" and "signals".
2939 enum TypeDebugFlags {
2940 NONE = 0,
2941 OBJECTS = 1,
2942 SIGNALS = 2,
2943 MASK = 3
2945 // Bit masks used to check or determine characteristics of a type.
2946 enum TypeFlags {
2947 ABSTRACT = 16,
2948 VALUE_ABSTRACT = 32
2951 // Bit masks used to check or determine specific characteristics of a
2952 // fundamental type.
2953 enum TypeFundamentalFlags {
2954 CLASSED = 1,
2955 INSTANTIATABLE = 2,
2956 DERIVABLE = 4,
2957 DEEP_DERIVABLE = 8
2960 // A structure that provides information to the type system which is
2961 // used specifically for managing fundamental types.
2962 struct TypeFundamentalInfo {
2963 TypeFundamentalFlags type_flags;
2967 // This structure is used to provide the type system with the information
2968 // required to initialize and destruct (finalize) a type's class and
2969 // its instances.
2970 // The initialized structure is passed to the g_type_register_static() function
2971 // (or is copied into the provided #GTypeInfo structure in the
2972 // g_type_plugin_complete_type_info()). The type system will perform a deep
2973 // copy of this structure, so its memory does not need to be persistent
2974 // across invocation of g_type_register_static().
2975 struct GTypeInfo {
2976 ushort class_size;
2977 BaseInitFunc base_init;
2978 BaseFinalizeFunc base_finalize;
2979 ClassInitFunc class_init;
2980 ClassFinalizeFunc class_finalize;
2981 const(void)* class_data;
2982 ushort instance_size, n_preallocs;
2983 InstanceInitFunc instance_init;
2984 TypeValueTable* value_table;
2987 // An opaque structure used as the base of all type instances.
2988 struct TypeInstance {
2989 private TypeClass* g_class;
2991 // Unintrospectable method: get_private() / g_type_instance_get_private()
2992 void* get_private()(Type private_type) nothrow {
2993 return g_type_instance_get_private(&this, private_type);
2997 // An opaque structure used as the base of all interface types.
2998 struct TypeInterface {
2999 private Type g_type, g_instance_type;
3002 // Returns the corresponding #GTypeInterface structure of the parent type
3003 // of the instance type to which @g_iface belongs. This is useful when
3004 // deriving the implementation of an interface from the parent type and
3005 // then possibly overriding some methods.
3007 // corresponding #GTypeInterface structure of the parent type of the
3008 // instance type to which @g_iface belongs, or %NULL if the parent
3009 // type doesn't conform to the interface.
3010 // RETURNS: The
3011 TypeInterface* peek_parent()() nothrow {
3012 return g_type_interface_peek_parent(&this);
3015 // Adds @prerequisite_type to the list of prerequisites of @interface_type.
3016 // This means that any type implementing @interface_type must also implement
3017 // @prerequisite_type. Prerequisites can be thought of as an alternative to
3018 // interface derivation (which GType doesn't support). An interface can have
3019 // at most one instantiatable prerequisite type.
3020 // <interface_type>: #GType value of an interface type.
3021 // <prerequisite_type>: #GType value of an interface or instantiatable type.
3022 static void add_prerequisite()(Type interface_type, Type prerequisite_type) nothrow {
3023 g_type_interface_add_prerequisite(interface_type, prerequisite_type);
3026 // Returns the #GTypePlugin structure for the dynamic interface
3027 // @interface_type which has been added to @instance_type, or %NULL if
3028 // @interface_type has not been added to @instance_type or does not
3029 // have a #GTypePlugin structure. See g_type_add_interface_dynamic().
3031 // interface @interface_type of @instance_type.
3032 // RETURNS: the #GTypePlugin for the dynamic
3033 // <instance_type>: the #GType value of an instantiatable type.
3034 // <interface_type>: the #GType value of an interface type.
3035 static TypePlugin* get_plugin()(Type instance_type, Type interface_type) nothrow {
3036 return g_type_interface_get_plugin(instance_type, interface_type);
3039 // Returns the #GTypeInterface structure of an interface to which the
3040 // passed in class conforms.
3042 // structure of iface_type if implemented by @instance_class, %NULL
3043 // otherwise
3044 // RETURNS: The GTypeInterface
3045 // <instance_class>: A #GTypeClass structure.
3046 // <iface_type>: An interface ID which this class conforms to.
3047 static TypeInterface* peek(AT0)(AT0 /*TypeClass*/ instance_class, Type iface_type) nothrow {
3048 return g_type_interface_peek(UpCast!(TypeClass*)(instance_class), iface_type);
3051 // VERSION: 2.2
3052 // Returns the prerequisites of an interfaces type.
3055 // newly-allocated zero-terminated array of #GType containing
3056 // the prerequisites of @interface_type
3057 // RETURNS: a
3058 // <interface_type>: an interface type
3059 // <n_prerequisites>: location to return the number of prerequisites, or %NULL
3060 static Type* /*new*/ prerequisites(AT0)(Type interface_type, /*out*/ AT0 /*uint*/ n_prerequisites=null) nothrow {
3061 return g_type_interface_prerequisites(interface_type, UpCast!(uint*)(n_prerequisites));
3066 // VERSION: 2.4
3067 // A callback called after an interface vtable is initialized.
3068 // See g_type_add_interface_check().
3069 // <check_data>: data passed to g_type_add_interface_check().
3070 // <g_iface>: the interface that has been initialized
3071 extern (C) alias void function (void* check_data, void* g_iface) nothrow TypeInterfaceCheckFunc;
3074 // #GTypeModule provides a simple implementation of the #GTypePlugin
3075 // interface. The model of #GTypeModule is a dynamically loaded module
3076 // which implements some number of types and interface
3077 // implementations. When the module is loaded, it registers its types
3078 // and interfaces using g_type_module_register_type() and
3079 // g_type_module_add_interface(). As long as any instances of these
3080 // types and interface implementations are in use, the module is kept
3081 // loaded. When the types and interfaces are gone, the module may be
3082 // unloaded. If the types and interfaces become used again, the module
3083 // will be reloaded. Note that the last unref cannot happen in module
3084 // code, since that would lead to the caller's code being unloaded before
3085 // g_object_unref() returns to it.
3087 // Keeping track of whether the module should be loaded or not is done by
3088 // using a use count - it starts at zero, and whenever it is greater than
3089 // zero, the module is loaded. The use count is maintained internally by
3090 // the type system, but also can be explicitly controlled by
3091 // g_type_module_use() and g_type_module_unuse(). Typically, when loading
3092 // a module for the first type, g_type_module_use() will be used to load
3093 // it so that it can initialize its types. At some later point, when the
3094 // module no longer needs to be loaded except for the type
3095 // implementations it contains, g_type_module_unuse() is called.
3097 // #GTypeModule does not actually provide any implementation of module
3098 // loading and unloading. To create a particular module type you must
3099 // derive from #GTypeModule and implement the load and unload functions
3100 // in #GTypeModuleClass.
3101 struct TypeModule /* : Object */ {
3102 mixin TypePlugin.__interface__;
3103 alias parent_instance this;
3104 alias parent_instance super_;
3105 alias parent_instance object;
3106 Object parent_instance;
3107 uint use_count;
3108 GLib2.SList* type_infos, interface_infos;
3109 char* name;
3112 // Registers an additional interface for a type, whose interface lives
3113 // in the given type plugin. If the interface was already registered
3114 // for the type in this plugin, nothing will be done.
3116 // As long as any instances of the type exist, the type plugin will
3117 // not be unloaded.
3118 // <instance_type>: type to which to add the interface.
3119 // <interface_type>: interface type to add
3120 // <interface_info>: type information structure
3121 void add_interface(AT0)(Type instance_type, Type interface_type, AT0 /*InterfaceInfo*/ interface_info) nothrow {
3122 g_type_module_add_interface(&this, instance_type, interface_type, UpCast!(InterfaceInfo*)(interface_info));
3125 // VERSION: 2.6
3126 // Looks up or registers an enumeration that is implemented with a particular
3127 // type plugin. If a type with name @type_name was previously registered,
3128 // the #GType identifier for the type is returned, otherwise the type
3129 // is newly registered, and the resulting #GType identifier returned.
3131 // As long as any instances of the type exist, the type plugin will
3132 // not be unloaded.
3133 // RETURNS: the new or existing type ID
3134 // <name>: name for the type
3135 // <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.
3136 Type register_enum(AT0, AT1)(AT0 /*char*/ name, AT1 /*EnumValue*/ const_static_values) nothrow {
3137 return g_type_module_register_enum(&this, toCString!(char*)(name), UpCast!(EnumValue*)(const_static_values));
3140 // VERSION: 2.6
3141 // Looks up or registers a flags type that is implemented with a particular
3142 // type plugin. If a type with name @type_name was previously registered,
3143 // the #GType identifier for the type is returned, otherwise the type
3144 // is newly registered, and the resulting #GType identifier returned.
3146 // As long as any instances of the type exist, the type plugin will
3147 // not be unloaded.
3148 // RETURNS: the new or existing type ID
3149 // <name>: name for the type
3150 // <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.
3151 Type register_flags(AT0, AT1)(AT0 /*char*/ name, AT1 /*FlagsValue*/ const_static_values) nothrow {
3152 return g_type_module_register_flags(&this, toCString!(char*)(name), UpCast!(FlagsValue*)(const_static_values));
3155 // Looks up or registers a type that is implemented with a particular
3156 // type plugin. If a type with name @type_name was previously registered,
3157 // the #GType identifier for the type is returned, otherwise the type
3158 // is newly registered, and the resulting #GType identifier returned.
3160 // When reregistering a type (typically because a module is unloaded
3161 // then reloaded, and reinitialized), @module and @parent_type must
3162 // be the same as they were previously.
3164 // As long as any instances of the type exist, the type plugin will
3165 // not be unloaded.
3166 // RETURNS: the new or existing type ID
3167 // <parent_type>: the type for the parent class
3168 // <type_name>: name for the type
3169 // <type_info>: type information structure
3170 // <flags>: flags field providing details about the type
3171 Type register_type(AT0, AT1)(Type parent_type, AT0 /*char*/ type_name, AT1 /*GTypeInfo*/ type_info, TypeFlags flags) nothrow {
3172 return g_type_module_register_type(&this, parent_type, toCString!(char*)(type_name), UpCast!(GTypeInfo*)(type_info), flags);
3175 // Sets the name for a #GTypeModule
3176 // <name>: a human-readable name to use in error messages.
3177 void set_name(AT0)(AT0 /*char*/ name) nothrow {
3178 g_type_module_set_name(&this, toCString!(char*)(name));
3181 // Decreases the use count of a #GTypeModule by one. If the
3182 // result is zero, the module will be unloaded. (However, the
3183 // #GTypeModule will not be freed, and types associated with the
3184 // #GTypeModule are not unregistered. Once a #GTypeModule is
3185 // initialized, it must exist forever.)
3186 void unuse()() nothrow {
3187 g_type_module_unuse(&this);
3190 // Increases the use count of a #GTypeModule by one. If the
3191 // use count was zero before, the plugin will be loaded.
3192 // If loading the plugin fails, the use count is reset to
3193 // its prior value.
3195 // loading the plugin failed.
3196 // RETURNS: %FALSE if the plugin needed to be loaded and
3197 int use()() nothrow {
3198 return g_type_module_use(&this);
3203 // In order to implement dynamic loading of types based on #GTypeModule,
3204 // the @load and @unload functions in #GTypeModuleClass must be implemented.
3205 struct TypeModuleClass {
3206 ObjectClass parent_class;
3207 extern (C) int function (TypeModule* module_) nothrow load;
3208 extern (C) void function (TypeModule* module_) nothrow unload;
3209 extern (C) void function () nothrow reserved1;
3210 extern (C) void function () nothrow reserved2;
3211 extern (C) void function () nothrow reserved3;
3212 extern (C) void function () nothrow reserved4;
3216 // The GObject type system supports dynamic loading of types. The
3217 // #GTypePlugin interface is used to handle the lifecycle of
3218 // dynamically loaded types. It goes as follows:
3220 // <orderedlist>
3221 // <listitem><para>
3222 // The type is initially introduced (usually upon loading the module
3223 // the first time, or by your main application that knows what modules
3224 // introduces what types), like this:
3225 // |[
3226 // new_type_id = g_type_register_dynamic (parent_type_id,
3227 // "TypeName",
3228 // new_type_plugin,
3229 // type_flags);
3230 // ]|
3231 // where <literal>new_type_plugin</literal> is an implementation of the
3232 // #GTypePlugin interface.
3233 // </para></listitem>
3234 // <listitem><para>
3235 // The type's implementation is referenced, e.g. through
3236 // g_type_class_ref() or through g_type_create_instance() (this is
3237 // being called by g_object_new()) or through one of the above done on
3238 // a type derived from <literal>new_type_id</literal>.
3239 // </para></listitem>
3240 // <listitem><para>
3241 // This causes the type system to load the type's implementation by calling
3242 // g_type_plugin_use() and g_type_plugin_complete_type_info() on
3243 // <literal>new_type_plugin</literal>.
3244 // </para></listitem>
3245 // <listitem><para>
3246 // At some point the type's implementation isn't required anymore, e.g. after
3247 // g_type_class_unref() or g_type_free_instance() (called when the reference
3248 // count of an instance drops to zero).
3249 // </para></listitem>
3250 // <listitem><para>
3251 // This causes the type system to throw away the information retrieved from
3252 // g_type_plugin_complete_type_info() and then it calls
3253 // g_type_plugin_unuse() on <literal>new_type_plugin</literal>.
3254 // </para></listitem>
3255 // <listitem><para>
3256 // Things may repeat from the second step.
3257 // </para></listitem>
3258 // </orderedlist>
3260 // So basically, you need to implement a #GTypePlugin type that
3261 // carries a use_count, once use_count goes from zero to one, you need
3262 // to load the implementation to successfully handle the upcoming
3263 // g_type_plugin_complete_type_info() call. Later, maybe after
3264 // succeeding use/unuse calls, once use_count drops to zero, you can
3265 // unload the implementation again. The type system makes sure to call
3266 // g_type_plugin_use() and g_type_plugin_complete_type_info() again
3267 // when the type is needed again.
3269 // #GTypeModule is an implementation of #GTypePlugin that already
3270 // implements most of this except for the actual module loading and
3271 // unloading. It even handles multiple registered types per module.
3272 struct TypePlugin /* Interface */ {
3273 mixin template __interface__() {
3274 // Calls the @complete_interface_info function from the
3275 // #GTypePluginClass of @plugin. There should be no need to use this
3276 // function outside of the GObject type system itself.
3277 // <instance_type>: the #GType of an instantiable type to which the interface is added
3278 // <interface_type>: the #GType of the interface whose info is completed
3279 // <info>: the #GInterfaceInfo to fill in
3280 void complete_interface_info(AT0)(Type instance_type, Type interface_type, AT0 /*InterfaceInfo*/ info) nothrow {
3281 g_type_plugin_complete_interface_info(cast(TypePlugin*)&this, instance_type, interface_type, UpCast!(InterfaceInfo*)(info));
3284 // Calls the @complete_type_info function from the #GTypePluginClass of @plugin.
3285 // There should be no need to use this function outside of the GObject
3286 // type system itself.
3287 // <g_type>: the #GType whose info is completed
3288 // <info>: the #GTypeInfo struct to fill in
3289 // <value_table>: the #GTypeValueTable to fill in
3290 void complete_type_info(AT0, AT1)(Type g_type, AT0 /*GTypeInfo*/ info, AT1 /*TypeValueTable*/ value_table) nothrow {
3291 g_type_plugin_complete_type_info(cast(TypePlugin*)&this, g_type, UpCast!(GTypeInfo*)(info), UpCast!(TypeValueTable*)(value_table));
3294 // Calls the @unuse_plugin function from the #GTypePluginClass of
3295 // @plugin. There should be no need to use this function outside of
3296 // the GObject type system itself.
3297 void unuse()() nothrow {
3298 g_type_plugin_unuse(cast(TypePlugin*)&this);
3301 // Calls the @use_plugin function from the #GTypePluginClass of
3302 // @plugin. There should be no need to use this function outside of
3303 // the GObject type system itself.
3304 void use()() nothrow {
3305 g_type_plugin_use(cast(TypePlugin*)&this);
3308 mixin __interface__;
3312 // The #GTypePlugin interface is used by the type system in order to handle
3313 // the lifecycle of dynamically loaded types.
3314 struct TypePluginClass {
3315 private TypeInterface base_iface;
3316 TypePluginUse use_plugin;
3317 TypePluginUnuse unuse_plugin;
3318 TypePluginCompleteTypeInfo complete_type_info;
3319 TypePluginCompleteInterfaceInfo complete_interface_info;
3323 // The type of the @complete_interface_info function of #GTypePluginClass.
3324 // <plugin>: the #GTypePlugin
3325 // <instance_type>: the #GType of an instantiable type to which the interface is added
3326 // <interface_type>: the #GType of the interface whose info is completed
3327 // <info>: the #GInterfaceInfo to fill in
3328 extern (C) alias void function (TypePlugin* plugin, Type instance_type, Type interface_type, InterfaceInfo* info) nothrow TypePluginCompleteInterfaceInfo;
3331 // The type of the @complete_type_info function of #GTypePluginClass.
3332 // <plugin>: the #GTypePlugin
3333 // <g_type>: the #GType whose info is completed
3334 // <info>: the #GTypeInfo struct to fill in
3335 // <value_table>: the #GTypeValueTable to fill in
3336 extern (C) alias void function (TypePlugin* plugin, Type g_type, GTypeInfo* info, TypeValueTable* value_table) nothrow TypePluginCompleteTypeInfo;
3339 // The type of the @unuse_plugin function of #GTypePluginClass.
3340 // <plugin>: the #GTypePlugin whose use count should be decreased
3341 extern (C) alias void function (TypePlugin* plugin) nothrow TypePluginUnuse;
3344 // The type of the @use_plugin function of #GTypePluginClass, which gets called
3345 // to increase the use count of @plugin.
3346 // <plugin>: the #GTypePlugin whose use count should be increased
3347 extern (C) alias void function (TypePlugin* plugin) nothrow TypePluginUse;
3350 // A structure holding information for a specific type. It is
3351 // filled in by the g_type_query() function.
3352 struct TypeQuery {
3353 Type type;
3354 char* type_name;
3355 uint class_size, instance_size;
3359 // The #GTypeValueTable provides the functions required by the #GValue implementation,
3360 // to serve as a container for values of a type.
3361 struct TypeValueTable {
3362 extern (C) void function (Value* value) nothrow value_init;
3363 extern (C) void function (Value* value) nothrow value_free;
3364 extern (C) void function (Value* src_value, Value* dest_value) nothrow value_copy;
3365 // Unintrospectable functionp: value_peek_pointer() / ()
3366 extern (C) void* function (Value* value) nothrow value_peek_pointer;
3367 char* collect_format;
3368 extern (C) char* /*new*/ function (Value* value, uint n_collect_values, TypeCValue* collect_values, uint collect_flags) nothrow collect_value;
3369 char* lcopy_format;
3370 extern (C) char* /*new*/ function (Value* value, uint n_collect_values, TypeCValue* collect_values, uint collect_flags) nothrow lcopy_value;
3373 // Unintrospectable function: peek() / g_type_value_table_peek()
3374 // Returns the location of the #GTypeValueTable associated with @type.
3375 // <emphasis>Note that this function should only be used from source code
3376 // that implements or has internal knowledge of the implementation of
3377 // @type.</emphasis>
3379 // %NULL if there is no #GTypeValueTable associated with @type.
3380 // RETURNS: Location of the #GTypeValueTable associated with @type or
3381 // <type>: A #GType value.
3382 static TypeValueTable* peek()(Type type) nothrow {
3383 return g_type_value_table_peek(type);
3387 enum int VALUE_COLLECT_FORMAT_MAX_LENGTH = 8;
3388 enum int VALUE_NOCOPY_CONTENTS = 134217728;
3389 // Unintrospectable callback: VaClosureMarshal() / ()
3390 extern (C) alias void function (Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow VaClosureMarshal;
3393 // An opaque structure used to hold different types of values.
3394 // The data within the structure has protected scope: it is accessible only
3395 // to functions within a #GTypeValueTable structure, or implementations of
3396 // the g_value_*() API. That is, code portions which implement new fundamental
3397 // types.
3398 // #GValue users cannot make any assumptions about how data is stored
3399 // within the 2 element @data union, and the @g_type member should
3400 // only be accessed through the G_VALUE_TYPE() macro.
3401 struct Value {
3402 private Type g_type;
3403 _Value__data__union[2] data;
3406 // Copies the value of @src_value into @dest_value.
3407 // <dest_value>: An initialized #GValue structure of the same type as @src_value.
3408 void copy(AT0)(AT0 /*Value*/ dest_value) nothrow {
3409 g_value_copy(&this, UpCast!(Value*)(dest_value));
3412 // Unintrospectable method: dup_boxed() / g_value_dup_boxed()
3413 // Get the contents of a %G_TYPE_BOXED derived #GValue. Upon getting,
3414 // the boxed value is duplicated and needs to be later freed with
3415 // g_boxed_free(), e.g. like: g_boxed_free (G_VALUE_TYPE (@value),
3416 // return_value);
3417 // RETURNS: boxed contents of @value
3418 void* dup_boxed()() nothrow {
3419 return g_value_dup_boxed(&this);
3422 // Get the contents of a %G_TYPE_OBJECT derived #GValue, increasing
3423 // its reference count. If the contents of the #GValue are %NULL, then
3424 // %NULL will be returned.
3426 // should be unreferenced when no longer needed.
3427 // RETURNS: object content of @value,
3428 Object* /*new*/ dup_object()() nothrow {
3429 return g_value_dup_object(&this);
3432 // Unintrospectable method: dup_param() / g_value_dup_param()
3433 // Get the contents of a %G_TYPE_PARAM #GValue, increasing its
3434 // reference count.
3436 // no longer needed.
3437 // RETURNS: #GParamSpec content of @value, should be unreferenced when
3438 ParamSpec* dup_param()() nothrow {
3439 return g_value_dup_param(&this);
3442 // Get a copy the contents of a %G_TYPE_STRING #GValue.
3443 // RETURNS: a newly allocated copy of the string content of @value
3444 char* /*new*/ dup_string()() nothrow {
3445 return g_value_dup_string(&this);
3448 // VERSION: 2.26
3449 // Get the contents of a variant #GValue, increasing its refcount.
3451 // g_variant_unref() when no longer needed
3452 // RETURNS: variant contents of @value, should be unrefed using
3453 GLib2.Variant* /*new*/ dup_variant()() nothrow {
3454 return g_value_dup_variant(&this);
3457 // Determines if @value will fit inside the size of a pointer value.
3458 // This is an internal function introduced mainly for C marshallers.
3459 // RETURNS: %TRUE if @value will fit inside a pointer value.
3460 int fits_pointer()() nothrow {
3461 return g_value_fits_pointer(&this);
3464 // Get the contents of a %G_TYPE_BOOLEAN #GValue.
3465 // RETURNS: boolean contents of @value
3466 int get_boolean()() nothrow {
3467 return g_value_get_boolean(&this);
3470 // Get the contents of a %G_TYPE_BOXED derived #GValue.
3471 // RETURNS: boxed contents of @value
3472 void* get_boxed()() nothrow {
3473 return g_value_get_boxed(&this);
3476 // DEPRECATED (v2.32) method: get_char - This function's return type is broken, see g_value_get_schar()
3477 // Do not use this function; it is broken on platforms where the %char
3478 // type is unsigned, such as ARM and PowerPC. See g_value_get_schar().
3480 // Get the contents of a %G_TYPE_CHAR #GValue.
3481 // RETURNS: character contents of @value
3482 char get_char()() nothrow {
3483 return g_value_get_char(&this);
3486 // Get the contents of a %G_TYPE_DOUBLE #GValue.
3487 // RETURNS: double contents of @value
3488 double get_double()() nothrow {
3489 return g_value_get_double(&this);
3492 // Get the contents of a %G_TYPE_ENUM #GValue.
3493 // RETURNS: enum contents of @value
3494 int get_enum()() nothrow {
3495 return g_value_get_enum(&this);
3498 // Get the contents of a %G_TYPE_FLAGS #GValue.
3499 // RETURNS: flags contents of @value
3500 uint get_flags()() nothrow {
3501 return g_value_get_flags(&this);
3504 // Get the contents of a %G_TYPE_FLOAT #GValue.
3505 // RETURNS: float contents of @value
3506 float get_float()() nothrow {
3507 return g_value_get_float(&this);
3510 // VERSION: 2.12
3511 // Get the contents of a %G_TYPE_GTYPE #GValue.
3512 // RETURNS: the #GType stored in @value
3513 Type get_gtype()() nothrow {
3514 return g_value_get_gtype(&this);
3517 // Get the contents of a %G_TYPE_INT #GValue.
3518 // RETURNS: integer contents of @value
3519 int get_int()() nothrow {
3520 return g_value_get_int(&this);
3523 // Get the contents of a %G_TYPE_INT64 #GValue.
3524 // RETURNS: 64bit integer contents of @value
3525 long get_int64()() nothrow {
3526 return g_value_get_int64(&this);
3529 // Get the contents of a %G_TYPE_LONG #GValue.
3530 // RETURNS: long integer contents of @value
3531 c_long get_long()() nothrow {
3532 return g_value_get_long(&this);
3535 // Get the contents of a %G_TYPE_OBJECT derived #GValue.
3536 // RETURNS: object contents of @value
3537 Object* get_object()() nothrow {
3538 return g_value_get_object(&this);
3541 // Get the contents of a %G_TYPE_PARAM #GValue.
3542 // RETURNS: #GParamSpec content of @value
3543 ParamSpec* get_param()() nothrow {
3544 return g_value_get_param(&this);
3547 // Get the contents of a pointer #GValue.
3548 // RETURNS: pointer contents of @value
3549 void* get_pointer()() nothrow {
3550 return g_value_get_pointer(&this);
3553 // VERSION: 2.32
3554 // Get the contents of a %G_TYPE_CHAR #GValue.
3555 // RETURNS: signed 8 bit integer contents of @value
3556 byte get_schar()() nothrow {
3557 return g_value_get_schar(&this);
3560 // Get the contents of a %G_TYPE_STRING #GValue.
3561 // RETURNS: string content of @value
3562 char* get_string()() nothrow {
3563 return g_value_get_string(&this);
3566 // Get the contents of a %G_TYPE_UCHAR #GValue.
3567 // RETURNS: unsigned character contents of @value
3568 ubyte get_uchar()() nothrow {
3569 return g_value_get_uchar(&this);
3572 // Get the contents of a %G_TYPE_UINT #GValue.
3573 // RETURNS: unsigned integer contents of @value
3574 uint get_uint()() nothrow {
3575 return g_value_get_uint(&this);
3578 // Get the contents of a %G_TYPE_UINT64 #GValue.
3579 // RETURNS: unsigned 64bit integer contents of @value
3580 ulong get_uint64()() nothrow {
3581 return g_value_get_uint64(&this);
3584 // Get the contents of a %G_TYPE_ULONG #GValue.
3585 // RETURNS: unsigned long integer contents of @value
3586 c_ulong get_ulong()() nothrow {
3587 return g_value_get_ulong(&this);
3590 // VERSION: 2.26
3591 // Get the contents of a variant #GValue.
3592 // RETURNS: variant contents of @value
3593 GLib2.Variant* /*new*/ get_variant()() nothrow {
3594 return g_value_get_variant(&this);
3597 // Initializes @value with the default value of @type.
3598 // RETURNS: the #GValue structure that has been passed in
3599 // <g_type>: Type the #GValue should hold values of.
3600 Value* init()(Type g_type) nothrow {
3601 return g_value_init(&this, g_type);
3604 // function asserts that g_value_fits_pointer() returned %TRUE for the
3605 // passed in value. This is an internal function introduced mainly
3606 // for C marshallers.
3607 // RETURNS: the value contents as pointer. This
3608 void* peek_pointer()() nothrow {
3609 return g_value_peek_pointer(&this);
3612 // Clears the current value in @value and resets it to the default value
3613 // (as if the value had just been initialized).
3614 // RETURNS: the #GValue structure that has been passed in
3615 Value* /*new*/ reset()() nothrow {
3616 return g_value_reset(&this);
3619 // Set the contents of a %G_TYPE_BOOLEAN #GValue to @v_boolean.
3620 // <v_boolean>: boolean value to be set
3621 void set_boolean()(int v_boolean) nothrow {
3622 g_value_set_boolean(&this, v_boolean);
3625 // Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.
3626 // <v_boxed>: boxed value to be set
3627 void set_boxed(AT0)(AT0 /*const(void)*/ v_boxed=null) nothrow {
3628 g_value_set_boxed(&this, UpCast!(const(void)*)(v_boxed));
3631 // DEPRECATED (v2.4) method: set_boxed_take_ownership - Use g_value_take_boxed() instead.
3632 // This is an internal function introduced mainly for C marshallers.
3633 // <v_boxed>: duplicated unowned boxed value to be set
3634 void set_boxed_take_ownership(AT0)(AT0 /*const(void)*/ v_boxed=null) nothrow {
3635 g_value_set_boxed_take_ownership(&this, UpCast!(const(void)*)(v_boxed));
3638 // DEPRECATED (v2.32) method: set_char - This function's input type is broken, see g_value_set_schar()
3639 // Set the contents of a %G_TYPE_CHAR #GValue to @v_char.
3640 // <v_char>: character value to be set
3641 void set_char()(char v_char) nothrow {
3642 g_value_set_char(&this, v_char);
3645 // Set the contents of a %G_TYPE_DOUBLE #GValue to @v_double.
3646 // <v_double>: double value to be set
3647 void set_double()(double v_double) nothrow {
3648 g_value_set_double(&this, v_double);
3651 // Set the contents of a %G_TYPE_ENUM #GValue to @v_enum.
3652 // <v_enum>: enum value to be set
3653 void set_enum()(int v_enum) nothrow {
3654 g_value_set_enum(&this, v_enum);
3657 // Set the contents of a %G_TYPE_FLAGS #GValue to @v_flags.
3658 // <v_flags>: flags value to be set
3659 void set_flags()(uint v_flags) nothrow {
3660 g_value_set_flags(&this, v_flags);
3663 // Set the contents of a %G_TYPE_FLOAT #GValue to @v_float.
3664 // <v_float>: float value to be set
3665 void set_float()(float v_float) nothrow {
3666 g_value_set_float(&this, v_float);
3669 // VERSION: 2.12
3670 // Set the contents of a %G_TYPE_GTYPE #GValue to @v_gtype.
3671 // <v_gtype>: #GType to be set
3672 void set_gtype()(Type v_gtype) nothrow {
3673 g_value_set_gtype(&this, v_gtype);
3676 // Sets @value from an instantiatable type via the
3677 // value_table's collect_value() function.
3678 // <instance>: the instance
3679 void set_instance(AT0)(AT0 /*void*/ instance=null) nothrow {
3680 g_value_set_instance(&this, UpCast!(void*)(instance));
3683 // Set the contents of a %G_TYPE_INT #GValue to @v_int.
3684 // <v_int>: integer value to be set
3685 void set_int()(int v_int) nothrow {
3686 g_value_set_int(&this, v_int);
3689 // Set the contents of a %G_TYPE_INT64 #GValue to @v_int64.
3690 // <v_int64>: 64bit integer value to be set
3691 void set_int64()(long v_int64) nothrow {
3692 g_value_set_int64(&this, v_int64);
3695 // Set the contents of a %G_TYPE_LONG #GValue to @v_long.
3696 // <v_long>: long integer value to be set
3697 void set_long()(c_long v_long) nothrow {
3698 g_value_set_long(&this, v_long);
3701 // Set the contents of a %G_TYPE_OBJECT derived #GValue to @v_object.
3703 // g_value_set_object() increases the reference count of @v_object
3704 // (the #GValue holds a reference to @v_object). If you do not wish
3705 // to increase the reference count of the object (i.e. you wish to
3706 // pass your current reference to the #GValue because you no longer
3707 // need it), use g_value_take_object() instead.
3709 // It is important that your #GValue holds a reference to @v_object (either its
3710 // own, or one it has taken) to ensure that the object won't be destroyed while
3711 // the #GValue still exists).
3712 // <v_object>: object value to be set
3713 void set_object(AT0)(AT0 /*Object*/ v_object=null) nothrow {
3714 g_value_set_object(&this, UpCast!(Object*)(v_object));
3717 // Unintrospectable method: set_object_take_ownership() / g_value_set_object_take_ownership()
3718 // DEPRECATED (v2.4) method: set_object_take_ownership - Use g_value_take_object() instead.
3719 // This is an internal function introduced mainly for C marshallers.
3720 // <v_object>: object value to be set
3721 void set_object_take_ownership(AT0)(AT0 /*void*/ v_object=null) nothrow {
3722 g_value_set_object_take_ownership(&this, UpCast!(void*)(v_object));
3725 // Set the contents of a %G_TYPE_PARAM #GValue to @param.
3726 // <param>: the #GParamSpec to be set
3727 void set_param(AT0)(AT0 /*ParamSpec*/ param=null) nothrow {
3728 g_value_set_param(&this, UpCast!(ParamSpec*)(param));
3731 // Unintrospectable method: set_param_take_ownership() / g_value_set_param_take_ownership()
3732 // DEPRECATED (v2.4) method: set_param_take_ownership - Use g_value_take_param() instead.
3733 // This is an internal function introduced mainly for C marshallers.
3734 // <param>: the #GParamSpec to be set
3735 void set_param_take_ownership(AT0)(AT0 /*ParamSpec*/ param=null) nothrow {
3736 g_value_set_param_take_ownership(&this, UpCast!(ParamSpec*)(param));
3739 // Set the contents of a pointer #GValue to @v_pointer.
3740 // <v_pointer>: pointer value to be set
3741 void set_pointer(AT0)(AT0 /*void*/ v_pointer) nothrow {
3742 g_value_set_pointer(&this, UpCast!(void*)(v_pointer));
3745 // VERSION: 2.32
3746 // Set the contents of a %G_TYPE_CHAR #GValue to @v_char.
3747 // <v_char>: signed 8 bit integer to be set
3748 void set_schar()(byte v_char) nothrow {
3749 g_value_set_schar(&this, v_char);
3752 // Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.
3753 // The boxed value is assumed to be static, and is thus not duplicated
3754 // when setting the #GValue.
3755 // <v_boxed>: static boxed value to be set
3756 void set_static_boxed(AT0)(AT0 /*const(void)*/ v_boxed=null) nothrow {
3757 g_value_set_static_boxed(&this, UpCast!(const(void)*)(v_boxed));
3760 // Set the contents of a %G_TYPE_STRING #GValue to @v_string.
3761 // The string is assumed to be static, and is thus not duplicated
3762 // when setting the #GValue.
3763 // <v_string>: static string to be set
3764 void set_static_string(AT0)(AT0 /*char*/ v_string=null) nothrow {
3765 g_value_set_static_string(&this, toCString!(char*)(v_string));
3768 // Set the contents of a %G_TYPE_STRING #GValue to @v_string.
3769 // <v_string>: caller-owned string to be duplicated for the #GValue
3770 void set_string(AT0)(AT0 /*char*/ v_string=null) nothrow {
3771 g_value_set_string(&this, toCString!(char*)(v_string));
3774 // DEPRECATED (v2.4) method: set_string_take_ownership - Use g_value_take_string() instead.
3775 // This is an internal function introduced mainly for C marshallers.
3776 // <v_string>: duplicated unowned string to be set
3777 void set_string_take_ownership(AT0)(AT0 /*char*/ v_string=null) nothrow {
3778 g_value_set_string_take_ownership(&this, toCString!(char*)(v_string));
3781 // Set the contents of a %G_TYPE_UCHAR #GValue to @v_uchar.
3782 // <v_uchar>: unsigned character value to be set
3783 void set_uchar()(ubyte v_uchar) nothrow {
3784 g_value_set_uchar(&this, v_uchar);
3787 // Set the contents of a %G_TYPE_UINT #GValue to @v_uint.
3788 // <v_uint>: unsigned integer value to be set
3789 void set_uint()(uint v_uint) nothrow {
3790 g_value_set_uint(&this, v_uint);
3793 // Set the contents of a %G_TYPE_UINT64 #GValue to @v_uint64.
3794 // <v_uint64>: unsigned 64bit integer value to be set
3795 void set_uint64()(ulong v_uint64) nothrow {
3796 g_value_set_uint64(&this, v_uint64);
3799 // Set the contents of a %G_TYPE_ULONG #GValue to @v_ulong.
3800 // <v_ulong>: unsigned long integer value to be set
3801 void set_ulong()(c_ulong v_ulong) nothrow {
3802 g_value_set_ulong(&this, v_ulong);
3805 // VERSION: 2.26
3806 // Set the contents of a variant #GValue to @variant.
3807 // If the variant is floating, it is consumed.
3808 // <variant>: a #GVariant, or %NULL
3809 void set_variant(AT0)(AT0 /*GLib2.Variant*/ variant=null) nothrow {
3810 g_value_set_variant(&this, UpCast!(GLib2.Variant*)(variant));
3813 // VERSION: 2.4
3814 // Sets the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed
3815 // and takes over the ownership of the callers reference to @v_boxed;
3816 // the caller doesn't have to unref it any more.
3817 // <v_boxed>: duplicated unowned boxed value to be set
3818 void take_boxed(AT0)(AT0 /*const(void)*/ v_boxed=null) nothrow {
3819 g_value_take_boxed(&this, UpCast!(const(void)*)(v_boxed));
3822 // Unintrospectable method: take_object() / g_value_take_object()
3823 // VERSION: 2.4
3824 // Sets the contents of a %G_TYPE_OBJECT derived #GValue to @v_object
3825 // and takes over the ownership of the callers reference to @v_object;
3826 // the caller doesn't have to unref it any more (i.e. the reference
3827 // count of the object is not increased).
3829 // If you want the #GValue to hold its own reference to @v_object, use
3830 // g_value_set_object() instead.
3831 // <v_object>: object value to be set
3832 void take_object(AT0)(AT0 /*void*/ v_object=null) nothrow {
3833 g_value_take_object(&this, UpCast!(void*)(v_object));
3836 // Unintrospectable method: take_param() / g_value_take_param()
3837 // VERSION: 2.4
3838 // Sets the contents of a %G_TYPE_PARAM #GValue to @param and takes
3839 // over the ownership of the callers reference to @param; the caller
3840 // doesn't have to unref it any more.
3841 // <param>: the #GParamSpec to be set
3842 void take_param(AT0)(AT0 /*ParamSpec*/ param=null) nothrow {
3843 g_value_take_param(&this, UpCast!(ParamSpec*)(param));
3846 // VERSION: 2.4
3847 // Sets the contents of a %G_TYPE_STRING #GValue to @v_string.
3848 // <v_string>: string to take ownership of
3849 void take_string(AT0)(AT0 /*char*/ v_string=null) nothrow {
3850 g_value_take_string(&this, toCString!(char*)(v_string));
3853 // VERSION: 2.26
3854 // Set the contents of a variant #GValue to @variant, and takes over
3855 // the ownership of the caller's reference to @variant;
3856 // the caller doesn't have to unref it any more (i.e. the reference
3857 // count of the variant is not increased).
3859 // If @variant was floating then its floating reference is converted to
3860 // a hard reference.
3862 // If you want the #GValue to hold its own reference to @variant, use
3863 // g_value_set_variant() instead.
3865 // This is an internal function introduced mainly for C marshallers.
3866 // <variant>: a #GVariant, or %NULL
3867 void take_variant(AT0)(AT0 /*GLib2.Variant*/ variant=null) nothrow {
3868 g_value_take_variant(&this, UpCast!(GLib2.Variant*)(variant));
3871 // Tries to cast the contents of @src_value into a type appropriate
3872 // to store in @dest_value, e.g. to transform a %G_TYPE_INT value
3873 // into a %G_TYPE_FLOAT value. Performing transformations between
3874 // value types might incur precision lossage. Especially
3875 // transformations into strings might reveal seemingly arbitrary
3876 // results and shouldn't be relied upon for production code (such
3877 // as rcfile value or object property serialization).
3879 // Upon failing transformations, @dest_value is left untouched.
3880 // RETURNS: Whether a transformation rule was found and could be applied.
3881 // <dest_value>: Target value.
3882 int transform(AT0)(AT0 /*Value*/ dest_value) nothrow {
3883 return g_value_transform(&this, UpCast!(Value*)(dest_value));
3886 // Clears the current value in @value and "unsets" the type,
3887 // this releases all resources associated with this GValue.
3888 // An unset value is the same as an uninitialized (zero-filled)
3889 // #GValue structure.
3890 void unset()() nothrow {
3891 g_value_unset(&this);
3894 // Unintrospectable function: register_transform_func() / g_value_register_transform_func()
3895 // Registers a value transformation function for use in g_value_transform().
3896 // A previously registered transformation function for @src_type and @dest_type
3897 // will be replaced.
3898 // <src_type>: Source type.
3899 // <dest_type>: Target type.
3900 // <transform_func>: a function which transforms values of type @src_type into value of type @dest_type
3901 static void register_transform_func()(Type src_type, Type dest_type, ValueTransform transform_func) nothrow {
3902 g_value_register_transform_func(src_type, dest_type, transform_func);
3905 // Returns whether a #GValue of type @src_type can be copied into
3906 // a #GValue of type @dest_type.
3907 // RETURNS: %TRUE if g_value_copy() is possible with @src_type and @dest_type.
3908 // <src_type>: source type to be copied.
3909 // <dest_type>: destination type for copying.
3910 static int type_compatible()(Type src_type, Type dest_type) nothrow {
3911 return g_value_type_compatible(src_type, dest_type);
3914 // Check whether g_value_transform() is able to transform values
3915 // of type @src_type into values of type @dest_type.
3916 // RETURNS: %TRUE if the transformation is possible, %FALSE otherwise.
3917 // <src_type>: Source type.
3918 // <dest_type>: Target type.
3919 static int type_transformable()(Type src_type, Type dest_type) nothrow {
3920 return g_value_type_transformable(src_type, dest_type);
3924 // A #GValueArray contains an array of #GValue elements.
3925 struct ValueArray {
3926 uint n_values;
3927 Value* values;
3928 private uint n_prealloced;
3931 // DEPRECATED (v2.32) constructor: new - Use #GArray and g_array_sized_new() instead.
3932 // Allocate and initialize a new #GValueArray, optionally preserve space
3933 // for @n_prealloced elements. New arrays always contain 0 elements,
3934 // regardless of the value of @n_prealloced.
3935 // RETURNS: a newly allocated #GValueArray with 0 values
3936 // <n_prealloced>: number of values to preallocate space for
3937 static ValueArray* /*new*/ new_()(uint n_prealloced) nothrow {
3938 return g_value_array_new(n_prealloced);
3940 static auto opCall()(uint n_prealloced) {
3941 return g_value_array_new(n_prealloced);
3944 // DEPRECATED (v2.32) method: append - Use #GArray and g_array_append_val() instead.
3945 // Insert a copy of @value as last element of @value_array. If @value is
3946 // %NULL, an uninitialized value is appended.
3947 // RETURNS: the #GValueArray passed in as @value_array
3948 // <value>: #GValue to copy into #GValueArray, or %NULL
3949 ValueArray* append(AT0)(AT0 /*Value*/ value=null) nothrow {
3950 return g_value_array_append(&this, UpCast!(Value*)(value));
3953 // DEPRECATED (v2.32) method: copy - Use #GArray and g_array_ref() instead.
3954 // Construct an exact copy of a #GValueArray by duplicating all its
3955 // contents.
3956 // RETURNS: Newly allocated copy of #GValueArray
3957 ValueArray* /*new*/ copy()() nothrow {
3958 return g_value_array_copy(&this);
3961 // DEPRECATED (v2.32) method: free - Use #GArray and g_array_unref() instead.
3962 // Free a #GValueArray including its contents.
3963 void free()() nothrow {
3964 g_value_array_free(&this);
3967 // DEPRECATED (v2.32) method: get_nth - Use g_array_index() instead.
3968 // Return a pointer to the value at @index_ containd in @value_array.
3969 // RETURNS: pointer to a value at @index_ in @value_array
3970 // <index_>: index of the value of interest
3971 Value* get_nth()(uint index_) nothrow {
3972 return g_value_array_get_nth(&this, index_);
3975 // DEPRECATED (v2.32) method: insert - Use #GArray and g_array_insert_val() instead.
3976 // Insert a copy of @value at specified position into @value_array. If @value
3977 // is %NULL, an uninitialized value is inserted.
3978 // RETURNS: the #GValueArray passed in as @value_array
3979 // <index_>: insertion position, must be &lt;= value_array-&gt;n_values
3980 // <value>: #GValue to copy into #GValueArray, or %NULL
3981 ValueArray* insert(AT0)(uint index_, AT0 /*Value*/ value=null) nothrow {
3982 return g_value_array_insert(&this, index_, UpCast!(Value*)(value));
3985 // DEPRECATED (v2.32) method: prepend - Use #GArray and g_array_prepend_val() instead.
3986 // Insert a copy of @value as first element of @value_array. If @value is
3987 // %NULL, an uninitialized value is prepended.
3988 // RETURNS: the #GValueArray passed in as @value_array
3989 // <value>: #GValue to copy into #GValueArray, or %NULL
3990 ValueArray* prepend(AT0)(AT0 /*Value*/ value=null) nothrow {
3991 return g_value_array_prepend(&this, UpCast!(Value*)(value));
3994 // DEPRECATED (v2.32) method: remove - Use #GArray and g_array_remove_index() instead.
3995 // Remove the value at position @index_ from @value_array.
3996 // RETURNS: the #GValueArray passed in as @value_array
3997 // <index_>: position of value to remove, which must be less than <code>value_array-><link linkend="GValueArray.n-values">n_values</link></code>
3998 ValueArray* remove()(uint index_) nothrow {
3999 return g_value_array_remove(&this, index_);
4002 // DEPRECATED (v2.32) method: sort - Use #GArray and g_array_sort().
4003 // Sort @value_array using @compare_func to compare the elements according to
4004 // the semantics of #GCompareFunc.
4006 // The current implementation uses Quick-Sort as sorting algorithm.
4007 // RETURNS: the #GValueArray passed in as @value_array
4008 // <compare_func>: function to compare elements
4009 ValueArray* sort()(GLib2.CompareFunc compare_func) nothrow {
4010 return g_value_array_sort(&this, compare_func);
4013 // DEPRECATED (v2.32) method: sort_with_data - Use #GArray and g_array_sort_with_data().
4014 // Sort @value_array using @compare_func to compare the elements according
4015 // to the semantics of #GCompareDataFunc.
4017 // The current implementation uses Quick-Sort as sorting algorithm.
4018 // RETURNS: the #GValueArray passed in as @value_array
4019 // <compare_func>: function to compare elements
4020 // <user_data>: extra data argument provided for @compare_func
4021 ValueArray* sort_with_data(AT0)(GLib2.CompareDataFunc compare_func, AT0 /*void*/ user_data) nothrow {
4022 return g_value_array_sort_with_data(&this, compare_func, UpCast!(void*)(user_data));
4027 // The type of value transformation functions which can be registered with
4028 // g_value_register_transform_func().
4029 // <src_value>: Source value.
4030 // <dest_value>: Target value.
4031 extern (C) alias void function (Value* src_value, Value* dest_value) nothrow ValueTransform;
4034 // A #GWeakNotify function can be added to an object as a callback that gets
4035 // triggered when the object is finalized. Since the object is already being
4036 // finalized when the #GWeakNotify is called, there's not much you could do
4037 // with the object, apart from e.g. using its address as hash-index or the like.
4038 // <data>: data that was provided when the weak reference was established
4039 // <where_the_object_was>: the object being finalized
4040 extern (C) alias void function (void* data, Object* where_the_object_was) nothrow WeakNotify;
4043 // A structure containing a weak reference to a #GObject. It can either
4044 // be empty (i.e. point to %NULL), or point to an object for as long as
4045 // at least one "strong" reference to that object exists. Before the
4046 // object's #GObjectClass.dispose method is called, every #GWeakRef
4047 // associated with becomes empty (i.e. points to %NULL).
4049 // Like #GValue, #GWeakRef can be statically allocated, stack- or
4050 // heap-allocated, or embedded in larger structures.
4052 // Unlike g_object_weak_ref() and g_object_add_weak_pointer(), this weak
4053 // reference is thread-safe: converting a weak pointer to a reference is
4054 // atomic with respect to invalidation of weak pointers to destroyed
4055 // objects.
4057 // If the object's #GObjectClass.dispose method results in additional
4058 // references to the object being held, any #GWeakRef<!-- -->s taken
4059 // before it was disposed will continue to point to %NULL. If
4060 // #GWeakRef<!-- -->s are taken after the object is disposed and
4061 // re-referenced, they will continue to point to it until its refcount
4062 // goes back to zero, at which point they too will be invalidated.
4063 struct WeakRef {
4066 union priv {
4067 void* p;
4071 // Unintrospectable method: clear() / g_weak_ref_clear()
4072 // VERSION: 2.32
4073 // Frees resources associated with a non-statically-allocated #GWeakRef.
4074 // After this call, the #GWeakRef is left in an undefined state.
4076 // You should only call this on a #GWeakRef that previously had
4077 // g_weak_ref_init() called on it.
4078 void clear()() nothrow {
4079 g_weak_ref_clear(&this);
4082 // Unintrospectable method: get() / g_weak_ref_get()
4083 // VERSION: 2.32
4084 // If @weak_ref is not empty, atomically acquire a strong
4085 // reference to the object it points to, and return that reference.
4087 // This function is needed because of the potential race between taking
4088 // the pointer value and g_object_ref() on it, if the object was losing
4089 // its last reference at the same time in a different thread.
4091 // The caller should release the resulting reference in the usual way,
4092 // by using g_object_unref().
4094 // by @weak_ref, or %NULL if it was empty
4095 // RETURNS: the object pointed to
4096 Object* /*new*/ get()() nothrow {
4097 return g_weak_ref_get(&this);
4100 // Unintrospectable method: init() / g_weak_ref_init()
4101 // VERSION: 2.32
4102 // Initialise a non-statically-allocated #GWeakRef.
4104 // This function also calls g_weak_ref_set() with @object on the
4105 // freshly-initialised weak reference.
4107 // This function should always be matched with a call to
4108 // g_weak_ref_clear(). It is not necessary to use this function for a
4109 // #GWeakRef in static storage because it will already be
4110 // properly initialised. Just use g_weak_ref_set() directly.
4111 // <object>: a #GObject or %NULL
4112 void init(AT0)(AT0 /*void*/ object=null) nothrow {
4113 g_weak_ref_init(&this, UpCast!(void*)(object));
4116 // Unintrospectable method: set() / g_weak_ref_set()
4117 // VERSION: 2.32
4118 // Change the object to which @weak_ref points, or set it to
4119 // %NULL.
4121 // You must own a strong reference on @object while calling this
4122 // function.
4123 // <object>: a #GObject or %NULL
4124 void set(AT0)(AT0 /*void*/ object=null) nothrow {
4125 g_weak_ref_set(&this, UpCast!(void*)(object));
4129 union _Value__data__union {
4130 int v_int;
4131 uint v_uint;
4132 c_long v_long;
4133 c_ulong v_ulong;
4134 long v_int64;
4135 ulong v_uint64;
4136 float v_float;
4137 double v_double;
4138 void* v_pointer;
4142 // Unintrospectable function: boxed_copy() / g_boxed_copy()
4143 // Provide a copy of a boxed structure @src_boxed which is of type @boxed_type.
4144 // RETURNS: The newly created copy of the boxed structure.
4145 // <boxed_type>: The type of @src_boxed.
4146 // <src_boxed>: The boxed structure to be copied.
4147 static void* boxed_copy(AT0)(Type boxed_type, AT0 /*const(void)*/ src_boxed) nothrow {
4148 return g_boxed_copy(boxed_type, UpCast!(const(void)*)(src_boxed));
4152 // Free the boxed structure @boxed which is of type @boxed_type.
4153 // <boxed_type>: The type of @boxed.
4154 // <boxed>: The boxed structure to be freed.
4155 static void boxed_free(AT0)(Type boxed_type, AT0 /*void*/ boxed) nothrow {
4156 g_boxed_free(boxed_type, UpCast!(void*)(boxed));
4160 // Unintrospectable function: boxed_type_register_static() / g_boxed_type_register_static()
4161 // This function creates a new %G_TYPE_BOXED derived type id for a new
4162 // boxed type with name @name. Boxed type handling functions have to be
4163 // provided to copy and free opaque boxed structures of this type.
4164 // RETURNS: New %G_TYPE_BOXED derived type id for @name.
4165 // <name>: Name of the new boxed type.
4166 // <boxed_copy>: Boxed structure copy function.
4167 // <boxed_free>: Boxed structure free function.
4168 static Type boxed_type_register_static(AT0)(AT0 /*char*/ name, BoxedCopyFunc boxed_copy, BoxedFreeFunc boxed_free) nothrow {
4169 return g_boxed_type_register_static(toCString!(char*)(name), boxed_copy, boxed_free);
4172 // MOVED TO: CClosure.marshal_BOOLEAN__BOXED_BOXED
4173 static void cclosure_marshal_BOOLEAN__BOXED_BOXED(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4174 g_cclosure_marshal_BOOLEAN__BOXED_BOXED(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4178 // MOVED TO: CClosure.marshal_BOOLEAN__FLAGS
4179 // A marshaller for a #GCClosure with a callback of type
4180 // <literal>gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter
4181 // denotes a flags type.
4182 // <closure>: the #GClosure to which the marshaller belongs
4183 // <return_value>: a #GValue which can store the returned #gboolean
4184 // <n_param_values>: 2
4185 // <param_values>: a #GValue array holding instance and arg1
4186 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4187 // <marshal_data>: additional data specified when registering the marshaller
4188 static void cclosure_marshal_BOOLEAN__FLAGS(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4189 g_cclosure_marshal_BOOLEAN__FLAGS(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4193 // MOVED TO: CClosure.marshal_STRING__OBJECT_POINTER
4194 // A marshaller for a #GCClosure with a callback of type
4195 // <literal>gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data)</literal>.
4196 // <closure>: the #GClosure to which the marshaller belongs
4197 // <return_value>: a #GValue, which can store the returned string
4198 // <n_param_values>: 3
4199 // <param_values>: a #GValue array holding instance, arg1 and arg2
4200 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4201 // <marshal_data>: additional data specified when registering the marshaller
4202 static void cclosure_marshal_STRING__OBJECT_POINTER(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4203 g_cclosure_marshal_STRING__OBJECT_POINTER(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4207 // MOVED TO: CClosure.marshal_VOID__BOOLEAN
4208 // A marshaller for a #GCClosure with a callback of type
4209 // <literal>void (*callback) (gpointer instance, gboolean arg1, gpointer user_data)</literal>.
4210 // <closure>: the #GClosure to which the marshaller belongs
4211 // <return_value>: ignored
4212 // <n_param_values>: 2
4213 // <param_values>: a #GValue array holding the instance and the #gboolean parameter
4214 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4215 // <marshal_data>: additional data specified when registering the marshaller
4216 static void cclosure_marshal_VOID__BOOLEAN(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4217 g_cclosure_marshal_VOID__BOOLEAN(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4221 // MOVED TO: CClosure.marshal_VOID__BOXED
4222 // A marshaller for a #GCClosure with a callback of type
4223 // <literal>void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data)</literal>.
4224 // <closure>: the #GClosure to which the marshaller belongs
4225 // <return_value>: ignored
4226 // <n_param_values>: 2
4227 // <param_values>: a #GValue array holding the instance and the #GBoxed* parameter
4228 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4229 // <marshal_data>: additional data specified when registering the marshaller
4230 static void cclosure_marshal_VOID__BOXED(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4231 g_cclosure_marshal_VOID__BOXED(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4235 // MOVED TO: CClosure.marshal_VOID__CHAR
4236 // A marshaller for a #GCClosure with a callback of type
4237 // <literal>void (*callback) (gpointer instance, gchar arg1, gpointer user_data)</literal>.
4238 // <closure>: the #GClosure to which the marshaller belongs
4239 // <return_value>: ignored
4240 // <n_param_values>: 2
4241 // <param_values>: a #GValue array holding the instance and the #gchar parameter
4242 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4243 // <marshal_data>: additional data specified when registering the marshaller
4244 static void cclosure_marshal_VOID__CHAR(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4245 g_cclosure_marshal_VOID__CHAR(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4249 // MOVED TO: CClosure.marshal_VOID__DOUBLE
4250 // A marshaller for a #GCClosure with a callback of type
4251 // <literal>void (*callback) (gpointer instance, gdouble arg1, gpointer user_data)</literal>.
4252 // <closure>: the #GClosure to which the marshaller belongs
4253 // <return_value>: ignored
4254 // <n_param_values>: 2
4255 // <param_values>: a #GValue array holding the instance and the #gdouble parameter
4256 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4257 // <marshal_data>: additional data specified when registering the marshaller
4258 static void cclosure_marshal_VOID__DOUBLE(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4259 g_cclosure_marshal_VOID__DOUBLE(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4263 // MOVED TO: CClosure.marshal_VOID__ENUM
4264 // A marshaller for a #GCClosure with a callback of type
4265 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter denotes an enumeration type..
4266 // <closure>: the #GClosure to which the marshaller belongs
4267 // <return_value>: ignored
4268 // <n_param_values>: 2
4269 // <param_values>: a #GValue array holding the instance and the enumeration parameter
4270 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4271 // <marshal_data>: additional data specified when registering the marshaller
4272 static void cclosure_marshal_VOID__ENUM(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4273 g_cclosure_marshal_VOID__ENUM(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4277 // MOVED TO: CClosure.marshal_VOID__FLAGS
4278 // A marshaller for a #GCClosure with a callback of type
4279 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter denotes a flags type.
4280 // <closure>: the #GClosure to which the marshaller belongs
4281 // <return_value>: ignored
4282 // <n_param_values>: 2
4283 // <param_values>: a #GValue array holding the instance and the flags parameter
4284 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4285 // <marshal_data>: additional data specified when registering the marshaller
4286 static void cclosure_marshal_VOID__FLAGS(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4287 g_cclosure_marshal_VOID__FLAGS(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4291 // MOVED TO: CClosure.marshal_VOID__FLOAT
4292 // A marshaller for a #GCClosure with a callback of type
4293 // <literal>void (*callback) (gpointer instance, gfloat arg1, gpointer user_data)</literal>.
4294 // <closure>: the #GClosure to which the marshaller belongs
4295 // <return_value>: ignored
4296 // <n_param_values>: 2
4297 // <param_values>: a #GValue array holding the instance and the #gfloat parameter
4298 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4299 // <marshal_data>: additional data specified when registering the marshaller
4300 static void cclosure_marshal_VOID__FLOAT(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4301 g_cclosure_marshal_VOID__FLOAT(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4305 // MOVED TO: CClosure.marshal_VOID__INT
4306 // A marshaller for a #GCClosure with a callback of type
4307 // <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal>.
4308 // <closure>: the #GClosure to which the marshaller belongs
4309 // <return_value>: ignored
4310 // <n_param_values>: 2
4311 // <param_values>: a #GValue array holding the instance and the #gint parameter
4312 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4313 // <marshal_data>: additional data specified when registering the marshaller
4314 static void cclosure_marshal_VOID__INT(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4315 g_cclosure_marshal_VOID__INT(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4319 // MOVED TO: CClosure.marshal_VOID__LONG
4320 // A marshaller for a #GCClosure with a callback of type
4321 // <literal>void (*callback) (gpointer instance, glong arg1, gpointer user_data)</literal>.
4322 // <closure>: the #GClosure to which the marshaller belongs
4323 // <return_value>: ignored
4324 // <n_param_values>: 2
4325 // <param_values>: a #GValue array holding the instance and the #glong parameter
4326 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4327 // <marshal_data>: additional data specified when registering the marshaller
4328 static void cclosure_marshal_VOID__LONG(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4329 g_cclosure_marshal_VOID__LONG(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4333 // MOVED TO: CClosure.marshal_VOID__OBJECT
4334 // A marshaller for a #GCClosure with a callback of type
4335 // <literal>void (*callback) (gpointer instance, GObject *arg1, gpointer user_data)</literal>.
4336 // <closure>: the #GClosure to which the marshaller belongs
4337 // <return_value>: ignored
4338 // <n_param_values>: 2
4339 // <param_values>: a #GValue array holding the instance and the #GObject* parameter
4340 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4341 // <marshal_data>: additional data specified when registering the marshaller
4342 static void cclosure_marshal_VOID__OBJECT(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4343 g_cclosure_marshal_VOID__OBJECT(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4347 // MOVED TO: CClosure.marshal_VOID__PARAM
4348 // A marshaller for a #GCClosure with a callback of type
4349 // <literal>void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data)</literal>.
4350 // <closure>: the #GClosure to which the marshaller belongs
4351 // <return_value>: ignored
4352 // <n_param_values>: 2
4353 // <param_values>: a #GValue array holding the instance and the #GParamSpec* parameter
4354 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4355 // <marshal_data>: additional data specified when registering the marshaller
4356 static void cclosure_marshal_VOID__PARAM(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4357 g_cclosure_marshal_VOID__PARAM(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4361 // MOVED TO: CClosure.marshal_VOID__POINTER
4362 // A marshaller for a #GCClosure with a callback of type
4363 // <literal>void (*callback) (gpointer instance, gpointer arg1, gpointer user_data)</literal>.
4364 // <closure>: the #GClosure to which the marshaller belongs
4365 // <return_value>: ignored
4366 // <n_param_values>: 2
4367 // <param_values>: a #GValue array holding the instance and the #gpointer parameter
4368 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4369 // <marshal_data>: additional data specified when registering the marshaller
4370 static void cclosure_marshal_VOID__POINTER(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4371 g_cclosure_marshal_VOID__POINTER(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4375 // MOVED TO: CClosure.marshal_VOID__STRING
4376 // A marshaller for a #GCClosure with a callback of type
4377 // <literal>void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data)</literal>.
4378 // <closure>: the #GClosure to which the marshaller belongs
4379 // <return_value>: ignored
4380 // <n_param_values>: 2
4381 // <param_values>: a #GValue array holding the instance and the #gchar* parameter
4382 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4383 // <marshal_data>: additional data specified when registering the marshaller
4384 static void cclosure_marshal_VOID__STRING(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4385 g_cclosure_marshal_VOID__STRING(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4389 // MOVED TO: CClosure.marshal_VOID__UCHAR
4390 // A marshaller for a #GCClosure with a callback of type
4391 // <literal>void (*callback) (gpointer instance, guchar arg1, gpointer user_data)</literal>.
4392 // <closure>: the #GClosure to which the marshaller belongs
4393 // <return_value>: ignored
4394 // <n_param_values>: 2
4395 // <param_values>: a #GValue array holding the instance and the #guchar parameter
4396 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4397 // <marshal_data>: additional data specified when registering the marshaller
4398 static void cclosure_marshal_VOID__UCHAR(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4399 g_cclosure_marshal_VOID__UCHAR(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4403 // MOVED TO: CClosure.marshal_VOID__UINT
4404 // A marshaller for a #GCClosure with a callback of type
4405 // <literal>void (*callback) (gpointer instance, guint arg1, gpointer user_data)</literal>.
4406 // <closure>: the #GClosure to which the marshaller belongs
4407 // <return_value>: ignored
4408 // <n_param_values>: 2
4409 // <param_values>: a #GValue array holding the instance and the #guint parameter
4410 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4411 // <marshal_data>: additional data specified when registering the marshaller
4412 static void cclosure_marshal_VOID__UINT(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4413 g_cclosure_marshal_VOID__UINT(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4417 // MOVED TO: CClosure.marshal_VOID__UINT_POINTER
4418 // A marshaller for a #GCClosure with a callback of type
4419 // <literal>void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data)</literal>.
4420 // <closure>: the #GClosure to which the marshaller belongs
4421 // <return_value>: ignored
4422 // <n_param_values>: 3
4423 // <param_values>: a #GValue array holding instance, arg1 and arg2
4424 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4425 // <marshal_data>: additional data specified when registering the marshaller
4426 static void cclosure_marshal_VOID__UINT_POINTER(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4427 g_cclosure_marshal_VOID__UINT_POINTER(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4431 // MOVED TO: CClosure.marshal_VOID__ULONG
4432 // A marshaller for a #GCClosure with a callback of type
4433 // <literal>void (*callback) (gpointer instance, gulong arg1, gpointer user_data)</literal>.
4434 // <closure>: the #GClosure to which the marshaller belongs
4435 // <return_value>: ignored
4436 // <n_param_values>: 2
4437 // <param_values>: a #GValue array holding the instance and the #gulong parameter
4438 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4439 // <marshal_data>: additional data specified when registering the marshaller
4440 static void cclosure_marshal_VOID__ULONG(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4441 g_cclosure_marshal_VOID__ULONG(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4445 // VERSION: 2.26
4446 // MOVED TO: CClosure.marshal_VOID__VARIANT
4447 // A marshaller for a #GCClosure with a callback of type
4448 // <literal>void (*callback) (gpointer instance, GVariant *arg1, gpointer user_data)</literal>.
4449 // <closure>: the #GClosure to which the marshaller belongs
4450 // <return_value>: ignored
4451 // <n_param_values>: 2
4452 // <param_values>: a #GValue array holding the instance and the #GVariant* parameter
4453 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4454 // <marshal_data>: additional data specified when registering the marshaller
4455 static void cclosure_marshal_VOID__VARIANT(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4456 g_cclosure_marshal_VOID__VARIANT(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4460 // MOVED TO: CClosure.marshal_VOID__VOID
4461 // A marshaller for a #GCClosure with a callback of type
4462 // <literal>void (*callback) (gpointer instance, gpointer user_data)</literal>.
4463 // <closure>: the #GClosure to which the marshaller belongs
4464 // <return_value>: ignored
4465 // <n_param_values>: 1
4466 // <param_values>: a #GValue array holding only the instance
4467 // <invocation_hint>: the invocation hint given as the last argument to g_closure_invoke()
4468 // <marshal_data>: additional data specified when registering the marshaller
4469 static void cclosure_marshal_VOID__VOID(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_value, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4470 g_cclosure_marshal_VOID__VOID(UpCast!(Closure*)(closure), UpCast!(Value*)(return_value), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4474 // VERSION: 2.30
4475 // MOVED TO: CClosure.marshal_generic
4476 // A generic marshaller function implemented via <ulink
4477 // url="http://sourceware.org/libffi/">libffi</ulink>.
4478 // <closure>: A #GClosure.
4479 // <return_gvalue>: A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
4480 // <n_param_values>: The length of the @param_values array.
4481 // <param_values>: An array of #GValue<!-- -->s holding the arguments on which to invoke the callback of closure.
4482 // <invocation_hint>: The invocation hint given as the last argument to g_closure_invoke().
4483 // <marshal_data>: Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
4484 static void cclosure_marshal_generic(AT0, AT1, AT2, AT3, AT4)(AT0 /*Closure*/ closure, AT1 /*Value*/ return_gvalue, uint n_param_values, AT2 /*Value*/ param_values, AT3 /*void*/ invocation_hint, AT4 /*void*/ marshal_data) nothrow {
4485 g_cclosure_marshal_generic(UpCast!(Closure*)(closure), UpCast!(Value*)(return_gvalue), n_param_values, UpCast!(Value*)(param_values), UpCast!(void*)(invocation_hint), UpCast!(void*)(marshal_data));
4489 // Unintrospectable function: cclosure_new() / g_cclosure_new()
4490 // MOVED TO: CClosure.new
4491 // Creates a new closure which invokes @callback_func with @user_data as
4492 // the last parameter.
4493 // RETURNS: a new #GCClosure
4494 // <callback_func>: the function to invoke
4495 // <user_data>: user data to pass to @callback_func
4496 // <destroy_data>: destroy notify to be called when @user_data is no longer used
4497 static Closure* /*new*/ cclosure_new(AT0)(Callback callback_func, AT0 /*void*/ user_data, ClosureNotify destroy_data) nothrow {
4498 return g_cclosure_new(callback_func, UpCast!(void*)(user_data), destroy_data);
4502 // Unintrospectable function: cclosure_new_object() / g_cclosure_new_object()
4503 // MOVED TO: CClosure.new_object
4504 // A variant of g_cclosure_new() which uses @object as @user_data and
4505 // calls g_object_watch_closure() on @object and the created
4506 // closure. This function is useful when you have a callback closely
4507 // associated with a #GObject, and want the callback to no longer run
4508 // after the object is is freed.
4509 // RETURNS: a new #GCClosure
4510 // <callback_func>: the function to invoke
4511 // <object>: a #GObject pointer to pass to @callback_func
4512 static Closure* /*new*/ cclosure_new_object(AT0)(Callback callback_func, AT0 /*Object*/ object) nothrow {
4513 return g_cclosure_new_object(callback_func, UpCast!(Object*)(object));
4517 // Unintrospectable function: cclosure_new_object_swap() / g_cclosure_new_object_swap()
4518 // MOVED TO: CClosure.new_object_swap
4519 // A variant of g_cclosure_new_swap() which uses @object as @user_data
4520 // and calls g_object_watch_closure() on @object and the created
4521 // closure. This function is useful when you have a callback closely
4522 // associated with a #GObject, and want the callback to no longer run
4523 // after the object is is freed.
4524 // RETURNS: a new #GCClosure
4525 // <callback_func>: the function to invoke
4526 // <object>: a #GObject pointer to pass to @callback_func
4527 static Closure* /*new*/ cclosure_new_object_swap(AT0)(Callback callback_func, AT0 /*Object*/ object) nothrow {
4528 return g_cclosure_new_object_swap(callback_func, UpCast!(Object*)(object));
4532 // Unintrospectable function: cclosure_new_swap() / g_cclosure_new_swap()
4533 // MOVED TO: CClosure.new_swap
4534 // Creates a new closure which invokes @callback_func with @user_data as
4535 // the first parameter.
4536 // RETURNS: a new #GCClosure
4537 // <callback_func>: the function to invoke
4538 // <user_data>: user data to pass to @callback_func
4539 // <destroy_data>: destroy notify to be called when @user_data is no longer used
4540 static Closure* /*new*/ cclosure_new_swap(AT0)(Callback callback_func, AT0 /*void*/ user_data, ClosureNotify destroy_data) nothrow {
4541 return g_cclosure_new_swap(callback_func, UpCast!(void*)(user_data), destroy_data);
4545 // Unintrospectable function: clear_object() / g_clear_object()
4546 // VERSION: 2.28
4547 // Clears a reference to a #GObject.
4549 // @object_ptr must not be %NULL.
4551 // If the reference is %NULL then this function does nothing.
4552 // Otherwise, the reference count of the object is decreased and the
4553 // pointer is set to %NULL.
4555 // This function is threadsafe and modifies the pointer atomically,
4556 // using memory barriers where needed.
4558 // A macro is also included that allows this function to be used without
4559 // pointer casts.
4560 // <object_ptr>: a pointer to a #GObject reference
4561 static void clear_object(AT0)(AT0 /*Object**/ object_ptr) nothrow {
4562 g_clear_object(UpCast!(Object**)(object_ptr));
4566 // This function is meant to be called from the <literal>complete_type_info</literal>
4567 // function of a #GTypePlugin implementation, as in the following
4568 // example:
4570 // |[
4571 // static void
4572 // my_enum_complete_type_info (GTypePlugin *plugin,
4573 // GType g_type,
4574 // GTypeInfo *info,
4575 // GTypeValueTable *value_table)
4576 // {
4577 // static const GEnumValue values[] = {
4578 // { MY_ENUM_FOO, "MY_ENUM_FOO", "foo" },
4579 // { MY_ENUM_BAR, "MY_ENUM_BAR", "bar" },
4580 // { 0, NULL, NULL }
4581 // };
4583 // g_enum_complete_type_info (type, info, values);
4584 // }
4585 // ]|
4586 // <g_enum_type>: the type identifier of the type being completed
4587 // <info>: the #GTypeInfo struct to be filled in
4588 // <const_values>: An array of #GEnumValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0.
4589 static void enum_complete_type_info(AT0, AT1)(Type g_enum_type, AT0 /*GTypeInfo*/ info, AT1 /*EnumValue*/ const_values) nothrow {
4590 g_enum_complete_type_info(g_enum_type, UpCast!(GTypeInfo*)(info), UpCast!(EnumValue*)(const_values));
4594 // Unintrospectable function: enum_get_value() / g_enum_get_value()
4595 // Returns the #GEnumValue for a value.
4597 // member of the enumeration
4598 // RETURNS: the #GEnumValue for @value, or %NULL if @value is not a
4599 // <enum_class>: a #GEnumClass
4600 // <value>: the value to look up
4601 static EnumValue* enum_get_value(AT0)(AT0 /*EnumClass*/ enum_class, int value) nothrow {
4602 return g_enum_get_value(UpCast!(EnumClass*)(enum_class), value);
4606 // Unintrospectable function: enum_get_value_by_name() / g_enum_get_value_by_name()
4607 // Looks up a #GEnumValue by name.
4609 // enumeration doesn't have a member with that name
4610 // RETURNS: the #GEnumValue with name @name, or %NULL if the
4611 // <enum_class>: a #GEnumClass
4612 // <name>: the name to look up
4613 static EnumValue* enum_get_value_by_name(AT0, AT1)(AT0 /*EnumClass*/ enum_class, AT1 /*char*/ name) nothrow {
4614 return g_enum_get_value_by_name(UpCast!(EnumClass*)(enum_class), toCString!(char*)(name));
4618 // Unintrospectable function: enum_get_value_by_nick() / g_enum_get_value_by_nick()
4619 // Looks up a #GEnumValue by nickname.
4621 // enumeration doesn't have a member with that nickname
4622 // RETURNS: the #GEnumValue with nickname @nick, or %NULL if the
4623 // <enum_class>: a #GEnumClass
4624 // <nick>: the nickname to look up
4625 static EnumValue* enum_get_value_by_nick(AT0, AT1)(AT0 /*EnumClass*/ enum_class, AT1 /*char*/ nick) nothrow {
4626 return g_enum_get_value_by_nick(UpCast!(EnumClass*)(enum_class), toCString!(char*)(nick));
4630 // Registers a new static enumeration type with the name @name.
4632 // It is normally more convenient to let <link
4633 // linkend="glib-mkenums">glib-mkenums</link> generate a
4634 // my_enum_get_type() function from a usual C enumeration definition
4635 // than to write one yourself using g_enum_register_static().
4636 // RETURNS: The new type identifier.
4637 // <name>: A nul-terminated string used as the name of the new type.
4638 // <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.
4639 static Type enum_register_static(AT0, AT1)(AT0 /*char*/ name, AT1 /*EnumValue*/ const_static_values) nothrow {
4640 return g_enum_register_static(toCString!(char*)(name), UpCast!(EnumValue*)(const_static_values));
4644 // This function is meant to be called from the complete_type_info()
4645 // function of a #GTypePlugin implementation, see the example for
4646 // g_enum_complete_type_info() above.
4647 // <g_flags_type>: the type identifier of the type being completed
4648 // <info>: the #GTypeInfo struct to be filled in
4649 // <const_values>: An array of #GFlagsValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0.
4650 static void flags_complete_type_info(AT0, AT1)(Type g_flags_type, AT0 /*GTypeInfo*/ info, AT1 /*FlagsValue*/ const_values) nothrow {
4651 g_flags_complete_type_info(g_flags_type, UpCast!(GTypeInfo*)(info), UpCast!(FlagsValue*)(const_values));
4655 // Unintrospectable function: flags_get_first_value() / g_flags_get_first_value()
4656 // Returns the first #GFlagsValue which is set in @value.
4658 // none is set
4659 // RETURNS: the first #GFlagsValue which is set in @value, or %NULL if
4660 // <flags_class>: a #GFlagsClass
4661 // <value>: the value
4662 static FlagsValue* flags_get_first_value(AT0)(AT0 /*FlagsClass*/ flags_class, uint value) nothrow {
4663 return g_flags_get_first_value(UpCast!(FlagsClass*)(flags_class), value);
4667 // Unintrospectable function: flags_get_value_by_name() / g_flags_get_value_by_name()
4668 // Looks up a #GFlagsValue by name.
4670 // flag with that name
4671 // RETURNS: the #GFlagsValue with name @name, or %NULL if there is no
4672 // <flags_class>: a #GFlagsClass
4673 // <name>: the name to look up
4674 static FlagsValue* flags_get_value_by_name(AT0, AT1)(AT0 /*FlagsClass*/ flags_class, AT1 /*char*/ name) nothrow {
4675 return g_flags_get_value_by_name(UpCast!(FlagsClass*)(flags_class), toCString!(char*)(name));
4679 // Unintrospectable function: flags_get_value_by_nick() / g_flags_get_value_by_nick()
4680 // Looks up a #GFlagsValue by nickname.
4682 // no flag with that nickname
4683 // RETURNS: the #GFlagsValue with nickname @nick, or %NULL if there is
4684 // <flags_class>: a #GFlagsClass
4685 // <nick>: the nickname to look up
4686 static FlagsValue* flags_get_value_by_nick(AT0, AT1)(AT0 /*FlagsClass*/ flags_class, AT1 /*char*/ nick) nothrow {
4687 return g_flags_get_value_by_nick(UpCast!(FlagsClass*)(flags_class), toCString!(char*)(nick));
4691 // Registers a new static flags type with the name @name.
4693 // It is normally more convenient to let <link
4694 // linkend="glib-mkenums">glib-mkenums</link> generate a
4695 // my_flags_get_type() function from a usual C enumeration definition
4696 // than to write one yourself using g_flags_register_static().
4697 // RETURNS: The new type identifier.
4698 // <name>: A nul-terminated string used as the name of the new type.
4699 // <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.
4700 static Type flags_register_static(AT0, AT1)(AT0 /*char*/ name, AT1 /*FlagsValue*/ const_static_values) nothrow {
4701 return g_flags_register_static(toCString!(char*)(name), UpCast!(FlagsValue*)(const_static_values));
4704 static Type gtype_get_type()() nothrow {
4705 return g_gtype_get_type();
4709 // Unintrospectable function: param_spec_boolean() / g_param_spec_boolean()
4710 // Creates a new #GParamSpecBoolean instance specifying a %G_TYPE_BOOLEAN
4711 // property.
4713 // See g_param_spec_internal() for details on property names.
4714 // RETURNS: a newly created parameter specification
4715 // <name>: canonical name of the property specified
4716 // <nick>: nick name for the property specified
4717 // <blurb>: description of the property specified
4718 // <default_value>: default value for the property specified
4719 // <flags>: flags for the property specified
4720 static ParamSpec* param_spec_boolean(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, int default_value, ParamFlags flags) nothrow {
4721 return g_param_spec_boolean(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), default_value, flags);
4725 // Unintrospectable function: param_spec_boxed() / g_param_spec_boxed()
4726 // Creates a new #GParamSpecBoxed instance specifying a %G_TYPE_BOXED
4727 // derived property.
4729 // See g_param_spec_internal() for details on property names.
4730 // RETURNS: a newly created parameter specification
4731 // <name>: canonical name of the property specified
4732 // <nick>: nick name for the property specified
4733 // <blurb>: description of the property specified
4734 // <boxed_type>: %G_TYPE_BOXED derived type of this property
4735 // <flags>: flags for the property specified
4736 static ParamSpec* param_spec_boxed(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, Type boxed_type, ParamFlags flags) nothrow {
4737 return g_param_spec_boxed(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), boxed_type, flags);
4741 // Unintrospectable function: param_spec_char() / g_param_spec_char()
4742 // Creates a new #GParamSpecChar instance specifying a %G_TYPE_CHAR property.
4743 // RETURNS: a newly created parameter specification
4744 // <name>: canonical name of the property specified
4745 // <nick>: nick name for the property specified
4746 // <blurb>: description of the property specified
4747 // <minimum>: minimum value for the property specified
4748 // <maximum>: maximum value for the property specified
4749 // <default_value>: default value for the property specified
4750 // <flags>: flags for the property specified
4751 static ParamSpec* param_spec_char(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, byte minimum, byte maximum, byte default_value, ParamFlags flags) nothrow {
4752 return g_param_spec_char(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), minimum, maximum, default_value, flags);
4756 // Unintrospectable function: param_spec_double() / g_param_spec_double()
4757 // Creates a new #GParamSpecDouble instance specifying a %G_TYPE_DOUBLE
4758 // property.
4760 // See g_param_spec_internal() for details on property names.
4761 // RETURNS: a newly created parameter specification
4762 // <name>: canonical name of the property specified
4763 // <nick>: nick name for the property specified
4764 // <blurb>: description of the property specified
4765 // <minimum>: minimum value for the property specified
4766 // <maximum>: maximum value for the property specified
4767 // <default_value>: default value for the property specified
4768 // <flags>: flags for the property specified
4769 static ParamSpec* param_spec_double(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, double minimum, double maximum, double default_value, ParamFlags flags) nothrow {
4770 return g_param_spec_double(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), minimum, maximum, default_value, flags);
4774 // Unintrospectable function: param_spec_enum() / g_param_spec_enum()
4775 // Creates a new #GParamSpecEnum instance specifying a %G_TYPE_ENUM
4776 // property.
4778 // See g_param_spec_internal() for details on property names.
4779 // RETURNS: a newly created parameter specification
4780 // <name>: canonical name of the property specified
4781 // <nick>: nick name for the property specified
4782 // <blurb>: description of the property specified
4783 // <enum_type>: a #GType derived from %G_TYPE_ENUM
4784 // <default_value>: default value for the property specified
4785 // <flags>: flags for the property specified
4786 static ParamSpec* param_spec_enum(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, Type enum_type, int default_value, ParamFlags flags) nothrow {
4787 return g_param_spec_enum(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), enum_type, default_value, flags);
4791 // Unintrospectable function: param_spec_flags() / g_param_spec_flags()
4792 // Creates a new #GParamSpecFlags instance specifying a %G_TYPE_FLAGS
4793 // property.
4795 // See g_param_spec_internal() for details on property names.
4796 // RETURNS: a newly created parameter specification
4797 // <name>: canonical name of the property specified
4798 // <nick>: nick name for the property specified
4799 // <blurb>: description of the property specified
4800 // <flags_type>: a #GType derived from %G_TYPE_FLAGS
4801 // <default_value>: default value for the property specified
4802 // <flags>: flags for the property specified
4803 static ParamSpec* param_spec_flags(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, Type flags_type, uint default_value, ParamFlags flags) nothrow {
4804 return g_param_spec_flags(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), flags_type, default_value, flags);
4808 // Unintrospectable function: param_spec_float() / g_param_spec_float()
4809 // Creates a new #GParamSpecFloat instance specifying a %G_TYPE_FLOAT property.
4811 // See g_param_spec_internal() for details on property names.
4812 // RETURNS: a newly created parameter specification
4813 // <name>: canonical name of the property specified
4814 // <nick>: nick name for the property specified
4815 // <blurb>: description of the property specified
4816 // <minimum>: minimum value for the property specified
4817 // <maximum>: maximum value for the property specified
4818 // <default_value>: default value for the property specified
4819 // <flags>: flags for the property specified
4820 static ParamSpec* param_spec_float(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, float minimum, float maximum, float default_value, ParamFlags flags) nothrow {
4821 return g_param_spec_float(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), minimum, maximum, default_value, flags);
4825 // Unintrospectable function: param_spec_gtype() / g_param_spec_gtype()
4826 // VERSION: 2.10
4827 // Creates a new #GParamSpecGType instance specifying a
4828 // %G_TYPE_GTYPE property.
4830 // See g_param_spec_internal() for details on property names.
4831 // RETURNS: a newly created parameter specification
4832 // <name>: canonical name of the property specified
4833 // <nick>: nick name for the property specified
4834 // <blurb>: description of the property specified
4835 // <is_a_type>: a #GType whose subtypes are allowed as values of the property (use %G_TYPE_NONE for any type)
4836 // <flags>: flags for the property specified
4837 static ParamSpec* param_spec_gtype(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, Type is_a_type, ParamFlags flags) nothrow {
4838 return g_param_spec_gtype(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), is_a_type, flags);
4842 // Unintrospectable function: param_spec_int() / g_param_spec_int()
4843 // Creates a new #GParamSpecInt instance specifying a %G_TYPE_INT property.
4845 // See g_param_spec_internal() for details on property names.
4846 // RETURNS: a newly created parameter specification
4847 // <name>: canonical name of the property specified
4848 // <nick>: nick name for the property specified
4849 // <blurb>: description of the property specified
4850 // <minimum>: minimum value for the property specified
4851 // <maximum>: maximum value for the property specified
4852 // <default_value>: default value for the property specified
4853 // <flags>: flags for the property specified
4854 static ParamSpec* param_spec_int(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, int minimum, int maximum, int default_value, ParamFlags flags) nothrow {
4855 return g_param_spec_int(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), minimum, maximum, default_value, flags);
4859 // Unintrospectable function: param_spec_int64() / g_param_spec_int64()
4860 // Creates a new #GParamSpecInt64 instance specifying a %G_TYPE_INT64 property.
4862 // See g_param_spec_internal() for details on property names.
4863 // RETURNS: a newly created parameter specification
4864 // <name>: canonical name of the property specified
4865 // <nick>: nick name for the property specified
4866 // <blurb>: description of the property specified
4867 // <minimum>: minimum value for the property specified
4868 // <maximum>: maximum value for the property specified
4869 // <default_value>: default value for the property specified
4870 // <flags>: flags for the property specified
4871 static ParamSpec* param_spec_int64(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, long minimum, long maximum, long default_value, ParamFlags flags) nothrow {
4872 return g_param_spec_int64(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), minimum, maximum, default_value, flags);
4876 // Unintrospectable function: param_spec_long() / g_param_spec_long()
4877 // Creates a new #GParamSpecLong instance specifying a %G_TYPE_LONG property.
4879 // See g_param_spec_internal() for details on property names.
4880 // RETURNS: a newly created parameter specification
4881 // <name>: canonical name of the property specified
4882 // <nick>: nick name for the property specified
4883 // <blurb>: description of the property specified
4884 // <minimum>: minimum value for the property specified
4885 // <maximum>: maximum value for the property specified
4886 // <default_value>: default value for the property specified
4887 // <flags>: flags for the property specified
4888 static ParamSpec* param_spec_long(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, c_long minimum, c_long maximum, c_long default_value, ParamFlags flags) nothrow {
4889 return g_param_spec_long(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), minimum, maximum, default_value, flags);
4893 // Unintrospectable function: param_spec_object() / g_param_spec_object()
4894 // Creates a new #GParamSpecBoxed instance specifying a %G_TYPE_OBJECT
4895 // derived property.
4897 // See g_param_spec_internal() for details on property names.
4898 // RETURNS: a newly created parameter specification
4899 // <name>: canonical name of the property specified
4900 // <nick>: nick name for the property specified
4901 // <blurb>: description of the property specified
4902 // <object_type>: %G_TYPE_OBJECT derived type of this property
4903 // <flags>: flags for the property specified
4904 static ParamSpec* param_spec_object(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, Type object_type, ParamFlags flags) nothrow {
4905 return g_param_spec_object(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), object_type, flags);
4909 // Unintrospectable function: param_spec_override() / g_param_spec_override()
4910 // VERSION: 2.4
4911 // Creates a new property of type #GParamSpecOverride. This is used
4912 // to direct operations to another paramspec, and will not be directly
4913 // useful unless you are implementing a new base type similar to GObject.
4914 // RETURNS: the newly created #GParamSpec
4915 // <name>: the name of the property.
4916 // <overridden>: The property that is being overridden
4917 static ParamSpec* param_spec_override(AT0, AT1)(AT0 /*char*/ name, AT1 /*ParamSpec*/ overridden) nothrow {
4918 return g_param_spec_override(toCString!(char*)(name), UpCast!(ParamSpec*)(overridden));
4922 // Unintrospectable function: param_spec_param() / g_param_spec_param()
4923 // Creates a new #GParamSpecParam instance specifying a %G_TYPE_PARAM
4924 // property.
4926 // See g_param_spec_internal() for details on property names.
4927 // RETURNS: a newly created parameter specification
4928 // <name>: canonical name of the property specified
4929 // <nick>: nick name for the property specified
4930 // <blurb>: description of the property specified
4931 // <param_type>: a #GType derived from %G_TYPE_PARAM
4932 // <flags>: flags for the property specified
4933 static ParamSpec* param_spec_param(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, Type param_type, ParamFlags flags) nothrow {
4934 return g_param_spec_param(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), param_type, flags);
4938 // Unintrospectable function: param_spec_pointer() / g_param_spec_pointer()
4939 // Creates a new #GParamSpecPointer instance specifying a pointer property.
4941 // See g_param_spec_internal() for details on property names.
4942 // RETURNS: a newly created parameter specification
4943 // <name>: canonical name of the property specified
4944 // <nick>: nick name for the property specified
4945 // <blurb>: description of the property specified
4946 // <flags>: flags for the property specified
4947 static ParamSpec* param_spec_pointer(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, ParamFlags flags) nothrow {
4948 return g_param_spec_pointer(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), flags);
4952 // MOVED TO: ParamSpecPool.new
4953 // Creates a new #GParamSpecPool.
4955 // If @type_prefixing is %TRUE, lookups in the newly created pool will
4956 // allow to specify the owner as a colon-separated prefix of the
4957 // property name, like "GtkContainer:border-width". This feature is
4958 // deprecated, so you should always set @type_prefixing to %FALSE.
4959 // RETURNS: a newly allocated #GParamSpecPool.
4960 // <type_prefixing>: Whether the pool will support type-prefixed property names.
4961 static ParamSpecPool* param_spec_pool_new()(int type_prefixing) nothrow {
4962 return g_param_spec_pool_new(type_prefixing);
4966 // Unintrospectable function: param_spec_string() / g_param_spec_string()
4967 // Creates a new #GParamSpecString instance.
4969 // See g_param_spec_internal() for details on property names.
4970 // RETURNS: a newly created parameter specification
4971 // <name>: canonical name of the property specified
4972 // <nick>: nick name for the property specified
4973 // <blurb>: description of the property specified
4974 // <default_value>: default value for the property specified
4975 // <flags>: flags for the property specified
4976 static ParamSpec* param_spec_string(AT0, AT1, AT2, AT3)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, AT3 /*char*/ default_value, ParamFlags flags) nothrow {
4977 return g_param_spec_string(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), toCString!(char*)(default_value), flags);
4981 // Unintrospectable function: param_spec_uchar() / g_param_spec_uchar()
4982 // Creates a new #GParamSpecUChar instance specifying a %G_TYPE_UCHAR property.
4983 // RETURNS: a newly created parameter specification
4984 // <name>: canonical name of the property specified
4985 // <nick>: nick name for the property specified
4986 // <blurb>: description of the property specified
4987 // <minimum>: minimum value for the property specified
4988 // <maximum>: maximum value for the property specified
4989 // <default_value>: default value for the property specified
4990 // <flags>: flags for the property specified
4991 static ParamSpec* param_spec_uchar(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, ubyte minimum, ubyte maximum, ubyte default_value, ParamFlags flags) nothrow {
4992 return g_param_spec_uchar(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), minimum, maximum, default_value, flags);
4996 // Unintrospectable function: param_spec_uint() / g_param_spec_uint()
4997 // Creates a new #GParamSpecUInt instance specifying a %G_TYPE_UINT property.
4999 // See g_param_spec_internal() for details on property names.
5000 // RETURNS: a newly created parameter specification
5001 // <name>: canonical name of the property specified
5002 // <nick>: nick name for the property specified
5003 // <blurb>: description of the property specified
5004 // <minimum>: minimum value for the property specified
5005 // <maximum>: maximum value for the property specified
5006 // <default_value>: default value for the property specified
5007 // <flags>: flags for the property specified
5008 static ParamSpec* param_spec_uint(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, uint minimum, uint maximum, uint default_value, ParamFlags flags) nothrow {
5009 return g_param_spec_uint(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), minimum, maximum, default_value, flags);
5013 // Unintrospectable function: param_spec_uint64() / g_param_spec_uint64()
5014 // Creates a new #GParamSpecUInt64 instance specifying a %G_TYPE_UINT64
5015 // property.
5017 // See g_param_spec_internal() for details on property names.
5018 // RETURNS: a newly created parameter specification
5019 // <name>: canonical name of the property specified
5020 // <nick>: nick name for the property specified
5021 // <blurb>: description of the property specified
5022 // <minimum>: minimum value for the property specified
5023 // <maximum>: maximum value for the property specified
5024 // <default_value>: default value for the property specified
5025 // <flags>: flags for the property specified
5026 static ParamSpec* param_spec_uint64(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, ulong minimum, ulong maximum, ulong default_value, ParamFlags flags) nothrow {
5027 return g_param_spec_uint64(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), minimum, maximum, default_value, flags);
5031 // Unintrospectable function: param_spec_ulong() / g_param_spec_ulong()
5032 // Creates a new #GParamSpecULong instance specifying a %G_TYPE_ULONG
5033 // property.
5035 // See g_param_spec_internal() for details on property names.
5036 // RETURNS: a newly created parameter specification
5037 // <name>: canonical name of the property specified
5038 // <nick>: nick name for the property specified
5039 // <blurb>: description of the property specified
5040 // <minimum>: minimum value for the property specified
5041 // <maximum>: maximum value for the property specified
5042 // <default_value>: default value for the property specified
5043 // <flags>: flags for the property specified
5044 static ParamSpec* param_spec_ulong(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, c_ulong minimum, c_ulong maximum, c_ulong default_value, ParamFlags flags) nothrow {
5045 return g_param_spec_ulong(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), minimum, maximum, default_value, flags);
5049 // Unintrospectable function: param_spec_unichar() / g_param_spec_unichar()
5050 // Creates a new #GParamSpecUnichar instance specifying a %G_TYPE_UINT
5051 // property. #GValue structures for this property can be accessed with
5052 // g_value_set_uint() and g_value_get_uint().
5054 // See g_param_spec_internal() for details on property names.
5055 // RETURNS: a newly created parameter specification
5056 // <name>: canonical name of the property specified
5057 // <nick>: nick name for the property specified
5058 // <blurb>: description of the property specified
5059 // <default_value>: default value for the property specified
5060 // <flags>: flags for the property specified
5061 static ParamSpec* param_spec_unichar(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, dchar default_value, ParamFlags flags) nothrow {
5062 return g_param_spec_unichar(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), default_value, flags);
5066 // Unintrospectable function: param_spec_value_array() / g_param_spec_value_array()
5067 // Creates a new #GParamSpecValueArray instance specifying a
5068 // %G_TYPE_VALUE_ARRAY property. %G_TYPE_VALUE_ARRAY is a
5069 // %G_TYPE_BOXED type, as such, #GValue structures for this property
5070 // can be accessed with g_value_set_boxed() and g_value_get_boxed().
5072 // See g_param_spec_internal() for details on property names.
5073 // RETURNS: a newly created parameter specification
5074 // <name>: canonical name of the property specified
5075 // <nick>: nick name for the property specified
5076 // <blurb>: description of the property specified
5077 // <element_spec>: a #GParamSpec describing the elements contained in arrays of this property, may be %NULL
5078 // <flags>: flags for the property specified
5079 static ParamSpec* param_spec_value_array(AT0, AT1, AT2, AT3)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, AT3 /*ParamSpec*/ element_spec, ParamFlags flags) nothrow {
5080 return g_param_spec_value_array(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), UpCast!(ParamSpec*)(element_spec), flags);
5084 // Unintrospectable function: param_spec_variant() / g_param_spec_variant()
5085 // VERSION: 2.26
5086 // Creates a new #GParamSpecVariant instance specifying a #GVariant
5087 // property.
5089 // If @default_value is floating, it is consumed.
5091 // See g_param_spec_internal() for details on property names.
5092 // RETURNS: the newly created #GParamSpec
5093 // <name>: canonical name of the property specified
5094 // <nick>: nick name for the property specified
5095 // <blurb>: description of the property specified
5096 // <type>: a #GVariantType
5097 // <default_value>: a #GVariant of type @type to use as the default value, or %NULL
5098 // <flags>: flags for the property specified
5099 static ParamSpec* param_spec_variant(AT0, AT1, AT2, AT3, AT4)(AT0 /*char*/ name, AT1 /*char*/ nick, AT2 /*char*/ blurb, AT3 /*GLib2.VariantType*/ type, AT4 /*GLib2.Variant*/ default_value, ParamFlags flags) nothrow {
5100 return g_param_spec_variant(toCString!(char*)(name), toCString!(char*)(nick), toCString!(char*)(blurb), UpCast!(GLib2.VariantType*)(type), UpCast!(GLib2.Variant*)(default_value), flags);
5104 // Registers @name as the name of a new static type derived from
5105 // #G_TYPE_PARAM. The type system uses the information contained in
5106 // the #GParamSpecTypeInfo structure pointed to by @info to manage the
5107 // #GParamSpec type and its instances.
5108 // RETURNS: The new type identifier.
5109 // <name>: 0-terminated string used as the name of the new #GParamSpec type.
5110 // <pspec_info>: The #GParamSpecTypeInfo for this #GParamSpec type.
5111 static Type param_type_register_static(AT0, AT1)(AT0 /*char*/ name, AT1 /*ParamSpecTypeInfo*/ pspec_info) nothrow {
5112 return g_param_type_register_static(toCString!(char*)(name), UpCast!(ParamSpecTypeInfo*)(pspec_info));
5116 // Transforms @src_value into @dest_value if possible, and then
5117 // validates @dest_value, in order for it to conform to @pspec. If
5118 // @strict_validation is %TRUE this function will only succeed if the
5119 // transformed @dest_value complied to @pspec without modifications.
5121 // See also g_value_type_transformable(), g_value_transform() and
5122 // g_param_value_validate().
5124 // %FALSE otherwise and @dest_value is left untouched.
5125 // RETURNS: %TRUE if transformation and validation were successful,
5126 // <pspec>: a valid #GParamSpec
5127 // <src_value>: souce #GValue
5128 // <dest_value>: destination #GValue of correct type for @pspec
5129 // <strict_validation>: %TRUE requires @dest_value to conform to @pspec without modifications
5130 static int param_value_convert(AT0, AT1, AT2)(AT0 /*ParamSpec*/ pspec, AT1 /*Value*/ src_value, AT2 /*Value*/ dest_value, int strict_validation) nothrow {
5131 return g_param_value_convert(UpCast!(ParamSpec*)(pspec), UpCast!(Value*)(src_value), UpCast!(Value*)(dest_value), strict_validation);
5135 // Checks whether @value contains the default value as specified in @pspec.
5136 // RETURNS: whether @value contains the canonical default for this @pspec
5137 // <pspec>: a valid #GParamSpec
5138 // <value>: a #GValue of correct type for @pspec
5139 static int param_value_defaults(AT0, AT1)(AT0 /*ParamSpec*/ pspec, AT1 /*Value*/ value) nothrow {
5140 return g_param_value_defaults(UpCast!(ParamSpec*)(pspec), UpCast!(Value*)(value));
5144 // Sets @value to its default value as specified in @pspec.
5145 // <pspec>: a valid #GParamSpec
5146 // <value>: a #GValue of correct type for @pspec
5147 static void param_value_set_default(AT0, AT1)(AT0 /*ParamSpec*/ pspec, AT1 /*Value*/ value) nothrow {
5148 g_param_value_set_default(UpCast!(ParamSpec*)(pspec), UpCast!(Value*)(value));
5152 // Ensures that the contents of @value comply with the specifications
5153 // set out by @pspec. For example, a #GParamSpecInt might require
5154 // that integers stored in @value may not be smaller than -42 and not be
5155 // greater than +42. If @value contains an integer outside of this range,
5156 // it is modified accordingly, so the resulting value will fit into the
5157 // range -42 .. +42.
5158 // RETURNS: whether modifying @value was necessary to ensure validity
5159 // <pspec>: a valid #GParamSpec
5160 // <value>: a #GValue of correct type for @pspec
5161 static int param_value_validate(AT0, AT1)(AT0 /*ParamSpec*/ pspec, AT1 /*Value*/ value) nothrow {
5162 return g_param_value_validate(UpCast!(ParamSpec*)(pspec), UpCast!(Value*)(value));
5166 // Compares @value1 with @value2 according to @pspec, and return -1, 0 or +1,
5167 // if @value1 is found to be less than, equal to or greater than @value2,
5168 // respectively.
5169 // RETURNS: -1, 0 or +1, for a less than, equal to or greater than result
5170 // <pspec>: a valid #GParamSpec
5171 // <value1>: a #GValue of correct type for @pspec
5172 // <value2>: a #GValue of correct type for @pspec
5173 static int param_values_cmp(AT0, AT1, AT2)(AT0 /*ParamSpec*/ pspec, AT1 /*Value*/ value1, AT2 /*Value*/ value2) nothrow {
5174 return g_param_values_cmp(UpCast!(ParamSpec*)(pspec), UpCast!(Value*)(value1), UpCast!(Value*)(value2));
5178 // Creates a new %G_TYPE_POINTER derived type id for a new
5179 // pointer type with name @name.
5180 // RETURNS: a new %G_TYPE_POINTER derived type id for @name.
5181 // <name>: the name of the new pointer type.
5182 static Type pointer_type_register_static(AT0)(AT0 /*char*/ name) nothrow {
5183 return g_pointer_type_register_static(toCString!(char*)(name));
5187 // VERSION: 2.28
5188 // A predefined #GSignalAccumulator for signals intended to be used as a
5189 // hook for application code to provide a particular value. Usually
5190 // only one such value is desired and multiple handlers for the same
5191 // signal don't make much sense (except for the case of the default
5192 // handler defined in the class structure, in which case you will
5193 // usually want the signal connection to override the class handler).
5195 // This accumulator will use the return value from the first signal
5196 // handler that is run as the return value for the signal and not run
5197 // any further handlers (ie: the first handler "wins").
5198 // RETURNS: standard #GSignalAccumulator result
5199 // <ihint>: standard #GSignalAccumulator parameter
5200 // <return_accu>: standard #GSignalAccumulator parameter
5201 // <handler_return>: standard #GSignalAccumulator parameter
5202 // <dummy>: standard #GSignalAccumulator parameter
5203 static int signal_accumulator_first_wins(AT0, AT1, AT2, AT3)(AT0 /*SignalInvocationHint*/ ihint, AT1 /*Value*/ return_accu, AT2 /*Value*/ handler_return, AT3 /*void*/ dummy) nothrow {
5204 return g_signal_accumulator_first_wins(UpCast!(SignalInvocationHint*)(ihint), UpCast!(Value*)(return_accu), UpCast!(Value*)(handler_return), UpCast!(void*)(dummy));
5208 // VERSION: 2.4
5209 // A predefined #GSignalAccumulator for signals that return a
5210 // boolean values. The behavior that this accumulator gives is
5211 // that a return of %TRUE stops the signal emission: no further
5212 // callbacks will be invoked, while a return of %FALSE allows
5213 // the emission to continue. The idea here is that a %TRUE return
5214 // indicates that the callback <emphasis>handled</emphasis> the signal,
5215 // and no further handling is needed.
5216 // RETURNS: standard #GSignalAccumulator result
5217 // <ihint>: standard #GSignalAccumulator parameter
5218 // <return_accu>: standard #GSignalAccumulator parameter
5219 // <handler_return>: standard #GSignalAccumulator parameter
5220 // <dummy>: standard #GSignalAccumulator parameter
5221 static int signal_accumulator_true_handled(AT0, AT1, AT2, AT3)(AT0 /*SignalInvocationHint*/ ihint, AT1 /*Value*/ return_accu, AT2 /*Value*/ handler_return, AT3 /*void*/ dummy) nothrow {
5222 return g_signal_accumulator_true_handled(UpCast!(SignalInvocationHint*)(ihint), UpCast!(Value*)(return_accu), UpCast!(Value*)(handler_return), UpCast!(void*)(dummy));
5226 // Adds an emission hook for a signal, which will get called for any emission
5227 // of that signal, independent of the instance. This is possible only
5228 // for signals which don't have #G_SIGNAL_NO_HOOKS flag set.
5229 // RETURNS: the hook id, for later use with g_signal_remove_emission_hook().
5230 // <signal_id>: the signal identifier, as returned by g_signal_lookup().
5231 // <detail>: the detail on which to call the hook.
5232 // <hook_func>: a #GSignalEmissionHook function.
5233 // <hook_data>: user data for @hook_func.
5234 // <data_destroy>: a #GDestroyNotify for @hook_data.
5235 static c_ulong signal_add_emission_hook(AT0)(uint signal_id, GLib2.Quark detail, SignalEmissionHook hook_func, AT0 /*void*/ hook_data, GLib2.DestroyNotify data_destroy) nothrow {
5236 return g_signal_add_emission_hook(signal_id, detail, hook_func, UpCast!(void*)(hook_data), data_destroy);
5240 // Calls the original class closure of a signal. This function should only
5241 // be called from an overridden class closure; see
5242 // g_signal_override_class_closure() and
5243 // g_signal_override_class_handler().
5244 // <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.
5245 // <return_value>: Location for the return value.
5246 static void signal_chain_from_overridden(AT0, AT1)(AT0 /*Value*/ instance_and_params, AT1 /*Value*/ return_value) nothrow {
5247 g_signal_chain_from_overridden(UpCast!(Value*)(instance_and_params), UpCast!(Value*)(return_value));
5251 // Unintrospectable function: signal_chain_from_overridden_handler() / g_signal_chain_from_overridden_handler()
5252 // VERSION: 2.18
5253 // Calls the original class closure of a signal. This function should
5254 // only be called from an overridden class closure; see
5255 // g_signal_override_class_closure() and
5256 // g_signal_override_class_handler().
5257 // <instance>: the instance the signal is being emitted on.
5258 alias g_signal_chain_from_overridden_handler signal_chain_from_overridden_handler; // Variadic
5261 // Connects a closure to a signal for a particular object.
5262 // RETURNS: the handler id
5263 // <instance>: the instance to connect to.
5264 // <detailed_signal>: a string of the form "signal-name::detail".
5265 // <closure>: the closure to connect.
5266 // <after>: whether the handler should be called before or after the default handler of the signal.
5267 static c_ulong signal_connect_closure(AT0, AT1, AT2)(AT0 /*void*/ instance, AT1 /*char*/ detailed_signal, AT2 /*Closure*/ closure, int after) nothrow {
5268 return g_signal_connect_closure(UpCast!(void*)(instance), toCString!(char*)(detailed_signal), UpCast!(Closure*)(closure), after);
5272 // Connects a closure to a signal for a particular object.
5273 // RETURNS: the handler id
5274 // <instance>: the instance to connect to.
5275 // <signal_id>: the id of the signal.
5276 // <detail>: the detail.
5277 // <closure>: the closure to connect.
5278 // <after>: whether the handler should be called before or after the default handler of the signal.
5279 static c_ulong signal_connect_closure_by_id(AT0, AT1)(AT0 /*void*/ instance, uint signal_id, GLib2.Quark detail, AT1 /*Closure*/ closure, int after) nothrow {
5280 return g_signal_connect_closure_by_id(UpCast!(void*)(instance), signal_id, detail, UpCast!(Closure*)(closure), after);
5284 // Unintrospectable function: signal_connect_data() / g_signal_connect_data()
5285 // Connects a #GCallback function to a signal for a particular object. Similar
5286 // to g_signal_connect(), but allows to provide a #GClosureNotify for the data
5287 // which will be called when the signal handler is disconnected and no longer
5288 // used. Specify @connect_flags if you need <literal>..._after()</literal> or
5289 // <literal>..._swapped()</literal> variants of this function.
5290 // RETURNS: the handler id
5291 // <instance>: the instance to connect to.
5292 // <detailed_signal>: a string of the form "signal-name::detail".
5293 // <c_handler>: the #GCallback to connect.
5294 // <data>: data to pass to @c_handler calls.
5295 // <destroy_data>: a #GClosureNotify for @data.
5296 // <connect_flags>: a combination of #GConnectFlags.
5297 static c_ulong signal_connect_data(AT0, AT1, AT2)(AT0 /*void*/ instance, AT1 /*char*/ detailed_signal, Callback c_handler, AT2 /*void*/ data, ClosureNotify destroy_data, ConnectFlags connect_flags) nothrow {
5298 return g_signal_connect_data(UpCast!(void*)(instance), toCString!(char*)(detailed_signal), c_handler, UpCast!(void*)(data), destroy_data, connect_flags);
5302 // Unintrospectable function: signal_connect_object() / g_signal_connect_object()
5303 // This is similar to g_signal_connect_data(), but uses a closure which
5304 // ensures that the @gobject stays alive during the call to @c_handler
5305 // by temporarily adding a reference count to @gobject.
5307 // Note that there is a bug in GObject that makes this function
5308 // much less useful than it might seem otherwise. Once @gobject is
5309 // disposed, the callback will no longer be called, but, the signal
5310 // handler is <emphasis>not</emphasis> currently disconnected. If the
5311 // @instance is itself being freed at the same time than this doesn't
5312 // matter, since the signal will automatically be removed, but
5313 // if @instance persists, then the signal handler will leak. You
5314 // should not remove the signal yourself because in a future versions of
5315 // GObject, the handler <emphasis>will</emphasis> automatically
5316 // be disconnected.
5318 // It's possible to work around this problem in a way that will
5319 // continue to work with future versions of GObject by checking
5320 // that the signal handler is still connected before disconnected it:
5321 // <informalexample><programlisting>
5322 // if (g_signal_handler_is_connected (instance, id))
5323 // g_signal_handler_disconnect (instance, id);
5324 // </programlisting></informalexample>
5325 // RETURNS: the handler id.
5326 // <instance>: the instance to connect to.
5327 // <detailed_signal>: a string of the form "signal-name::detail".
5328 // <c_handler>: the #GCallback to connect.
5329 // <gobject>: the object to pass as data to @c_handler.
5330 // <connect_flags>: a combination of #GConnectFlags.
5331 static c_ulong signal_connect_object(AT0, AT1, AT2)(AT0 /*void*/ instance, AT1 /*char*/ detailed_signal, Callback c_handler, AT2 /*void*/ gobject, ConnectFlags connect_flags) nothrow {
5332 return g_signal_connect_object(UpCast!(void*)(instance), toCString!(char*)(detailed_signal), c_handler, UpCast!(void*)(gobject), connect_flags);
5336 // Unintrospectable function: signal_emit() / g_signal_emit()
5337 // Emits a signal.
5339 // Note that g_signal_emit() resets the return value to the default
5340 // if no handlers are connected, in contrast to g_signal_emitv().
5341 // <instance>: the instance the signal is being emitted on.
5342 // <signal_id>: the signal id
5343 // <detail>: the detail
5344 alias g_signal_emit signal_emit; // Variadic
5347 // Unintrospectable function: signal_emit_by_name() / g_signal_emit_by_name()
5348 // Emits a signal.
5350 // Note that g_signal_emit_by_name() resets the return value to the default
5351 // if no handlers are connected, in contrast to g_signal_emitv().
5352 // <instance>: the instance the signal is being emitted on.
5353 // <detailed_signal>: a string of the form "signal-name::detail".
5354 alias g_signal_emit_by_name signal_emit_by_name; // Variadic
5357 // Unintrospectable function: signal_emit_valist() / g_signal_emit_valist()
5358 // Emits a signal.
5360 // Note that g_signal_emit_valist() resets the return value to the default
5361 // if no handlers are connected, in contrast to g_signal_emitv().
5362 // <instance>: the instance the signal is being emitted on.
5363 // <signal_id>: the signal id
5364 // <detail>: the detail
5365 // <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.
5366 static void signal_emit_valist(AT0)(AT0 /*void*/ instance, uint signal_id, GLib2.Quark detail, va_list var_args) nothrow {
5367 g_signal_emit_valist(UpCast!(void*)(instance), signal_id, detail, var_args);
5371 // Emits a signal.
5373 // Note that g_signal_emitv() doesn't change @return_value if no handlers are
5374 // connected, in contrast to g_signal_emit() and g_signal_emit_valist().
5375 // <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.
5376 // <signal_id>: the signal id
5377 // <detail>: the detail
5378 // <return_value>: Location to store the return value of the signal emission.
5379 static void signal_emitv(AT0, AT1)(AT0 /*Value*/ instance_and_params, uint signal_id, GLib2.Quark detail, AT1 /*Value*/ return_value) nothrow {
5380 g_signal_emitv(UpCast!(Value*)(instance_and_params), signal_id, detail, UpCast!(Value*)(return_value));
5384 // Returns the invocation hint of the innermost signal emission of instance.
5385 // RETURNS: the invocation hint of the innermost signal emission.
5386 // <instance>: the instance to query
5387 static SignalInvocationHint* signal_get_invocation_hint(AT0)(AT0 /*void*/ instance) nothrow {
5388 return g_signal_get_invocation_hint(UpCast!(void*)(instance));
5392 // Blocks a handler of an instance so it will not be called during any
5393 // signal emissions unless it is unblocked again. Thus "blocking" a
5394 // signal handler means to temporarily deactive it, a signal handler
5395 // has to be unblocked exactly the same amount of times it has been
5396 // blocked before to become active again.
5398 // The @handler_id has to be a valid signal handler id, connected to a
5399 // signal of @instance.
5400 // <instance>: The instance to block the signal handler of.
5401 // <handler_id>: Handler id of the handler to be blocked.
5402 static void signal_handler_block(AT0)(AT0 /*void*/ instance, c_ulong handler_id) nothrow {
5403 g_signal_handler_block(UpCast!(void*)(instance), handler_id);
5407 // Disconnects a handler from an instance so it will not be called during
5408 // any future or currently ongoing emissions of the signal it has been
5409 // connected to. The @handler_id becomes invalid and may be reused.
5411 // The @handler_id has to be a valid signal handler id, connected to a
5412 // signal of @instance.
5413 // <instance>: The instance to remove the signal handler from.
5414 // <handler_id>: Handler id of the handler to be disconnected.
5415 static void signal_handler_disconnect(AT0)(AT0 /*void*/ instance, c_ulong handler_id) nothrow {
5416 g_signal_handler_disconnect(UpCast!(void*)(instance), handler_id);
5420 // Finds the first signal handler that matches certain selection criteria.
5421 // The criteria mask is passed as an OR-ed combination of #GSignalMatchType
5422 // flags, and the criteria values are passed as arguments.
5423 // The match @mask has to be non-0 for successful matches.
5424 // If no handler was found, 0 is returned.
5425 // RETURNS: A valid non-0 signal handler id for a successful match.
5426 // <instance>: The instance owning the signal handler to be found.
5427 // <mask>: Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handler has to match.
5428 // <signal_id>: Signal the handler has to be connected to.
5429 // <detail>: Signal detail the handler has to be connected to.
5430 // <closure>: The closure the handler will invoke.
5431 // <func>: The C closure callback of the handler (useless for non-C closures).
5432 // <data>: The closure data of the handler's closure.
5433 static c_ulong signal_handler_find(AT0, AT1, AT2, AT3)(AT0 /*void*/ instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, AT1 /*Closure*/ closure, AT2 /*void*/ func, AT3 /*void*/ data) nothrow {
5434 return g_signal_handler_find(UpCast!(void*)(instance), mask, signal_id, detail, UpCast!(Closure*)(closure), UpCast!(void*)(func), UpCast!(void*)(data));
5438 // Returns whether @handler_id is the id of a handler connected to @instance.
5439 // RETURNS: whether @handler_id identifies a handler connected to @instance.
5440 // <instance>: The instance where a signal handler is sought.
5441 // <handler_id>: the handler id.
5442 static int signal_handler_is_connected(AT0)(AT0 /*void*/ instance, c_ulong handler_id) nothrow {
5443 return g_signal_handler_is_connected(UpCast!(void*)(instance), handler_id);
5447 // Undoes the effect of a previous g_signal_handler_block() call. A
5448 // blocked handler is skipped during signal emissions and will not be
5449 // invoked, unblocking it (for exactly the amount of times it has been
5450 // blocked before) reverts its "blocked" state, so the handler will be
5451 // recognized by the signal system and is called upon future or
5452 // currently ongoing signal emissions (since the order in which
5453 // handlers are called during signal emissions is deterministic,
5454 // whether the unblocked handler in question is called as part of a
5455 // currently ongoing emission depends on how far that emission has
5456 // proceeded yet).
5458 // The @handler_id has to be a valid id of a signal handler that is
5459 // connected to a signal of @instance and is currently blocked.
5460 // <instance>: The instance to unblock the signal handler of.
5461 // <handler_id>: Handler id of the handler to be unblocked.
5462 static void signal_handler_unblock(AT0)(AT0 /*void*/ instance, c_ulong handler_id) nothrow {
5463 g_signal_handler_unblock(UpCast!(void*)(instance), handler_id);
5467 // Blocks all handlers on an instance that match a certain selection criteria.
5468 // The criteria mask is passed as an OR-ed combination of #GSignalMatchType
5469 // flags, and the criteria values are passed as arguments.
5470 // Passing at least one of the %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC
5471 // or %G_SIGNAL_MATCH_DATA match flags is required for successful matches.
5472 // If no handlers were found, 0 is returned, the number of blocked handlers
5473 // otherwise.
5474 // RETURNS: The number of handlers that matched.
5475 // <instance>: The instance to block handlers from.
5476 // <mask>: Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handlers have to match.
5477 // <signal_id>: Signal the handlers have to be connected to.
5478 // <detail>: Signal detail the handlers have to be connected to.
5479 // <closure>: The closure the handlers will invoke.
5480 // <func>: The C closure callback of the handlers (useless for non-C closures).
5481 // <data>: The closure data of the handlers' closures.
5482 static uint signal_handlers_block_matched(AT0, AT1, AT2, AT3)(AT0 /*void*/ instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, AT1 /*Closure*/ closure, AT2 /*void*/ func, AT3 /*void*/ data) nothrow {
5483 return g_signal_handlers_block_matched(UpCast!(void*)(instance), mask, signal_id, detail, UpCast!(Closure*)(closure), UpCast!(void*)(func), UpCast!(void*)(data));
5486 static void signal_handlers_destroy(AT0)(AT0 /*void*/ instance) nothrow {
5487 g_signal_handlers_destroy(UpCast!(void*)(instance));
5491 // Disconnects all handlers on an instance that match a certain
5492 // selection criteria. The criteria mask is passed as an OR-ed
5493 // combination of #GSignalMatchType flags, and the criteria values are
5494 // passed as arguments. Passing at least one of the
5495 // %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC or
5496 // %G_SIGNAL_MATCH_DATA match flags is required for successful
5497 // matches. If no handlers were found, 0 is returned, the number of
5498 // disconnected handlers otherwise.
5499 // RETURNS: The number of handlers that matched.
5500 // <instance>: The instance to remove handlers from.
5501 // <mask>: Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handlers have to match.
5502 // <signal_id>: Signal the handlers have to be connected to.
5503 // <detail>: Signal detail the handlers have to be connected to.
5504 // <closure>: The closure the handlers will invoke.
5505 // <func>: The C closure callback of the handlers (useless for non-C closures).
5506 // <data>: The closure data of the handlers' closures.
5507 static uint signal_handlers_disconnect_matched(AT0, AT1, AT2, AT3)(AT0 /*void*/ instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, AT1 /*Closure*/ closure, AT2 /*void*/ func, AT3 /*void*/ data) nothrow {
5508 return g_signal_handlers_disconnect_matched(UpCast!(void*)(instance), mask, signal_id, detail, UpCast!(Closure*)(closure), UpCast!(void*)(func), UpCast!(void*)(data));
5512 // Unblocks all handlers on an instance that match a certain selection
5513 // criteria. The criteria mask is passed as an OR-ed combination of
5514 // #GSignalMatchType flags, and the criteria values are passed as arguments.
5515 // Passing at least one of the %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC
5516 // or %G_SIGNAL_MATCH_DATA match flags is required for successful matches.
5517 // If no handlers were found, 0 is returned, the number of unblocked handlers
5518 // otherwise. The match criteria should not apply to any handlers that are
5519 // not currently blocked.
5520 // RETURNS: The number of handlers that matched.
5521 // <instance>: The instance to unblock handlers from.
5522 // <mask>: Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handlers have to match.
5523 // <signal_id>: Signal the handlers have to be connected to.
5524 // <detail>: Signal detail the handlers have to be connected to.
5525 // <closure>: The closure the handlers will invoke.
5526 // <func>: The C closure callback of the handlers (useless for non-C closures).
5527 // <data>: The closure data of the handlers' closures.
5528 static uint signal_handlers_unblock_matched(AT0, AT1, AT2, AT3)(AT0 /*void*/ instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, AT1 /*Closure*/ closure, AT2 /*void*/ func, AT3 /*void*/ data) nothrow {
5529 return g_signal_handlers_unblock_matched(UpCast!(void*)(instance), mask, signal_id, detail, UpCast!(Closure*)(closure), UpCast!(void*)(func), UpCast!(void*)(data));
5533 // Returns whether there are any handlers connected to @instance for the
5534 // given signal id and detail.
5536 // One example of when you might use this is when the arguments to the
5537 // signal are difficult to compute. A class implementor may opt to not
5538 // emit the signal if no one is attached anyway, thus saving the cost
5539 // of building the arguments.
5541 // otherwise.
5542 // RETURNS: %TRUE if a handler is connected to the signal, %FALSE
5543 // <instance>: the object whose signal handlers are sought.
5544 // <signal_id>: the signal id.
5545 // <detail>: the detail.
5546 // <may_be_blocked>: whether blocked handlers should count as match.
5547 static int signal_has_handler_pending(AT0)(AT0 /*void*/ instance, uint signal_id, GLib2.Quark detail, int may_be_blocked) nothrow {
5548 return g_signal_has_handler_pending(UpCast!(void*)(instance), signal_id, detail, may_be_blocked);
5552 // Lists the signals by id that a certain instance or interface type
5553 // created. Further information about the signals can be acquired through
5554 // g_signal_query().
5555 // RETURNS: Newly allocated array of signal IDs.
5556 // <itype>: Instance or interface type.
5557 // <n_ids>: Location to store the number of signal ids for @itype.
5558 static uint* signal_list_ids(AT0)(Type itype, /*out*/ AT0 /*uint*/ n_ids) nothrow {
5559 return g_signal_list_ids(itype, UpCast!(uint*)(n_ids));
5563 // Given the name of the signal and the type of object it connects to, gets
5564 // the signal's identifying integer. Emitting the signal by number is
5565 // somewhat faster than using the name each time.
5567 // Also tries the ancestors of the given type.
5569 // See g_signal_new() for details on allowed signal names.
5570 // RETURNS: the signal's identifying number, or 0 if no signal was found.
5571 // <name>: the signal's name.
5572 // <itype>: the type that the signal operates on.
5573 static uint signal_lookup(AT0)(AT0 /*char*/ name, Type itype) nothrow {
5574 return g_signal_lookup(toCString!(char*)(name), itype);
5578 // Given the signal's identifier, finds its name.
5580 // Two different signals may have the same name, if they have differing types.
5581 // RETURNS: the signal name, or %NULL if the signal number was invalid.
5582 // <signal_id>: the signal's identifying number.
5583 static char* signal_name()(uint signal_id) nothrow {
5584 return g_signal_name(signal_id);
5588 // Unintrospectable function: signal_new() / g_signal_new()
5589 // Creates a new signal. (This is usually done in the class initializer.)
5591 // A signal name consists of segments consisting of ASCII letters and
5592 // digits, separated by either the '-' or '_' character. The first
5593 // character of a signal name must be a letter. Names which violate these
5594 // rules lead to undefined behaviour of the GSignal system.
5596 // When registering a signal and looking up a signal, either separator can
5597 // be used, but they cannot be mixed.
5599 // If 0 is used for @class_offset subclasses cannot override the class handler
5600 // in their <code>class_init</code> method by doing
5601 // <code>super_class->signal_handler = my_signal_handler</code>. Instead they
5602 // will have to use g_signal_override_class_handler().
5604 // If c_marshaller is %NULL, g_cclosure_marshal_generic() will be used as
5605 // the marshaller for this signal.
5606 // RETURNS: the signal id
5607 // <signal_name>: the name for the signal
5608 // <itype>: the type this signal pertains to. It will also pertain to types which are derived from this type.
5609 // <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.
5610 // <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.
5611 // <accumulator>: the accumulator for this signal; may be %NULL.
5612 // <accu_data>: user data for the @accumulator.
5613 // <c_marshaller>: the function to translate arrays of parameter values to signal emissions into C language callback invocations or %NULL.
5614 // <return_type>: the type of return value, or #G_TYPE_NONE for a signal without a return value.
5615 // <n_params>: the number of parameter types to follow.
5616 alias g_signal_new signal_new; // Variadic
5619 // Unintrospectable function: signal_new_class_handler() / g_signal_new_class_handler()
5620 // VERSION: 2.18
5621 // Creates a new signal. (This is usually done in the class initializer.)
5623 // This is a variant of g_signal_new() that takes a C callback instead
5624 // off a class offset for the signal's class handler. This function
5625 // doesn't need a function pointer exposed in the class structure of
5626 // an object definition, instead the function pointer is passed
5627 // directly and can be overriden by derived classes with
5628 // g_signal_override_class_closure() or
5629 // g_signal_override_class_handler()and chained to with
5630 // g_signal_chain_from_overridden() or
5631 // g_signal_chain_from_overridden_handler().
5633 // See g_signal_new() for information about signal names.
5635 // If c_marshaller is %NULL @g_cclosure_marshal_generic will be used as
5636 // the marshaller for this signal.
5637 // RETURNS: the signal id
5638 // <signal_name>: the name for the signal
5639 // <itype>: the type this signal pertains to. It will also pertain to types which are derived from this type.
5640 // <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.
5641 // <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.
5642 // <accumulator>: the accumulator for this signal; may be %NULL.
5643 // <accu_data>: user data for the @accumulator.
5644 // <c_marshaller>: the function to translate arrays of parameter values to signal emissions into C language callback invocations or %NULL.
5645 // <return_type>: the type of return value, or #G_TYPE_NONE for a signal without a return value.
5646 // <n_params>: the number of parameter types to follow.
5647 alias g_signal_new_class_handler signal_new_class_handler; // Variadic
5650 // Unintrospectable function: signal_new_valist() / g_signal_new_valist()
5651 // Creates a new signal. (This is usually done in the class initializer.)
5653 // See g_signal_new() for details on allowed signal names.
5655 // If c_marshaller is %NULL, g_cclosure_marshal_generic() will be used as
5656 // the marshaller for this signal.
5657 // RETURNS: the signal id
5658 // <signal_name>: the name for the signal
5659 // <itype>: the type this signal pertains to. It will also pertain to types which are derived from this type.
5660 // <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.
5661 // <class_closure>: The closure to invoke on signal emission; may be %NULL.
5662 // <accumulator>: the accumulator for this signal; may be %NULL.
5663 // <accu_data>: user data for the @accumulator.
5664 // <c_marshaller>: the function to translate arrays of parameter values to signal emissions into C language callback invocations or %NULL.
5665 // <return_type>: the type of return value, or #G_TYPE_NONE for a signal without a return value.
5666 // <n_params>: the number of parameter types in @args.
5667 // <args>: va_list of #GType, one for each parameter.
5668 static uint signal_new_valist(AT0, AT1, AT2)(AT0 /*char*/ signal_name, Type itype, SignalFlags signal_flags, AT1 /*Closure*/ class_closure, SignalAccumulator accumulator, AT2 /*void*/ accu_data, SignalCMarshaller c_marshaller, Type return_type, uint n_params, va_list args) nothrow {
5669 return g_signal_new_valist(toCString!(char*)(signal_name), itype, signal_flags, UpCast!(Closure*)(class_closure), accumulator, UpCast!(void*)(accu_data), c_marshaller, return_type, n_params, args);
5673 // Unintrospectable function: signal_newv() / g_signal_newv()
5674 // Creates a new signal. (This is usually done in the class initializer.)
5676 // See g_signal_new() for details on allowed signal names.
5678 // If c_marshaller is %NULL @g_cclosure_marshal_generic will be used as
5679 // the marshaller for this signal.
5680 // RETURNS: the signal id
5681 // <signal_name>: the name for the signal
5682 // <itype>: the type this signal pertains to. It will also pertain to types which are derived from this type
5683 // <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
5684 // <class_closure>: The closure to invoke on signal emission; may be %NULL
5685 // <accumulator>: the accumulator for this signal; may be %NULL
5686 // <accu_data>: user data for the @accumulator
5687 // <c_marshaller>: the function to translate arrays of parameter values to signal emissions into C language callback invocations or %NULL
5688 // <return_type>: the type of return value, or #G_TYPE_NONE for a signal without a return value
5689 // <n_params>: the length of @param_types
5690 // <param_types>: an array of types, one for each parameter
5691 static uint signal_newv(AT0, AT1, AT2, AT3)(AT0 /*char*/ signal_name, Type itype, SignalFlags signal_flags, AT1 /*Closure*/ class_closure, SignalAccumulator accumulator, AT2 /*void*/ accu_data, SignalCMarshaller c_marshaller, Type return_type, uint n_params, AT3 /*Type*/ param_types) nothrow {
5692 return g_signal_newv(toCString!(char*)(signal_name), itype, signal_flags, UpCast!(Closure*)(class_closure), accumulator, UpCast!(void*)(accu_data), c_marshaller, return_type, n_params, UpCast!(Type*)(param_types));
5696 // Overrides the class closure (i.e. the default handler) for the given signal
5697 // for emissions on instances of @instance_type. @instance_type must be derived
5698 // from the type to which the signal belongs.
5700 // See g_signal_chain_from_overridden() and
5701 // g_signal_chain_from_overridden_handler() for how to chain up to the
5702 // parent class closure from inside the overridden one.
5703 // <signal_id>: the signal id
5704 // <instance_type>: the instance type on which to override the class closure for the signal.
5705 // <class_closure>: the closure.
5706 static void signal_override_class_closure(AT0)(uint signal_id, Type instance_type, AT0 /*Closure*/ class_closure) nothrow {
5707 g_signal_override_class_closure(signal_id, instance_type, UpCast!(Closure*)(class_closure));
5711 // Unintrospectable function: signal_override_class_handler() / g_signal_override_class_handler()
5712 // VERSION: 2.18
5713 // Overrides the class closure (i.e. the default handler) for the
5714 // given signal for emissions on instances of @instance_type with
5715 // callabck @class_handler. @instance_type must be derived from the
5716 // type to which the signal belongs.
5718 // See g_signal_chain_from_overridden() and
5719 // g_signal_chain_from_overridden_handler() for how to chain up to the
5720 // parent class closure from inside the overridden one.
5721 // <signal_name>: the name for the signal
5722 // <instance_type>: the instance type on which to override the class handler for the signal.
5723 // <class_handler>: the handler.
5724 static void signal_override_class_handler(AT0)(AT0 /*char*/ signal_name, Type instance_type, Callback class_handler) nothrow {
5725 g_signal_override_class_handler(toCString!(char*)(signal_name), instance_type, class_handler);
5729 // Internal function to parse a signal name into its @signal_id
5730 // and @detail quark.
5731 // RETURNS: Whether the signal name could successfully be parsed and @signal_id_p and @detail_p contain valid return values.
5732 // <detailed_signal>: a string of the form "signal-name::detail".
5733 // <itype>: The interface/instance type that introduced "signal-name".
5734 // <signal_id_p>: Location to store the signal id.
5735 // <detail_p>: Location to store the detail quark.
5736 // <force_detail_quark>: %TRUE forces creation of a #GQuark for the detail.
5737 static int signal_parse_name(AT0, AT1, AT2)(AT0 /*char*/ detailed_signal, Type itype, /*out*/ AT1 /*uint*/ signal_id_p, /*out*/ AT2 /*GLib2.Quark*/ detail_p, int force_detail_quark) nothrow {
5738 return g_signal_parse_name(toCString!(char*)(detailed_signal), itype, UpCast!(uint*)(signal_id_p), UpCast!(GLib2.Quark*)(detail_p), force_detail_quark);
5742 // Queries the signal system for in-depth information about a
5743 // specific signal. This function will fill in a user-provided
5744 // structure to hold signal-specific information. If an invalid
5745 // signal id is passed in, the @signal_id member of the #GSignalQuery
5746 // is 0. All members filled into the #GSignalQuery structure should
5747 // be considered constant and have to be left untouched.
5748 // <signal_id>: The signal id of the signal to query information for.
5749 // <query>: A user provided structure that is filled in with constant values upon success.
5750 static void signal_query(AT0)(uint signal_id, /*out*/ AT0 /*SignalQuery*/ query) nothrow {
5751 g_signal_query(signal_id, UpCast!(SignalQuery*)(query));
5755 // Deletes an emission hook.
5756 // <signal_id>: the id of the signal
5757 // <hook_id>: the id of the emission hook, as returned by g_signal_add_emission_hook()
5758 static void signal_remove_emission_hook()(uint signal_id, c_ulong hook_id) nothrow {
5759 g_signal_remove_emission_hook(signal_id, hook_id);
5762 static void signal_set_va_marshaller()(uint signal_id, Type instance_type, SignalCVaMarshaller va_marshaller) nothrow {
5763 g_signal_set_va_marshaller(signal_id, instance_type, va_marshaller);
5767 // Stops a signal's current emission.
5769 // This will prevent the default method from running, if the signal was
5770 // %G_SIGNAL_RUN_LAST and you connected normally (i.e. without the "after"
5771 // flag).
5773 // Prints a warning if used on a signal which isn't being emitted.
5774 // <instance>: the object whose signal handlers you wish to stop.
5775 // <signal_id>: the signal identifier, as returned by g_signal_lookup().
5776 // <detail>: the detail which the signal was emitted with.
5777 static void signal_stop_emission(AT0)(AT0 /*void*/ instance, uint signal_id, GLib2.Quark detail) nothrow {
5778 g_signal_stop_emission(UpCast!(void*)(instance), signal_id, detail);
5782 // Stops a signal's current emission.
5784 // This is just like g_signal_stop_emission() except it will look up the
5785 // signal id for you.
5786 // <instance>: the object whose signal handlers you wish to stop.
5787 // <detailed_signal>: a string of the form "signal-name::detail".
5788 static void signal_stop_emission_by_name(AT0, AT1)(AT0 /*void*/ instance, AT1 /*char*/ detailed_signal) nothrow {
5789 g_signal_stop_emission_by_name(UpCast!(void*)(instance), toCString!(char*)(detailed_signal));
5793 // Creates a new closure which invokes the function found at the offset
5794 // @struct_offset in the class structure of the interface or classed type
5795 // identified by @itype.
5796 // RETURNS: a new #GCClosure
5797 // <itype>: the #GType identifier of an interface or classed type
5798 // <struct_offset>: the offset of the member function of @itype's class structure which is to be invoked by the new closure
5799 static Closure* /*new*/ signal_type_cclosure_new()(Type itype, uint struct_offset) nothrow {
5800 return g_signal_type_cclosure_new(itype, struct_offset);
5804 // Set the callback for a source as a #GClosure.
5806 // If the source is not one of the standard GLib types, the @closure_callback
5807 // and @closure_marshal fields of the #GSourceFuncs structure must have been
5808 // filled in with pointers to appropriate functions.
5809 // <source>: the source
5810 // <closure>: a #GClosure
5811 static void source_set_closure(AT0, AT1)(AT0 /*GLib2.Source*/ source, AT1 /*Closure*/ closure) nothrow {
5812 g_source_set_closure(UpCast!(GLib2.Source*)(source), UpCast!(Closure*)(closure));
5816 // Sets a dummy callback for @source. The callback will do nothing, and
5817 // if the source expects a #gboolean return value, it will return %TRUE.
5818 // (If the source expects any other type of return value, it will return
5819 // a 0/%NULL value; whatever g_value_init() initializes a #GValue to for
5820 // that type.)
5822 // If the source is not one of the standard GLib types, the
5823 // @closure_callback and @closure_marshal fields of the #GSourceFuncs
5824 // structure must have been filled in with pointers to appropriate
5825 // functions.
5826 // <source>: the source
5827 static void source_set_dummy_callback(AT0)(AT0 /*GLib2.Source*/ source) nothrow {
5828 g_source_set_dummy_callback(UpCast!(GLib2.Source*)(source));
5832 // Return a newly allocated string, which describes the contents of a
5833 // #GValue. The main purpose of this function is to describe #GValue
5834 // contents for debugging output, the way in which the contents are
5835 // described may change between different GLib versions.
5836 // RETURNS: Newly allocated string.
5837 // <value>: #GValue which contents are to be described.
5838 static char* /*new*/ strdup_value_contents(AT0)(AT0 /*Value*/ value) nothrow {
5839 return g_strdup_value_contents(UpCast!(Value*)(value));
5843 // Unintrospectable function: type_add_class_cache_func() / g_type_add_class_cache_func()
5844 // Adds a #GTypeClassCacheFunc to be called before the reference count of a
5845 // class goes from one to zero. This can be used to prevent premature class
5846 // destruction. All installed #GTypeClassCacheFunc functions will be chained
5847 // until one of them returns %TRUE. The functions have to check the class id
5848 // passed in to figure whether they actually want to cache the class of this
5849 // type, since all classes are routed through the same #GTypeClassCacheFunc
5850 // chain.
5851 // <cache_data>: data to be passed to @cache_func
5852 // <cache_func>: a #GTypeClassCacheFunc
5853 static void type_add_class_cache_func(AT0)(AT0 /*void*/ cache_data, TypeClassCacheFunc cache_func) nothrow {
5854 g_type_add_class_cache_func(UpCast!(void*)(cache_data), cache_func);
5858 // VERSION: 2.24
5859 // Registers a private class structure for a classed type;
5860 // when the class is allocated, the private structures for
5861 // the class and all of its parent types are allocated
5862 // sequentially in the same memory block as the public
5863 // structures. This function should be called in the
5864 // type's get_type() function after the type is registered.
5865 // The private structure can be retrieved using the
5866 // G_TYPE_CLASS_GET_PRIVATE() macro.
5867 // <class_type>: GType of an classed type.
5868 // <private_size>: size of private structure.
5869 static void type_add_class_private()(Type class_type, size_t private_size) nothrow {
5870 g_type_add_class_private(class_type, private_size);
5874 // Unintrospectable function: type_add_interface_check() / g_type_add_interface_check()
5875 // VERSION: 2.4
5876 // Adds a function to be called after an interface vtable is
5877 // initialized for any class (i.e. after the @interface_init member of
5878 // #GInterfaceInfo has been called).
5880 // This function is useful when you want to check an invariant that
5881 // depends on the interfaces of a class. For instance, the
5882 // implementation of #GObject uses this facility to check that an
5883 // object implements all of the properties that are defined on its
5884 // interfaces.
5885 // <check_data>: data to pass to @check_func
5886 // <check_func>: function to be called after each interface is initialized.
5887 static void type_add_interface_check(AT0)(AT0 /*void*/ check_data, TypeInterfaceCheckFunc check_func) nothrow {
5888 g_type_add_interface_check(UpCast!(void*)(check_data), check_func);
5892 // Adds the dynamic @interface_type to @instantiable_type. The information
5893 // contained in the #GTypePlugin structure pointed to by @plugin
5894 // is used to manage the relationship.
5895 // <instance_type>: the #GType value of an instantiable type.
5896 // <interface_type>: the #GType value of an interface type.
5897 // <plugin>: the #GTypePlugin structure to retrieve the #GInterfaceInfo from.
5898 static void type_add_interface_dynamic(AT0)(Type instance_type, Type interface_type, AT0 /*TypePlugin*/ plugin) nothrow {
5899 g_type_add_interface_dynamic(instance_type, interface_type, UpCast!(TypePlugin*)(plugin));
5903 // Adds the static @interface_type to @instantiable_type. The
5904 // information contained in the #GInterfaceInfo structure pointed to by
5905 // @info is used to manage the relationship.
5906 // <instance_type>: #GType value of an instantiable type.
5907 // <interface_type>: #GType value of an interface type.
5908 // <info>: The #GInterfaceInfo structure for this (@instance_type, @interface_type) combination.
5909 static void type_add_interface_static(AT0)(Type instance_type, Type interface_type, AT0 /*InterfaceInfo*/ info) nothrow {
5910 g_type_add_interface_static(instance_type, interface_type, UpCast!(InterfaceInfo*)(info));
5913 // Unintrospectable function: type_check_class_cast() / g_type_check_class_cast()
5914 static TypeClass* type_check_class_cast(AT0)(AT0 /*TypeClass*/ g_class, Type is_a_type) nothrow {
5915 return g_type_check_class_cast(UpCast!(TypeClass*)(g_class), is_a_type);
5918 static int type_check_class_is_a(AT0)(AT0 /*TypeClass*/ g_class, Type is_a_type) nothrow {
5919 return g_type_check_class_is_a(UpCast!(TypeClass*)(g_class), is_a_type);
5923 // Private helper function to aid implementation of the G_TYPE_CHECK_INSTANCE()
5924 // macro.
5925 // <instance>: A valid #GTypeInstance structure.
5926 static int type_check_instance(AT0)(AT0 /*TypeInstance*/ instance) nothrow {
5927 return g_type_check_instance(UpCast!(TypeInstance*)(instance));
5930 // Unintrospectable function: type_check_instance_cast() / g_type_check_instance_cast()
5931 static TypeInstance* type_check_instance_cast(AT0)(AT0 /*TypeInstance*/ instance, Type iface_type) nothrow {
5932 return g_type_check_instance_cast(UpCast!(TypeInstance*)(instance), iface_type);
5935 static int type_check_instance_is_a(AT0)(AT0 /*TypeInstance*/ instance, Type iface_type) nothrow {
5936 return g_type_check_instance_is_a(UpCast!(TypeInstance*)(instance), iface_type);
5939 static int type_check_is_value_type()(Type type) nothrow {
5940 return g_type_check_is_value_type(type);
5943 static int type_check_value(AT0)(AT0 /*Value*/ value) nothrow {
5944 return g_type_check_value(UpCast!(Value*)(value));
5947 static int type_check_value_holds(AT0)(AT0 /*Value*/ value, Type type) nothrow {
5948 return g_type_check_value_holds(UpCast!(Value*)(value), type);
5952 // Return a newly allocated and 0-terminated array of type IDs, listing the
5953 // child types of @type. The return value has to be g_free()ed after use.
5955 // and 0-terminated array of child types.
5956 // RETURNS: Newly allocated
5957 // <type>: The parent type.
5958 // <n_children>: Optional #guint pointer to contain the number of child types.
5959 static Type* /*new*/ type_children(AT0)(Type type, /*out*/ AT0 /*uint*/ n_children=null) nothrow {
5960 return g_type_children(type, UpCast!(uint*)(n_children));
5964 // VERSION: 2.4
5965 // MOVED TO: TypeClass.add_private
5966 // Registers a private structure for an instantiatable type.
5968 // When an object is allocated, the private structures for
5969 // the type and all of its parent types are allocated
5970 // sequentially in the same memory block as the public
5971 // structures.
5973 // Note that the accumulated size of the private structures of
5974 // a type and all its parent types cannot excced 64 KiB.
5976 // This function should be called in the type's class_init() function.
5977 // The private structure can be retrieved using the
5978 // G_TYPE_INSTANCE_GET_PRIVATE() macro.
5980 // The following example shows attaching a private structure
5981 // <structname>MyObjectPrivate</structname> to an object
5982 // <structname>MyObject</structname> defined in the standard GObject
5983 // fashion.
5984 // type's class_init() function.
5985 // Note the use of a structure member "priv" to avoid the overhead
5986 // of repeatedly calling MY_OBJECT_GET_PRIVATE().
5988 // |[
5989 // typedef struct _MyObject MyObject;
5990 // typedef struct _MyObjectPrivate MyObjectPrivate;
5992 // struct _MyObject {
5993 // GObject parent;
5995 // MyObjectPrivate *priv;
5996 // };
5998 // struct _MyObjectPrivate {
5999 // int some_field;
6000 // };
6002 // static void
6003 // my_object_class_init (MyObjectClass *klass)
6004 // {
6005 // g_type_class_add_private (klass, sizeof (MyObjectPrivate));
6006 // }
6008 // static void
6009 // my_object_init (MyObject *my_object)
6010 // {
6011 // my_object->priv = G_TYPE_INSTANCE_GET_PRIVATE (my_object,
6012 // MY_TYPE_OBJECT,
6013 // MyObjectPrivate);
6014 // }
6016 // static int
6017 // my_object_get_some_field (MyObject *my_object)
6018 // {
6019 // MyObjectPrivate *priv;
6021 // g_return_val_if_fail (MY_IS_OBJECT (my_object), 0);
6023 // priv = my_object->priv;
6025 // return priv->some_field;
6026 // }
6027 // ]|
6028 // <g_class>: class structure for an instantiatable type
6029 // <private_size>: size of private structure.
6030 static void type_class_add_private(AT0)(AT0 /*void*/ g_class, size_t private_size) nothrow {
6031 g_type_class_add_private(UpCast!(void*)(g_class), private_size);
6035 // MOVED TO: TypeClass.peek
6036 // This function is essentially the same as g_type_class_ref(), except that
6037 // the classes reference count isn't incremented. As a consequence, this function
6038 // may return %NULL if the class of the type passed in does not currently
6039 // exist (hasn't been referenced before).
6041 // structure for the given type ID or %NULL if the class does not
6042 // currently exist.
6043 // RETURNS: The #GTypeClass
6044 // <type>: Type ID of a classed type.
6045 static TypeClass* type_class_peek()(Type type) nothrow {
6046 return g_type_class_peek(type);
6050 // VERSION: 2.4
6051 // MOVED TO: TypeClass.peek_static
6052 // A more efficient version of g_type_class_peek() which works only for
6053 // static types.
6055 // structure for the given type ID or %NULL if the class does not
6056 // currently exist or is dynamically loaded.
6057 // RETURNS: The #GTypeClass
6058 // <type>: Type ID of a classed type.
6059 static TypeClass* type_class_peek_static()(Type type) nothrow {
6060 return g_type_class_peek_static(type);
6064 // MOVED TO: TypeClass.ref
6065 // Increments the reference count of the class structure belonging to
6066 // @type. This function will demand-create the class if it doesn't
6067 // exist already.
6069 // structure for the given type ID.
6070 // RETURNS: The #GTypeClass
6071 // <type>: Type ID of a classed type.
6072 static TypeClass* type_class_ref()(Type type) nothrow {
6073 return g_type_class_ref(type);
6077 // Unintrospectable function: type_create_instance() / g_type_create_instance()
6078 // Creates and initializes an instance of @type if @type is valid and
6079 // can be instantiated. The type system only performs basic allocation
6080 // and structure setups for instances: actual instance creation should
6081 // happen through functions supplied by the type's fundamental type
6082 // implementation. So use of g_type_create_instance() is reserved for
6083 // implementators of fundamental types only. E.g. instances of the
6084 // #GObject hierarchy should be created via g_object_new() and
6085 // <emphasis>never</emphasis> directly through
6086 // g_type_create_instance() which doesn't handle things like singleton
6087 // objects or object construction. Note: Do <emphasis>not</emphasis>
6088 // use this function, unless you're implementing a fundamental
6089 // type. Also language bindings should <emphasis>not</emphasis> use
6090 // this function but g_object_new() instead.
6092 // treatment by the fundamental type implementation.
6093 // RETURNS: An allocated and initialized instance, subject to further
6094 // <type>: An instantiatable type to create an instance for.
6095 static TypeInstance* type_create_instance()(Type type) nothrow {
6096 return g_type_create_instance(type);
6100 // VERSION: 2.4
6101 // If the interface type @g_type is currently in use, returns its
6102 // default interface vtable.
6105 // vtable for the interface, or %NULL if the type is not currently in
6106 // use.
6107 // RETURNS: the default
6108 // <g_type>: an interface type
6109 static TypeInterface* type_default_interface_peek()(Type g_type) nothrow {
6110 return g_type_default_interface_peek(g_type);
6114 // VERSION: 2.4
6115 // Increments the reference count for the interface type @g_type,
6116 // and returns the default interface vtable for the type.
6118 // If the type is not currently in use, then the default vtable
6119 // for the type will be created and initalized by calling
6120 // the base interface init and default vtable init functions for
6121 // the type (the @<structfield>base_init</structfield>
6122 // and <structfield>class_init</structfield> members of #GTypeInfo).
6123 // Calling g_type_default_interface_ref() is useful when you
6124 // want to make sure that signals and properties for an interface
6125 // have been installed.
6128 // vtable for the interface; call g_type_default_interface_unref()
6129 // when you are done using the interface.
6130 // RETURNS: the default
6131 // <g_type>: an interface type
6132 static TypeInterface* type_default_interface_ref()(Type g_type) nothrow {
6133 return g_type_default_interface_ref(g_type);
6137 // VERSION: 2.4
6138 // Decrements the reference count for the type corresponding to the
6139 // interface default vtable @g_iface. If the type is dynamic, then
6140 // when no one is using the interface and all references have
6141 // been released, the finalize function for the interface's default
6142 // vtable (the <structfield>class_finalize</structfield> member of
6143 // #GTypeInfo) will be called.
6144 // <g_iface>: the default vtable structure for a interface, as returned by g_type_default_interface_ref()
6145 static void type_default_interface_unref(AT0)(AT0 /*TypeInterface*/ g_iface) nothrow {
6146 g_type_default_interface_unref(UpCast!(TypeInterface*)(g_iface));
6150 // Returns the length of the ancestry of the passed in type. This
6151 // includes the type itself, so that e.g. a fundamental type has depth 1.
6152 // RETURNS: The depth of @type.
6153 // <type>: A #GType value.
6154 static uint type_depth()(Type type) nothrow {
6155 return g_type_depth(type);
6159 // Frees an instance of a type, returning it to the instance pool for
6160 // the type, if there is one.
6162 // Like g_type_create_instance(), this function is reserved for
6163 // implementors of fundamental types.
6164 // <instance>: an instance of a type.
6165 static void type_free_instance(AT0)(AT0 /*TypeInstance*/ instance) nothrow {
6166 g_type_free_instance(UpCast!(TypeInstance*)(instance));
6170 // Lookup the type ID from a given type name, returning 0 if no type
6171 // has been registered under this name (this is the preferred method
6172 // to find out by name whether a specific type has been registered
6173 // yet).
6174 // RETURNS: Corresponding type ID or 0.
6175 // <name>: Type name to lookup.
6176 static Type type_from_name(AT0)(AT0 /*char*/ name) nothrow {
6177 return g_type_from_name(toCString!(char*)(name));
6181 // Internal function, used to extract the fundamental type ID portion.
6182 // use G_TYPE_FUNDAMENTAL() instead.
6183 // RETURNS: fundamental type ID
6184 // <type_id>: valid type ID
6185 static Type type_fundamental()(Type type_id) nothrow {
6186 return g_type_fundamental(type_id);
6190 // Returns the next free fundamental type id which can be used to
6191 // register a new fundamental type with g_type_register_fundamental().
6192 // The returned type ID represents the highest currently registered
6193 // fundamental type identifier.
6195 // or 0 if the type system ran out of fundamental type IDs.
6196 // RETURNS: The nextmost fundamental type ID to be registered,
6197 static Type type_fundamental_next()() nothrow {
6198 return g_type_fundamental_next();
6202 // Returns the #GTypePlugin structure for @type or
6203 // %NULL if @type does not have a #GTypePlugin structure.
6205 // dynamic type, %NULL otherwise.
6206 // RETURNS: The corresponding plugin if @type is a
6207 // <type>: The #GType to retrieve the plugin for.
6208 static TypePlugin* type_get_plugin()(Type type) nothrow {
6209 return g_type_get_plugin(type);
6213 // Obtains data which has previously been attached to @type
6214 // with g_type_set_qdata().
6216 // Note that this does not take subtyping into account; data
6217 // attached to one type with g_type_set_qdata() cannot
6218 // be retrieved from a subtype using g_type_get_qdata().
6219 // RETURNS: the data, or %NULL if no data was found
6220 // <type>: a #GType
6221 // <quark>: a #GQuark id to identify the data
6222 static void* type_get_qdata()(Type type, GLib2.Quark quark) nothrow {
6223 return g_type_get_qdata(type, quark);
6227 // Prior to any use of the type system, g_type_init() has to be called
6228 // to initialize the type system and assorted other code portions
6229 // (such as the various fundamental type implementations or the signal
6230 // system).
6232 // This function is idempotent.
6234 // Since version 2.24 this also initializes the thread system
6235 static void type_init()() nothrow {
6236 g_type_init();
6240 // Similar to g_type_init(), but additionally sets debug flags.
6242 // This function is idempotent.
6243 // <debug_flags>: Bitwise combination of #GTypeDebugFlags values for debugging purposes.
6244 static void type_init_with_debug_flags()(TypeDebugFlags debug_flags) nothrow {
6245 g_type_init_with_debug_flags(debug_flags);
6249 // MOVED TO: TypeInterface.add_prerequisite
6250 // Adds @prerequisite_type to the list of prerequisites of @interface_type.
6251 // This means that any type implementing @interface_type must also implement
6252 // @prerequisite_type. Prerequisites can be thought of as an alternative to
6253 // interface derivation (which GType doesn't support). An interface can have
6254 // at most one instantiatable prerequisite type.
6255 // <interface_type>: #GType value of an interface type.
6256 // <prerequisite_type>: #GType value of an interface or instantiatable type.
6257 static void type_interface_add_prerequisite()(Type interface_type, Type prerequisite_type) nothrow {
6258 g_type_interface_add_prerequisite(interface_type, prerequisite_type);
6262 // MOVED TO: TypeInterface.get_plugin
6263 // Returns the #GTypePlugin structure for the dynamic interface
6264 // @interface_type which has been added to @instance_type, or %NULL if
6265 // @interface_type has not been added to @instance_type or does not
6266 // have a #GTypePlugin structure. See g_type_add_interface_dynamic().
6268 // interface @interface_type of @instance_type.
6269 // RETURNS: the #GTypePlugin for the dynamic
6270 // <instance_type>: the #GType value of an instantiatable type.
6271 // <interface_type>: the #GType value of an interface type.
6272 static TypePlugin* type_interface_get_plugin()(Type instance_type, Type interface_type) nothrow {
6273 return g_type_interface_get_plugin(instance_type, interface_type);
6277 // MOVED TO: TypeInterface.peek
6278 // Returns the #GTypeInterface structure of an interface to which the
6279 // passed in class conforms.
6281 // structure of iface_type if implemented by @instance_class, %NULL
6282 // otherwise
6283 // RETURNS: The GTypeInterface
6284 // <instance_class>: A #GTypeClass structure.
6285 // <iface_type>: An interface ID which this class conforms to.
6286 static TypeInterface* type_interface_peek(AT0)(AT0 /*TypeClass*/ instance_class, Type iface_type) nothrow {
6287 return g_type_interface_peek(UpCast!(TypeClass*)(instance_class), iface_type);
6291 // VERSION: 2.2
6292 // MOVED TO: TypeInterface.prerequisites
6293 // Returns the prerequisites of an interfaces type.
6296 // newly-allocated zero-terminated array of #GType containing
6297 // the prerequisites of @interface_type
6298 // RETURNS: a
6299 // <interface_type>: an interface type
6300 // <n_prerequisites>: location to return the number of prerequisites, or %NULL
6301 static Type* /*new*/ type_interface_prerequisites(AT0)(Type interface_type, /*out*/ AT0 /*uint*/ n_prerequisites=null) nothrow {
6302 return g_type_interface_prerequisites(interface_type, UpCast!(uint*)(n_prerequisites));
6306 // Return a newly allocated and 0-terminated array of type IDs, listing the
6307 // interface types that @type conforms to. The return value has to be
6308 // g_free()ed after use.
6310 // allocated and 0-terminated array of interface types.
6311 // RETURNS: Newly
6312 // <type>: The type to list interface types for.
6313 // <n_interfaces>: Optional #guint pointer to contain the number of interface types.
6314 static Type* /*new*/ type_interfaces(AT0)(Type type, /*out*/ AT0 /*uint*/ n_interfaces=null) nothrow {
6315 return g_type_interfaces(type, UpCast!(uint*)(n_interfaces));
6319 // If @is_a_type is a derivable type, check whether @type is a
6320 // descendant of @is_a_type. If @is_a_type is an interface, check
6321 // whether @type conforms to it.
6322 // RETURNS: %TRUE if @type is_a @is_a_type holds true.
6323 // <type>: Type to check anchestry for.
6324 // <is_a_type>: Possible anchestor of @type or interface @type could conform to.
6325 static int type_is_a()(Type type, Type is_a_type) nothrow {
6326 return g_type_is_a(type, is_a_type);
6330 // Get the unique name that is assigned to a type ID. Note that this
6331 // function (like all other GType API) cannot cope with invalid type
6332 // IDs. %G_TYPE_INVALID may be passed to this function, as may be any
6333 // other validly registered type ID, but randomized type IDs should
6334 // not be passed in and will most likely lead to a crash.
6335 // RETURNS: Static type name or %NULL.
6336 // <type>: Type to return name for.
6337 static char* type_name()(Type type) nothrow {
6338 return g_type_name(type);
6341 static char* type_name_from_class(AT0)(AT0 /*TypeClass*/ g_class) nothrow {
6342 return g_type_name_from_class(UpCast!(TypeClass*)(g_class));
6345 static char* type_name_from_instance(AT0)(AT0 /*TypeInstance*/ instance) nothrow {
6346 return g_type_name_from_instance(UpCast!(TypeInstance*)(instance));
6350 // Given a @leaf_type and a @root_type which is contained in its
6351 // anchestry, return the type that @root_type is the immediate parent
6352 // of. In other words, this function determines the type that is
6353 // derived directly from @root_type which is also a base class of
6354 // @leaf_type. Given a root type and a leaf type, this function can
6355 // be used to determine the types and order in which the leaf type is
6356 // descended from the root type.
6357 // RETURNS: Immediate child of @root_type and anchestor of @leaf_type.
6358 // <leaf_type>: Descendant of @root_type and the type to be returned.
6359 // <root_type>: Immediate parent of the returned type.
6360 static Type type_next_base()(Type leaf_type, Type root_type) nothrow {
6361 return g_type_next_base(leaf_type, root_type);
6365 // Return the direct parent type of the passed in type. If the passed
6366 // in type has no parent, i.e. is a fundamental type, 0 is returned.
6367 // RETURNS: The parent type.
6368 // <type>: The derived type.
6369 static Type type_parent()(Type type) nothrow {
6370 return g_type_parent(type);
6374 // Get the corresponding quark of the type IDs name.
6375 // RETURNS: The type names quark or 0.
6376 // <type>: Type to return quark of type name for.
6377 static GLib2.Quark type_qname()(Type type) nothrow {
6378 return g_type_qname(type);
6382 // Queries the type system for information about a specific type.
6383 // This function will fill in a user-provided structure to hold
6384 // type-specific information. If an invalid #GType is passed in, the
6385 // @type member of the #GTypeQuery is 0. All members filled into the
6386 // #GTypeQuery structure should be considered constant and have to be
6387 // left untouched.
6388 // <type>: the #GType value of a static, classed type.
6389 // <query>: A user provided structure that is filled in with constant values upon success.
6390 static void type_query(AT0)(Type type, /*out*/ AT0 /*TypeQuery*/ query) nothrow {
6391 g_type_query(type, UpCast!(TypeQuery*)(query));
6395 // Registers @type_name as the name of a new dynamic type derived from
6396 // @parent_type. The type system uses the information contained in the
6397 // #GTypePlugin structure pointed to by @plugin to manage the type and its
6398 // instances (if not abstract). The value of @flags determines the nature
6399 // (e.g. abstract or not) of the type.
6400 // RETURNS: The new type identifier or #G_TYPE_INVALID if registration failed.
6401 // <parent_type>: Type from which this type will be derived.
6402 // <type_name>: 0-terminated string used as the name of the new type.
6403 // <plugin>: The #GTypePlugin structure to retrieve the #GTypeInfo from.
6404 // <flags>: Bitwise combination of #GTypeFlags values.
6405 static Type type_register_dynamic(AT0, AT1)(Type parent_type, AT0 /*char*/ type_name, AT1 /*TypePlugin*/ plugin, TypeFlags flags) nothrow {
6406 return g_type_register_dynamic(parent_type, toCString!(char*)(type_name), UpCast!(TypePlugin*)(plugin), flags);
6410 // Registers @type_id as the predefined identifier and @type_name as the
6411 // name of a fundamental type. If @type_id is already registered, or a type
6412 // named @type_name is already registered, the behaviour is undefined. The type
6413 // system uses the information contained in the #GTypeInfo structure pointed to
6414 // by @info and the #GTypeFundamentalInfo structure pointed to by @finfo to
6415 // manage the type and its instances. The value of @flags determines additional
6416 // characteristics of the fundamental type.
6417 // RETURNS: The predefined type identifier.
6418 // <type_id>: A predefined type identifier.
6419 // <type_name>: 0-terminated string used as the name of the new type.
6420 // <info>: The #GTypeInfo structure for this type.
6421 // <finfo>: The #GTypeFundamentalInfo structure for this type.
6422 // <flags>: Bitwise combination of #GTypeFlags values.
6423 static Type type_register_fundamental(AT0, AT1, AT2)(Type type_id, AT0 /*char*/ type_name, AT1 /*GTypeInfo*/ info, AT2 /*TypeFundamentalInfo*/ finfo, TypeFlags flags) nothrow {
6424 return g_type_register_fundamental(type_id, toCString!(char*)(type_name), UpCast!(GTypeInfo*)(info), UpCast!(TypeFundamentalInfo*)(finfo), flags);
6428 // Registers @type_name as the name of a new static type derived from
6429 // @parent_type. The type system uses the information contained in the
6430 // #GTypeInfo structure pointed to by @info to manage the type and its
6431 // instances (if not abstract). The value of @flags determines the nature
6432 // (e.g. abstract or not) of the type.
6433 // RETURNS: The new type identifier.
6434 // <parent_type>: Type from which this type will be derived.
6435 // <type_name>: 0-terminated string used as the name of the new type.
6436 // <info>: The #GTypeInfo structure for this type.
6437 // <flags>: Bitwise combination of #GTypeFlags values.
6438 static Type type_register_static(AT0, AT1)(Type parent_type, AT0 /*char*/ type_name, AT1 /*GTypeInfo*/ info, TypeFlags flags) nothrow {
6439 return g_type_register_static(parent_type, toCString!(char*)(type_name), UpCast!(GTypeInfo*)(info), flags);
6443 // Unintrospectable function: type_register_static_simple() / g_type_register_static_simple()
6444 // VERSION: 2.12
6445 // Registers @type_name as the name of a new static type derived from
6446 // @parent_type. The value of @flags determines the nature (e.g.
6447 // abstract or not) of the type. It works by filling a #GTypeInfo
6448 // struct and calling g_type_register_static().
6449 // RETURNS: The new type identifier.
6450 // <parent_type>: Type from which this type will be derived.
6451 // <type_name>: 0-terminated string used as the name of the new type.
6452 // <class_size>: Size of the class structure (see #GTypeInfo)
6453 // <class_init>: Location of the class initialization function (see #GTypeInfo)
6454 // <instance_size>: Size of the instance structure (see #GTypeInfo)
6455 // <instance_init>: Location of the instance initialization function (see #GTypeInfo)
6456 // <flags>: Bitwise combination of #GTypeFlags values.
6457 static Type type_register_static_simple(AT0)(Type parent_type, AT0 /*char*/ type_name, uint class_size, ClassInitFunc class_init, uint instance_size, InstanceInitFunc instance_init, TypeFlags flags) nothrow {
6458 return g_type_register_static_simple(parent_type, toCString!(char*)(type_name), class_size, class_init, instance_size, instance_init, flags);
6462 // Unintrospectable function: type_remove_class_cache_func() / g_type_remove_class_cache_func()
6463 // Removes a previously installed #GTypeClassCacheFunc. The cache
6464 // maintained by @cache_func has to be empty when calling
6465 // g_type_remove_class_cache_func() to avoid leaks.
6466 // <cache_data>: data that was given when adding @cache_func
6467 // <cache_func>: a #GTypeClassCacheFunc
6468 static void type_remove_class_cache_func(AT0)(AT0 /*void*/ cache_data, TypeClassCacheFunc cache_func) nothrow {
6469 g_type_remove_class_cache_func(UpCast!(void*)(cache_data), cache_func);
6473 // Unintrospectable function: type_remove_interface_check() / g_type_remove_interface_check()
6474 // VERSION: 2.4
6475 // Removes an interface check function added with
6476 // g_type_add_interface_check().
6477 // <check_data>: callback data passed to g_type_add_interface_check()
6478 // <check_func>: callback function passed to g_type_add_interface_check()
6479 static void type_remove_interface_check(AT0)(AT0 /*void*/ check_data, TypeInterfaceCheckFunc check_func) nothrow {
6480 g_type_remove_interface_check(UpCast!(void*)(check_data), check_func);
6484 // Attaches arbitrary data to a type.
6485 // <type>: a #GType
6486 // <quark>: a #GQuark id to identify the data
6487 // <data>: the data
6488 static void type_set_qdata(AT0)(Type type, GLib2.Quark quark, AT0 /*void*/ data) nothrow {
6489 g_type_set_qdata(type, quark, UpCast!(void*)(data));
6492 static int type_test_flags()(Type type, uint flags) nothrow {
6493 return g_type_test_flags(type, flags);
6497 // Unintrospectable function: type_value_table_peek() / g_type_value_table_peek()
6498 // MOVED TO: TypeValueTable.peek
6499 // Returns the location of the #GTypeValueTable associated with @type.
6500 // <emphasis>Note that this function should only be used from source code
6501 // that implements or has internal knowledge of the implementation of
6502 // @type.</emphasis>
6504 // %NULL if there is no #GTypeValueTable associated with @type.
6505 // RETURNS: Location of the #GTypeValueTable associated with @type or
6506 // <type>: A #GType value.
6507 static TypeValueTable* type_value_table_peek()(Type type) nothrow {
6508 return g_type_value_table_peek(type);
6512 // Unintrospectable function: value_register_transform_func() / g_value_register_transform_func()
6513 // MOVED TO: Value.register_transform_func
6514 // Registers a value transformation function for use in g_value_transform().
6515 // A previously registered transformation function for @src_type and @dest_type
6516 // will be replaced.
6517 // <src_type>: Source type.
6518 // <dest_type>: Target type.
6519 // <transform_func>: a function which transforms values of type @src_type into value of type @dest_type
6520 static void value_register_transform_func()(Type src_type, Type dest_type, ValueTransform transform_func) nothrow {
6521 g_value_register_transform_func(src_type, dest_type, transform_func);
6525 // MOVED TO: Value.type_compatible
6526 // Returns whether a #GValue of type @src_type can be copied into
6527 // a #GValue of type @dest_type.
6528 // RETURNS: %TRUE if g_value_copy() is possible with @src_type and @dest_type.
6529 // <src_type>: source type to be copied.
6530 // <dest_type>: destination type for copying.
6531 static int value_type_compatible()(Type src_type, Type dest_type) nothrow {
6532 return g_value_type_compatible(src_type, dest_type);
6536 // MOVED TO: Value.type_transformable
6537 // Check whether g_value_transform() is able to transform values
6538 // of type @src_type into values of type @dest_type.
6539 // RETURNS: %TRUE if the transformation is possible, %FALSE otherwise.
6540 // <src_type>: Source type.
6541 // <dest_type>: Target type.
6542 static int value_type_transformable()(Type src_type, Type dest_type) nothrow {
6543 return g_value_type_transformable(src_type, dest_type);
6547 // C prototypes:
6549 extern (C) {
6550 BindingFlags g_binding_get_flags(Binding* this_) nothrow;
6551 Object* g_binding_get_source(Binding* this_) nothrow;
6552 char* g_binding_get_source_property(Binding* this_) nothrow;
6553 Object* g_binding_get_target(Binding* this_) nothrow;
6554 char* g_binding_get_target_property(Binding* this_) nothrow;
6555 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;
6556 void g_cclosure_marshal_BOOLEAN__BOXED_BOXEDv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6557 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;
6558 void g_cclosure_marshal_BOOLEAN__FLAGSv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6559 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;
6560 void g_cclosure_marshal_STRING__OBJECT_POINTERv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6561 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;
6562 void g_cclosure_marshal_VOID__BOOLEANv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6563 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;
6564 void g_cclosure_marshal_VOID__BOXEDv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6565 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;
6566 void g_cclosure_marshal_VOID__CHARv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6567 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;
6568 void g_cclosure_marshal_VOID__DOUBLEv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6569 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;
6570 void g_cclosure_marshal_VOID__ENUMv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6571 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;
6572 void g_cclosure_marshal_VOID__FLAGSv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6573 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;
6574 void g_cclosure_marshal_VOID__FLOATv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6575 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;
6576 void g_cclosure_marshal_VOID__INTv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6577 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;
6578 void g_cclosure_marshal_VOID__LONGv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6579 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;
6580 void g_cclosure_marshal_VOID__OBJECTv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6581 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;
6582 void g_cclosure_marshal_VOID__PARAMv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6583 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;
6584 void g_cclosure_marshal_VOID__POINTERv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6585 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;
6586 void g_cclosure_marshal_VOID__STRINGv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6587 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;
6588 void g_cclosure_marshal_VOID__UCHARv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6589 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;
6590 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;
6591 void g_cclosure_marshal_VOID__UINT_POINTERv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6592 void g_cclosure_marshal_VOID__UINTv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6593 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;
6594 void g_cclosure_marshal_VOID__ULONGv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6595 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;
6596 void g_cclosure_marshal_VOID__VARIANTv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6597 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;
6598 void g_cclosure_marshal_VOID__VOIDv(Closure* closure, Value* return_value, void* instance, va_list args, void* marshal_data, int n_params, Type* param_types) nothrow;
6599 void g_cclosure_marshal_generic(Closure* closure, Value* return_gvalue, uint n_param_values, Value* param_values, void* invocation_hint, void* marshal_data) nothrow;
6600 void g_cclosure_marshal_generic_va(Closure* closure, Value* return_value, void* instance, va_list args_list, void* marshal_data, int n_params, Type* param_types) nothrow;
6601 Closure* /*new*/ g_cclosure_new(Callback callback_func, void* user_data, ClosureNotify destroy_data) nothrow;
6602 Closure* /*new*/ g_cclosure_new_object(Callback callback_func, Object* object) nothrow;
6603 Closure* /*new*/ g_cclosure_new_object_swap(Callback callback_func, Object* object) nothrow;
6604 Closure* /*new*/ g_cclosure_new_swap(Callback callback_func, void* user_data, ClosureNotify destroy_data) nothrow;
6605 Closure* /*new*/ g_closure_new_object(uint sizeof_closure, Object* object) nothrow;
6606 Closure* /*new*/ g_closure_new_simple(uint sizeof_closure, void* data) nothrow;
6607 void g_closure_add_finalize_notifier(Closure* this_, void* notify_data, ClosureNotify notify_func) nothrow;
6608 void g_closure_add_invalidate_notifier(Closure* this_, void* notify_data, ClosureNotify notify_func) nothrow;
6609 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;
6610 void g_closure_invalidate(Closure* this_) nothrow;
6611 void g_closure_invoke(Closure* this_, Value* return_value, uint n_param_values, Value* param_values, void* invocation_hint=null) nothrow;
6612 Closure* g_closure_ref(Closure* this_) nothrow;
6613 void g_closure_remove_finalize_notifier(Closure* this_, void* notify_data, ClosureNotify notify_func) nothrow;
6614 void g_closure_remove_invalidate_notifier(Closure* this_, void* notify_data, ClosureNotify notify_func) nothrow;
6615 void g_closure_set_marshal(Closure* this_, ClosureMarshal marshal) nothrow;
6616 void g_closure_set_meta_marshal(Closure* this_, void* marshal_data, ClosureMarshal meta_marshal) nothrow;
6617 void g_closure_sink(Closure* this_) nothrow;
6618 void g_closure_unref(Closure* this_) nothrow;
6619 Object* /*new*/ g_object_new_valist(Type object_type, char* first_property_name, va_list var_args) nothrow;
6620 Object* /*new*/ g_object_newv(Type object_type, uint n_parameters, Parameter* parameters) nothrow;
6621 size_t g_object_compat_control(size_t what, void* data) nothrow;
6622 void* g_object_connect(void* object, char* signal_spec, ...) nothrow;
6623 void g_object_disconnect(void* object, char* signal_spec, ...) nothrow;
6624 void g_object_get(void* object, char* first_property_name, ...) nothrow;
6625 ParamSpec* g_object_interface_find_property(void* g_iface, char* property_name) nothrow;
6626 void g_object_interface_install_property(void* g_iface, ParamSpec* pspec) nothrow;
6627 ParamSpec** /*new container*/ g_object_interface_list_properties(void* g_iface, /*out*/ uint* n_properties_p) nothrow;
6628 void* /*new*/ g_object_new(Type object_type, char* first_property_name, ...) nothrow;
6629 void g_object_set(void* object, char* first_property_name, ...) nothrow;
6630 void g_object_add_toggle_ref(Object* this_, ToggleNotify notify, void* data) nothrow;
6631 void g_object_add_weak_pointer(Object* this_, /*inout*/ void** weak_pointer_location) nothrow;
6632 Binding* g_object_bind_property(Object* this_, char* source_property, Object* target, char* target_property, BindingFlags flags) nothrow;
6633 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;
6634 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;
6635 void g_object_force_floating(Object* this_) nothrow;
6636 void g_object_freeze_notify(Object* this_) nothrow;
6637 void* g_object_get_data(Object* this_, char* key) nothrow;
6638 void g_object_get_property(Object* this_, char* property_name, Value* value) nothrow;
6639 void* g_object_get_qdata(Object* this_, GLib2.Quark quark) nothrow;
6640 void g_object_get_valist(Object* this_, char* first_property_name, va_list var_args) nothrow;
6641 int g_object_is_floating(Object* this_) nothrow;
6642 void g_object_notify(Object* this_, char* property_name) nothrow;
6643 void g_object_notify_by_pspec(Object* this_, ParamSpec* pspec) nothrow;
6644 Object* g_object_ref(Object* this_) nothrow;
6645 Object* g_object_ref_sink(Object* this_) nothrow;
6646 void g_object_remove_toggle_ref(Object* this_, ToggleNotify notify, void* data) nothrow;
6647 void g_object_remove_weak_pointer(Object* this_, /*inout*/ void** weak_pointer_location) nothrow;
6648 void g_object_run_dispose(Object* this_) nothrow;
6649 void g_object_set_data(Object* this_, char* key, void* data) nothrow;
6650 void g_object_set_data_full(Object* this_, char* key, void* data, GLib2.DestroyNotify destroy) nothrow;
6651 void g_object_set_property(Object* this_, char* property_name, Value* value) nothrow;
6652 void g_object_set_qdata(Object* this_, GLib2.Quark quark, void* data) nothrow;
6653 void g_object_set_qdata_full(Object* this_, GLib2.Quark quark, void* data, GLib2.DestroyNotify destroy) nothrow;
6654 void g_object_set_valist(Object* this_, char* first_property_name, va_list var_args) nothrow;
6655 void* /*new*/ g_object_steal_data(Object* this_, char* key) nothrow;
6656 void* /*new*/ g_object_steal_qdata(Object* this_, GLib2.Quark quark) nothrow;
6657 void g_object_thaw_notify(Object* this_) nothrow;
6658 void g_object_unref(Object* this_) nothrow;
6659 void g_object_watch_closure(Object* this_, Closure* closure) nothrow;
6660 void g_object_weak_ref(Object* this_, WeakNotify notify, void* data) nothrow;
6661 void g_object_weak_unref(Object* this_, WeakNotify notify, void* data) nothrow;
6662 ParamSpec* g_object_class_find_property(ObjectClass* this_, char* property_name) nothrow;
6663 void g_object_class_install_properties(ObjectClass* this_, uint n_pspecs, ParamSpec** pspecs) nothrow;
6664 void g_object_class_install_property(ObjectClass* this_, uint property_id, ParamSpec* pspec) nothrow;
6665 ParamSpec** /*new container*/ g_object_class_list_properties(ObjectClass* this_, /*out*/ uint* n_properties) nothrow;
6666 void g_object_class_override_property(ObjectClass* this_, uint property_id, char* name) nothrow;
6667 void* g_param_spec_internal(Type param_type, char* name, char* nick, char* blurb, ParamFlags flags) nothrow;
6668 char* g_param_spec_get_blurb(ParamSpec* this_) nothrow;
6669 char* g_param_spec_get_name(ParamSpec* this_) nothrow;
6670 char* g_param_spec_get_nick(ParamSpec* this_) nothrow;
6671 void* g_param_spec_get_qdata(ParamSpec* this_, GLib2.Quark quark) nothrow;
6672 ParamSpec* g_param_spec_get_redirect_target(ParamSpec* this_) nothrow;
6673 ParamSpec* g_param_spec_ref(ParamSpec* this_) nothrow;
6674 ParamSpec* g_param_spec_ref_sink(ParamSpec* this_) nothrow;
6675 void g_param_spec_set_qdata(ParamSpec* this_, GLib2.Quark quark, void* data) nothrow;
6676 void g_param_spec_set_qdata_full(ParamSpec* this_, GLib2.Quark quark, void* data, GLib2.DestroyNotify destroy) nothrow;
6677 void g_param_spec_sink(ParamSpec* this_) nothrow;
6678 void* g_param_spec_steal_qdata(ParamSpec* this_, GLib2.Quark quark) nothrow;
6679 void g_param_spec_unref(ParamSpec* this_) nothrow;
6680 void g_param_spec_pool_insert(ParamSpecPool* this_, ParamSpec* pspec, Type owner_type) nothrow;
6681 ParamSpec** /*new container*/ g_param_spec_pool_list(ParamSpecPool* this_, Type owner_type, /*out*/ uint* n_pspecs_p) nothrow;
6682 GLib2.List* /*new container*/ g_param_spec_pool_list_owned(ParamSpecPool* this_, Type owner_type) nothrow;
6683 ParamSpec* g_param_spec_pool_lookup(ParamSpecPool* this_, char* param_name, Type owner_type, int walk_ancestors) nothrow;
6684 void g_param_spec_pool_remove(ParamSpecPool* this_, ParamSpec* pspec) nothrow;
6685 ParamSpecPool* g_param_spec_pool_new(int type_prefixing) nothrow;
6686 void* g_type_class_get_private(TypeClass* this_, Type private_type) nothrow;
6687 TypeClass* g_type_class_peek_parent(TypeClass* this_) nothrow;
6688 void g_type_class_unref(TypeClass* this_) nothrow;
6689 void g_type_class_unref_uncached(TypeClass* this_) nothrow;
6690 void g_type_class_add_private(void* g_class, size_t private_size) nothrow;
6691 TypeClass* g_type_class_peek(Type type) nothrow;
6692 TypeClass* g_type_class_peek_static(Type type) nothrow;
6693 TypeClass* g_type_class_ref(Type type) nothrow;
6694 void* g_type_instance_get_private(TypeInstance* this_, Type private_type) nothrow;
6695 TypeInterface* g_type_interface_peek_parent(TypeInterface* this_) nothrow;
6696 void g_type_interface_add_prerequisite(Type interface_type, Type prerequisite_type) nothrow;
6697 TypePlugin* g_type_interface_get_plugin(Type instance_type, Type interface_type) nothrow;
6698 TypeInterface* g_type_interface_peek(TypeClass* instance_class, Type iface_type) nothrow;
6699 Type* /*new*/ g_type_interface_prerequisites(Type interface_type, /*out*/ uint* n_prerequisites=null) nothrow;
6700 void g_type_module_add_interface(TypeModule* this_, Type instance_type, Type interface_type, InterfaceInfo* interface_info) nothrow;
6701 Type g_type_module_register_enum(TypeModule* this_, char* name, EnumValue* const_static_values) nothrow;
6702 Type g_type_module_register_flags(TypeModule* this_, char* name, FlagsValue* const_static_values) nothrow;
6703 Type g_type_module_register_type(TypeModule* this_, Type parent_type, char* type_name, GTypeInfo* type_info, TypeFlags flags) nothrow;
6704 void g_type_module_set_name(TypeModule* this_, char* name) nothrow;
6705 void g_type_module_unuse(TypeModule* this_) nothrow;
6706 int g_type_module_use(TypeModule* this_) nothrow;
6707 void g_type_plugin_complete_interface_info(TypePlugin* this_, Type instance_type, Type interface_type, InterfaceInfo* info) nothrow;
6708 void g_type_plugin_complete_type_info(TypePlugin* this_, Type g_type, GTypeInfo* info, TypeValueTable* value_table) nothrow;
6709 void g_type_plugin_unuse(TypePlugin* this_) nothrow;
6710 void g_type_plugin_use(TypePlugin* this_) nothrow;
6711 TypeValueTable* g_type_value_table_peek(Type type) nothrow;
6712 void g_value_copy(Value* this_, Value* dest_value) nothrow;
6713 void* g_value_dup_boxed(Value* this_) nothrow;
6714 Object* /*new*/ g_value_dup_object(Value* this_) nothrow;
6715 ParamSpec* g_value_dup_param(Value* this_) nothrow;
6716 char* /*new*/ g_value_dup_string(Value* this_) nothrow;
6717 GLib2.Variant* /*new*/ g_value_dup_variant(Value* this_) nothrow;
6718 int g_value_fits_pointer(Value* this_) nothrow;
6719 int g_value_get_boolean(Value* this_) nothrow;
6720 void* g_value_get_boxed(Value* this_) nothrow;
6721 char g_value_get_char(Value* this_) nothrow;
6722 double g_value_get_double(Value* this_) nothrow;
6723 int g_value_get_enum(Value* this_) nothrow;
6724 uint g_value_get_flags(Value* this_) nothrow;
6725 float g_value_get_float(Value* this_) nothrow;
6726 Type g_value_get_gtype(Value* this_) nothrow;
6727 int g_value_get_int(Value* this_) nothrow;
6728 long g_value_get_int64(Value* this_) nothrow;
6729 c_long g_value_get_long(Value* this_) nothrow;
6730 Object* g_value_get_object(Value* this_) nothrow;
6731 ParamSpec* g_value_get_param(Value* this_) nothrow;
6732 void* g_value_get_pointer(Value* this_) nothrow;
6733 byte g_value_get_schar(Value* this_) nothrow;
6734 char* g_value_get_string(Value* this_) nothrow;
6735 ubyte g_value_get_uchar(Value* this_) nothrow;
6736 uint g_value_get_uint(Value* this_) nothrow;
6737 ulong g_value_get_uint64(Value* this_) nothrow;
6738 c_ulong g_value_get_ulong(Value* this_) nothrow;
6739 GLib2.Variant* /*new*/ g_value_get_variant(Value* this_) nothrow;
6740 Value* g_value_init(Value* this_, Type g_type) nothrow;
6741 void* g_value_peek_pointer(Value* this_) nothrow;
6742 Value* /*new*/ g_value_reset(Value* this_) nothrow;
6743 void g_value_set_boolean(Value* this_, int v_boolean) nothrow;
6744 void g_value_set_boxed(Value* this_, const(void)* v_boxed=null) nothrow;
6745 void g_value_set_boxed_take_ownership(Value* this_, const(void)* v_boxed=null) nothrow;
6746 void g_value_set_char(Value* this_, char v_char) nothrow;
6747 void g_value_set_double(Value* this_, double v_double) nothrow;
6748 void g_value_set_enum(Value* this_, int v_enum) nothrow;
6749 void g_value_set_flags(Value* this_, uint v_flags) nothrow;
6750 void g_value_set_float(Value* this_, float v_float) nothrow;
6751 void g_value_set_gtype(Value* this_, Type v_gtype) nothrow;
6752 void g_value_set_instance(Value* this_, void* instance=null) nothrow;
6753 void g_value_set_int(Value* this_, int v_int) nothrow;
6754 void g_value_set_int64(Value* this_, long v_int64) nothrow;
6755 void g_value_set_long(Value* this_, c_long v_long) nothrow;
6756 void g_value_set_object(Value* this_, Object* v_object=null) nothrow;
6757 void g_value_set_object_take_ownership(Value* this_, void* v_object=null) nothrow;
6758 void g_value_set_param(Value* this_, ParamSpec* param=null) nothrow;
6759 void g_value_set_param_take_ownership(Value* this_, ParamSpec* param=null) nothrow;
6760 void g_value_set_pointer(Value* this_, void* v_pointer) nothrow;
6761 void g_value_set_schar(Value* this_, byte v_char) nothrow;
6762 void g_value_set_static_boxed(Value* this_, const(void)* v_boxed=null) nothrow;
6763 void g_value_set_static_string(Value* this_, char* v_string=null) nothrow;
6764 void g_value_set_string(Value* this_, char* v_string=null) nothrow;
6765 void g_value_set_string_take_ownership(Value* this_, char* v_string=null) nothrow;
6766 void g_value_set_uchar(Value* this_, ubyte v_uchar) nothrow;
6767 void g_value_set_uint(Value* this_, uint v_uint) nothrow;
6768 void g_value_set_uint64(Value* this_, ulong v_uint64) nothrow;
6769 void g_value_set_ulong(Value* this_, c_ulong v_ulong) nothrow;
6770 void g_value_set_variant(Value* this_, GLib2.Variant* variant=null) nothrow;
6771 void g_value_take_boxed(Value* this_, const(void)* v_boxed=null) nothrow;
6772 void g_value_take_object(Value* this_, void* v_object=null) nothrow;
6773 void g_value_take_param(Value* this_, ParamSpec* param=null) nothrow;
6774 void g_value_take_string(Value* this_, char* v_string=null) nothrow;
6775 void g_value_take_variant(Value* this_, GLib2.Variant* variant=null) nothrow;
6776 int g_value_transform(Value* this_, Value* dest_value) nothrow;
6777 void g_value_unset(Value* this_) nothrow;
6778 void g_value_register_transform_func(Type src_type, Type dest_type, ValueTransform transform_func) nothrow;
6779 int g_value_type_compatible(Type src_type, Type dest_type) nothrow;
6780 int g_value_type_transformable(Type src_type, Type dest_type) nothrow;
6781 ValueArray* /*new*/ g_value_array_new(uint n_prealloced) nothrow;
6782 ValueArray* g_value_array_append(ValueArray* this_, Value* value=null) nothrow;
6783 ValueArray* /*new*/ g_value_array_copy(ValueArray* this_) nothrow;
6784 void g_value_array_free(ValueArray* this_) nothrow;
6785 Value* g_value_array_get_nth(ValueArray* this_, uint index_) nothrow;
6786 ValueArray* g_value_array_insert(ValueArray* this_, uint index_, Value* value=null) nothrow;
6787 ValueArray* g_value_array_prepend(ValueArray* this_, Value* value=null) nothrow;
6788 ValueArray* g_value_array_remove(ValueArray* this_, uint index_) nothrow;
6789 ValueArray* g_value_array_sort(ValueArray* this_, GLib2.CompareFunc compare_func) nothrow;
6790 ValueArray* g_value_array_sort_with_data(ValueArray* this_, GLib2.CompareDataFunc compare_func, void* user_data) nothrow;
6791 void g_weak_ref_clear(WeakRef* this_) nothrow;
6792 Object* /*new*/ g_weak_ref_get(WeakRef* this_) nothrow;
6793 void g_weak_ref_init(WeakRef* this_, void* object=null) nothrow;
6794 void g_weak_ref_set(WeakRef* this_, void* object=null) nothrow;
6795 void* g_boxed_copy(Type boxed_type, const(void)* src_boxed) nothrow;
6796 void g_boxed_free(Type boxed_type, void* boxed) nothrow;
6797 Type g_boxed_type_register_static(char* name, BoxedCopyFunc boxed_copy, BoxedFreeFunc boxed_free) nothrow;
6798 void g_clear_object(Object** object_ptr) nothrow;
6799 void g_enum_complete_type_info(Type g_enum_type, GTypeInfo* info, EnumValue* const_values) nothrow;
6800 EnumValue* g_enum_get_value(EnumClass* enum_class, int value) nothrow;
6801 EnumValue* g_enum_get_value_by_name(EnumClass* enum_class, char* name) nothrow;
6802 EnumValue* g_enum_get_value_by_nick(EnumClass* enum_class, char* nick) nothrow;
6803 Type g_enum_register_static(char* name, EnumValue* const_static_values) nothrow;
6804 void g_flags_complete_type_info(Type g_flags_type, GTypeInfo* info, FlagsValue* const_values) nothrow;
6805 FlagsValue* g_flags_get_first_value(FlagsClass* flags_class, uint value) nothrow;
6806 FlagsValue* g_flags_get_value_by_name(FlagsClass* flags_class, char* name) nothrow;
6807 FlagsValue* g_flags_get_value_by_nick(FlagsClass* flags_class, char* nick) nothrow;
6808 Type g_flags_register_static(char* name, FlagsValue* const_static_values) nothrow;
6809 Type g_gtype_get_type() nothrow;
6810 ParamSpec* g_param_spec_boolean(char* name, char* nick, char* blurb, int default_value, ParamFlags flags) nothrow;
6811 ParamSpec* g_param_spec_boxed(char* name, char* nick, char* blurb, Type boxed_type, ParamFlags flags) nothrow;
6812 ParamSpec* g_param_spec_char(char* name, char* nick, char* blurb, byte minimum, byte maximum, byte default_value, ParamFlags flags) nothrow;
6813 ParamSpec* g_param_spec_double(char* name, char* nick, char* blurb, double minimum, double maximum, double default_value, ParamFlags flags) nothrow;
6814 ParamSpec* g_param_spec_enum(char* name, char* nick, char* blurb, Type enum_type, int default_value, ParamFlags flags) nothrow;
6815 ParamSpec* g_param_spec_flags(char* name, char* nick, char* blurb, Type flags_type, uint default_value, ParamFlags flags) nothrow;
6816 ParamSpec* g_param_spec_float(char* name, char* nick, char* blurb, float minimum, float maximum, float default_value, ParamFlags flags) nothrow;
6817 ParamSpec* g_param_spec_gtype(char* name, char* nick, char* blurb, Type is_a_type, ParamFlags flags) nothrow;
6818 ParamSpec* g_param_spec_int(char* name, char* nick, char* blurb, int minimum, int maximum, int default_value, ParamFlags flags) nothrow;
6819 ParamSpec* g_param_spec_int64(char* name, char* nick, char* blurb, long minimum, long maximum, long default_value, ParamFlags flags) nothrow;
6820 ParamSpec* g_param_spec_long(char* name, char* nick, char* blurb, c_long minimum, c_long maximum, c_long default_value, ParamFlags flags) nothrow;
6821 ParamSpec* g_param_spec_object(char* name, char* nick, char* blurb, Type object_type, ParamFlags flags) nothrow;
6822 ParamSpec* g_param_spec_override(char* name, ParamSpec* overridden) nothrow;
6823 ParamSpec* g_param_spec_param(char* name, char* nick, char* blurb, Type param_type, ParamFlags flags) nothrow;
6824 ParamSpec* g_param_spec_pointer(char* name, char* nick, char* blurb, ParamFlags flags) nothrow;
6825 ParamSpec* g_param_spec_string(char* name, char* nick, char* blurb, char* default_value, ParamFlags flags) nothrow;
6826 ParamSpec* g_param_spec_uchar(char* name, char* nick, char* blurb, ubyte minimum, ubyte maximum, ubyte default_value, ParamFlags flags) nothrow;
6827 ParamSpec* g_param_spec_uint(char* name, char* nick, char* blurb, uint minimum, uint maximum, uint default_value, ParamFlags flags) nothrow;
6828 ParamSpec* g_param_spec_uint64(char* name, char* nick, char* blurb, ulong minimum, ulong maximum, ulong default_value, ParamFlags flags) nothrow;
6829 ParamSpec* g_param_spec_ulong(char* name, char* nick, char* blurb, c_ulong minimum, c_ulong maximum, c_ulong default_value, ParamFlags flags) nothrow;
6830 ParamSpec* g_param_spec_unichar(char* name, char* nick, char* blurb, dchar default_value, ParamFlags flags) nothrow;
6831 ParamSpec* g_param_spec_value_array(char* name, char* nick, char* blurb, ParamSpec* element_spec, ParamFlags flags) nothrow;
6832 ParamSpec* g_param_spec_variant(char* name, char* nick, char* blurb, GLib2.VariantType* type, GLib2.Variant* default_value, ParamFlags flags) nothrow;
6833 Type g_param_type_register_static(char* name, ParamSpecTypeInfo* pspec_info) nothrow;
6834 int g_param_value_convert(ParamSpec* pspec, Value* src_value, Value* dest_value, int strict_validation) nothrow;
6835 int g_param_value_defaults(ParamSpec* pspec, Value* value) nothrow;
6836 void g_param_value_set_default(ParamSpec* pspec, Value* value) nothrow;
6837 int g_param_value_validate(ParamSpec* pspec, Value* value) nothrow;
6838 int g_param_values_cmp(ParamSpec* pspec, Value* value1, Value* value2) nothrow;
6839 Type g_pointer_type_register_static(char* name) nothrow;
6840 int g_signal_accumulator_first_wins(SignalInvocationHint* ihint, Value* return_accu, Value* handler_return, void* dummy) nothrow;
6841 int g_signal_accumulator_true_handled(SignalInvocationHint* ihint, Value* return_accu, Value* handler_return, void* dummy) nothrow;
6842 c_ulong g_signal_add_emission_hook(uint signal_id, GLib2.Quark detail, SignalEmissionHook hook_func, void* hook_data, GLib2.DestroyNotify data_destroy) nothrow;
6843 void g_signal_chain_from_overridden(Value* instance_and_params, Value* return_value) nothrow;
6844 void g_signal_chain_from_overridden_handler(void* instance, ...) nothrow;
6845 c_ulong g_signal_connect_closure(void* instance, char* detailed_signal, Closure* closure, int after) nothrow;
6846 c_ulong g_signal_connect_closure_by_id(void* instance, uint signal_id, GLib2.Quark detail, Closure* closure, int after) nothrow;
6847 c_ulong g_signal_connect_data(void* instance, char* detailed_signal, Callback c_handler, void* data, ClosureNotify destroy_data, ConnectFlags connect_flags) nothrow;
6848 c_ulong g_signal_connect_object(void* instance, char* detailed_signal, Callback c_handler, void* gobject, ConnectFlags connect_flags) nothrow;
6849 void g_signal_emit(void* instance, uint signal_id, GLib2.Quark detail, ...) nothrow;
6850 void g_signal_emit_by_name(void* instance, char* detailed_signal, ...) nothrow;
6851 void g_signal_emit_valist(void* instance, uint signal_id, GLib2.Quark detail, va_list var_args) nothrow;
6852 void g_signal_emitv(Value* instance_and_params, uint signal_id, GLib2.Quark detail, Value* return_value) nothrow;
6853 SignalInvocationHint* g_signal_get_invocation_hint(void* instance) nothrow;
6854 void g_signal_handler_block(void* instance, c_ulong handler_id) nothrow;
6855 void g_signal_handler_disconnect(void* instance, c_ulong handler_id) nothrow;
6856 c_ulong g_signal_handler_find(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data) nothrow;
6857 int g_signal_handler_is_connected(void* instance, c_ulong handler_id) nothrow;
6858 void g_signal_handler_unblock(void* instance, c_ulong handler_id) nothrow;
6859 uint g_signal_handlers_block_matched(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data) nothrow;
6860 void g_signal_handlers_destroy(void* instance) nothrow;
6861 uint g_signal_handlers_disconnect_matched(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data) nothrow;
6862 uint g_signal_handlers_unblock_matched(void* instance, SignalMatchType mask, uint signal_id, GLib2.Quark detail, Closure* closure, void* func, void* data) nothrow;
6863 int g_signal_has_handler_pending(void* instance, uint signal_id, GLib2.Quark detail, int may_be_blocked) nothrow;
6864 uint* g_signal_list_ids(Type itype, /*out*/ uint* n_ids) nothrow;
6865 uint g_signal_lookup(char* name, Type itype) nothrow;
6866 char* g_signal_name(uint signal_id) nothrow;
6867 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;
6868 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;
6869 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;
6870 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;
6871 void g_signal_override_class_closure(uint signal_id, Type instance_type, Closure* class_closure) nothrow;
6872 void g_signal_override_class_handler(char* signal_name, Type instance_type, Callback class_handler) nothrow;
6873 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;
6874 void g_signal_query(uint signal_id, /*out*/ SignalQuery* query) nothrow;
6875 void g_signal_remove_emission_hook(uint signal_id, c_ulong hook_id) nothrow;
6876 void g_signal_set_va_marshaller(uint signal_id, Type instance_type, SignalCVaMarshaller va_marshaller) nothrow;
6877 void g_signal_stop_emission(void* instance, uint signal_id, GLib2.Quark detail) nothrow;
6878 void g_signal_stop_emission_by_name(void* instance, char* detailed_signal) nothrow;
6879 Closure* /*new*/ g_signal_type_cclosure_new(Type itype, uint struct_offset) nothrow;
6880 void g_source_set_closure(GLib2.Source* source, Closure* closure) nothrow;
6881 void g_source_set_dummy_callback(GLib2.Source* source) nothrow;
6882 char* /*new*/ g_strdup_value_contents(Value* value) nothrow;
6883 void g_type_add_class_cache_func(void* cache_data, TypeClassCacheFunc cache_func) nothrow;
6884 void g_type_add_class_private(Type class_type, size_t private_size) nothrow;
6885 void g_type_add_interface_check(void* check_data, TypeInterfaceCheckFunc check_func) nothrow;
6886 void g_type_add_interface_dynamic(Type instance_type, Type interface_type, TypePlugin* plugin) nothrow;
6887 void g_type_add_interface_static(Type instance_type, Type interface_type, InterfaceInfo* info) nothrow;
6888 TypeClass* g_type_check_class_cast(TypeClass* g_class, Type is_a_type) nothrow;
6889 int g_type_check_class_is_a(TypeClass* g_class, Type is_a_type) nothrow;
6890 int g_type_check_instance(TypeInstance* instance) nothrow;
6891 TypeInstance* g_type_check_instance_cast(TypeInstance* instance, Type iface_type) nothrow;
6892 int g_type_check_instance_is_a(TypeInstance* instance, Type iface_type) nothrow;
6893 int g_type_check_is_value_type(Type type) nothrow;
6894 int g_type_check_value(Value* value) nothrow;
6895 int g_type_check_value_holds(Value* value, Type type) nothrow;
6896 Type* /*new*/ g_type_children(Type type, /*out*/ uint* n_children=null) nothrow;
6897 TypeInstance* g_type_create_instance(Type type) nothrow;
6898 TypeInterface* g_type_default_interface_peek(Type g_type) nothrow;
6899 TypeInterface* g_type_default_interface_ref(Type g_type) nothrow;
6900 void g_type_default_interface_unref(TypeInterface* g_iface) nothrow;
6901 uint g_type_depth(Type type) nothrow;
6902 void g_type_free_instance(TypeInstance* instance) nothrow;
6903 Type g_type_from_name(char* name) nothrow;
6904 Type g_type_fundamental(Type type_id) nothrow;
6905 Type g_type_fundamental_next() nothrow;
6906 TypePlugin* g_type_get_plugin(Type type) nothrow;
6907 void* g_type_get_qdata(Type type, GLib2.Quark quark) nothrow;
6908 void g_type_init() nothrow;
6909 void g_type_init_with_debug_flags(TypeDebugFlags debug_flags) nothrow;
6910 Type* /*new*/ g_type_interfaces(Type type, /*out*/ uint* n_interfaces=null) nothrow;
6911 int g_type_is_a(Type type, Type is_a_type) nothrow;
6912 char* g_type_name(Type type) nothrow;
6913 char* g_type_name_from_class(TypeClass* g_class) nothrow;
6914 char* g_type_name_from_instance(TypeInstance* instance) nothrow;
6915 Type g_type_next_base(Type leaf_type, Type root_type) nothrow;
6916 Type g_type_parent(Type type) nothrow;
6917 GLib2.Quark g_type_qname(Type type) nothrow;
6918 void g_type_query(Type type, /*out*/ TypeQuery* query) nothrow;
6919 Type g_type_register_dynamic(Type parent_type, char* type_name, TypePlugin* plugin, TypeFlags flags) nothrow;
6920 Type g_type_register_fundamental(Type type_id, char* type_name, GTypeInfo* info, TypeFundamentalInfo* finfo, TypeFlags flags) nothrow;
6921 Type g_type_register_static(Type parent_type, char* type_name, GTypeInfo* info, TypeFlags flags) nothrow;
6922 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;
6923 void g_type_remove_class_cache_func(void* cache_data, TypeClassCacheFunc cache_func) nothrow;
6924 void g_type_remove_interface_check(void* check_data, TypeInterfaceCheckFunc check_func) nothrow;
6925 void g_type_set_qdata(Type type, GLib2.Quark quark, void* data) nothrow;
6926 int g_type_test_flags(Type type, uint flags) nothrow;