Imported Upstream version 1.38.0
[platform/upstream/gobject-introspection.git] / gir / gobject-2.0.c
1 /************************************************************/
2 /* THIS FILE IS GENERATED DO NOT EDIT */
3 /************************************************************/
4
5 /**
6  * GBinding:flags:
7  *
8  * Flags to be used to control the #GBinding
9  *
10  * Since: 2.26
11  */
12
13
14 /**
15  * GBinding:source:
16  *
17  * The #GObject that should be used as the source of the binding
18  *
19  * Since: 2.26
20  */
21
22
23 /**
24  * GBinding:source-property:
25  *
26  * The name of the property of #GBinding:source that should be used
27  * as the source of the binding
28  *
29  * Since: 2.26
30  */
31
32
33 /**
34  * GBinding:target:
35  *
36  * The #GObject that should be used as the target of the binding
37  *
38  * Since: 2.26
39  */
40
41
42 /**
43  * GBinding:target-property:
44  *
45  * The name of the property of #GBinding:target that should be used
46  * as the target of the binding
47  *
48  * Since: 2.26
49  */
50
51
52 /**
53  * GObject::notify:
54  * @gobject: the object which received the signal.
55  * @pspec: the #GParamSpec of the property which changed.
56  *
57  * The notify signal is emitted on an object when one of its
58  * properties has been changed. Note that getting this signal
59  * doesn't guarantee that the value of the property has actually
60  * changed, it may also be emitted when the setter for the property
61  * is called to reinstate the previous value.
62  *
63  * This signal is typically used to obtain change notification for a
64  * single property, by specifying the property name as a detail in the
65  * g_signal_connect() call, like this:
66  * |[
67  * g_signal_connect (text_view->buffer, "notify::paste-target-list",
68  *                   G_CALLBACK (gtk_text_view_target_list_notify),
69  *                   text_view)
70  * ]|
71  * It is important to note that you must use
72  * <link linkend="canonical-parameter-name">canonical</link> parameter names as
73  * detail strings for the notify signal.
74  */
75
76
77 /**
78  * GParamSpecPool:
79  *
80  * A #GParamSpecPool maintains a collection of #GParamSpec<!-- -->s which can be
81  * quickly accessed by owner and name. The implementation of the #GObject property
82  * system uses such a pool to store the #GParamSpecs of the properties all object
83  * types.
84  */
85
86
87 /**
88  * GWeakRef:
89  *
90  * A structure containing a weak reference to a #GObject.  It can either
91  * be empty (i.e. point to %NULL), or point to an object for as long as
92  * at least one "strong" reference to that object exists. Before the
93  * object's #GObjectClass.dispose method is called, every #GWeakRef
94  * associated with becomes empty (i.e. points to %NULL).
95  *
96  * Like #GValue, #GWeakRef can be statically allocated, stack- or
97  * heap-allocated, or embedded in larger structures.
98  *
99  * Unlike g_object_weak_ref() and g_object_add_weak_pointer(), this weak
100  * reference is thread-safe: converting a weak pointer to a reference is
101  * atomic with respect to invalidation of weak pointers to destroyed
102  * objects.
103  *
104  * If the object's #GObjectClass.dispose method results in additional
105  * references to the object being held, any #GWeakRef<!-- -->s taken
106  * before it was disposed will continue to point to %NULL.  If
107  * #GWeakRef<!-- -->s are taken after the object is disposed and
108  * re-referenced, they will continue to point to it until its refcount
109  * goes back to zero, at which point they too will be invalidated.
110  */
111
112
113 /**
114  * SECTION:enumerations_flags
115  * @short_description: Enumeration and flags types
116  * @title: Enumeration and Flag Types
117  * @see_also: #GParamSpecEnum, #GParamSpecFlags, g_param_spec_enum(), g_param_spec_flags()
118  *
119  * The GLib type system provides fundamental types for enumeration and
120  * flags types. (Flags types are like enumerations, but allow their
121  * values to be combined by bitwise or). A registered enumeration or
122  * flags type associates a name and a nickname with each allowed
123  * value, and the methods g_enum_get_value_by_name(),
124  * g_enum_get_value_by_nick(), g_flags_get_value_by_name() and
125  * g_flags_get_value_by_nick() can look up values by their name or
126  * nickname.  When an enumeration or flags type is registered with the
127  * GLib type system, it can be used as value type for object
128  * properties, using g_param_spec_enum() or g_param_spec_flags().
129  *
130  * GObject ships with a utility called <link
131  * linkend="glib-mkenums">glib-mkenums</link> that can construct
132  * suitable type registration functions from C enumeration
133  * definitions.
134  */
135
136
137 /**
138  * SECTION:gbinding
139  * @Title: GBinding
140  * @Short_Description: Bind two object properties
141  *
142  * #GBinding is the representation of a binding between a property on a
143  * #GObject instance (or source) and another property on another #GObject
144  * instance (or target). Whenever the source property changes, the same
145  * value is applied to the target property; for instance, the following
146  * binding:
147  *
148  * |[
149  *   g_object_bind_property (object1, "property-a",
150  *                           object2, "property-b",
151  *                           G_BINDING_DEFAULT);
152  * ]|
153  *
154  * will cause <emphasis>object2:property-b</emphasis> to be updated every
155  * time g_object_set() or the specific accessor changes the value of
156  * <emphasis>object1:property-a</emphasis>.
157  *
158  * It is possible to create a bidirectional binding between two properties
159  * of two #GObject instances, so that if either property changes, the
160  * other is updated as well, for instance:
161  *
162  * |[
163  *   g_object_bind_property (object1, "property-a",
164  *                           object2, "property-b",
165  *                           G_BINDING_BIDIRECTIONAL);
166  * ]|
167  *
168  * will keep the two properties in sync.
169  *
170  * It is also possible to set a custom transformation function (in both
171  * directions, in case of a bidirectional binding) to apply a custom
172  * transformation from the source value to the target value before
173  * applying it; for instance, the following binding:
174  *
175  * |[
176  *   g_object_bind_property_full (adjustment1, "value",
177  *                                adjustment2, "value",
178  *                                G_BINDING_BIDIRECTIONAL,
179  *                                celsius_to_fahrenheit,
180  *                                fahrenheit_to_celsius,
181  *                                NULL, NULL);
182  * ]|
183  *
184  * will keep the <emphasis>value</emphasis> property of the two adjustments
185  * in sync; the <function>celsius_to_fahrenheit</function> function will be
186  * called whenever the <emphasis>adjustment1:value</emphasis> property changes
187  * and will transform the current value of the property before applying it
188  * to the <emphasis>adjustment2:value</emphasis> property; vice versa, the
189  * <function>fahrenheit_to_celsius</function> function will be called whenever
190  * the <emphasis>adjustment2:value</emphasis> property changes, and will
191  * transform the current value of the property before applying it to the
192  * <emphasis>adjustment1:value</emphasis>.
193  *
194  * Note that #GBinding does not resolve cycles by itself; a cycle like
195  *
196  * |[
197  *   object1:propertyA -> object2:propertyB
198  *   object2:propertyB -> object3:propertyC
199  *   object3:propertyC -> object1:propertyA
200  * ]|
201  *
202  * might lead to an infinite loop. The loop, in this particular case,
203  * can be avoided if the objects emit the #GObject::notify signal only
204  * if the value has effectively been changed. A binding is implemented
205  * using the #GObject::notify signal, so it is susceptible to all the
206  * various ways of blocking a signal emission, like g_signal_stop_emission()
207  * or g_signal_handler_block().
208  *
209  * A binding will be severed, and the resources it allocates freed, whenever
210  * either one of the #GObject instances it refers to are finalized, or when
211  * the #GBinding instance loses its last reference.
212  *
213  * <note><para>Bindings for languages with garbage collection can use
214  * g_binding_unbind() to explicitly release a binding between the source
215  * and target properties, instead of relying on the last reference on the
216  * binding, source, and target instances to drop.</para></note>
217  *
218  * #GBinding is available since GObject 2.26
219  */
220
221
222 /**
223  * SECTION:gboxed
224  * @short_description: A mechanism to wrap opaque C structures registered by the type system
225  * @see_also: #GParamSpecBoxed, g_param_spec_boxed()
226  * @title: Boxed Types
227  *
228  * GBoxed is a generic wrapper mechanism for arbitrary C structures. The only
229  * thing the type system needs to know about the structures is how to copy and
230  * free them, beyond that they are treated as opaque chunks of memory.
231  *
232  * Boxed types are useful for simple value-holder structures like rectangles or
233  * points. They can also be used for wrapping structures defined in non-GObject
234  * based libraries.
235  */
236
237
238 /**
239  * SECTION:gclosure
240  * @short_description: Functions as first-class objects
241  * @title: Closures
242  *
243  * A #GClosure represents a callback supplied by the programmer. It
244  * will generally comprise a function of some kind and a marshaller
245  * used to call it. It is the reponsibility of the marshaller to
246  * convert the arguments for the invocation from #GValue<!-- -->s into
247  * a suitable form, perform the callback on the converted arguments,
248  * and transform the return value back into a #GValue.
249  *
250  * In the case of C programs, a closure usually just holds a pointer
251  * to a function and maybe a data argument, and the marshaller
252  * converts between #GValue<!-- --> and native C types. The GObject
253  * library provides the #GCClosure type for this purpose. Bindings for
254  * other languages need marshallers which convert between #GValue<!--
255  * -->s and suitable representations in the runtime of the language in
256  * order to use functions written in that languages as callbacks.
257  *
258  * Within GObject, closures play an important role in the
259  * implementation of signals. When a signal is registered, the
260  * @c_marshaller argument to g_signal_new() specifies the default C
261  * marshaller for any closure which is connected to this
262  * signal. GObject provides a number of C marshallers for this
263  * purpose, see the g_cclosure_marshal_*() functions. Additional C
264  * marshallers can be generated with the <link
265  * linkend="glib-genmarshal">glib-genmarshal</link> utility.  Closures
266  * can be explicitly connected to signals with
267  * g_signal_connect_closure(), but it usually more convenient to let
268  * GObject create a closure automatically by using one of the
269  * g_signal_connect_*() functions which take a callback function/user
270  * data pair.
271  *
272  * Using closures has a number of important advantages over a simple
273  * callback function/data pointer combination:
274  * <itemizedlist>
275  * <listitem><para>
276  * Closures allow the callee to get the types of the callback parameters,
277  * which means that language bindings don't have to write individual glue
278  * for each callback type.
279  * </para></listitem>
280  * <listitem><para>
281  * The reference counting of #GClosure makes it easy to handle reentrancy
282  * right; if a callback is removed while it is being invoked, the closure
283  * and its parameters won't be freed until the invocation finishes.
284  * </para></listitem>
285  * <listitem><para>
286  * g_closure_invalidate() and invalidation notifiers allow callbacks to be
287  * automatically removed when the objects they point to go away.
288  * </para></listitem>
289  * </itemizedlist>
290  */
291
292
293 /**
294  * SECTION:generic_values
295  * @short_description: A polymorphic type that can hold values of any other type
296  * @see_also: The fundamental types which all support #GValue operations and thus can be used as a type initializer for g_value_init() are defined by a separate interface.  See the <link linkend="gobject-Standard-Parameter-and-Value-Types">Standard Values API</link> for details.
297  * @title: Generic values
298  *
299  * The #GValue structure is basically a variable container that consists
300  * of a type identifier and a specific value of that type.
301  * The type identifier within a #GValue structure always determines the
302  * type of the associated value.
303  * To create a undefined #GValue structure, simply create a zero-filled
304  * #GValue structure. To initialize the #GValue, use the g_value_init()
305  * function. A #GValue cannot be used until it is initialized.
306  * The basic type operations (such as freeing and copying) are determined
307  * by the #GTypeValueTable associated with the type ID stored in the #GValue.
308  * Other #GValue operations (such as converting values between types) are
309  * provided by this interface.
310  *
311  * The code in the example program below demonstrates #GValue's
312  * features.
313  *
314  * |[
315  * #include &lt;glib-object.h&gt;
316  *
317  * static void
318  * int2string (const GValue *src_value,
319  *             GValue       *dest_value)
320  * {
321  *   if (g_value_get_int (src_value) == 42)
322  *     g_value_set_static_string (dest_value, "An important number");
323  *   else
324  *     g_value_set_static_string (dest_value, "What's that?");
325  * }
326  *
327  * int
328  * main (int   argc,
329  *       char *argv[])
330  * {
331  *   /&ast; GValues must be initialized &ast;/
332  *   GValue a = G_VALUE_INIT;
333  *   GValue b = G_VALUE_INIT;
334  *   const gchar *message;
335  *
336  *   /&ast; The GValue starts empty &ast;/
337  *   g_assert (!G_VALUE_HOLDS_STRING (&amp;a));
338  *
339  *   /&ast; Put a string in it &ast;/
340  *   g_value_init (&amp;a, G_TYPE_STRING);
341  *   g_assert (G_VALUE_HOLDS_STRING (&amp;a));
342  *   g_value_set_static_string (&amp;a, "Hello, world!");
343  *   g_printf ("%s\n", g_value_get_string (&amp;a));
344  *
345  *   /&ast; Reset it to its pristine state &ast;/
346  *   g_value_unset (&amp;a);
347  *
348  *   /&ast; It can then be reused for another type &ast;/
349  *   g_value_init (&amp;a, G_TYPE_INT);
350  *   g_value_set_int (&amp;a, 42);
351  *
352  *   /&ast; Attempt to transform it into a GValue of type STRING &ast;/
353  *   g_value_init (&amp;b, G_TYPE_STRING);
354  *
355  *   /&ast; An INT is transformable to a STRING &ast;/
356  *   g_assert (g_value_type_transformable (G_TYPE_INT, G_TYPE_STRING));
357  *
358  *   g_value_transform (&amp;a, &amp;b);
359  *   g_printf ("%s\n", g_value_get_string (&amp;b));
360  *
361  *   /&ast; Attempt to transform it again using a custom transform function &ast;/
362  *   g_value_register_transform_func (G_TYPE_INT, G_TYPE_STRING, int2string);
363  *   g_value_transform (&amp;a, &amp;b);
364  *   g_printf ("%s\n", g_value_get_string (&amp;b));
365  *   return 0;
366  * }
367  * ]|
368  */
369
370
371 /**
372  * SECTION:gparamspec
373  * @short_description: Metadata for parameter specifications
374  * @see_also: g_object_class_install_property(), g_object_set(), g_object_get(), g_object_set_property(), g_object_get_property(), g_value_register_transform_func()
375  * @title: GParamSpec
376  *
377  * #GParamSpec is an object structure that encapsulates the metadata
378  * required to specify parameters, such as e.g. #GObject properties.
379  *
380  * <para id="canonical-parameter-name">
381  * Parameter names need to start with a letter (a-z or A-Z). Subsequent
382  * characters can be letters, numbers or a '-'.
383  * All other characters are replaced by a '-' during construction.
384  * The result of this replacement is called the canonical name of the
385  * parameter.
386  * </para>
387  */
388
389
390 /**
391  * SECTION:gtype
392  * @short_description: The GLib Runtime type identification and management system
393  * @title: Type Information
394  *
395  * The GType API is the foundation of the GObject system.  It provides the
396  * facilities for registering and managing all fundamental data types,
397  * user-defined object and interface types.
398  *
399  * For type creation and registration purposes, all types fall into one of
400  * two categories: static or dynamic.  Static types are never loaded or
401  * unloaded at run-time as dynamic types may be.  Static types are created
402  * with g_type_register_static() that gets type specific information passed
403  * in via a #GTypeInfo structure.
404  * Dynamic types are created with g_type_register_dynamic() which takes a
405  * #GTypePlugin structure instead. The remaining type information (the
406  * #GTypeInfo structure) is retrieved during runtime through #GTypePlugin
407  * and the g_type_plugin_*() API.
408  * These registration functions are usually called only once from a
409  * function whose only purpose is to return the type identifier for a
410  * specific class.  Once the type (or class or interface) is registered,
411  * it may be instantiated, inherited, or implemented depending on exactly
412  * what sort of type it is.
413  * There is also a third registration function for registering fundamental
414  * types called g_type_register_fundamental() which requires both a #GTypeInfo
415  * structure and a #GTypeFundamentalInfo structure but it is seldom used
416  * since most fundamental types are predefined rather than user-defined.
417  *
418  * Type instance and class structs are limited to a total of 64 KiB,
419  * including all parent types. Similarly, type instances' private data
420  * (as created by g_type_class_add_private()) are limited to a total of
421  * 64 KiB. If a type instance needs a large static buffer, allocate it
422  * separately (typically by using #GArray or #GPtrArray) and put a pointer
423  * to the buffer in the structure.
424  *
425  * A final word about type names.
426  * Such an identifier needs to be at least three characters long. There is no
427  * upper length limit. The first character needs to be a letter (a-z or A-Z)
428  * or an underscore '_'. Subsequent characters can be letters, numbers or
429  * any of '-_+'.
430  */
431
432
433 /**
434  * SECTION:gtypemodule
435  * @short_description: Type loading modules
436  * @see_also: <variablelist> <varlistentry> <term>#GTypePlugin</term> <listitem><para>The abstract type loader interface.</para></listitem> </varlistentry> <varlistentry> <term>#GModule</term> <listitem><para>Portable mechanism for dynamically loaded modules.</para></listitem> </varlistentry> </variablelist>
437  * @title: GTypeModule
438  *
439  * #GTypeModule provides a simple implementation of the #GTypePlugin
440  * interface. The model of #GTypeModule is a dynamically loaded module
441  * which implements some number of types and interface
442  * implementations. When the module is loaded, it registers its types
443  * and interfaces using g_type_module_register_type() and
444  * g_type_module_add_interface().  As long as any instances of these
445  * types and interface implementations are in use, the module is kept
446  * loaded. When the types and interfaces are gone, the module may be
447  * unloaded. If the types and interfaces become used again, the module
448  * will be reloaded. Note that the last unref cannot happen in module
449  * code, since that would lead to the caller's code being unloaded before
450  * g_object_unref() returns to it.
451  *
452  * Keeping track of whether the module should be loaded or not is done by
453  * using a use count - it starts at zero, and whenever it is greater than
454  * zero, the module is loaded. The use count is maintained internally by
455  * the type system, but also can be explicitly controlled by
456  * g_type_module_use() and g_type_module_unuse(). Typically, when loading
457  * a module for the first type, g_type_module_use() will be used to load
458  * it so that it can initialize its types. At some later point, when the
459  * module no longer needs to be loaded except for the type
460  * implementations it contains, g_type_module_unuse() is called.
461  *
462  * #GTypeModule does not actually provide any implementation of module
463  * loading and unloading. To create a particular module type you must
464  * derive from #GTypeModule and implement the load and unload functions
465  * in #GTypeModuleClass.
466  */
467
468
469 /**
470  * SECTION:gtypeplugin
471  * @short_description: An interface for dynamically loadable types
472  * @see_also: #GTypeModule and g_type_register_dynamic().
473  * @title: GTypePlugin
474  *
475  * The GObject type system supports dynamic loading of types. The
476  * #GTypePlugin interface is used to handle the lifecycle of
477  * dynamically loaded types.  It goes as follows:
478  *
479  * <orderedlist>
480  * <listitem><para>
481  *   The type is initially introduced (usually upon loading the module
482  *   the first time, or by your main application that knows what modules
483  *   introduces what types), like this:
484  *   |[
485  *   new_type_id = g_type_register_dynamic (parent_type_id,
486  *                                                 "TypeName",
487  *                                                 new_type_plugin,
488  *                                                 type_flags);
489  *   ]|
490  *   where <literal>new_type_plugin</literal> is an implementation of the
491  *   #GTypePlugin interface.
492  * </para></listitem>
493  * <listitem><para>
494  *    The type's implementation is referenced, e.g. through
495  *    g_type_class_ref() or through g_type_create_instance() (this is
496  *    being called by g_object_new()) or through one of the above done on
497  *    a type derived from <literal>new_type_id</literal>.
498  * </para></listitem>
499  * <listitem><para>
500  *    This causes the type system to load the type's implementation by calling
501  *    g_type_plugin_use() and g_type_plugin_complete_type_info() on
502  *    <literal>new_type_plugin</literal>.
503  * </para></listitem>
504  * <listitem><para>
505  *    At some point the type's implementation isn't required anymore, e.g. after
506  *    g_type_class_unref() or g_type_free_instance() (called when the reference
507  *    count of an instance drops to zero).
508  * </para></listitem>
509  * <listitem><para>
510  *    This causes the type system to throw away the information retrieved from
511  *    g_type_plugin_complete_type_info() and then it calls
512  *    g_type_plugin_unuse() on <literal>new_type_plugin</literal>.
513  * </para></listitem>
514  * <listitem><para>
515  *    Things may repeat from the second step.
516  * </para></listitem>
517  * </orderedlist>
518  *
519  * So basically, you need to implement a #GTypePlugin type that
520  * carries a use_count, once use_count goes from zero to one, you need
521  * to load the implementation to successfully handle the upcoming
522  * g_type_plugin_complete_type_info() call. Later, maybe after
523  * succeeding use/unuse calls, once use_count drops to zero, you can
524  * unload the implementation again. The type system makes sure to call
525  * g_type_plugin_use() and g_type_plugin_complete_type_info() again
526  * when the type is needed again.
527  *
528  * #GTypeModule is an implementation of #GTypePlugin that already
529  * implements most of this except for the actual module loading and
530  * unloading. It even handles multiple registered types per module.
531  */
532
533
534 /**
535  * SECTION:objects
536  * @title: GObject
537  * @short_description: The base object type
538  * @see_also: #GParamSpecObject, g_param_spec_object()
539  *
540  * GObject is the fundamental type providing the common attributes and
541  * methods for all object types in GTK+, Pango and other libraries
542  * based on GObject.  The GObject class provides methods for object
543  * construction and destruction, property access methods, and signal
544  * support.  Signals are described in detail in <xref
545  * linkend="gobject-Signals"/>.
546  *
547  * <para id="floating-ref">
548  * GInitiallyUnowned is derived from GObject. The only difference between
549  * the two is that the initial reference of a GInitiallyUnowned is flagged
550  * as a <firstterm>floating</firstterm> reference.
551  * This means that it is not specifically claimed to be "owned" by
552  * any code portion. The main motivation for providing floating references is
553  * C convenience. In particular, it allows code to be written as:
554  * |[
555  * container = create_container ();
556  * container_add_child (container, create_child());
557  * ]|
558  * If <function>container_add_child()</function> will g_object_ref_sink() the
559  * passed in child, no reference of the newly created child is leaked.
560  * Without floating references, <function>container_add_child()</function>
561  * can only g_object_ref() the new child, so to implement this code without
562  * reference leaks, it would have to be written as:
563  * |[
564  * Child *child;
565  * container = create_container ();
566  * child = create_child ();
567  * container_add_child (container, child);
568  * g_object_unref (child);
569  * ]|
570  * The floating reference can be converted into
571  * an ordinary reference by calling g_object_ref_sink().
572  * For already sunken objects (objects that don't have a floating reference
573  * anymore), g_object_ref_sink() is equivalent to g_object_ref() and returns
574  * a new reference.
575  * Since floating references are useful almost exclusively for C convenience,
576  * language bindings that provide automated reference and memory ownership
577  * maintenance (such as smart pointers or garbage collection) should not
578  * expose floating references in their API.
579  * </para>
580  *
581  * Some object implementations may need to save an objects floating state
582  * across certain code portions (an example is #GtkMenu), to achieve this,
583  * the following sequence can be used:
584  *
585  * |[
586  * /&ast; save floating state &ast;/
587  * gboolean was_floating = g_object_is_floating (object);
588  * g_object_ref_sink (object);
589  * /&ast; protected code portion &ast;/
590  * ...;
591  * /&ast; restore floating state &ast;/
592  * if (was_floating)
593  *   g_object_force_floating (object);
594  * else
595  *   g_object_unref (object); /&ast; release previously acquired reference &ast;/
596  * ]|
597  */
598
599
600 /**
601  * SECTION:param_value_types
602  * @short_description: Standard Parameter and Value Types
603  * @see_also: #GParamSpec, #GValue, g_object_class_install_property().
604  * @title: Parameters and Values
605  *
606  * #GValue provides an abstract container structure which can be
607  * copied, transformed and compared while holding a value of any
608  * (derived) type, which is registered as a #GType with a
609  * #GTypeValueTable in its #GTypeInfo structure.  Parameter
610  * specifications for most value types can be created as #GParamSpec
611  * derived instances, to implement e.g. #GObject properties which
612  * operate on #GValue containers.
613  *
614  * Parameter names need to start with a letter (a-z or A-Z). Subsequent
615  * characters can be letters, numbers or a '-'.
616  * All other characters are replaced by a '-' during construction.
617  */
618
619
620 /**
621  * SECTION:signals
622  * @short_description: A means for customization of object behaviour and a general purpose notification mechanism
623  * @title: Signals
624  *
625  * The basic concept of the signal system is that of the
626  * <emphasis>emission</emphasis> of a signal. Signals are introduced
627  * per-type and are identified through strings.  Signals introduced
628  * for a parent type are available in derived types as well, so
629  * basically they are a per-type facility that is inherited.  A signal
630  * emission mainly involves invocation of a certain set of callbacks
631  * in precisely defined manner. There are two main categories of such
632  * callbacks, per-object
633  * <footnote><para>Although signals can deal with any kind of instantiatable
634  * type, i'm referring to those types as "object types" in the following,
635  * simply because that is the context most users will encounter signals in.
636  * </para></footnote>
637  * ones and user provided ones.
638  * The per-object callbacks are most often referred to as "object method
639  * handler" or "default (signal) handler", while user provided callbacks are
640  * usually just called "signal handler".
641  * The object method handler is provided at signal creation time (this most
642  * frequently happens at the end of an object class' creation), while user
643  * provided handlers are frequently connected and disconnected to/from a certain
644  * signal on certain object instances.
645  *
646  * A signal emission consists of five stages, unless prematurely stopped:
647  * <variablelist>
648  * <varlistentry><term></term><listitem><para>
649  *      1 - Invocation of the object method handler for %G_SIGNAL_RUN_FIRST signals
650  * </para></listitem></varlistentry>
651  * <varlistentry><term></term><listitem><para>
652  *      2 - Invocation of normal user-provided signal handlers (<emphasis>after</emphasis> flag %FALSE)
653  * </para></listitem></varlistentry>
654  * <varlistentry><term></term><listitem><para>
655  *      3 - Invocation of the object method handler for %G_SIGNAL_RUN_LAST signals
656  * </para></listitem></varlistentry>
657  * <varlistentry><term></term><listitem><para>
658  *      4 - Invocation of user provided signal handlers, connected with an <emphasis>after</emphasis> flag of %TRUE
659  * </para></listitem></varlistentry>
660  * <varlistentry><term></term><listitem><para>
661  *      5 - Invocation of the object method handler for %G_SIGNAL_RUN_CLEANUP signals
662  * </para></listitem></varlistentry>
663  * </variablelist>
664  * The user-provided signal handlers are called in the order they were
665  * connected in.
666  * All handlers may prematurely stop a signal emission, and any number of
667  * handlers may be connected, disconnected, blocked or unblocked during
668  * a signal emission.
669  * There are certain criteria for skipping user handlers in stages 2 and 4
670  * of a signal emission.
671  * First, user handlers may be <emphasis>blocked</emphasis>, blocked handlers are omitted
672  * during callback invocation, to return from the "blocked" state, a
673  * handler has to get unblocked exactly the same amount of times
674  * it has been blocked before.
675  * Second, upon emission of a %G_SIGNAL_DETAILED signal, an additional
676  * "detail" argument passed in to g_signal_emit() has to match the detail
677  * argument of the signal handler currently subject to invocation.
678  * Specification of no detail argument for signal handlers (omission of the
679  * detail part of the signal specification upon connection) serves as a
680  * wildcard and matches any detail argument passed in to emission.
681  */
682
683
684 /**
685  * SECTION:value_arrays
686  * @short_description: A container structure to maintain an array of generic values
687  * @see_also: #GValue, #GParamSpecValueArray, g_param_spec_value_array()
688  * @title: Value arrays
689  *
690  * The prime purpose of a #GValueArray is for it to be used as an
691  * object property that holds an array of values. A #GValueArray wraps
692  * an array of #GValue elements in order for it to be used as a boxed
693  * type through %G_TYPE_VALUE_ARRAY.
694  *
695  * #GValueArray is deprecated in favour of #GArray since GLib 2.32. It
696  * is possible to create a #GArray that behaves like a #GValueArray by
697  * using the size of #GValue as the element size, and by setting
698  * g_value_unset() as the clear function using g_array_set_clear_func(),
699  * for instance, the following code:
700  *
701  * |[
702  *   GValueArray *array = g_value_array_new (10);
703  * ]|
704  *
705  * can be replaced by:
706  *
707  * |[
708  *   GArray *array = g_array_sized_new (FALSE, TRUE, sizeof (GValue), 10);
709  *   g_array_set_clear_func (array, (GDestroyNotify) g_value_unset);
710  * ]|
711  */
712
713
714 /**
715  * g_binding_get_flags:
716  * @binding: a #GBinding
717  *
718  * Retrieves the flags passed when constructing the #GBinding
719  *
720  * Returns: the #GBindingFlags used by the #GBinding
721  * Since: 2.26
722  */
723
724
725 /**
726  * g_binding_get_source:
727  * @binding: a #GBinding
728  *
729  * Retrieves the #GObject instance used as the source of the binding
730  *
731  * Returns: (transfer none): the source #GObject
732  * Since: 2.26
733  */
734
735
736 /**
737  * g_binding_get_source_property:
738  * @binding: a #GBinding
739  *
740  * Retrieves the name of the property of #GBinding:source used as the source
741  * of the binding
742  *
743  * Returns: the name of the source property
744  * Since: 2.26
745  */
746
747
748 /**
749  * g_binding_get_target:
750  * @binding: a #GBinding
751  *
752  * Retrieves the #GObject instance used as the target of the binding
753  *
754  * Returns: (transfer none): the target #GObject
755  * Since: 2.26
756  */
757
758
759 /**
760  * g_binding_get_target_property:
761  * @binding: a #GBinding
762  *
763  * Retrieves the name of the property of #GBinding:target used as the target
764  * of the binding
765  *
766  * Returns: the name of the target property
767  * Since: 2.26
768  */
769
770
771 /**
772  * g_binding_unbind:
773  * @binding: a #GBinding
774  *
775  * Explicitly releases the binding between the source and the target
776  * property expressed by @binding.
777  *
778  * <note>This function will release the reference that is being held on
779  * the @binding instance; if you want to hold on to the #GBinding instance
780  * after calling g_binding_unbind(), you will need to hold a reference
781  * to it.</note>
782  *
783  * Since: 2.38
784  */
785
786
787 /**
788  * g_boxed_copy:
789  * @boxed_type: The type of @src_boxed.
790  * @src_boxed: The boxed structure to be copied.
791  *
792  * Provide a copy of a boxed structure @src_boxed which is of type @boxed_type.
793  *
794  * Returns: The newly created copy of the boxed structure.
795  */
796
797
798 /**
799  * g_boxed_free:
800  * @boxed_type: The type of @boxed.
801  * @boxed: The boxed structure to be freed.
802  *
803  * Free the boxed structure @boxed which is of type @boxed_type.
804  */
805
806
807 /**
808  * g_boxed_type_register_static:
809  * @name: Name of the new boxed type.
810  * @boxed_copy: Boxed structure copy function.
811  * @boxed_free: Boxed structure free function.
812  *
813  * This function creates a new %G_TYPE_BOXED derived type id for a new
814  * boxed type with name @name. Boxed type handling functions have to be
815  * provided to copy and free opaque boxed structures of this type.
816  *
817  * Returns: New %G_TYPE_BOXED derived type id for @name.
818  */
819
820
821 /**
822  * g_cclosure_marshal_BOOLEAN__FLAGS:
823  * @closure: the #GClosure to which the marshaller belongs
824  * @return_value: a #GValue which can store the returned #gboolean
825  * @n_param_values: 2
826  * @param_values: a #GValue array holding instance and arg1
827  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
828  * @marshal_data: additional data specified when registering the marshaller
829  *
830  * A marshaller for a #GCClosure with a callback of type
831  * <literal>gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter
832  * denotes a flags type.
833  */
834
835
836 /**
837  * g_cclosure_marshal_BOOLEAN__OBJECT_BOXED_BOXED:
838  * @closure: the #GClosure to which the marshaller belongs
839  * @return_value: a #GValue, which can store the returned string
840  * @n_param_values: 3
841  * @param_values: a #GValue array holding instance, arg1 and arg2
842  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
843  * @marshal_data: additional data specified when registering the marshaller
844  *
845  * A marshaller for a #GCClosure with a callback of type
846  * <literal>gboolean (*callback) (gpointer instance, GBoxed *arg1, GBoxed *arg2, gpointer user_data)</literal>.
847  *
848  * Since: 2.26
849  */
850
851
852 /**
853  * g_cclosure_marshal_BOOL__FLAGS:
854  *
855  * Another name for g_cclosure_marshal_BOOLEAN__FLAGS().
856  */
857
858
859 /**
860  * g_cclosure_marshal_STRING__OBJECT_POINTER:
861  * @closure: the #GClosure to which the marshaller belongs
862  * @return_value: a #GValue, which can store the returned string
863  * @n_param_values: 3
864  * @param_values: a #GValue array holding instance, arg1 and arg2
865  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
866  * @marshal_data: additional data specified when registering the marshaller
867  *
868  * A marshaller for a #GCClosure with a callback of type
869  * <literal>gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data)</literal>.
870  */
871
872
873 /**
874  * g_cclosure_marshal_VOID__BOOLEAN:
875  * @closure: the #GClosure to which the marshaller belongs
876  * @return_value: ignored
877  * @n_param_values: 2
878  * @param_values: a #GValue array holding the instance and the #gboolean parameter
879  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
880  * @marshal_data: additional data specified when registering the marshaller
881  *
882  * A marshaller for a #GCClosure with a callback of type
883  * <literal>void (*callback) (gpointer instance, gboolean arg1, gpointer user_data)</literal>.
884  */
885
886
887 /**
888  * g_cclosure_marshal_VOID__BOXED:
889  * @closure: the #GClosure to which the marshaller belongs
890  * @return_value: ignored
891  * @n_param_values: 2
892  * @param_values: a #GValue array holding the instance and the #GBoxed* parameter
893  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
894  * @marshal_data: additional data specified when registering the marshaller
895  *
896  * A marshaller for a #GCClosure with a callback of type
897  * <literal>void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data)</literal>.
898  */
899
900
901 /**
902  * g_cclosure_marshal_VOID__CHAR:
903  * @closure: the #GClosure to which the marshaller belongs
904  * @return_value: ignored
905  * @n_param_values: 2
906  * @param_values: a #GValue array holding the instance and the #gchar parameter
907  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
908  * @marshal_data: additional data specified when registering the marshaller
909  *
910  * A marshaller for a #GCClosure with a callback of type
911  * <literal>void (*callback) (gpointer instance, gchar arg1, gpointer user_data)</literal>.
912  */
913
914
915 /**
916  * g_cclosure_marshal_VOID__DOUBLE:
917  * @closure: the #GClosure to which the marshaller belongs
918  * @return_value: ignored
919  * @n_param_values: 2
920  * @param_values: a #GValue array holding the instance and the #gdouble parameter
921  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
922  * @marshal_data: additional data specified when registering the marshaller
923  *
924  * A marshaller for a #GCClosure with a callback of type
925  * <literal>void (*callback) (gpointer instance, gdouble arg1, gpointer user_data)</literal>.
926  */
927
928
929 /**
930  * g_cclosure_marshal_VOID__ENUM:
931  * @closure: the #GClosure to which the marshaller belongs
932  * @return_value: ignored
933  * @n_param_values: 2
934  * @param_values: a #GValue array holding the instance and the enumeration parameter
935  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
936  * @marshal_data: additional data specified when registering the marshaller
937  *
938  * A marshaller for a #GCClosure with a callback of type
939  * <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter denotes an enumeration type..
940  */
941
942
943 /**
944  * g_cclosure_marshal_VOID__FLAGS:
945  * @closure: the #GClosure to which the marshaller belongs
946  * @return_value: ignored
947  * @n_param_values: 2
948  * @param_values: a #GValue array holding the instance and the flags parameter
949  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
950  * @marshal_data: additional data specified when registering the marshaller
951  *
952  * A marshaller for a #GCClosure with a callback of type
953  * <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter denotes a flags type.
954  */
955
956
957 /**
958  * g_cclosure_marshal_VOID__FLOAT:
959  * @closure: the #GClosure to which the marshaller belongs
960  * @return_value: ignored
961  * @n_param_values: 2
962  * @param_values: a #GValue array holding the instance and the #gfloat parameter
963  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
964  * @marshal_data: additional data specified when registering the marshaller
965  *
966  * A marshaller for a #GCClosure with a callback of type
967  * <literal>void (*callback) (gpointer instance, gfloat arg1, gpointer user_data)</literal>.
968  */
969
970
971 /**
972  * g_cclosure_marshal_VOID__INT:
973  * @closure: the #GClosure to which the marshaller belongs
974  * @return_value: ignored
975  * @n_param_values: 2
976  * @param_values: a #GValue array holding the instance and the #gint parameter
977  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
978  * @marshal_data: additional data specified when registering the marshaller
979  *
980  * A marshaller for a #GCClosure with a callback of type
981  * <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal>.
982  */
983
984
985 /**
986  * g_cclosure_marshal_VOID__LONG:
987  * @closure: the #GClosure to which the marshaller belongs
988  * @return_value: ignored
989  * @n_param_values: 2
990  * @param_values: a #GValue array holding the instance and the #glong parameter
991  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
992  * @marshal_data: additional data specified when registering the marshaller
993  *
994  * A marshaller for a #GCClosure with a callback of type
995  * <literal>void (*callback) (gpointer instance, glong arg1, gpointer user_data)</literal>.
996  */
997
998
999 /**
1000  * g_cclosure_marshal_VOID__OBJECT:
1001  * @closure: the #GClosure to which the marshaller belongs
1002  * @return_value: ignored
1003  * @n_param_values: 2
1004  * @param_values: a #GValue array holding the instance and the #GObject* parameter
1005  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
1006  * @marshal_data: additional data specified when registering the marshaller
1007  *
1008  * A marshaller for a #GCClosure with a callback of type
1009  * <literal>void (*callback) (gpointer instance, GObject *arg1, gpointer user_data)</literal>.
1010  */
1011
1012
1013 /**
1014  * g_cclosure_marshal_VOID__PARAM:
1015  * @closure: the #GClosure to which the marshaller belongs
1016  * @return_value: ignored
1017  * @n_param_values: 2
1018  * @param_values: a #GValue array holding the instance and the #GParamSpec* parameter
1019  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
1020  * @marshal_data: additional data specified when registering the marshaller
1021  *
1022  * A marshaller for a #GCClosure with a callback of type
1023  * <literal>void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data)</literal>.
1024  */
1025
1026
1027 /**
1028  * g_cclosure_marshal_VOID__POINTER:
1029  * @closure: the #GClosure to which the marshaller belongs
1030  * @return_value: ignored
1031  * @n_param_values: 2
1032  * @param_values: a #GValue array holding the instance and the #gpointer parameter
1033  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
1034  * @marshal_data: additional data specified when registering the marshaller
1035  *
1036  * A marshaller for a #GCClosure with a callback of type
1037  * <literal>void (*callback) (gpointer instance, gpointer arg1, gpointer user_data)</literal>.
1038  */
1039
1040
1041 /**
1042  * g_cclosure_marshal_VOID__STRING:
1043  * @closure: the #GClosure to which the marshaller belongs
1044  * @return_value: ignored
1045  * @n_param_values: 2
1046  * @param_values: a #GValue array holding the instance and the #gchar* parameter
1047  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
1048  * @marshal_data: additional data specified when registering the marshaller
1049  *
1050  * A marshaller for a #GCClosure with a callback of type
1051  * <literal>void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data)</literal>.
1052  */
1053
1054
1055 /**
1056  * g_cclosure_marshal_VOID__UCHAR:
1057  * @closure: the #GClosure to which the marshaller belongs
1058  * @return_value: ignored
1059  * @n_param_values: 2
1060  * @param_values: a #GValue array holding the instance and the #guchar parameter
1061  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
1062  * @marshal_data: additional data specified when registering the marshaller
1063  *
1064  * A marshaller for a #GCClosure with a callback of type
1065  * <literal>void (*callback) (gpointer instance, guchar arg1, gpointer user_data)</literal>.
1066  */
1067
1068
1069 /**
1070  * g_cclosure_marshal_VOID__UINT:
1071  * @closure: the #GClosure to which the marshaller belongs
1072  * @return_value: ignored
1073  * @n_param_values: 2
1074  * @param_values: a #GValue array holding the instance and the #guint parameter
1075  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
1076  * @marshal_data: additional data specified when registering the marshaller
1077  *
1078  * A marshaller for a #GCClosure with a callback of type
1079  * <literal>void (*callback) (gpointer instance, guint arg1, gpointer user_data)</literal>.
1080  */
1081
1082
1083 /**
1084  * g_cclosure_marshal_VOID__UINT_POINTER:
1085  * @closure: the #GClosure to which the marshaller belongs
1086  * @return_value: ignored
1087  * @n_param_values: 3
1088  * @param_values: a #GValue array holding instance, arg1 and arg2
1089  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
1090  * @marshal_data: additional data specified when registering the marshaller
1091  *
1092  * A marshaller for a #GCClosure with a callback of type
1093  * <literal>void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data)</literal>.
1094  */
1095
1096
1097 /**
1098  * g_cclosure_marshal_VOID__ULONG:
1099  * @closure: the #GClosure to which the marshaller belongs
1100  * @return_value: ignored
1101  * @n_param_values: 2
1102  * @param_values: a #GValue array holding the instance and the #gulong parameter
1103  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
1104  * @marshal_data: additional data specified when registering the marshaller
1105  *
1106  * A marshaller for a #GCClosure with a callback of type
1107  * <literal>void (*callback) (gpointer instance, gulong arg1, gpointer user_data)</literal>.
1108  */
1109
1110
1111 /**
1112  * g_cclosure_marshal_VOID__VARIANT:
1113  * @closure: the #GClosure to which the marshaller belongs
1114  * @return_value: ignored
1115  * @n_param_values: 2
1116  * @param_values: a #GValue array holding the instance and the #GVariant* parameter
1117  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
1118  * @marshal_data: additional data specified when registering the marshaller
1119  *
1120  * A marshaller for a #GCClosure with a callback of type
1121  * <literal>void (*callback) (gpointer instance, GVariant *arg1, gpointer user_data)</literal>.
1122  *
1123  * Since: 2.26
1124  */
1125
1126
1127 /**
1128  * g_cclosure_marshal_VOID__VOID:
1129  * @closure: the #GClosure to which the marshaller belongs
1130  * @return_value: ignored
1131  * @n_param_values: 1
1132  * @param_values: a #GValue array holding only the instance
1133  * @invocation_hint: the invocation hint given as the last argument to g_closure_invoke()
1134  * @marshal_data: additional data specified when registering the marshaller
1135  *
1136  * A marshaller for a #GCClosure with a callback of type
1137  * <literal>void (*callback) (gpointer instance, gpointer user_data)</literal>.
1138  */
1139
1140
1141 /**
1142  * g_cclosure_marshal_generic:
1143  * @closure: A #GClosure.
1144  * @return_gvalue: A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
1145  * @n_param_values: The length of the @param_values array.
1146  * @param_values: An array of #GValue<!-- -->s holding the arguments on which to invoke the callback of closure.
1147  * @invocation_hint: The invocation hint given as the last argument to g_closure_invoke().
1148  * @marshal_data: Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
1149  *
1150  * A generic marshaller function implemented via <ulink
1151  * url="http://sourceware.org/libffi/">libffi</ulink>.
1152  *
1153  * Since: 2.30
1154  */
1155
1156
1157 /**
1158  * g_cclosure_new: (skip)
1159  * @callback_func: the function to invoke
1160  * @user_data: user data to pass to @callback_func
1161  * @destroy_data: destroy notify to be called when @user_data is no longer used
1162  *
1163  * Creates a new closure which invokes @callback_func with @user_data as
1164  * the last parameter.
1165  *
1166  * Returns: a new #GCClosure
1167  */
1168
1169
1170 /**
1171  * g_cclosure_new_object: (skip)
1172  * @callback_func: the function to invoke
1173  * @object: a #GObject pointer to pass to @callback_func
1174  *
1175  * A variant of g_cclosure_new() which uses @object as @user_data and
1176  * calls g_object_watch_closure() on @object and the created
1177  * closure. This function is useful when you have a callback closely
1178  * associated with a #GObject, and want the callback to no longer run
1179  * after the object is is freed.
1180  *
1181  * Returns: a new #GCClosure
1182  */
1183
1184
1185 /**
1186  * g_cclosure_new_object_swap: (skip)
1187  * @callback_func: the function to invoke
1188  * @object: a #GObject pointer to pass to @callback_func
1189  *
1190  * A variant of g_cclosure_new_swap() which uses @object as @user_data
1191  * and calls g_object_watch_closure() on @object and the created
1192  * closure. This function is useful when you have a callback closely
1193  * associated with a #GObject, and want the callback to no longer run
1194  * after the object is is freed.
1195  *
1196  * Returns: a new #GCClosure
1197  */
1198
1199
1200 /**
1201  * g_cclosure_new_swap: (skip)
1202  * @callback_func: the function to invoke
1203  * @user_data: user data to pass to @callback_func
1204  * @destroy_data: destroy notify to be called when @user_data is no longer used
1205  *
1206  * Creates a new closure which invokes @callback_func with @user_data as
1207  * the first parameter.
1208  *
1209  * Returns: (transfer full): a new #GCClosure
1210  */
1211
1212
1213 /**
1214  * g_clear_object: (skip)
1215  * @object_ptr: a pointer to a #GObject reference
1216  *
1217  * Clears a reference to a #GObject.
1218  *
1219  * @object_ptr must not be %NULL.
1220  *
1221  * If the reference is %NULL then this function does nothing.
1222  * Otherwise, the reference count of the object is decreased and the
1223  * pointer is set to %NULL.
1224  *
1225  * This function is threadsafe and modifies the pointer atomically,
1226  * using memory barriers where needed.
1227  *
1228  * A macro is also included that allows this function to be used without
1229  * pointer casts.
1230  *
1231  * Since: 2.28
1232  */
1233
1234
1235 /**
1236  * g_closure_add_finalize_notifier: (skip)
1237  * @closure: a #GClosure
1238  * @notify_data: data to pass to @notify_func
1239  * @notify_func: the callback function to register
1240  *
1241  * Registers a finalization notifier which will be called when the
1242  * reference count of @closure goes down to 0. Multiple finalization
1243  * notifiers on a single closure are invoked in unspecified order. If
1244  * a single call to g_closure_unref() results in the closure being
1245  * both invalidated and finalized, then the invalidate notifiers will
1246  * be run before the finalize notifiers.
1247  */
1248
1249
1250 /**
1251  * g_closure_add_invalidate_notifier: (skip)
1252  * @closure: a #GClosure
1253  * @notify_data: data to pass to @notify_func
1254  * @notify_func: the callback function to register
1255  *
1256  * Registers an invalidation notifier which will be called when the
1257  * @closure is invalidated with g_closure_invalidate(). Invalidation
1258  * notifiers are invoked before finalization notifiers, in an
1259  * unspecified order.
1260  */
1261
1262
1263 /**
1264  * g_closure_add_marshal_guards: (skip)
1265  * @closure: a #GClosure
1266  * @pre_marshal_data: data to pass to @pre_marshal_notify
1267  * @pre_marshal_notify: a function to call before the closure callback
1268  * @post_marshal_data: data to pass to @post_marshal_notify
1269  * @post_marshal_notify: a function to call after the closure callback
1270  *
1271  * Adds a pair of notifiers which get invoked before and after the
1272  * closure callback, respectively. This is typically used to protect
1273  * the extra arguments for the duration of the callback. See
1274  * g_object_watch_closure() for an example of marshal guards.
1275  */
1276
1277
1278 /**
1279  * g_closure_invalidate:
1280  * @closure: GClosure to invalidate
1281  *
1282  * Sets a flag on the closure to indicate that its calling
1283  * environment has become invalid, and thus causes any future
1284  * invocations of g_closure_invoke() on this @closure to be
1285  * ignored. Also, invalidation notifiers installed on the closure will
1286  * be called at this point. Note that unless you are holding a
1287  * reference to the closure yourself, the invalidation notifiers may
1288  * unref the closure and cause it to be destroyed, so if you need to
1289  * access the closure after calling g_closure_invalidate(), make sure
1290  * that you've previously called g_closure_ref().
1291  *
1292  * Note that g_closure_invalidate() will also be called when the
1293  * reference count of a closure drops to zero (unless it has already
1294  * been invalidated before).
1295  */
1296
1297
1298 /**
1299  * g_closure_invoke:
1300  * @closure: a #GClosure
1301  * @return_value: (allow-none): a #GValue to store the return value. May be %NULL if the callback of @closure doesn't return a value.
1302  * @n_param_values: the length of the @param_values array
1303  * @param_values: (array length=n_param_values): an array of #GValue<!-- -->s holding the arguments on which to invoke the callback of @closure
1304  * @invocation_hint: (allow-none): a context-dependent invocation hint
1305  *
1306  * Invokes the closure, i.e. executes the callback represented by the @closure.
1307  */
1308
1309
1310 /**
1311  * g_closure_new_object:
1312  * @sizeof_closure: the size of the structure to allocate, must be at least <literal>sizeof (GClosure)</literal>
1313  * @object: a #GObject pointer to store in the @data field of the newly allocated #GClosure
1314  *
1315  * A variant of g_closure_new_simple() which stores @object in the
1316  * @data field of the closure and calls g_object_watch_closure() on
1317  * @object and the created closure. This function is mainly useful
1318  * when implementing new types of closures.
1319  *
1320  * Returns: (transfer full): a newly allocated #GClosure
1321  */
1322
1323
1324 /**
1325  * g_closure_new_simple:
1326  * @sizeof_closure: the size of the structure to allocate, must be at least <literal>sizeof (GClosure)</literal>
1327  * @data: data to store in the @data field of the newly allocated #GClosure
1328  *
1329  * Allocates a struct of the given size and initializes the initial
1330  * part as a #GClosure. This function is mainly useful when
1331  * implementing new types of closures.
1332  *
1333  * |[
1334  * typedef struct _MyClosure MyClosure;
1335  * struct _MyClosure
1336  * {
1337  *   GClosure closure;
1338  *   // extra data goes here
1339  * };
1340  *
1341  * static void
1342  * my_closure_finalize (gpointer  notify_data,
1343  *                      GClosure *closure)
1344  * {
1345  *   MyClosure *my_closure = (MyClosure *)closure;
1346  *
1347  *   // free extra data here
1348  * }
1349  *
1350  * MyClosure *my_closure_new (gpointer data)
1351  * {
1352  *   GClosure *closure;
1353  *   MyClosure *my_closure;
1354  *
1355  *   closure = g_closure_new_simple (sizeof (MyClosure), data);
1356  *   my_closure = (MyClosure *) closure;
1357  *
1358  *   // initialize extra data here
1359  *
1360  *   g_closure_add_finalize_notifier (closure, notify_data,
1361  *                                    my_closure_finalize);
1362  *   return my_closure;
1363  * }
1364  * ]|
1365  *
1366  * Returns: (transfer full): a newly allocated #GClosure
1367  */
1368
1369
1370 /**
1371  * g_closure_ref:
1372  * @closure: #GClosure to increment the reference count on
1373  *
1374  * Increments the reference count on a closure to force it staying
1375  * alive while the caller holds a pointer to it.
1376  *
1377  * Returns: (transfer none): The @closure passed in, for convenience
1378  */
1379
1380
1381 /**
1382  * g_closure_remove_finalize_notifier: (skip)
1383  * @closure: a #GClosure
1384  * @notify_data: data which was passed to g_closure_add_finalize_notifier() when registering @notify_func
1385  * @notify_func: the callback function to remove
1386  *
1387  * Removes a finalization notifier.
1388  *
1389  * Notice that notifiers are automatically removed after they are run.
1390  */
1391
1392
1393 /**
1394  * g_closure_remove_invalidate_notifier: (skip)
1395  * @closure: a #GClosure
1396  * @notify_data: data which was passed to g_closure_add_invalidate_notifier() when registering @notify_func
1397  * @notify_func: the callback function to remove
1398  *
1399  * Removes an invalidation notifier.
1400  *
1401  * Notice that notifiers are automatically removed after they are run.
1402  */
1403
1404
1405 /**
1406  * g_closure_set_marshal: (skip)
1407  * @closure: a #GClosure
1408  * @marshal: a #GClosureMarshal function
1409  *
1410  * Sets the marshaller of @closure. The <literal>marshal_data</literal>
1411  * of @marshal provides a way for a meta marshaller to provide additional
1412  * information to the marshaller. (See g_closure_set_meta_marshal().) For
1413  * GObject's C predefined marshallers (the g_cclosure_marshal_*()
1414  * functions), what it provides is a callback function to use instead of
1415  * @closure->callback.
1416  */
1417
1418
1419 /**
1420  * g_closure_set_meta_marshal: (skip)
1421  * @closure: a #GClosure
1422  * @marshal_data: context-dependent data to pass to @meta_marshal
1423  * @meta_marshal: a #GClosureMarshal function
1424  *
1425  * Sets the meta marshaller of @closure.  A meta marshaller wraps
1426  * @closure->marshal and modifies the way it is called in some
1427  * fashion. The most common use of this facility is for C callbacks.
1428  * The same marshallers (generated by <link
1429  * linkend="glib-genmarshal">glib-genmarshal</link>) are used
1430  * everywhere, but the way that we get the callback function
1431  * differs. In most cases we want to use @closure->callback, but in
1432  * other cases we want to use some different technique to retrieve the
1433  * callback function.
1434  *
1435  * For example, class closures for signals (see
1436  * g_signal_type_cclosure_new()) retrieve the callback function from a
1437  * fixed offset in the class structure.  The meta marshaller retrieves
1438  * the right callback and passes it to the marshaller as the
1439  * @marshal_data argument.
1440  */
1441
1442
1443 /**
1444  * g_closure_sink:
1445  * @closure: #GClosure to decrement the initial reference count on, if it's still being held
1446  *
1447  * Takes over the initial ownership of a closure.  Each closure is
1448  * initially created in a <firstterm>floating</firstterm> state, which
1449  * means that the initial reference count is not owned by any caller.
1450  * g_closure_sink() checks to see if the object is still floating, and
1451  * if so, unsets the floating state and decreases the reference
1452  * count. If the closure is not floating, g_closure_sink() does
1453  * nothing. The reason for the existence of the floating state is to
1454  * prevent cumbersome code sequences like:
1455  * |[
1456  * closure = g_cclosure_new (cb_func, cb_data);
1457  * g_source_set_closure (source, closure);
1458  * g_closure_unref (closure); // XXX GObject doesn't really need this
1459  * ]|
1460  * Because g_source_set_closure() (and similar functions) take ownership of the
1461  * initial reference count, if it is unowned, we instead can write:
1462  * |[
1463  * g_source_set_closure (source, g_cclosure_new (cb_func, cb_data));
1464  * ]|
1465  *
1466  * Generally, this function is used together with g_closure_ref(). Ane example
1467  * of storing a closure for later notification looks like:
1468  * |[
1469  * static GClosure *notify_closure = NULL;
1470  * void
1471  * foo_notify_set_closure (GClosure *closure)
1472  * {
1473  *   if (notify_closure)
1474  *     g_closure_unref (notify_closure);
1475  *   notify_closure = closure;
1476  *   if (notify_closure)
1477  *     {
1478  *       g_closure_ref (notify_closure);
1479  *       g_closure_sink (notify_closure);
1480  *     }
1481  * }
1482  * ]|
1483  *
1484  * Because g_closure_sink() may decrement the reference count of a closure
1485  * (if it hasn't been called on @closure yet) just like g_closure_unref(),
1486  * g_closure_ref() should be called prior to this function.
1487  */
1488
1489
1490 /**
1491  * g_closure_unref:
1492  * @closure: #GClosure to decrement the reference count on
1493  *
1494  * Decrements the reference count of a closure after it was previously
1495  * incremented by the same caller. If no other callers are using the
1496  * closure, then the closure will be destroyed and freed.
1497  */
1498
1499
1500 /**
1501  * g_enum_complete_type_info:
1502  * @g_enum_type: the type identifier of the type being completed
1503  * @info: the #GTypeInfo struct to be filled in
1504  * @const_values: An array of #GEnumValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0.
1505  *
1506  * This function is meant to be called from the <literal>complete_type_info</literal>
1507  * function of a #GTypePlugin implementation, as in the following
1508  * example:
1509  *
1510  * |[
1511  * static void
1512  * my_enum_complete_type_info (GTypePlugin     *plugin,
1513  *                             GType            g_type,
1514  *                             GTypeInfo       *info,
1515  *                             GTypeValueTable *value_table)
1516  * {
1517  *   static const GEnumValue values[] = {
1518  *     { MY_ENUM_FOO, "MY_ENUM_FOO", "foo" },
1519  *     { MY_ENUM_BAR, "MY_ENUM_BAR", "bar" },
1520  *     { 0, NULL, NULL }
1521  *   };
1522  *
1523  *   g_enum_complete_type_info (type, info, values);
1524  * }
1525  * ]|
1526  */
1527
1528
1529 /**
1530  * g_enum_get_value:
1531  * @enum_class: a #GEnumClass
1532  * @value: the value to look up
1533  *
1534  * Returns the #GEnumValue for a value.
1535  *
1536  * Returns: the #GEnumValue for @value, or %NULL if @value is not a member of the enumeration
1537  */
1538
1539
1540 /**
1541  * g_enum_get_value_by_name:
1542  * @enum_class: a #GEnumClass
1543  * @name: the name to look up
1544  *
1545  * Looks up a #GEnumValue by name.
1546  *
1547  * Returns: the #GEnumValue with name @name, or %NULL if the enumeration doesn't have a member with that name
1548  */
1549
1550
1551 /**
1552  * g_enum_get_value_by_nick:
1553  * @enum_class: a #GEnumClass
1554  * @nick: the nickname to look up
1555  *
1556  * Looks up a #GEnumValue by nickname.
1557  *
1558  * Returns: the #GEnumValue with nickname @nick, or %NULL if the enumeration doesn't have a member with that nickname
1559  */
1560
1561
1562 /**
1563  * g_enum_register_static:
1564  * @name: A nul-terminated string used as the name of the new type.
1565  * @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.
1566  *
1567  * Registers a new static enumeration type with the name @name.
1568  *
1569  * It is normally more convenient to let <link
1570  * linkend="glib-mkenums">glib-mkenums</link> generate a
1571  * my_enum_get_type() function from a usual C enumeration definition
1572  * than to write one yourself using g_enum_register_static().
1573  *
1574  * Returns: The new type identifier.
1575  */
1576
1577
1578 /**
1579  * g_flags_complete_type_info:
1580  * @g_flags_type: the type identifier of the type being completed
1581  * @info: the #GTypeInfo struct to be filled in
1582  * @const_values: An array of #GFlagsValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0.
1583  *
1584  * This function is meant to be called from the complete_type_info()
1585  * function of a #GTypePlugin implementation, see the example for
1586  * g_enum_complete_type_info() above.
1587  */
1588
1589
1590 /**
1591  * g_flags_get_first_value:
1592  * @flags_class: a #GFlagsClass
1593  * @value: the value
1594  *
1595  * Returns the first #GFlagsValue which is set in @value.
1596  *
1597  * Returns: the first #GFlagsValue which is set in @value, or %NULL if none is set
1598  */
1599
1600
1601 /**
1602  * g_flags_get_value_by_name:
1603  * @flags_class: a #GFlagsClass
1604  * @name: the name to look up
1605  *
1606  * Looks up a #GFlagsValue by name.
1607  *
1608  * Returns: the #GFlagsValue with name @name, or %NULL if there is no flag with that name
1609  */
1610
1611
1612 /**
1613  * g_flags_get_value_by_nick:
1614  * @flags_class: a #GFlagsClass
1615  * @nick: the nickname to look up
1616  *
1617  * Looks up a #GFlagsValue by nickname.
1618  *
1619  * Returns: the #GFlagsValue with nickname @nick, or %NULL if there is no flag with that nickname
1620  */
1621
1622
1623 /**
1624  * g_flags_register_static:
1625  * @name: A nul-terminated string used as the name of the new type.
1626  * @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.
1627  *
1628  * Registers a new static flags type with the name @name.
1629  *
1630  * It is normally more convenient to let <link
1631  * linkend="glib-mkenums">glib-mkenums</link> generate a
1632  * my_flags_get_type() function from a usual C enumeration definition
1633  * than to write one yourself using g_flags_register_static().
1634  *
1635  * Returns: The new type identifier.
1636  */
1637
1638
1639 /**
1640  * g_object_add_toggle_ref: (skip)
1641  * @object: a #GObject
1642  * @notify: a function to call when this reference is the last reference to the object, or is no longer the last reference.
1643  * @data: data to pass to @notify
1644  *
1645  * Increases the reference count of the object by one and sets a
1646  * callback to be called when all other references to the object are
1647  * dropped, or when this is already the last reference to the object
1648  * and another reference is established.
1649  *
1650  * This functionality is intended for binding @object to a proxy
1651  * object managed by another memory manager. This is done with two
1652  * paired references: the strong reference added by
1653  * g_object_add_toggle_ref() and a reverse reference to the proxy
1654  * object which is either a strong reference or weak reference.
1655  *
1656  * The setup is that when there are no other references to @object,
1657  * only a weak reference is held in the reverse direction from @object
1658  * to the proxy object, but when there are other references held to
1659  * @object, a strong reference is held. The @notify callback is called
1660  * when the reference from @object to the proxy object should be
1661  * <firstterm>toggled</firstterm> from strong to weak (@is_last_ref
1662  * true) or weak to strong (@is_last_ref false).
1663  *
1664  * Since a (normal) reference must be held to the object before
1665  * calling g_object_add_toggle_ref(), the initial state of the reverse
1666  * link is always strong.
1667  *
1668  * Multiple toggle references may be added to the same gobject,
1669  * however if there are multiple toggle references to an object, none
1670  * of them will ever be notified until all but one are removed.  For
1671  * this reason, you should only ever use a toggle reference if there
1672  * is important state in the proxy object.
1673  *
1674  * Since: 2.8
1675  */
1676
1677
1678 /**
1679  * g_object_add_weak_pointer: (skip)
1680  * @object: The object that should be weak referenced.
1681  * @weak_pointer_location: (inout): The memory address of a pointer.
1682  *
1683  * Adds a weak reference from weak_pointer to @object to indicate that
1684  * the pointer located at @weak_pointer_location is only valid during
1685  * the lifetime of @object. When the @object is finalized,
1686  * @weak_pointer will be set to %NULL.
1687  *
1688  * Note that as with g_object_weak_ref(), the weak references created by
1689  * this method are not thread-safe: they cannot safely be used in one
1690  * thread if the object's last g_object_unref() might happen in another
1691  * thread. Use #GWeakRef if thread-safety is required.
1692  */
1693
1694
1695 /**
1696  * g_object_bind_property:
1697  * @source: (type GObject.Object): the source #GObject
1698  * @source_property: the property on @source to bind
1699  * @target: (type GObject.Object): the target #GObject
1700  * @target_property: the property on @target to bind
1701  * @flags: flags to pass to #GBinding
1702  *
1703  * Creates a binding between @source_property on @source and @target_property
1704  * on @target. Whenever the @source_property is changed the @target_property is
1705  * updated using the same value. For instance:
1706  *
1707  * |[
1708  *   g_object_bind_property (action, "active", widget, "sensitive", 0);
1709  * ]|
1710  *
1711  * Will result in the "sensitive" property of the widget #GObject instance to be
1712  * updated with the same value of the "active" property of the action #GObject
1713  * instance.
1714  *
1715  * If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
1716  * if @target_property on @target changes then the @source_property on @source
1717  * will be updated as well.
1718  *
1719  * The binding will automatically be removed when either the @source or the
1720  * @target instances are finalized. To remove the binding without affecting the
1721  * @source and the @target you can just call g_object_unref() on the returned
1722  * #GBinding instance.
1723  *
1724  * A #GObject can have multiple bindings.
1725  *
1726  * Returns: (transfer none): the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
1727  * Since: 2.26
1728  */
1729
1730
1731 /**
1732  * g_object_bind_property_full:
1733  * @source: (type GObject.Object): the source #GObject
1734  * @source_property: the property on @source to bind
1735  * @target: (type GObject.Object): the target #GObject
1736  * @target_property: the property on @target to bind
1737  * @flags: flags to pass to #GBinding
1738  * @transform_to: (scope notified) (allow-none): the transformation function from the @source to the @target, or %NULL to use the default
1739  * @transform_from: (scope notified) (allow-none): the transformation function from the @target to the @source, or %NULL to use the default
1740  * @user_data: custom data to be passed to the transformation functions, or %NULL
1741  * @notify: function to be called when disposing the binding, to free the resources used by the transformation functions
1742  *
1743  * Complete version of g_object_bind_property().
1744  *
1745  * Creates a binding between @source_property on @source and @target_property
1746  * on @target, allowing you to set the transformation functions to be used by
1747  * the binding.
1748  *
1749  * If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
1750  * if @target_property on @target changes then the @source_property on @source
1751  * will be updated as well. The @transform_from function is only used in case
1752  * of bidirectional bindings, otherwise it will be ignored
1753  *
1754  * The binding will automatically be removed when either the @source or the
1755  * @target instances are finalized. To remove the binding without affecting the
1756  * @source and the @target you can just call g_object_unref() on the returned
1757  * #GBinding instance.
1758  *
1759  * A #GObject can have multiple bindings.
1760  *
1761  * <note>The same @user_data parameter will be used for both @transform_to
1762  * and @transform_from transformation functions; the @notify function will
1763  * be called once, when the binding is removed. If you need different data
1764  * for each transformation function, please use
1765  * g_object_bind_property_with_closures() instead.</note>
1766  *
1767  * Returns: (transfer none): the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
1768  * Since: 2.26
1769  */
1770
1771
1772 /**
1773  * g_object_bind_property_with_closures:
1774  * @source: (type GObject.Object): the source #GObject
1775  * @source_property: the property on @source to bind
1776  * @target: (type GObject.Object): the target #GObject
1777  * @target_property: the property on @target to bind
1778  * @flags: flags to pass to #GBinding
1779  * @transform_to: a #GClosure wrapping the transformation function from the @source to the @target, or %NULL to use the default
1780  * @transform_from: a #GClosure wrapping the transformation function from the @target to the @source, or %NULL to use the default
1781  *
1782  * Creates a binding between @source_property on @source and @target_property
1783  * on @target, allowing you to set the transformation functions to be used by
1784  * the binding.
1785  *
1786  * This function is the language bindings friendly version of
1787  * g_object_bind_property_full(), using #GClosure<!-- -->s instead of
1788  * function pointers.
1789  *
1790  * Rename to: g_object_bind_property_full
1791  * Returns: (transfer none): the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
1792  * Since: 2.26
1793  */
1794
1795
1796 /**
1797  * g_object_class_find_property:
1798  * @oclass: a #GObjectClass
1799  * @property_name: the name of the property to look up
1800  *
1801  * Looks up the #GParamSpec for a property of a class.
1802  *
1803  * Returns: (transfer none): the #GParamSpec for the property, or %NULL if the class doesn't have a property of that name
1804  */
1805
1806
1807 /**
1808  * g_object_class_install_properties:
1809  * @oclass: a #GObjectClass
1810  * @n_pspecs: the length of the #GParamSpec<!-- -->s array
1811  * @pspecs: (array length=n_pspecs): the #GParamSpec<!-- -->s array defining the new properties
1812  *
1813  * Installs new properties from an array of #GParamSpec<!-- -->s. This is
1814  * usually done in the class initializer.
1815  *
1816  * The property id of each property is the index of each #GParamSpec in
1817  * the @pspecs array.
1818  *
1819  * The property id of 0 is treated specially by #GObject and it should not
1820  * be used to store a #GParamSpec.
1821  *
1822  * This function should be used if you plan to use a static array of
1823  * #GParamSpec<!-- -->s and g_object_notify_by_pspec(). For instance, this
1824  * class initialization:
1825  *
1826  * |[
1827  * enum {
1828  *   PROP_0, PROP_FOO, PROP_BAR, N_PROPERTIES
1829  * };
1830  *
1831  * static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, };
1832  *
1833  * static void
1834  * my_object_class_init (MyObjectClass *klass)
1835  * {
1836  *   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
1837  *
1838  *   obj_properties[PROP_FOO] =
1839  *     g_param_spec_int ("foo", "Foo", "Foo",
1840  *                       -1, G_MAXINT,
1841  *                       0,
1842  *                       G_PARAM_READWRITE);
1843  *
1844  *   obj_properties[PROP_BAR] =
1845  *     g_param_spec_string ("bar", "Bar", "Bar",
1846  *                          NULL,
1847  *                          G_PARAM_READWRITE);
1848  *
1849  *   gobject_class->set_property = my_object_set_property;
1850  *   gobject_class->get_property = my_object_get_property;
1851  *   g_object_class_install_properties (gobject_class,
1852  *                                      N_PROPERTIES,
1853  *                                      obj_properties);
1854  * }
1855  * ]|
1856  *
1857  * allows calling g_object_notify_by_pspec() to notify of property changes:
1858  *
1859  * |[
1860  * void
1861  * my_object_set_foo (MyObject *self, gint foo)
1862  * {
1863  *   if (self->foo != foo)
1864  *     {
1865  *       self->foo = foo;
1866  *       g_object_notify_by_pspec (G_OBJECT (self), obj_properties[PROP_FOO]);
1867  *     }
1868  *  }
1869  * ]|
1870  *
1871  * Since: 2.26
1872  */
1873
1874
1875 /**
1876  * g_object_class_install_property:
1877  * @oclass: a #GObjectClass
1878  * @property_id: the id for the new property
1879  * @pspec: the #GParamSpec for the new property
1880  *
1881  * Installs a new property. This is usually done in the class initializer.
1882  *
1883  * Note that it is possible to redefine a property in a derived class,
1884  * by installing a property with the same name. This can be useful at times,
1885  * e.g. to change the range of allowed values or the default value.
1886  */
1887
1888
1889 /**
1890  * g_object_class_list_properties:
1891  * @oclass: a #GObjectClass
1892  * @n_properties: (out): return location for the length of the returned array
1893  *
1894  * Get an array of #GParamSpec* for all properties of a class.
1895  *
1896  * Returns: (array length=n_properties) (transfer container): an array of #GParamSpec* which should be freed after use
1897  */
1898
1899
1900 /**
1901  * g_object_class_override_property:
1902  * @oclass: a #GObjectClass
1903  * @property_id: the new property ID
1904  * @name: the name of a property registered in a parent class or in an interface of this class.
1905  *
1906  * Registers @property_id as referring to a property with the
1907  * name @name in a parent class or in an interface implemented
1908  * by @oclass. This allows this class to <firstterm>override</firstterm>
1909  * a property implementation in a parent class or to provide
1910  * the implementation of a property from an interface.
1911  *
1912  * <note>
1913  * Internally, overriding is implemented by creating a property of type
1914  * #GParamSpecOverride; generally operations that query the properties of
1915  * the object class, such as g_object_class_find_property() or
1916  * g_object_class_list_properties() will return the overridden
1917  * property. However, in one case, the @construct_properties argument of
1918  * the @constructor virtual function, the #GParamSpecOverride is passed
1919  * instead, so that the @param_id field of the #GParamSpec will be
1920  * correct.  For virtually all uses, this makes no difference. If you
1921  * need to get the overridden property, you can call
1922  * g_param_spec_get_redirect_target().
1923  * </note>
1924  *
1925  * Since: 2.4
1926  */
1927
1928
1929 /**
1930  * g_object_connect: (skip)
1931  * @object: a #GObject
1932  * @signal_spec: the spec for the first signal
1933  * @...: #GCallback for the first signal, followed by data for the first signal, followed optionally by more signal spec/callback/data triples, followed by %NULL
1934  *
1935  * A convenience function to connect multiple signals at once.
1936  *
1937  * The signal specs expected by this function have the form
1938  * "modifier::signal_name", where modifier can be one of the following:
1939  * <variablelist>
1940  * <varlistentry>
1941  * <term>signal</term>
1942  * <listitem><para>
1943  * equivalent to <literal>g_signal_connect_data (..., NULL, 0)</literal>
1944  * </para></listitem>
1945  * </varlistentry>
1946  * <varlistentry>
1947  * <term>object_signal</term>
1948  * <term>object-signal</term>
1949  * <listitem><para>
1950  * equivalent to <literal>g_signal_connect_object (..., 0)</literal>
1951  * </para></listitem>
1952  * </varlistentry>
1953  * <varlistentry>
1954  * <term>swapped_signal</term>
1955  * <term>swapped-signal</term>
1956  * <listitem><para>
1957  * equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED)</literal>
1958  * </para></listitem>
1959  * </varlistentry>
1960  * <varlistentry>
1961  * <term>swapped_object_signal</term>
1962  * <term>swapped-object-signal</term>
1963  * <listitem><para>
1964  * equivalent to <literal>g_signal_connect_object (..., G_CONNECT_SWAPPED)</literal>
1965  * </para></listitem>
1966  * </varlistentry>
1967  * <varlistentry>
1968  * <term>signal_after</term>
1969  * <term>signal-after</term>
1970  * <listitem><para>
1971  * equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_AFTER)</literal>
1972  * </para></listitem>
1973  * </varlistentry>
1974  * <varlistentry>
1975  * <term>object_signal_after</term>
1976  * <term>object-signal-after</term>
1977  * <listitem><para>
1978  * equivalent to <literal>g_signal_connect_object (..., G_CONNECT_AFTER)</literal>
1979  * </para></listitem>
1980  * </varlistentry>
1981  * <varlistentry>
1982  * <term>swapped_signal_after</term>
1983  * <term>swapped-signal-after</term>
1984  * <listitem><para>
1985  * equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER)</literal>
1986  * </para></listitem>
1987  * </varlistentry>
1988  * <varlistentry>
1989  * <term>swapped_object_signal_after</term>
1990  * <term>swapped-object-signal-after</term>
1991  * <listitem><para>
1992  * equivalent to <literal>g_signal_connect_object (..., G_CONNECT_SWAPPED | G_CONNECT_AFTER)</literal>
1993  * </para></listitem>
1994  * </varlistentry>
1995  * </variablelist>
1996  *
1997  * |[
1998  *   menu->toplevel = g_object_connect (g_object_new (GTK_TYPE_WINDOW,
1999  *                                                 "type", GTK_WINDOW_POPUP,
2000  *                                                 "child", menu,
2001  *                                                 NULL),
2002  *                                   "signal::event", gtk_menu_window_event, menu,
2003  *                                   "signal::size_request", gtk_menu_window_size_request, menu,
2004  *                                   "signal::destroy", gtk_widget_destroyed, &amp;menu-&gt;toplevel,
2005  *                                   NULL);
2006  * ]|
2007  *
2008  * Returns: (transfer none): @object
2009  */
2010
2011
2012 /**
2013  * g_object_disconnect: (skip)
2014  * @object: a #GObject
2015  * @signal_spec: the spec for the first signal
2016  * @...: #GCallback for the first signal, followed by data for the first signal, followed optionally by more signal spec/callback/data triples, followed by %NULL
2017  *
2018  * A convenience function to disconnect multiple signals at once.
2019  *
2020  * The signal specs expected by this function have the form
2021  * "any_signal", which means to disconnect any signal with matching
2022  * callback and data, or "any_signal::signal_name", which only
2023  * disconnects the signal named "signal_name".
2024  */
2025
2026
2027 /**
2028  * g_object_dup_data:
2029  * @object: the #GObject to store user data on
2030  * @key: a string, naming the user data pointer
2031  * @dup_func: (allow-none): function to dup the value
2032  * @user_data: (allow-none): passed as user_data to @dup_func
2033  *
2034  * This is a variant of g_object_get_data() which returns
2035  * a 'duplicate' of the value. @dup_func defines the
2036  * meaning of 'duplicate' in this context, it could e.g.
2037  * take a reference on a ref-counted object.
2038  *
2039  * If the @key is not set on the object then @dup_func
2040  * will be called with a %NULL argument.
2041  *
2042  * Note that @dup_func is called while user data of @object
2043  * is locked.
2044  *
2045  * This function can be useful to avoid races when multiple
2046  * threads are using object data on the same key on the same
2047  * object.
2048  *
2049  * Returns: the result of calling @dup_func on the value associated with @key on @object, or %NULL if not set. If @dup_func is %NULL, the value is returned unmodified.
2050  * Since: 2.34
2051  */
2052
2053
2054 /**
2055  * g_object_dup_qdata:
2056  * @object: the #GObject to store user data on
2057  * @quark: a #GQuark, naming the user data pointer
2058  * @dup_func: (allow-none): function to dup the value
2059  * @user_data: (allow-none): passed as user_data to @dup_func
2060  *
2061  * This is a variant of g_object_get_qdata() which returns
2062  * a 'duplicate' of the value. @dup_func defines the
2063  * meaning of 'duplicate' in this context, it could e.g.
2064  * take a reference on a ref-counted object.
2065  *
2066  * If the @quark is not set on the object then @dup_func
2067  * will be called with a %NULL argument.
2068  *
2069  * Note that @dup_func is called while user data of @object
2070  * is locked.
2071  *
2072  * This function can be useful to avoid races when multiple
2073  * threads are using object data on the same key on the same
2074  * object.
2075  *
2076  * Returns: the result of calling @dup_func on the value associated with @quark on @object, or %NULL if not set. If @dup_func is %NULL, the value is returned unmodified.
2077  * Since: 2.34
2078  */
2079
2080
2081 /**
2082  * g_object_force_floating:
2083  * @object: a #GObject
2084  *
2085  * This function is intended for #GObject implementations to re-enforce a
2086  * <link linkend="floating-ref">floating</link> object reference.
2087  * Doing this is seldom required: all
2088  * #GInitiallyUnowned<!-- -->s are created with a floating reference which
2089  * usually just needs to be sunken by calling g_object_ref_sink().
2090  *
2091  * Since: 2.10
2092  */
2093
2094
2095 /**
2096  * g_object_freeze_notify:
2097  * @object: a #GObject
2098  *
2099  * Increases the freeze count on @object. If the freeze count is
2100  * non-zero, the emission of "notify" signals on @object is
2101  * stopped. The signals are queued until the freeze count is decreased
2102  * to zero. Duplicate notifications are squashed so that at most one
2103  * #GObject::notify signal is emitted for each property modified while the
2104  * object is frozen.
2105  *
2106  * This is necessary for accessors that modify multiple properties to prevent
2107  * premature notification while the object is still being modified.
2108  */
2109
2110
2111 /**
2112  * g_object_get: (skip)
2113  * @object: a #GObject
2114  * @first_property_name: name of the first property to get
2115  * @...: return location for the first property, followed optionally by more name/return location pairs, followed by %NULL
2116  *
2117  * Gets properties of an object.
2118  *
2119  * In general, a copy is made of the property contents and the caller
2120  * is responsible for freeing the memory in the appropriate manner for
2121  * the type, for instance by calling g_free() or g_object_unref().
2122  *
2123  * <example>
2124  * <title>Using g_object_get(<!-- -->)</title>
2125  * An example of using g_object_get() to get the contents
2126  * of three properties - one of type #G_TYPE_INT,
2127  * one of type #G_TYPE_STRING, and one of type #G_TYPE_OBJECT:
2128  * <programlisting>
2129  *  gint intval;
2130  *  gchar *strval;
2131  *  GObject *objval;
2132  *
2133  *  g_object_get (my_object,
2134  *                "int-property", &intval,
2135  *                "str-property", &strval,
2136  *                "obj-property", &objval,
2137  *                NULL);
2138  *
2139  *  // Do something with intval, strval, objval
2140  *
2141  *  g_free (strval);
2142  *  g_object_unref (objval);
2143  * </programlisting>
2144  * </example>
2145  */
2146
2147
2148 /**
2149  * g_object_get_data:
2150  * @object: #GObject containing the associations
2151  * @key: name of the key for that association
2152  *
2153  * Gets a named field from the objects table of associations (see g_object_set_data()).
2154  *
2155  * Returns: (transfer none): the data if found, or %NULL if no such data exists.
2156  */
2157
2158
2159 /**
2160  * g_object_get_property:
2161  * @object: a #GObject
2162  * @property_name: the name of the property to get
2163  * @value: return location for the property value
2164  *
2165  * Gets a property of an object. @value must have been initialized to the
2166  * expected type of the property (or a type to which the expected type can be
2167  * transformed) using g_value_init().
2168  *
2169  * In general, a copy is made of the property contents and the caller is
2170  * responsible for freeing the memory by calling g_value_unset().
2171  *
2172  * Note that g_object_get_property() is really intended for language
2173  * bindings, g_object_get() is much more convenient for C programming.
2174  */
2175
2176
2177 /**
2178  * g_object_get_qdata:
2179  * @object: The GObject to get a stored user data pointer from
2180  * @quark: A #GQuark, naming the user data pointer
2181  *
2182  * This function gets back user data pointers stored via
2183  * g_object_set_qdata().
2184  *
2185  * Returns: (transfer none): The user data pointer set, or %NULL
2186  */
2187
2188
2189 /**
2190  * g_object_get_valist: (skip)
2191  * @object: a #GObject
2192  * @first_property_name: name of the first property to get
2193  * @var_args: return location for the first property, followed optionally by more name/return location pairs, followed by %NULL
2194  *
2195  * Gets properties of an object.
2196  *
2197  * In general, a copy is made of the property contents and the caller
2198  * is responsible for freeing the memory in the appropriate manner for
2199  * the type, for instance by calling g_free() or g_object_unref().
2200  *
2201  * See g_object_get().
2202  */
2203
2204
2205 /**
2206  * g_object_interface_find_property:
2207  * @g_iface: any interface vtable for the interface, or the default vtable for the interface
2208  * @property_name: name of a property to lookup.
2209  *
2210  * Find the #GParamSpec with the given name for an
2211  * interface. Generally, the interface vtable passed in as @g_iface
2212  * will be the default vtable from g_type_default_interface_ref(), or,
2213  * if you know the interface has already been loaded,
2214  * g_type_default_interface_peek().
2215  *
2216  * Since: 2.4
2217  * Returns: (transfer none): the #GParamSpec for the property of the interface with the name @property_name, or %NULL if no such property exists.
2218  */
2219
2220
2221 /**
2222  * g_object_interface_install_property:
2223  * @g_iface: any interface vtable for the interface, or the default vtable for the interface.
2224  * @pspec: the #GParamSpec for the new property
2225  *
2226  * Add a property to an interface; this is only useful for interfaces
2227  * that are added to GObject-derived types. Adding a property to an
2228  * interface forces all objects classes with that interface to have a
2229  * compatible property. The compatible property could be a newly
2230  * created #GParamSpec, but normally
2231  * g_object_class_override_property() will be used so that the object
2232  * class only needs to provide an implementation and inherits the
2233  * property description, default value, bounds, and so forth from the
2234  * interface property.
2235  *
2236  * This function is meant to be called from the interface's default
2237  * vtable initialization function (the @class_init member of
2238  * #GTypeInfo.) It must not be called after after @class_init has
2239  * been called for any object types implementing this interface.
2240  *
2241  * Since: 2.4
2242  */
2243
2244
2245 /**
2246  * g_object_interface_list_properties:
2247  * @g_iface: any interface vtable for the interface, or the default vtable for the interface
2248  * @n_properties_p: (out): location to store number of properties returned.
2249  *
2250  * Lists the properties of an interface.Generally, the interface
2251  * vtable passed in as @g_iface will be the default vtable from
2252  * g_type_default_interface_ref(), or, if you know the interface has
2253  * already been loaded, g_type_default_interface_peek().
2254  *
2255  * Since: 2.4
2256  * Returns: (array length=n_properties_p) (transfer container): a pointer to an array of pointers to #GParamSpec structures. The paramspecs are owned by GLib, but the array should be freed with g_free() when you are done with it.
2257  */
2258
2259
2260 /**
2261  * g_object_is_floating:
2262  * @object: (type GObject.Object): a #GObject
2263  *
2264  * Checks whether @object has a <link linkend="floating-ref">floating</link>
2265  * reference.
2266  *
2267  * Since: 2.10
2268  * Returns: %TRUE if @object has a floating reference
2269  */
2270
2271
2272 /**
2273  * g_object_new: (skip)
2274  * @object_type: the type id of the #GObject subtype to instantiate
2275  * @first_property_name: the name of the first property
2276  * @...: the value of the first property, followed optionally by more name/value pairs, followed by %NULL
2277  *
2278  * Creates a new instance of a #GObject subtype and sets its properties.
2279  *
2280  * Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY)
2281  * which are not explicitly specified are set to their default values.
2282  *
2283  * Returns: (transfer full): a new instance of @object_type
2284  */
2285
2286
2287 /**
2288  * g_object_new_valist: (skip)
2289  * @object_type: the type id of the #GObject subtype to instantiate
2290  * @first_property_name: the name of the first property
2291  * @var_args: the value of the first property, followed optionally by more name/value pairs, followed by %NULL
2292  *
2293  * Creates a new instance of a #GObject subtype and sets its properties.
2294  *
2295  * Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY)
2296  * which are not explicitly specified are set to their default values.
2297  *
2298  * Returns: a new instance of @object_type
2299  */
2300
2301
2302 /**
2303  * g_object_newv:
2304  * @object_type: the type id of the #GObject subtype to instantiate
2305  * @n_parameters: the length of the @parameters array
2306  * @parameters: (array length=n_parameters): an array of #GParameter
2307  *
2308  * Creates a new instance of a #GObject subtype and sets its properties.
2309  *
2310  * Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY)
2311  * which are not explicitly specified are set to their default values.
2312  *
2313  * Rename to: g_object_new
2314  * Returns: (type GObject.Object) (transfer full): a new instance of @object_type
2315  */
2316
2317
2318 /**
2319  * g_object_notify:
2320  * @object: a #GObject
2321  * @property_name: the name of a property installed on the class of @object.
2322  *
2323  * Emits a "notify" signal for the property @property_name on @object.
2324  *
2325  * When possible, eg. when signaling a property change from within the class
2326  * that registered the property, you should use g_object_notify_by_pspec()
2327  * instead.
2328  */
2329
2330
2331 /**
2332  * g_object_notify_by_pspec:
2333  * @object: a #GObject
2334  * @pspec: the #GParamSpec of a property installed on the class of @object.
2335  *
2336  * Emits a "notify" signal for the property specified by @pspec on @object.
2337  *
2338  * This function omits the property name lookup, hence it is faster than
2339  * g_object_notify().
2340  *
2341  * One way to avoid using g_object_notify() from within the
2342  * class that registered the properties, and using g_object_notify_by_pspec()
2343  * instead, is to store the GParamSpec used with
2344  * g_object_class_install_property() inside a static array, e.g.:
2345  *
2346  * |[
2347  *   enum
2348  *   {
2349  *     PROP_0,
2350  *     PROP_FOO,
2351  *     PROP_LAST
2352  *   };
2353  *
2354  *   static GParamSpec *properties[PROP_LAST];
2355  *
2356  *   static void
2357  *   my_object_class_init (MyObjectClass *klass)
2358  *   {
2359  *     properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
2360  *                                              0, 100,
2361  *                                              50,
2362  *                                              G_PARAM_READWRITE);
2363  *     g_object_class_install_property (gobject_class,
2364  *                                      PROP_FOO,
2365  *                                      properties[PROP_FOO]);
2366  *   }
2367  * ]|
2368  *
2369  * and then notify a change on the "foo" property with:
2370  *
2371  * |[
2372  *   g_object_notify_by_pspec (self, properties[PROP_FOO]);
2373  * ]|
2374  *
2375  * Since: 2.26
2376  */
2377
2378
2379 /**
2380  * g_object_ref:
2381  * @object: (type GObject.Object): a #GObject
2382  *
2383  * Increases the reference count of @object.
2384  *
2385  * Returns: (type GObject.Object) (transfer none): the same @object
2386  */
2387
2388
2389 /**
2390  * g_object_ref_sink:
2391  * @object: (type GObject.Object): a #GObject
2392  *
2393  * Increase the reference count of @object, and possibly remove the
2394  * <link linkend="floating-ref">floating</link> reference, if @object
2395  * has a floating reference.
2396  *
2397  * In other words, if the object is floating, then this call "assumes
2398  * ownership" of the floating reference, converting it to a normal
2399  * reference by clearing the floating flag while leaving the reference
2400  * count unchanged.  If the object is not floating, then this call
2401  * adds a new normal reference increasing the reference count by one.
2402  *
2403  * Since: 2.10
2404  * Returns: (type GObject.Object) (transfer none): @object
2405  */
2406
2407
2408 /**
2409  * g_object_remove_toggle_ref: (skip)
2410  * @object: a #GObject
2411  * @notify: a function to call when this reference is the last reference to the object, or is no longer the last reference.
2412  * @data: data to pass to @notify
2413  *
2414  * Removes a reference added with g_object_add_toggle_ref(). The
2415  * reference count of the object is decreased by one.
2416  *
2417  * Since: 2.8
2418  */
2419
2420
2421 /**
2422  * g_object_remove_weak_pointer: (skip)
2423  * @object: The object that is weak referenced.
2424  * @weak_pointer_location: (inout): The memory address of a pointer.
2425  *
2426  * Removes a weak reference from @object that was previously added
2427  * using g_object_add_weak_pointer(). The @weak_pointer_location has
2428  * to match the one used with g_object_add_weak_pointer().
2429  */
2430
2431
2432 /**
2433  * g_object_replace_data:
2434  * @object: the #GObject to store user data on
2435  * @key: a string, naming the user data pointer
2436  * @oldval: (allow-none): the old value to compare against
2437  * @newval: (allow-none): the new value
2438  * @destroy: (allow-none): a destroy notify for the new value
2439  * @old_destroy: (allow-none): destroy notify for the existing value
2440  *
2441  * Compares the user data for the key @key on @object with
2442  * @oldval, and if they are the same, replaces @oldval with
2443  * @newval.
2444  *
2445  * This is like a typical atomic compare-and-exchange
2446  * operation, for user data on an object.
2447  *
2448  * If the previous value was replaced then ownership of the
2449  * old value (@oldval) is passed to the caller, including
2450  * the registered destroy notify for it (passed out in @old_destroy).
2451  * Its up to the caller to free this as he wishes, which may
2452  * or may not include using @old_destroy as sometimes replacement
2453  * should not destroy the object in the normal way.
2454  *
2455  * Return: %TRUE if the existing value for @key was replaced
2456  *  by @newval, %FALSE otherwise.
2457  *
2458  * Since: 2.34
2459  */
2460
2461
2462 /**
2463  * g_object_replace_qdata:
2464  * @object: the #GObject to store user data on
2465  * @quark: a #GQuark, naming the user data pointer
2466  * @oldval: (allow-none): the old value to compare against
2467  * @newval: (allow-none): the new value
2468  * @destroy: (allow-none): a destroy notify for the new value
2469  * @old_destroy: (allow-none): destroy notify for the existing value
2470  *
2471  * Compares the user data for the key @quark on @object with
2472  * @oldval, and if they are the same, replaces @oldval with
2473  * @newval.
2474  *
2475  * This is like a typical atomic compare-and-exchange
2476  * operation, for user data on an object.
2477  *
2478  * If the previous value was replaced then ownership of the
2479  * old value (@oldval) is passed to the caller, including
2480  * the registered destroy notify for it (passed out in @old_destroy).
2481  * Its up to the caller to free this as he wishes, which may
2482  * or may not include using @old_destroy as sometimes replacement
2483  * should not destroy the object in the normal way.
2484  *
2485  * Return: %TRUE if the existing value for @quark was replaced
2486  *  by @newval, %FALSE otherwise.
2487  *
2488  * Since: 2.34
2489  */
2490
2491
2492 /**
2493  * g_object_run_dispose:
2494  * @object: a #GObject
2495  *
2496  * Releases all references to other objects. This can be used to break
2497  * reference cycles.
2498  *
2499  * This functions should only be called from object system implementations.
2500  */
2501
2502
2503 /**
2504  * g_object_set: (skip)
2505  * @object: a #GObject
2506  * @first_property_name: name of the first property to set
2507  * @...: value for the first property, followed optionally by more name/value pairs, followed by %NULL
2508  *
2509  * Sets properties on an object.
2510  */
2511
2512
2513 /**
2514  * g_object_set_data:
2515  * @object: #GObject containing the associations.
2516  * @key: name of the key
2517  * @data: data to associate with that key
2518  *
2519  * Each object carries around a table of associations from
2520  * strings to pointers.  This function lets you set an association.
2521  *
2522  * If the object already had an association with that name,
2523  * the old association will be destroyed.
2524  */
2525
2526
2527 /**
2528  * g_object_set_data_full: (skip)
2529  * @object: #GObject containing the associations
2530  * @key: name of the key
2531  * @data: data to associate with that key
2532  * @destroy: function to call when the association is destroyed
2533  *
2534  * Like g_object_set_data() except it adds notification
2535  * for when the association is destroyed, either by setting it
2536  * to a different value or when the object is destroyed.
2537  *
2538  * Note that the @destroy callback is not called if @data is %NULL.
2539  */
2540
2541
2542 /**
2543  * g_object_set_property:
2544  * @object: a #GObject
2545  * @property_name: the name of the property to set
2546  * @value: the value
2547  *
2548  * Sets a property on an object.
2549  */
2550
2551
2552 /**
2553  * g_object_set_qdata: (skip)
2554  * @object: The GObject to set store a user data pointer
2555  * @quark: A #GQuark, naming the user data pointer
2556  * @data: An opaque user data pointer
2557  *
2558  * This sets an opaque, named pointer on an object.
2559  * The name is specified through a #GQuark (retrived e.g. via
2560  * g_quark_from_static_string()), and the pointer
2561  * can be gotten back from the @object with g_object_get_qdata()
2562  * until the @object is finalized.
2563  * Setting a previously set user data pointer, overrides (frees)
2564  * the old pointer set, using #NULL as pointer essentially
2565  * removes the data stored.
2566  */
2567
2568
2569 /**
2570  * g_object_set_qdata_full: (skip)
2571  * @object: The GObject to set store a user data pointer
2572  * @quark: A #GQuark, naming the user data pointer
2573  * @data: An opaque user data pointer
2574  * @destroy: Function to invoke with @data as argument, when @data needs to be freed
2575  *
2576  * This function works like g_object_set_qdata(), but in addition,
2577  * a void (*destroy) (gpointer) function may be specified which is
2578  * called with @data as argument when the @object is finalized, or
2579  * the data is being overwritten by a call to g_object_set_qdata()
2580  * with the same @quark.
2581  */
2582
2583
2584 /**
2585  * g_object_set_valist: (skip)
2586  * @object: a #GObject
2587  * @first_property_name: name of the first property to set
2588  * @var_args: value for the first property, followed optionally by more name/value pairs, followed by %NULL
2589  *
2590  * Sets properties on an object.
2591  */
2592
2593
2594 /**
2595  * g_object_steal_data:
2596  * @object: #GObject containing the associations
2597  * @key: name of the key
2598  *
2599  * Remove a specified datum from the object's data associations,
2600  * without invoking the association's destroy handler.
2601  *
2602  * Returns: (transfer full): the data if found, or %NULL if no such data exists.
2603  */
2604
2605
2606 /**
2607  * g_object_steal_qdata:
2608  * @object: The GObject to get a stored user data pointer from
2609  * @quark: A #GQuark, naming the user data pointer
2610  *
2611  * This function gets back user data pointers stored via
2612  * g_object_set_qdata() and removes the @data from object
2613  * without invoking its destroy() function (if any was
2614  * set).
2615  * Usually, calling this function is only required to update
2616  * user data pointers with a destroy notifier, for example:
2617  * |[
2618  * void
2619  * object_add_to_user_list (GObject     *object,
2620  *                          const gchar *new_string)
2621  * {
2622  *   // the quark, naming the object data
2623  *   GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
2624  *   // retrive the old string list
2625  *   GList *list = g_object_steal_qdata (object, quark_string_list);
2626  *
2627  *   // prepend new string
2628  *   list = g_list_prepend (list, g_strdup (new_string));
2629  *   // this changed 'list', so we need to set it again
2630  *   g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
2631  * }
2632  * static void
2633  * free_string_list (gpointer data)
2634  * {
2635  *   GList *node, *list = data;
2636  *
2637  *   for (node = list; node; node = node->next)
2638  *     g_free (node->data);
2639  *   g_list_free (list);
2640  * }
2641  * ]|
2642  * Using g_object_get_qdata() in the above example, instead of
2643  * g_object_steal_qdata() would have left the destroy function set,
2644  * and thus the partial string list would have been freed upon
2645  * g_object_set_qdata_full().
2646  *
2647  * Returns: (transfer full): The user data pointer set, or %NULL
2648  */
2649
2650
2651 /**
2652  * g_object_thaw_notify:
2653  * @object: a #GObject
2654  *
2655  * Reverts the effect of a previous call to
2656  * g_object_freeze_notify(). The freeze count is decreased on @object
2657  * and when it reaches zero, queued "notify" signals are emitted.
2658  *
2659  * Duplicate notifications for each property are squashed so that at most one
2660  * #GObject::notify signal is emitted for each property.
2661  *
2662  * It is an error to call this function when the freeze count is zero.
2663  */
2664
2665
2666 /**
2667  * g_object_unref:
2668  * @object: (type GObject.Object): a #GObject
2669  *
2670  * Decreases the reference count of @object. When its reference count
2671  * drops to 0, the object is finalized (i.e. its memory is freed).
2672  */
2673
2674
2675 /**
2676  * g_object_watch_closure:
2677  * @object: GObject restricting lifetime of @closure
2678  * @closure: GClosure to watch
2679  *
2680  * This function essentially limits the life time of the @closure to
2681  * the life time of the object. That is, when the object is finalized,
2682  * the @closure is invalidated by calling g_closure_invalidate() on
2683  * it, in order to prevent invocations of the closure with a finalized
2684  * (nonexisting) object. Also, g_object_ref() and g_object_unref() are
2685  * added as marshal guards to the @closure, to ensure that an extra
2686  * reference count is held on @object during invocation of the
2687  * @closure.  Usually, this function will be called on closures that
2688  * use this @object as closure data.
2689  */
2690
2691
2692 /**
2693  * g_object_weak_ref: (skip)
2694  * @object: #GObject to reference weakly
2695  * @notify: callback to invoke before the object is freed
2696  * @data: extra data to pass to notify
2697  *
2698  * Adds a weak reference callback to an object. Weak references are
2699  * used for notification when an object is finalized. They are called
2700  * "weak references" because they allow you to safely hold a pointer
2701  * to an object without calling g_object_ref() (g_object_ref() adds a
2702  * strong reference, that is, forces the object to stay alive).
2703  *
2704  * Note that the weak references created by this method are not
2705  * thread-safe: they cannot safely be used in one thread if the
2706  * object's last g_object_unref() might happen in another thread.
2707  * Use #GWeakRef if thread-safety is required.
2708  */
2709
2710
2711 /**
2712  * g_object_weak_unref: (skip)
2713  * @object: #GObject to remove a weak reference from
2714  * @notify: callback to search for
2715  * @data: data to search for
2716  *
2717  * Removes a weak reference callback to an object.
2718  */
2719
2720
2721 /**
2722  * g_param_get_default_value:
2723  * @param: a #GParamSpec
2724  *
2725  * Gets the default value of @param as a pointer to a #GValue.
2726  *
2727  * The #GValue will remain value for the life of @param.
2728  *
2729  * Returns: a pointer to a #GValue which must not be modified
2730  * Since: 2.38
2731  */
2732
2733
2734 /**
2735  * g_param_spec_boolean:
2736  * @name: canonical name of the property specified
2737  * @nick: nick name for the property specified
2738  * @blurb: description of the property specified
2739  * @default_value: default value for the property specified
2740  * @flags: flags for the property specified
2741  *
2742  * Creates a new #GParamSpecBoolean instance specifying a %G_TYPE_BOOLEAN
2743  * property.
2744  *
2745  * See g_param_spec_internal() for details on property names.
2746  *
2747  * Returns: (transfer full): a newly created parameter specification
2748  */
2749
2750
2751 /**
2752  * g_param_spec_boxed:
2753  * @name: canonical name of the property specified
2754  * @nick: nick name for the property specified
2755  * @blurb: description of the property specified
2756  * @boxed_type: %G_TYPE_BOXED derived type of this property
2757  * @flags: flags for the property specified
2758  *
2759  * Creates a new #GParamSpecBoxed instance specifying a %G_TYPE_BOXED
2760  * derived property.
2761  *
2762  * See g_param_spec_internal() for details on property names.
2763  *
2764  * Returns: (transfer full): a newly created parameter specification
2765  */
2766
2767
2768 /**
2769  * g_param_spec_char:
2770  * @name: canonical name of the property specified
2771  * @nick: nick name for the property specified
2772  * @blurb: description of the property specified
2773  * @minimum: minimum value for the property specified
2774  * @maximum: maximum value for the property specified
2775  * @default_value: default value for the property specified
2776  * @flags: flags for the property specified
2777  *
2778  * Creates a new #GParamSpecChar instance specifying a %G_TYPE_CHAR property.
2779  *
2780  * Returns: (transfer full): a newly created parameter specification
2781  */
2782
2783
2784 /**
2785  * g_param_spec_double:
2786  * @name: canonical name of the property specified
2787  * @nick: nick name for the property specified
2788  * @blurb: description of the property specified
2789  * @minimum: minimum value for the property specified
2790  * @maximum: maximum value for the property specified
2791  * @default_value: default value for the property specified
2792  * @flags: flags for the property specified
2793  *
2794  * Creates a new #GParamSpecDouble instance specifying a %G_TYPE_DOUBLE
2795  * property.
2796  *
2797  * See g_param_spec_internal() for details on property names.
2798  *
2799  * Returns: (transfer full): a newly created parameter specification
2800  */
2801
2802
2803 /**
2804  * g_param_spec_enum:
2805  * @name: canonical name of the property specified
2806  * @nick: nick name for the property specified
2807  * @blurb: description of the property specified
2808  * @enum_type: a #GType derived from %G_TYPE_ENUM
2809  * @default_value: default value for the property specified
2810  * @flags: flags for the property specified
2811  *
2812  * Creates a new #GParamSpecEnum instance specifying a %G_TYPE_ENUM
2813  * property.
2814  *
2815  * See g_param_spec_internal() for details on property names.
2816  *
2817  * Returns: (transfer full): a newly created parameter specification
2818  */
2819
2820
2821 /**
2822  * g_param_spec_flags:
2823  * @name: canonical name of the property specified
2824  * @nick: nick name for the property specified
2825  * @blurb: description of the property specified
2826  * @flags_type: a #GType derived from %G_TYPE_FLAGS
2827  * @default_value: default value for the property specified
2828  * @flags: flags for the property specified
2829  *
2830  * Creates a new #GParamSpecFlags instance specifying a %G_TYPE_FLAGS
2831  * property.
2832  *
2833  * See g_param_spec_internal() for details on property names.
2834  *
2835  * Returns: (transfer full): a newly created parameter specification
2836  */
2837
2838
2839 /**
2840  * g_param_spec_float:
2841  * @name: canonical name of the property specified
2842  * @nick: nick name for the property specified
2843  * @blurb: description of the property specified
2844  * @minimum: minimum value for the property specified
2845  * @maximum: maximum value for the property specified
2846  * @default_value: default value for the property specified
2847  * @flags: flags for the property specified
2848  *
2849  * Creates a new #GParamSpecFloat instance specifying a %G_TYPE_FLOAT property.
2850  *
2851  * See g_param_spec_internal() for details on property names.
2852  *
2853  * Returns: (transfer full): a newly created parameter specification
2854  */
2855
2856
2857 /**
2858  * g_param_spec_get_blurb:
2859  * @pspec: a valid #GParamSpec
2860  *
2861  * Get the short description of a #GParamSpec.
2862  *
2863  * Returns: the short description of @pspec.
2864  */
2865
2866
2867 /**
2868  * g_param_spec_get_name:
2869  * @pspec: a valid #GParamSpec
2870  *
2871  * Get the name of a #GParamSpec.
2872  *
2873  * The name is always an "interned" string (as per g_intern_string()).
2874  * This allows for pointer-value comparisons.
2875  *
2876  * Returns: the name of @pspec.
2877  */
2878
2879
2880 /**
2881  * g_param_spec_get_nick:
2882  * @pspec: a valid #GParamSpec
2883  *
2884  * Get the nickname of a #GParamSpec.
2885  *
2886  * Returns: the nickname of @pspec.
2887  */
2888
2889
2890 /**
2891  * g_param_spec_get_qdata:
2892  * @pspec: a valid #GParamSpec
2893  * @quark: a #GQuark, naming the user data pointer
2894  *
2895  * Gets back user data pointers stored via g_param_spec_set_qdata().
2896  *
2897  * Returns: (transfer none): the user data pointer set, or %NULL
2898  */
2899
2900
2901 /**
2902  * g_param_spec_get_redirect_target:
2903  * @pspec: a #GParamSpec
2904  *
2905  * If the paramspec redirects operations to another paramspec,
2906  * returns that paramspec. Redirect is used typically for
2907  * providing a new implementation of a property in a derived
2908  * type while preserving all the properties from the parent
2909  * type. Redirection is established by creating a property
2910  * of type #GParamSpecOverride. See g_object_class_override_property()
2911  * for an example of the use of this capability.
2912  *
2913  * Since: 2.4
2914  * Returns: (transfer none): paramspec to which requests on this paramspec should be redirected, or %NULL if none.
2915  */
2916
2917
2918 /**
2919  * g_param_spec_gtype:
2920  * @name: canonical name of the property specified
2921  * @nick: nick name for the property specified
2922  * @blurb: description of the property specified
2923  * @is_a_type: a #GType whose subtypes are allowed as values of the property (use %G_TYPE_NONE for any type)
2924  * @flags: flags for the property specified
2925  *
2926  * Creates a new #GParamSpecGType instance specifying a
2927  * %G_TYPE_GTYPE property.
2928  *
2929  * See g_param_spec_internal() for details on property names.
2930  *
2931  * Since: 2.10
2932  * Returns: (transfer full): a newly created parameter specification
2933  */
2934
2935
2936 /**
2937  * g_param_spec_int:
2938  * @name: canonical name of the property specified
2939  * @nick: nick name for the property specified
2940  * @blurb: description of the property specified
2941  * @minimum: minimum value for the property specified
2942  * @maximum: maximum value for the property specified
2943  * @default_value: default value for the property specified
2944  * @flags: flags for the property specified
2945  *
2946  * Creates a new #GParamSpecInt instance specifying a %G_TYPE_INT property.
2947  *
2948  * See g_param_spec_internal() for details on property names.
2949  *
2950  * Returns: (transfer full): a newly created parameter specification
2951  */
2952
2953
2954 /**
2955  * g_param_spec_int64:
2956  * @name: canonical name of the property specified
2957  * @nick: nick name for the property specified
2958  * @blurb: description of the property specified
2959  * @minimum: minimum value for the property specified
2960  * @maximum: maximum value for the property specified
2961  * @default_value: default value for the property specified
2962  * @flags: flags for the property specified
2963  *
2964  * Creates a new #GParamSpecInt64 instance specifying a %G_TYPE_INT64 property.
2965  *
2966  * See g_param_spec_internal() for details on property names.
2967  *
2968  * Returns: (transfer full): a newly created parameter specification
2969  */
2970
2971
2972 /**
2973  * g_param_spec_internal: (skip)
2974  * @param_type: the #GType for the property; must be derived from #G_TYPE_PARAM
2975  * @name: the canonical name of the property
2976  * @nick: the nickname of the property
2977  * @blurb: a short description of the property
2978  * @flags: a combination of #GParamFlags
2979  *
2980  * Creates a new #GParamSpec instance.
2981  *
2982  * A property name consists of segments consisting of ASCII letters and
2983  * digits, separated by either the '-' or '_' character. The first
2984  * character of a property name must be a letter. Names which violate these
2985  * rules lead to undefined behaviour.
2986  *
2987  * When creating and looking up a #GParamSpec, either separator can be
2988  * used, but they cannot be mixed. Using '-' is considerably more
2989  * efficient and in fact required when using property names as detail
2990  * strings for signals.
2991  *
2992  * Beyond the name, #GParamSpec<!-- -->s have two more descriptive
2993  * strings associated with them, the @nick, which should be suitable
2994  * for use as a label for the property in a property editor, and the
2995  * @blurb, which should be a somewhat longer description, suitable for
2996  * e.g. a tooltip. The @nick and @blurb should ideally be localized.
2997  *
2998  * Returns: a newly allocated #GParamSpec instance
2999  */
3000
3001
3002 /**
3003  * g_param_spec_long:
3004  * @name: canonical name of the property specified
3005  * @nick: nick name for the property specified
3006  * @blurb: description of the property specified
3007  * @minimum: minimum value for the property specified
3008  * @maximum: maximum value for the property specified
3009  * @default_value: default value for the property specified
3010  * @flags: flags for the property specified
3011  *
3012  * Creates a new #GParamSpecLong instance specifying a %G_TYPE_LONG property.
3013  *
3014  * See g_param_spec_internal() for details on property names.
3015  *
3016  * Returns: (transfer full): a newly created parameter specification
3017  */
3018
3019
3020 /**
3021  * g_param_spec_object:
3022  * @name: canonical name of the property specified
3023  * @nick: nick name for the property specified
3024  * @blurb: description of the property specified
3025  * @object_type: %G_TYPE_OBJECT derived type of this property
3026  * @flags: flags for the property specified
3027  *
3028  * Creates a new #GParamSpecBoxed instance specifying a %G_TYPE_OBJECT
3029  * derived property.
3030  *
3031  * See g_param_spec_internal() for details on property names.
3032  *
3033  * Returns: (transfer full): a newly created parameter specification
3034  */
3035
3036
3037 /**
3038  * g_param_spec_override: (skip)
3039  * @name: the name of the property.
3040  * @overridden: The property that is being overridden
3041  *
3042  * Creates a new property of type #GParamSpecOverride. This is used
3043  * to direct operations to another paramspec, and will not be directly
3044  * useful unless you are implementing a new base type similar to GObject.
3045  *
3046  * Since: 2.4
3047  * Returns: the newly created #GParamSpec
3048  */
3049
3050
3051 /**
3052  * g_param_spec_param:
3053  * @name: canonical name of the property specified
3054  * @nick: nick name for the property specified
3055  * @blurb: description of the property specified
3056  * @param_type: a #GType derived from %G_TYPE_PARAM
3057  * @flags: flags for the property specified
3058  *
3059  * Creates a new #GParamSpecParam instance specifying a %G_TYPE_PARAM
3060  * property.
3061  *
3062  * See g_param_spec_internal() for details on property names.
3063  *
3064  * Returns: (transfer full): a newly created parameter specification
3065  */
3066
3067
3068 /**
3069  * g_param_spec_pointer:
3070  * @name: canonical name of the property specified
3071  * @nick: nick name for the property specified
3072  * @blurb: description of the property specified
3073  * @flags: flags for the property specified
3074  *
3075  * Creates a new #GParamSpecPointer instance specifying a pointer property.
3076  *
3077  * See g_param_spec_internal() for details on property names.
3078  *
3079  * Returns: (transfer full): a newly created parameter specification
3080  */
3081
3082
3083 /**
3084  * g_param_spec_pool_insert:
3085  * @pool: a #GParamSpecPool.
3086  * @pspec: the #GParamSpec to insert
3087  * @owner_type: a #GType identifying the owner of @pspec
3088  *
3089  * Inserts a #GParamSpec in the pool.
3090  */
3091
3092
3093 /**
3094  * g_param_spec_pool_list:
3095  * @pool: a #GParamSpecPool
3096  * @owner_type: the owner to look for
3097  * @n_pspecs_p: (out): return location for the length of the returned array
3098  *
3099  * Gets an array of all #GParamSpec<!-- -->s owned by @owner_type in
3100  * the pool.
3101  *
3102  * Returns: (array length=n_pspecs_p) (transfer container): a newly allocated array containing pointers to all #GParamSpecs owned by @owner_type in the pool
3103  */
3104
3105
3106 /**
3107  * g_param_spec_pool_list_owned:
3108  * @pool: a #GParamSpecPool
3109  * @owner_type: the owner to look for
3110  *
3111  * Gets an #GList of all #GParamSpec<!-- -->s owned by @owner_type in
3112  * the pool.
3113  *
3114  * Returns: (transfer container) (element-type GObject.ParamSpec): a #GList of all #GParamSpec<!-- -->s owned by @owner_type in the pool#GParamSpec<!-- -->s.
3115  */
3116
3117
3118 /**
3119  * g_param_spec_pool_lookup:
3120  * @pool: a #GParamSpecPool
3121  * @param_name: the name to look for
3122  * @owner_type: the owner to look for
3123  * @walk_ancestors: If %TRUE, also try to find a #GParamSpec with @param_name owned by an ancestor of @owner_type.
3124  *
3125  * Looks up a #GParamSpec in the pool.
3126  *
3127  * Returns: (transfer none): The found #GParamSpec, or %NULL if no matching #GParamSpec was found.
3128  */
3129
3130
3131 /**
3132  * g_param_spec_pool_new:
3133  * @type_prefixing: Whether the pool will support type-prefixed property names.
3134  *
3135  * Creates a new #GParamSpecPool.
3136  *
3137  * If @type_prefixing is %TRUE, lookups in the newly created pool will
3138  * allow to specify the owner as a colon-separated prefix of the
3139  * property name, like "GtkContainer:border-width". This feature is
3140  * deprecated, so you should always set @type_prefixing to %FALSE.
3141  *
3142  * Returns: (transfer none): a newly allocated #GParamSpecPool.
3143  */
3144
3145
3146 /**
3147  * g_param_spec_pool_remove:
3148  * @pool: a #GParamSpecPool
3149  * @pspec: the #GParamSpec to remove
3150  *
3151  * Removes a #GParamSpec from the pool.
3152  */
3153
3154
3155 /**
3156  * g_param_spec_ref: (skip)
3157  * @pspec: a valid #GParamSpec
3158  *
3159  * Increments the reference count of @pspec.
3160  *
3161  * Returns: the #GParamSpec that was passed into this function
3162  */
3163
3164
3165 /**
3166  * g_param_spec_ref_sink: (skip)
3167  * @pspec: a valid #GParamSpec
3168  *
3169  * Convenience function to ref and sink a #GParamSpec.
3170  *
3171  * Since: 2.10
3172  * Returns: the #GParamSpec that was passed into this function
3173  */
3174
3175
3176 /**
3177  * g_param_spec_set_qdata:
3178  * @pspec: the #GParamSpec to set store a user data pointer
3179  * @quark: a #GQuark, naming the user data pointer
3180  * @data: an opaque user data pointer
3181  *
3182  * Sets an opaque, named pointer on a #GParamSpec. The name is
3183  * specified through a #GQuark (retrieved e.g. via
3184  * g_quark_from_static_string()), and the pointer can be gotten back
3185  * from the @pspec with g_param_spec_get_qdata().  Setting a
3186  * previously set user data pointer, overrides (frees) the old pointer
3187  * set, using %NULL as pointer essentially removes the data stored.
3188  */
3189
3190
3191 /**
3192  * g_param_spec_set_qdata_full: (skip)
3193  * @pspec: the #GParamSpec to set store a user data pointer
3194  * @quark: a #GQuark, naming the user data pointer
3195  * @data: an opaque user data pointer
3196  * @destroy: function to invoke with @data as argument, when @data needs to be freed
3197  *
3198  * This function works like g_param_spec_set_qdata(), but in addition,
3199  * a <literal>void (*destroy) (gpointer)</literal> function may be
3200  * specified which is called with @data as argument when the @pspec is
3201  * finalized, or the data is being overwritten by a call to
3202  * g_param_spec_set_qdata() with the same @quark.
3203  */
3204
3205
3206 /**
3207  * g_param_spec_sink:
3208  * @pspec: a valid #GParamSpec
3209  *
3210  * The initial reference count of a newly created #GParamSpec is 1,
3211  * even though no one has explicitly called g_param_spec_ref() on it
3212  * yet. So the initial reference count is flagged as "floating", until
3213  * someone calls <literal>g_param_spec_ref (pspec); g_param_spec_sink
3214  * (pspec);</literal> in sequence on it, taking over the initial
3215  * reference count (thus ending up with a @pspec that has a reference
3216  * count of 1 still, but is not flagged "floating" anymore).
3217  */
3218
3219
3220 /**
3221  * g_param_spec_steal_qdata:
3222  * @pspec: the #GParamSpec to get a stored user data pointer from
3223  * @quark: a #GQuark, naming the user data pointer
3224  *
3225  * Gets back user data pointers stored via g_param_spec_set_qdata()
3226  * and removes the @data from @pspec without invoking its destroy()
3227  * function (if any was set).  Usually, calling this function is only
3228  * required to update user data pointers with a destroy notifier.
3229  *
3230  * Returns: (transfer none): the user data pointer set, or %NULL
3231  */
3232
3233
3234 /**
3235  * g_param_spec_string:
3236  * @name: canonical name of the property specified
3237  * @nick: nick name for the property specified
3238  * @blurb: description of the property specified
3239  * @default_value: default value for the property specified
3240  * @flags: flags for the property specified
3241  *
3242  * Creates a new #GParamSpecString instance.
3243  *
3244  * See g_param_spec_internal() for details on property names.
3245  *
3246  * Returns: (transfer full): a newly created parameter specification
3247  */
3248
3249
3250 /**
3251  * g_param_spec_uchar:
3252  * @name: canonical name of the property specified
3253  * @nick: nick name for the property specified
3254  * @blurb: description of the property specified
3255  * @minimum: minimum value for the property specified
3256  * @maximum: maximum value for the property specified
3257  * @default_value: default value for the property specified
3258  * @flags: flags for the property specified
3259  *
3260  * Creates a new #GParamSpecUChar instance specifying a %G_TYPE_UCHAR property.
3261  *
3262  * Returns: (transfer full): a newly created parameter specification
3263  */
3264
3265
3266 /**
3267  * g_param_spec_uint:
3268  * @name: canonical name of the property specified
3269  * @nick: nick name for the property specified
3270  * @blurb: description of the property specified
3271  * @minimum: minimum value for the property specified
3272  * @maximum: maximum value for the property specified
3273  * @default_value: default value for the property specified
3274  * @flags: flags for the property specified
3275  *
3276  * Creates a new #GParamSpecUInt instance specifying a %G_TYPE_UINT property.
3277  *
3278  * See g_param_spec_internal() for details on property names.
3279  *
3280  * Returns: (transfer full): a newly created parameter specification
3281  */
3282
3283
3284 /**
3285  * g_param_spec_uint64:
3286  * @name: canonical name of the property specified
3287  * @nick: nick name for the property specified
3288  * @blurb: description of the property specified
3289  * @minimum: minimum value for the property specified
3290  * @maximum: maximum value for the property specified
3291  * @default_value: default value for the property specified
3292  * @flags: flags for the property specified
3293  *
3294  * Creates a new #GParamSpecUInt64 instance specifying a %G_TYPE_UINT64
3295  * property.
3296  *
3297  * See g_param_spec_internal() for details on property names.
3298  *
3299  * Returns: (transfer full): a newly created parameter specification
3300  */
3301
3302
3303 /**
3304  * g_param_spec_ulong:
3305  * @name: canonical name of the property specified
3306  * @nick: nick name for the property specified
3307  * @blurb: description of the property specified
3308  * @minimum: minimum value for the property specified
3309  * @maximum: maximum value for the property specified
3310  * @default_value: default value for the property specified
3311  * @flags: flags for the property specified
3312  *
3313  * Creates a new #GParamSpecULong instance specifying a %G_TYPE_ULONG
3314  * property.
3315  *
3316  * See g_param_spec_internal() for details on property names.
3317  *
3318  * Returns: (transfer full): a newly created parameter specification
3319  */
3320
3321
3322 /**
3323  * g_param_spec_unichar:
3324  * @name: canonical name of the property specified
3325  * @nick: nick name for the property specified
3326  * @blurb: description of the property specified
3327  * @default_value: default value for the property specified
3328  * @flags: flags for the property specified
3329  *
3330  * Creates a new #GParamSpecUnichar instance specifying a %G_TYPE_UINT
3331  * property. #GValue structures for this property can be accessed with
3332  * g_value_set_uint() and g_value_get_uint().
3333  *
3334  * See g_param_spec_internal() for details on property names.
3335  *
3336  * Returns: (transfer full): a newly created parameter specification
3337  */
3338
3339
3340 /**
3341  * g_param_spec_unref: (skip)
3342  * @pspec: a valid #GParamSpec
3343  *
3344  * Decrements the reference count of a @pspec.
3345  */
3346
3347
3348 /**
3349  * g_param_spec_value_array: (skip)
3350  * @name: canonical name of the property specified
3351  * @nick: nick name for the property specified
3352  * @blurb: description of the property specified
3353  * @element_spec: a #GParamSpec describing the elements contained in arrays of this property, may be %NULL
3354  * @flags: flags for the property specified
3355  *
3356  * Creates a new #GParamSpecValueArray instance specifying a
3357  * %G_TYPE_VALUE_ARRAY property. %G_TYPE_VALUE_ARRAY is a
3358  * %G_TYPE_BOXED type, as such, #GValue structures for this property
3359  * can be accessed with g_value_set_boxed() and g_value_get_boxed().
3360  *
3361  * See g_param_spec_internal() for details on property names.
3362  *
3363  * Returns: a newly created parameter specification
3364  */
3365
3366
3367 /**
3368  * g_param_spec_variant:
3369  * @name: canonical name of the property specified
3370  * @nick: nick name for the property specified
3371  * @blurb: description of the property specified
3372  * @type: a #GVariantType
3373  * @default_value: (allow-none) (transfer full): a #GVariant of type @type to use as the default value, or %NULL
3374  * @flags: flags for the property specified
3375  *
3376  * Creates a new #GParamSpecVariant instance specifying a #GVariant
3377  * property.
3378  *
3379  * If @default_value is floating, it is consumed.
3380  *
3381  * See g_param_spec_internal() for details on property names.
3382  *
3383  * Returns: (transfer full): the newly created #GParamSpec
3384  * Since: 2.26
3385  */
3386
3387
3388 /**
3389  * g_param_type_register_static:
3390  * @name: 0-terminated string used as the name of the new #GParamSpec type.
3391  * @pspec_info: The #GParamSpecTypeInfo for this #GParamSpec type.
3392  *
3393  * Registers @name as the name of a new static type derived from
3394  * #G_TYPE_PARAM. The type system uses the information contained in
3395  * the #GParamSpecTypeInfo structure pointed to by @info to manage the
3396  * #GParamSpec type and its instances.
3397  *
3398  * Returns: The new type identifier.
3399  */
3400
3401
3402 /**
3403  * g_param_value_convert:
3404  * @pspec: a valid #GParamSpec
3405  * @src_value: souce #GValue
3406  * @dest_value: destination #GValue of correct type for @pspec
3407  * @strict_validation: %TRUE requires @dest_value to conform to @pspec without modifications
3408  *
3409  * Transforms @src_value into @dest_value if possible, and then
3410  * validates @dest_value, in order for it to conform to @pspec.  If
3411  * @strict_validation is %TRUE this function will only succeed if the
3412  * transformed @dest_value complied to @pspec without modifications.
3413  *
3414  * See also g_value_type_transformable(), g_value_transform() and
3415  * g_param_value_validate().
3416  *
3417  * Returns: %TRUE if transformation and validation were successful, %FALSE otherwise and @dest_value is left untouched.
3418  */
3419
3420
3421 /**
3422  * g_param_value_defaults:
3423  * @pspec: a valid #GParamSpec
3424  * @value: a #GValue of correct type for @pspec
3425  *
3426  * Checks whether @value contains the default value as specified in @pspec.
3427  *
3428  * Returns: whether @value contains the canonical default for this @pspec
3429  */
3430
3431
3432 /**
3433  * g_param_value_set_default:
3434  * @pspec: a valid #GParamSpec
3435  * @value: a #GValue of correct type for @pspec
3436  *
3437  * Sets @value to its default value as specified in @pspec.
3438  */
3439
3440
3441 /**
3442  * g_param_value_validate:
3443  * @pspec: a valid #GParamSpec
3444  * @value: a #GValue of correct type for @pspec
3445  *
3446  * Ensures that the contents of @value comply with the specifications
3447  * set out by @pspec. For example, a #GParamSpecInt might require
3448  * that integers stored in @value may not be smaller than -42 and not be
3449  * greater than +42. If @value contains an integer outside of this range,
3450  * it is modified accordingly, so the resulting value will fit into the
3451  * range -42 .. +42.
3452  *
3453  * Returns: whether modifying @value was necessary to ensure validity
3454  */
3455
3456
3457 /**
3458  * g_param_values_cmp:
3459  * @pspec: a valid #GParamSpec
3460  * @value1: a #GValue of correct type for @pspec
3461  * @value2: a #GValue of correct type for @pspec
3462  *
3463  * Compares @value1 with @value2 according to @pspec, and return -1, 0 or +1,
3464  * if @value1 is found to be less than, equal to or greater than @value2,
3465  * respectively.
3466  *
3467  * Returns: -1, 0 or +1, for a less than, equal to or greater than result
3468  */
3469
3470
3471 /**
3472  * g_pointer_type_register_static:
3473  * @name: the name of the new pointer type.
3474  *
3475  * Creates a new %G_TYPE_POINTER derived type id for a new
3476  * pointer type with name @name.
3477  *
3478  * Returns: a new %G_TYPE_POINTER derived type id for @name.
3479  */
3480
3481
3482 /**
3483  * g_signal_accumulator_first_wins:
3484  * @ihint: standard #GSignalAccumulator parameter
3485  * @return_accu: standard #GSignalAccumulator parameter
3486  * @handler_return: standard #GSignalAccumulator parameter
3487  * @dummy: standard #GSignalAccumulator parameter
3488  *
3489  * A predefined #GSignalAccumulator for signals intended to be used as a
3490  * hook for application code to provide a particular value.  Usually
3491  * only one such value is desired and multiple handlers for the same
3492  * signal don't make much sense (except for the case of the default
3493  * handler defined in the class structure, in which case you will
3494  * usually want the signal connection to override the class handler).
3495  *
3496  * This accumulator will use the return value from the first signal
3497  * handler that is run as the return value for the signal and not run
3498  * any further handlers (ie: the first handler "wins").
3499  *
3500  * Returns: standard #GSignalAccumulator result
3501  * Since: 2.28
3502  */
3503
3504
3505 /**
3506  * g_signal_accumulator_true_handled:
3507  * @ihint: standard #GSignalAccumulator parameter
3508  * @return_accu: standard #GSignalAccumulator parameter
3509  * @handler_return: standard #GSignalAccumulator parameter
3510  * @dummy: standard #GSignalAccumulator parameter
3511  *
3512  * A predefined #GSignalAccumulator for signals that return a
3513  * boolean values. The behavior that this accumulator gives is
3514  * that a return of %TRUE stops the signal emission: no further
3515  * callbacks will be invoked, while a return of %FALSE allows
3516  * the emission to continue. The idea here is that a %TRUE return
3517  * indicates that the callback <emphasis>handled</emphasis> the signal,
3518  * and no further handling is needed.
3519  *
3520  * Since: 2.4
3521  * Returns: standard #GSignalAccumulator result
3522  */
3523
3524
3525 /**
3526  * g_signal_add_emission_hook:
3527  * @signal_id: the signal identifier, as returned by g_signal_lookup().
3528  * @detail: the detail on which to call the hook.
3529  * @hook_func: a #GSignalEmissionHook function.
3530  * @hook_data: user data for @hook_func.
3531  * @data_destroy: a #GDestroyNotify for @hook_data.
3532  *
3533  * Adds an emission hook for a signal, which will get called for any emission
3534  * of that signal, independent of the instance. This is possible only
3535  * for signals which don't have #G_SIGNAL_NO_HOOKS flag set.
3536  *
3537  * Returns: the hook id, for later use with g_signal_remove_emission_hook().
3538  */
3539
3540
3541 /**
3542  * g_signal_chain_from_overridden:
3543  * @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.
3544  * @return_value: Location for the return value.
3545  *
3546  * Calls the original class closure of a signal. This function should only
3547  * be called from an overridden class closure; see
3548  * g_signal_override_class_closure() and
3549  * g_signal_override_class_handler().
3550  */
3551
3552
3553 /**
3554  * g_signal_chain_from_overridden_handler: (skip)
3555  * @instance: the instance the signal is being emitted on.
3556  * @...: parameters to be passed to the parent class closure, 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.
3557  *
3558  * Calls the original class closure of a signal. This function should
3559  * only be called from an overridden class closure; see
3560  * g_signal_override_class_closure() and
3561  * g_signal_override_class_handler().
3562  *
3563  * Since: 2.18
3564  */
3565
3566
3567 /**
3568  * g_signal_connect_closure:
3569  * @instance: (type GObject.Object): the instance to connect to.
3570  * @detailed_signal: a string of the form "signal-name::detail".
3571  * @closure: the closure to connect.
3572  * @after: whether the handler should be called before or after the default handler of the signal.
3573  *
3574  * Connects a closure to a signal for a particular object.
3575  *
3576  * Returns: the handler id
3577  */
3578
3579
3580 /**
3581  * g_signal_connect_closure_by_id:
3582  * @instance: (type GObject.Object): the instance to connect to.
3583  * @signal_id: the id of the signal.
3584  * @detail: the detail.
3585  * @closure: the closure to connect.
3586  * @after: whether the handler should be called before or after the default handler of the signal.
3587  *
3588  * Connects a closure to a signal for a particular object.
3589  *
3590  * Returns: the handler id
3591  */
3592
3593
3594 /**
3595  * g_signal_connect_data:
3596  * @instance: (type GObject.Object): the instance to connect to.
3597  * @detailed_signal: a string of the form "signal-name::detail".
3598  * @c_handler: the #GCallback to connect.
3599  * @data: data to pass to @c_handler calls.
3600  * @destroy_data: a #GClosureNotify for @data.
3601  * @connect_flags: a combination of #GConnectFlags.
3602  *
3603  * Connects a #GCallback function to a signal for a particular object. Similar
3604  * to g_signal_connect(), but allows to provide a #GClosureNotify for the data
3605  * which will be called when the signal handler is disconnected and no longer
3606  * used. Specify @connect_flags if you need <literal>..._after()</literal> or
3607  * <literal>..._swapped()</literal> variants of this function.
3608  *
3609  * Returns: the handler id
3610  */
3611
3612
3613 /**
3614  * g_signal_connect_object: (skip)
3615  * @instance: the instance to connect to.
3616  * @detailed_signal: a string of the form "signal-name::detail".
3617  * @c_handler: the #GCallback to connect.
3618  * @gobject: the object to pass as data to @c_handler.
3619  * @connect_flags: a combination of #GConnectFlags.
3620  *
3621  * This is similar to g_signal_connect_data(), but uses a closure which
3622  * ensures that the @gobject stays alive during the call to @c_handler
3623  * by temporarily adding a reference count to @gobject.
3624  *
3625  * When the @gobject is destroyed the signal handler will be automatically
3626  * disconnected.  Note that this is not currently threadsafe (ie:
3627  * emitting a signal while @gobject is being destroyed in another thread
3628  * is not safe).
3629  *
3630  * Returns: the handler id.
3631  */
3632
3633
3634 /**
3635  * g_signal_emit:
3636  * @instance: (type GObject.Object): the instance the signal is being emitted on.
3637  * @signal_id: the signal id
3638  * @detail: the detail
3639  * @...: 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.
3640  *
3641  * Emits a signal.
3642  *
3643  * Note that g_signal_emit() resets the return value to the default
3644  * if no handlers are connected, in contrast to g_signal_emitv().
3645  */
3646
3647
3648 /**
3649  * g_signal_emit_by_name:
3650  * @instance: (type GObject.Object): the instance the signal is being emitted on.
3651  * @detailed_signal: a string of the form "signal-name::detail".
3652  * @...: 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.
3653  *
3654  * Emits a signal.
3655  *
3656  * Note that g_signal_emit_by_name() resets the return value to the default
3657  * if no handlers are connected, in contrast to g_signal_emitv().
3658  */
3659
3660
3661 /**
3662  * g_signal_emit_valist: (skip)
3663  * @instance: the instance the signal is being emitted on.
3664  * @signal_id: the signal id
3665  * @detail: the detail
3666  * @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.
3667  *
3668  * Emits a signal.
3669  *
3670  * Note that g_signal_emit_valist() resets the return value to the default
3671  * if no handlers are connected, in contrast to g_signal_emitv().
3672  */
3673
3674
3675 /**
3676  * g_signal_emitv:
3677  * @instance_and_params: (array): 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.
3678  * @signal_id: the signal id
3679  * @detail: the detail
3680  * @return_value: Location to store the return value of the signal emission.
3681  *
3682  * Emits a signal.
3683  *
3684  * Note that g_signal_emitv() doesn't change @return_value if no handlers are
3685  * connected, in contrast to g_signal_emit() and g_signal_emit_valist().
3686  */
3687
3688
3689 /**
3690  * g_signal_get_invocation_hint:
3691  * @instance: (type GObject.Object): the instance to query
3692  *
3693  * Returns the invocation hint of the innermost signal emission of instance.
3694  *
3695  * Returns: (transfer none): the invocation hint of the innermost signal  emission.
3696  */
3697
3698
3699 /**
3700  * g_signal_handler_block:
3701  * @instance: (type GObject.Object): The instance to block the signal handler of.
3702  * @handler_id: Handler id of the handler to be blocked.
3703  *
3704  * Blocks a handler of an instance so it will not be called during any
3705  * signal emissions unless it is unblocked again. Thus "blocking" a
3706  * signal handler means to temporarily deactive it, a signal handler
3707  * has to be unblocked exactly the same amount of times it has been
3708  * blocked before to become active again.
3709  *
3710  * The @handler_id has to be a valid signal handler id, connected to a
3711  * signal of @instance.
3712  */
3713
3714
3715 /**
3716  * g_signal_handler_disconnect:
3717  * @instance: (type GObject.Object): The instance to remove the signal handler from.
3718  * @handler_id: Handler id of the handler to be disconnected.
3719  *
3720  * Disconnects a handler from an instance so it will not be called during
3721  * any future or currently ongoing emissions of the signal it has been
3722  * connected to. The @handler_id becomes invalid and may be reused.
3723  *
3724  * The @handler_id has to be a valid signal handler id, connected to a
3725  * signal of @instance.
3726  */
3727
3728
3729 /**
3730  * g_signal_handler_find:
3731  * @instance: (type GObject.Object): The instance owning the signal handler to be found.
3732  * @mask: Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handler has to match.
3733  * @signal_id: Signal the handler has to be connected to.
3734  * @detail: Signal detail the handler has to be connected to.
3735  * @closure: (allow-none): The closure the handler will invoke.
3736  * @func: The C closure callback of the handler (useless for non-C closures).
3737  * @data: The closure data of the handler's closure.
3738  *
3739  * Finds the first signal handler that matches certain selection criteria.
3740  * The criteria mask is passed as an OR-ed combination of #GSignalMatchType
3741  * flags, and the criteria values are passed as arguments.
3742  * The match @mask has to be non-0 for successful matches.
3743  * If no handler was found, 0 is returned.
3744  *
3745  * Returns: A valid non-0 signal handler id for a successful match.
3746  */
3747
3748
3749 /**
3750  * g_signal_handler_is_connected:
3751  * @instance: (type GObject.Object): The instance where a signal handler is sought.
3752  * @handler_id: the handler id.
3753  *
3754  * Returns whether @handler_id is the id of a handler connected to @instance.
3755  *
3756  * Returns: whether @handler_id identifies a handler connected to @instance.
3757  */
3758
3759
3760 /**
3761  * g_signal_handler_unblock:
3762  * @instance: (type GObject.Object): The instance to unblock the signal handler of.
3763  * @handler_id: Handler id of the handler to be unblocked.
3764  *
3765  * Undoes the effect of a previous g_signal_handler_block() call.  A
3766  * blocked handler is skipped during signal emissions and will not be
3767  * invoked, unblocking it (for exactly the amount of times it has been
3768  * blocked before) reverts its "blocked" state, so the handler will be
3769  * recognized by the signal system and is called upon future or
3770  * currently ongoing signal emissions (since the order in which
3771  * handlers are called during signal emissions is deterministic,
3772  * whether the unblocked handler in question is called as part of a
3773  * currently ongoing emission depends on how far that emission has
3774  * proceeded yet).
3775  *
3776  * The @handler_id has to be a valid id of a signal handler that is
3777  * connected to a signal of @instance and is currently blocked.
3778  */
3779
3780
3781 /**
3782  * g_signal_handlers_block_matched:
3783  * @instance: (type GObject.Object): The instance to block handlers from.
3784  * @mask: Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handlers have to match.
3785  * @signal_id: Signal the handlers have to be connected to.
3786  * @detail: Signal detail the handlers have to be connected to.
3787  * @closure: (allow-none): The closure the handlers will invoke.
3788  * @func: The C closure callback of the handlers (useless for non-C closures).
3789  * @data: The closure data of the handlers' closures.
3790  *
3791  * Blocks all handlers on an instance that match a certain selection criteria.
3792  * The criteria mask is passed as an OR-ed combination of #GSignalMatchType
3793  * flags, and the criteria values are passed as arguments.
3794  * Passing at least one of the %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC
3795  * or %G_SIGNAL_MATCH_DATA match flags is required for successful matches.
3796  * If no handlers were found, 0 is returned, the number of blocked handlers
3797  * otherwise.
3798  *
3799  * Returns: The number of handlers that matched.
3800  */
3801
3802
3803 /**
3804  * g_signal_handlers_destroy:
3805  * @instance: (type GObject.Object): The instance where a signal handler is sought.
3806  */
3807
3808
3809 /**
3810  * g_signal_handlers_disconnect_matched:
3811  * @instance: (type GObject.Object): The instance to remove handlers from.
3812  * @mask: Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handlers have to match.
3813  * @signal_id: Signal the handlers have to be connected to.
3814  * @detail: Signal detail the handlers have to be connected to.
3815  * @closure: (allow-none): The closure the handlers will invoke.
3816  * @func: The C closure callback of the handlers (useless for non-C closures).
3817  * @data: The closure data of the handlers' closures.
3818  *
3819  * Disconnects all handlers on an instance that match a certain
3820  * selection criteria. The criteria mask is passed as an OR-ed
3821  * combination of #GSignalMatchType flags, and the criteria values are
3822  * passed as arguments.  Passing at least one of the
3823  * %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC or
3824  * %G_SIGNAL_MATCH_DATA match flags is required for successful
3825  * matches.  If no handlers were found, 0 is returned, the number of
3826  * disconnected handlers otherwise.
3827  *
3828  * Returns: The number of handlers that matched.
3829  */
3830
3831
3832 /**
3833  * g_signal_handlers_unblock_matched:
3834  * @instance: (type GObject.Object): The instance to unblock handlers from.
3835  * @mask: Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handlers have to match.
3836  * @signal_id: Signal the handlers have to be connected to.
3837  * @detail: Signal detail the handlers have to be connected to.
3838  * @closure: (allow-none): The closure the handlers will invoke.
3839  * @func: The C closure callback of the handlers (useless for non-C closures).
3840  * @data: The closure data of the handlers' closures.
3841  *
3842  * Unblocks all handlers on an instance that match a certain selection
3843  * criteria. The criteria mask is passed as an OR-ed combination of
3844  * #GSignalMatchType flags, and the criteria values are passed as arguments.
3845  * Passing at least one of the %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC
3846  * or %G_SIGNAL_MATCH_DATA match flags is required for successful matches.
3847  * If no handlers were found, 0 is returned, the number of unblocked handlers
3848  * otherwise. The match criteria should not apply to any handlers that are
3849  * not currently blocked.
3850  *
3851  * Returns: The number of handlers that matched.
3852  */
3853
3854
3855 /**
3856  * g_signal_has_handler_pending:
3857  * @instance: (type GObject.Object): the object whose signal handlers are sought.
3858  * @signal_id: the signal id.
3859  * @detail: the detail.
3860  * @may_be_blocked: whether blocked handlers should count as match.
3861  *
3862  * Returns whether there are any handlers connected to @instance for the
3863  * given signal id and detail.
3864  *
3865  * One example of when you might use this is when the arguments to the
3866  * signal are difficult to compute. A class implementor may opt to not
3867  * emit the signal if no one is attached anyway, thus saving the cost
3868  * of building the arguments.
3869  *
3870  * Returns: %TRUE if a handler is connected to the signal, %FALSE otherwise.
3871  */
3872
3873
3874 /**
3875  * g_signal_list_ids:
3876  * @itype: Instance or interface type.
3877  * @n_ids: Location to store the number of signal ids for @itype.
3878  *
3879  * Lists the signals by id that a certain instance or interface type
3880  * created. Further information about the signals can be acquired through
3881  * g_signal_query().
3882  *
3883  * Returns: (array length=n_ids): Newly allocated array of signal IDs.
3884  */
3885
3886
3887 /**
3888  * g_signal_lookup:
3889  * @name: the signal's name.
3890  * @itype: the type that the signal operates on.
3891  *
3892  * Given the name of the signal and the type of object it connects to, gets
3893  * the signal's identifying integer. Emitting the signal by number is
3894  * somewhat faster than using the name each time.
3895  *
3896  * Also tries the ancestors of the given type.
3897  *
3898  * See g_signal_new() for details on allowed signal names.
3899  *
3900  * Returns: the signal's identifying number, or 0 if no signal was found.
3901  */
3902
3903
3904 /**
3905  * g_signal_name:
3906  * @signal_id: the signal's identifying number.
3907  *
3908  * Given the signal's identifier, finds its name.
3909  *
3910  * Two different signals may have the same name, if they have differing types.
3911  *
3912  * Returns: the signal name, or %NULL if the signal number was invalid.
3913  */
3914
3915
3916 /**
3917  * g_signal_new:
3918  * @signal_name: the name for the signal
3919  * @itype: the type this signal pertains to. It will also pertain to types which are derived from this type.
3920  * @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.
3921  * @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.
3922  * @accumulator: the accumulator for this signal; may be %NULL.
3923  * @accu_data: user data for the @accumulator.
3924  * @c_marshaller: (allow-none): the function to translate arrays of parameter values to signal emissions into C language callback invocations or %NULL.
3925  * @return_type: the type of return value, or #G_TYPE_NONE for a signal without a return value.
3926  * @n_params: the number of parameter types to follow.
3927  * @...: a list of types, one for each parameter.
3928  *
3929  * Creates a new signal. (This is usually done in the class initializer.)
3930  *
3931  * A signal name consists of segments consisting of ASCII letters and
3932  * digits, separated by either the '-' or '_' character. The first
3933  * character of a signal name must be a letter. Names which violate these
3934  * rules lead to undefined behaviour of the GSignal system.
3935  *
3936  * When registering a signal and looking up a signal, either separator can
3937  * be used, but they cannot be mixed.
3938  *
3939  * If 0 is used for @class_offset subclasses cannot override the class handler
3940  * in their <code>class_init</code> method by doing
3941  * <code>super_class->signal_handler = my_signal_handler</code>. Instead they
3942  * will have to use g_signal_override_class_handler().
3943  *
3944  * If c_marshaller is %NULL, g_cclosure_marshal_generic() will be used as
3945  * the marshaller for this signal.
3946  *
3947  * Returns: the signal id
3948  */
3949
3950
3951 /**
3952  * g_signal_new_class_handler:
3953  * @signal_name: the name for the signal
3954  * @itype: the type this signal pertains to. It will also pertain to types which are derived from this type.
3955  * @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.
3956  * @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.
3957  * @accumulator: the accumulator for this signal; may be %NULL.
3958  * @accu_data: user data for the @accumulator.
3959  * @c_marshaller: (allow-none): the function to translate arrays of parameter values to signal emissions into C language callback invocations or %NULL.
3960  * @return_type: the type of return value, or #G_TYPE_NONE for a signal without a return value.
3961  * @n_params: the number of parameter types to follow.
3962  * @...: a list of types, one for each parameter.
3963  *
3964  * Creates a new signal. (This is usually done in the class initializer.)
3965  *
3966  * This is a variant of g_signal_new() that takes a C callback instead
3967  * off a class offset for the signal's class handler. This function
3968  * doesn't need a function pointer exposed in the class structure of
3969  * an object definition, instead the function pointer is passed
3970  * directly and can be overriden by derived classes with
3971  * g_signal_override_class_closure() or
3972  * g_signal_override_class_handler()and chained to with
3973  * g_signal_chain_from_overridden() or
3974  * g_signal_chain_from_overridden_handler().
3975  *
3976  * See g_signal_new() for information about signal names.
3977  *
3978  * If c_marshaller is %NULL @g_cclosure_marshal_generic will be used as
3979  * the marshaller for this signal.
3980  *
3981  * Returns: the signal id
3982  * Since: 2.18
3983  */
3984
3985
3986 /**
3987  * g_signal_new_valist:
3988  * @signal_name: the name for the signal
3989  * @itype: the type this signal pertains to. It will also pertain to types which are derived from this type.
3990  * @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.
3991  * @class_closure: The closure to invoke on signal emission; may be %NULL.
3992  * @accumulator: the accumulator for this signal; may be %NULL.
3993  * @accu_data: user data for the @accumulator.
3994  * @c_marshaller: (allow-none): the function to translate arrays of parameter values to signal emissions into C language callback invocations or %NULL.
3995  * @return_type: the type of return value, or #G_TYPE_NONE for a signal without a return value.
3996  * @n_params: the number of parameter types in @args.
3997  * @args: va_list of #GType, one for each parameter.
3998  *
3999  * Creates a new signal. (This is usually done in the class initializer.)
4000  *
4001  * See g_signal_new() for details on allowed signal names.
4002  *
4003  * If c_marshaller is %NULL, g_cclosure_marshal_generic() will be used as
4004  * the marshaller for this signal.
4005  *
4006  * Returns: the signal id
4007  */
4008
4009
4010 /**
4011  * g_signal_newv:
4012  * @signal_name: the name for the signal
4013  * @itype: the type this signal pertains to. It will also pertain to types which are derived from this type
4014  * @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
4015  * @class_closure: (allow-none): The closure to invoke on signal emission; may be %NULL
4016  * @accumulator: (allow-none): the accumulator for this signal; may be %NULL
4017  * @accu_data: user data for the @accumulator
4018  * @c_marshaller: (allow-none): the function to translate arrays of parameter values to signal emissions into C language callback invocations or %NULL
4019  * @return_type: the type of return value, or #G_TYPE_NONE for a signal without a return value
4020  * @n_params: the length of @param_types
4021  * @param_types: (array length=n_params): an array of types, one for each parameter
4022  *
4023  * Creates a new signal. (This is usually done in the class initializer.)
4024  *
4025  * See g_signal_new() for details on allowed signal names.
4026  *
4027  * If c_marshaller is %NULL @g_cclosure_marshal_generic will be used as
4028  * the marshaller for this signal.
4029  *
4030  * Returns: the signal id
4031  */
4032
4033
4034 /**
4035  * g_signal_override_class_closure:
4036  * @signal_id: the signal id
4037  * @instance_type: the instance type on which to override the class closure for the signal.
4038  * @class_closure: the closure.
4039  *
4040  * Overrides the class closure (i.e. the default handler) for the given signal
4041  * for emissions on instances of @instance_type. @instance_type must be derived
4042  * from the type to which the signal belongs.
4043  *
4044  * See g_signal_chain_from_overridden() and
4045  * g_signal_chain_from_overridden_handler() for how to chain up to the
4046  * parent class closure from inside the overridden one.
4047  */
4048
4049
4050 /**
4051  * g_signal_override_class_handler:
4052  * @signal_name: the name for the signal
4053  * @instance_type: the instance type on which to override the class handler for the signal.
4054  * @class_handler: the handler.
4055  *
4056  * Overrides the class closure (i.e. the default handler) for the
4057  * given signal for emissions on instances of @instance_type with
4058  * callback @class_handler. @instance_type must be derived from the
4059  * type to which the signal belongs.
4060  *
4061  * See g_signal_chain_from_overridden() and
4062  * g_signal_chain_from_overridden_handler() for how to chain up to the
4063  * parent class closure from inside the overridden one.
4064  *
4065  * Since: 2.18
4066  */
4067
4068
4069 /**
4070  * g_signal_parse_name:
4071  * @detailed_signal: a string of the form "signal-name::detail".
4072  * @itype: The interface/instance type that introduced "signal-name".
4073  * @signal_id_p: (out): Location to store the signal id.
4074  * @detail_p: (out): Location to store the detail quark.
4075  * @force_detail_quark: %TRUE forces creation of a #GQuark for the detail.
4076  *
4077  * Internal function to parse a signal name into its @signal_id
4078  * and @detail quark.
4079  *
4080  * Returns: Whether the signal name could successfully be parsed and @signal_id_p and @detail_p contain valid return values.
4081  */
4082
4083
4084 /**
4085  * g_signal_query:
4086  * @signal_id: The signal id of the signal to query information for.
4087  * @query: (out caller-allocates): A user provided structure that is filled in with constant values upon success.
4088  *
4089  * Queries the signal system for in-depth information about a
4090  * specific signal. This function will fill in a user-provided
4091  * structure to hold signal-specific information. If an invalid
4092  * signal id is passed in, the @signal_id member of the #GSignalQuery
4093  * is 0. All members filled into the #GSignalQuery structure should
4094  * be considered constant and have to be left untouched.
4095  */
4096
4097
4098 /**
4099  * g_signal_remove_emission_hook:
4100  * @signal_id: the id of the signal
4101  * @hook_id: the id of the emission hook, as returned by g_signal_add_emission_hook()
4102  *
4103  * Deletes an emission hook.
4104  */
4105
4106
4107 /**
4108  * g_signal_stop_emission:
4109  * @instance: (type GObject.Object): the object whose signal handlers you wish to stop.
4110  * @signal_id: the signal identifier, as returned by g_signal_lookup().
4111  * @detail: the detail which the signal was emitted with.
4112  *
4113  * Stops a signal's current emission.
4114  *
4115  * This will prevent the default method from running, if the signal was
4116  * %G_SIGNAL_RUN_LAST and you connected normally (i.e. without the "after"
4117  * flag).
4118  *
4119  * Prints a warning if used on a signal which isn't being emitted.
4120  */
4121
4122
4123 /**
4124  * g_signal_stop_emission_by_name:
4125  * @instance: (type GObject.Object): the object whose signal handlers you wish to stop.
4126  * @detailed_signal: a string of the form "signal-name::detail".
4127  *
4128  * Stops a signal's current emission.
4129  *
4130  * This is just like g_signal_stop_emission() except it will look up the
4131  * signal id for you.
4132  */
4133
4134
4135 /**
4136  * g_signal_type_cclosure_new:
4137  * @itype: the #GType identifier of an interface or classed type
4138  * @struct_offset: the offset of the member function of @itype's class structure which is to be invoked by the new closure
4139  *
4140  * Creates a new closure which invokes the function found at the offset
4141  * @struct_offset in the class structure of the interface or classed type
4142  * identified by @itype.
4143  *
4144  * Returns: a new #GCClosure
4145  */
4146
4147
4148 /**
4149  * g_source_set_closure:
4150  * @source: the source
4151  * @closure: a #GClosure
4152  *
4153  * Set the callback for a source as a #GClosure.
4154  *
4155  * If the source is not one of the standard GLib types, the @closure_callback
4156  * and @closure_marshal fields of the #GSourceFuncs structure must have been
4157  * filled in with pointers to appropriate functions.
4158  */
4159
4160
4161 /**
4162  * g_source_set_dummy_callback:
4163  * @source: the source
4164  *
4165  * Sets a dummy callback for @source. The callback will do nothing, and
4166  * if the source expects a #gboolean return value, it will return %TRUE.
4167  * (If the source expects any other type of return value, it will return
4168  * a 0/%NULL value; whatever g_value_init() initializes a #GValue to for
4169  * that type.)
4170  *
4171  * If the source is not one of the standard GLib types, the
4172  * @closure_callback and @closure_marshal fields of the #GSourceFuncs
4173  * structure must have been filled in with pointers to appropriate
4174  * functions.
4175  */
4176
4177
4178 /**
4179  * g_strdup_value_contents:
4180  * @value: #GValue which contents are to be described.
4181  *
4182  * Return a newly allocated string, which describes the contents of a
4183  * #GValue.  The main purpose of this function is to describe #GValue
4184  * contents for debugging output, the way in which the contents are
4185  * described may change between different GLib versions.
4186  *
4187  * Returns: Newly allocated string.
4188  */
4189
4190
4191 /**
4192  * g_type_add_class_cache_func: (skip)
4193  * @cache_data: data to be passed to @cache_func
4194  * @cache_func: a #GTypeClassCacheFunc
4195  *
4196  * Adds a #GTypeClassCacheFunc to be called before the reference count of a
4197  * class goes from one to zero. This can be used to prevent premature class
4198  * destruction. All installed #GTypeClassCacheFunc functions will be chained
4199  * until one of them returns %TRUE. The functions have to check the class id
4200  * passed in to figure whether they actually want to cache the class of this
4201  * type, since all classes are routed through the same #GTypeClassCacheFunc
4202  * chain.
4203  */
4204
4205
4206 /**
4207  * g_type_add_class_private:
4208  * @class_type: GType of an classed type.
4209  * @private_size: size of private structure.
4210  *
4211  * Registers a private class structure for a classed type;
4212  * when the class is allocated, the private structures for
4213  * the class and all of its parent types are allocated
4214  * sequentially in the same memory block as the public
4215  * structures. This function should be called in the
4216  * type's get_type() function after the type is registered.
4217  * The private structure can be retrieved using the
4218  * G_TYPE_CLASS_GET_PRIVATE() macro.
4219  *
4220  * Since: 2.24
4221  */
4222
4223
4224 /**
4225  * g_type_add_interface_check: (skip)
4226  * @check_data: data to pass to @check_func
4227  * @check_func: function to be called after each interface is initialized.
4228  *
4229  * Adds a function to be called after an interface vtable is
4230  * initialized for any class (i.e. after the @interface_init member of
4231  * #GInterfaceInfo has been called).
4232  *
4233  * This function is useful when you want to check an invariant that
4234  * depends on the interfaces of a class. For instance, the
4235  * implementation of #GObject uses this facility to check that an
4236  * object implements all of the properties that are defined on its
4237  * interfaces.
4238  *
4239  * Since: 2.4
4240  */
4241
4242
4243 /**
4244  * g_type_add_interface_dynamic:
4245  * @instance_type: the #GType value of an instantiable type.
4246  * @interface_type: the #GType value of an interface type.
4247  * @plugin: the #GTypePlugin structure to retrieve the #GInterfaceInfo from.
4248  *
4249  * Adds the dynamic @interface_type to @instantiable_type. The information
4250  * contained in the #GTypePlugin structure pointed to by @plugin
4251  * is used to manage the relationship.
4252  */
4253
4254
4255 /**
4256  * g_type_add_interface_static:
4257  * @instance_type: #GType value of an instantiable type.
4258  * @interface_type: #GType value of an interface type.
4259  * @info: The #GInterfaceInfo structure for this (@instance_type, @interface_type) combination.
4260  *
4261  * Adds the static @interface_type to @instantiable_type.  The
4262  * information contained in the #GInterfaceInfo structure pointed to by
4263  * @info is used to manage the relationship.
4264  */
4265
4266
4267 /**
4268  * g_type_check_instance:
4269  * @instance: A valid #GTypeInstance structure.
4270  *
4271  * Private helper function to aid implementation of the G_TYPE_CHECK_INSTANCE()
4272  * macro.
4273  *
4274  * Returns: %TRUE if @instance is valid, %FALSE otherwise.
4275  */
4276
4277
4278 /**
4279  * g_type_children:
4280  * @type: The parent type.
4281  * @n_children: (out) (allow-none): Optional #guint pointer to contain the number of child types.
4282  *
4283  * Return a newly allocated and 0-terminated array of type IDs, listing the
4284  * child types of @type. The return value has to be g_free()ed after use.
4285  *
4286  * Returns: (array length=n_children) (transfer full): Newly allocated and 0-terminated array of child types.
4287  */
4288
4289
4290 /**
4291  * g_type_class_add_private:
4292  * @g_class: class structure for an instantiatable type
4293  * @private_size: size of private structure.
4294  *
4295  * Registers a private structure for an instantiatable type.
4296  *
4297  * When an object is allocated, the private structures for
4298  * the type and all of its parent types are allocated
4299  * sequentially in the same memory block as the public
4300  * structures.
4301  *
4302  * Note that the accumulated size of the private structures of
4303  * a type and all its parent types cannot exceed 64 KiB.
4304  *
4305  * This function should be called in the type's class_init() function.
4306  * The private structure can be retrieved using the
4307  * G_TYPE_INSTANCE_GET_PRIVATE() macro.
4308  *
4309  * The following example shows attaching a private structure
4310  * <structname>MyObjectPrivate</structname> to an object
4311  * <structname>MyObject</structname> defined in the standard GObject
4312  * fashion.
4313  * type's class_init() function.
4314  * Note the use of a structure member "priv" to avoid the overhead
4315  * of repeatedly calling MY_OBJECT_GET_PRIVATE().
4316  *
4317  * |[
4318  * typedef struct _MyObject        MyObject;
4319  * typedef struct _MyObjectPrivate MyObjectPrivate;
4320  *
4321  * struct _MyObject {
4322  *  GObject parent;
4323  *
4324  *  MyObjectPrivate *priv;
4325  * };
4326  *
4327  * struct _MyObjectPrivate {
4328  *   int some_field;
4329  * };
4330  *
4331  * static void
4332  * my_object_class_init (MyObjectClass *klass)
4333  * {
4334  *   g_type_class_add_private (klass, sizeof (MyObjectPrivate));
4335  * }
4336  *
4337  * static void
4338  * my_object_init (MyObject *my_object)
4339  * {
4340  *   my_object->priv = G_TYPE_INSTANCE_GET_PRIVATE (my_object,
4341  *                                                  MY_TYPE_OBJECT,
4342  *                                                  MyObjectPrivate);
4343  * }
4344  *
4345  * static int
4346  * my_object_get_some_field (MyObject *my_object)
4347  * {
4348  *   MyObjectPrivate *priv;
4349  *
4350  *   g_return_val_if_fail (MY_IS_OBJECT (my_object), 0);
4351  *
4352  *   priv = my_object->priv;
4353  *
4354  *   return priv->some_field;
4355  * }
4356  * ]|
4357  *
4358  * Since: 2.4
4359  */
4360
4361
4362 /**
4363  * g_type_class_get_instance_private_offset: (skip)
4364  * @g_class: a #GTypeClass
4365  *
4366  * Gets the offset of the private data for instances of @g_class.
4367  *
4368  * This is how many bytes you should add to the instance pointer of a
4369  * class in order to get the private data for the type represented by
4370  * @g_class.
4371  *
4372  * You can only call this function after you have registered a private
4373  * data area for @g_class using g_type_class_add_private().
4374  *
4375  * Returns: the offset, in bytes
4376  * Since: 2.38
4377  */
4378
4379
4380 /**
4381  * g_type_class_peek:
4382  * @type: Type ID of a classed type.
4383  *
4384  * This function is essentially the same as g_type_class_ref(), except that
4385  * the classes reference count isn't incremented. As a consequence, this function
4386  * may return %NULL if the class of the type passed in does not currently
4387  * exist (hasn't been referenced before).
4388  *
4389  * Returns: (type GObject.TypeClass) (transfer none): The #GTypeClass structure for the given type ID or %NULL if the class does not currently exist.
4390  */
4391
4392
4393 /**
4394  * g_type_class_peek_parent:
4395  * @g_class: (type GObject.TypeClass): The #GTypeClass structure to retrieve the parent class for.
4396  *
4397  * This is a convenience function often needed in class initializers.
4398  * It returns the class structure of the immediate parent type of the
4399  * class passed in.  Since derived classes hold a reference count on
4400  * their parent classes as long as they are instantiated, the returned
4401  * class will always exist. This function is essentially equivalent
4402  * to:
4403  *
4404  * <programlisting>
4405  * g_type_class_peek (g_type_parent (G_TYPE_FROM_CLASS (g_class)));
4406  * </programlisting>
4407  *
4408  * Returns: (type GObject.TypeClass) (transfer none): The parent class of @g_class.
4409  */
4410
4411
4412 /**
4413  * g_type_class_peek_static:
4414  * @type: Type ID of a classed type.
4415  *
4416  * A more efficient version of g_type_class_peek() which works only for
4417  * static types.
4418  *
4419  * Since: 2.4
4420  * Returns: (type GObject.TypeClass) (transfer none): The #GTypeClass structure for the given type ID or %NULL if the class does not currently exist or is dynamically loaded.
4421  */
4422
4423
4424 /**
4425  * g_type_class_ref:
4426  * @type: Type ID of a classed type.
4427  *
4428  * Increments the reference count of the class structure belonging to
4429  * @type. This function will demand-create the class if it doesn't
4430  * exist already.
4431  *
4432  * Returns: (type GObject.TypeClass) (transfer none): The #GTypeClass structure for the given type ID.
4433  */
4434
4435
4436 /**
4437  * g_type_class_unref:
4438  * @g_class: (type GObject.TypeClass): The #GTypeClass structure to unreference.
4439  *
4440  * Decrements the reference count of the class structure being passed in.
4441  * Once the last reference count of a class has been released, classes
4442  * may be finalized by the type system, so further dereferencing of a
4443  * class pointer after g_type_class_unref() are invalid.
4444  */
4445
4446
4447 /**
4448  * g_type_class_unref_uncached: (skip)
4449  * @g_class: (type GObject.TypeClass): The #GTypeClass structure to unreference.
4450  *
4451  * A variant of g_type_class_unref() for use in #GTypeClassCacheFunc
4452  * implementations. It unreferences a class without consulting the chain
4453  * of #GTypeClassCacheFunc<!-- -->s, avoiding the recursion which would occur
4454  * otherwise.
4455  */
4456
4457
4458 /**
4459  * g_type_create_instance: (skip)
4460  * @type: An instantiatable type to create an instance for.
4461  *
4462  * Creates and initializes an instance of @type if @type is valid and
4463  * can be instantiated. The type system only performs basic allocation
4464  * and structure setups for instances: actual instance creation should
4465  * happen through functions supplied by the type's fundamental type
4466  * implementation.  So use of g_type_create_instance() is reserved for
4467  * implementators of fundamental types only. E.g. instances of the
4468  * #GObject hierarchy should be created via g_object_new() and
4469  * <emphasis>never</emphasis> directly through
4470  * g_type_create_instance() which doesn't handle things like singleton
4471  * objects or object construction.  Note: Do <emphasis>not</emphasis>
4472  * use this function, unless you're implementing a fundamental
4473  * type. Also language bindings should <emphasis>not</emphasis> use
4474  * this function but g_object_new() instead.
4475  *
4476  * Returns: An allocated and initialized instance, subject to further treatment by the fundamental type implementation.
4477  */
4478
4479
4480 /**
4481  * g_type_default_interface_peek:
4482  * @g_type: an interface type
4483  *
4484  * If the interface type @g_type is currently in use, returns its
4485  * default interface vtable.
4486  *
4487  * Since: 2.4
4488  * Returns: (type GObject.TypeInterface) (transfer none): the default vtable for the interface, or %NULL if the type is not currently in use.
4489  */
4490
4491
4492 /**
4493  * g_type_default_interface_ref:
4494  * @g_type: an interface type
4495  *
4496  * Increments the reference count for the interface type @g_type,
4497  * and returns the default interface vtable for the type.
4498  *
4499  * If the type is not currently in use, then the default vtable
4500  * for the type will be created and initalized by calling
4501  * the base interface init and default vtable init functions for
4502  * the type (the @<structfield>base_init</structfield>
4503  * and <structfield>class_init</structfield> members of #GTypeInfo).
4504  * Calling g_type_default_interface_ref() is useful when you
4505  * want to make sure that signals and properties for an interface
4506  * have been installed.
4507  *
4508  * Since: 2.4
4509  * Returns: (type GObject.TypeInterface) (transfer none): the default vtable for the interface; call g_type_default_interface_unref() when you are done using the interface.
4510  */
4511
4512
4513 /**
4514  * g_type_default_interface_unref:
4515  * @g_iface: (type GObject.TypeInterface): the default vtable structure for a interface, as returned by g_type_default_interface_ref()
4516  *
4517  * Decrements the reference count for the type corresponding to the
4518  * interface default vtable @g_iface. If the type is dynamic, then
4519  * when no one is using the interface and all references have
4520  * been released, the finalize function for the interface's default
4521  * vtable (the <structfield>class_finalize</structfield> member of
4522  * #GTypeInfo) will be called.
4523  *
4524  * Since: 2.4
4525  */
4526
4527
4528 /**
4529  * g_type_depth:
4530  * @type: A #GType value.
4531  *
4532  * Returns the length of the ancestry of the passed in type. This
4533  * includes the type itself, so that e.g. a fundamental type has depth 1.
4534  *
4535  * Returns: The depth of @type.
4536  */
4537
4538
4539 /**
4540  * g_type_ensure:
4541  * @type: a #GType.
4542  *
4543  * Ensures that the indicated @type has been registered with the
4544  * type system, and its _class_init() method has been run.
4545  *
4546  * In theory, simply calling the type's _get_type() method (or using
4547  * the corresponding macro) is supposed take care of this. However,
4548  * _get_type() methods are often marked %G_GNUC_CONST for performance
4549  * reasons, even though this is technically incorrect (since
4550  * %G_GNUC_CONST requires that the function not have side effects,
4551  * which _get_type() methods do on the first call). As a result, if
4552  * you write a bare call to a _get_type() macro, it may get optimized
4553  * out by the compiler. Using g_type_ensure() guarantees that the
4554  * type's _get_type() method is called.
4555  *
4556  * Since: 2.34
4557  */
4558
4559
4560 /**
4561  * g_type_free_instance:
4562  * @instance: an instance of a type.
4563  *
4564  * Frees an instance of a type, returning it to the instance pool for
4565  * the type, if there is one.
4566  *
4567  * Like g_type_create_instance(), this function is reserved for
4568  * implementors of fundamental types.
4569  */
4570
4571
4572 /**
4573  * g_type_from_name:
4574  * @name: Type name to lookup.
4575  *
4576  * Lookup the type ID from a given type name, returning 0 if no type
4577  * has been registered under this name (this is the preferred method
4578  * to find out by name whether a specific type has been registered
4579  * yet).
4580  *
4581  * Returns: Corresponding type ID or 0.
4582  */
4583
4584
4585 /**
4586  * g_type_fundamental:
4587  * @type_id: valid type ID
4588  *
4589  * Internal function, used to extract the fundamental type ID portion.
4590  * use G_TYPE_FUNDAMENTAL() instead.
4591  *
4592  * Returns: fundamental type ID
4593  */
4594
4595
4596 /**
4597  * g_type_fundamental_next:
4598  *
4599  * Returns the next free fundamental type id which can be used to
4600  * register a new fundamental type with g_type_register_fundamental().
4601  * The returned type ID represents the highest currently registered
4602  * fundamental type identifier.
4603  *
4604  * Returns: The nextmost fundamental type ID to be registered, or 0 if the type system ran out of fundamental type IDs.
4605  */
4606
4607
4608 /**
4609  * g_type_get_plugin:
4610  * @type: The #GType to retrieve the plugin for.
4611  *
4612  * Returns the #GTypePlugin structure for @type or
4613  * %NULL if @type does not have a #GTypePlugin structure.
4614  *
4615  * Returns: (transfer none): The corresponding plugin if @type is a dynamic type, %NULL otherwise.
4616  */
4617
4618
4619 /**
4620  * g_type_get_qdata:
4621  * @type: a #GType
4622  * @quark: a #GQuark id to identify the data
4623  *
4624  * Obtains data which has previously been attached to @type
4625  * with g_type_set_qdata().
4626  *
4627  * Note that this does not take subtyping into account; data
4628  * attached to one type with g_type_set_qdata() cannot
4629  * be retrieved from a subtype using g_type_get_qdata().
4630  *
4631  * Returns: (transfer none): the data, or %NULL if no data was found
4632  */
4633
4634
4635 /**
4636  * g_type_get_type_registration_serial:
4637  *
4638  * Returns an opaque serial number that represents the state of the set of
4639  * registered types. Any time a type is registered this serial changes,
4640  * which means you can cache information based on type lookups (such as
4641  * g_type_from_name()) and know if the cache is still valid at a later
4642  * time by comparing the current serial with the one at the type lookup.
4643  *
4644  * Since: 2.36
4645  * Returns: An unsigned int, representing the state of type registrations.
4646  */
4647
4648
4649 /**
4650  * g_type_init:
4651  *
4652  * This function used to initialise the type system.  Since GLib 2.36,
4653  * the type system is initialised automatically and this function does
4654  * nothing.
4655  *
4656  * Deprecated: 2.36: the type system is now initialised automatically
4657  */
4658
4659
4660 /**
4661  * g_type_init_with_debug_flags:
4662  * @debug_flags: Bitwise combination of #GTypeDebugFlags values for debugging purposes.
4663  *
4664  * This function used to initialise the type system with debugging
4665  * flags.  Since GLib 2.36, the type system is initialised automatically
4666  * and this function does nothing.
4667  *
4668  * If you need to enable debugging features, use the GOBJECT_DEBUG
4669  * environment variable.
4670  *
4671  * Deprecated: 2.36: the type system is now initialised automatically
4672  */
4673
4674
4675 /**
4676  * g_type_interface_add_prerequisite:
4677  * @interface_type: #GType value of an interface type.
4678  * @prerequisite_type: #GType value of an interface or instantiatable type.
4679  *
4680  * Adds @prerequisite_type to the list of prerequisites of @interface_type.
4681  * This means that any type implementing @interface_type must also implement
4682  * @prerequisite_type. Prerequisites can be thought of as an alternative to
4683  * interface derivation (which GType doesn't support). An interface can have
4684  * at most one instantiatable prerequisite type.
4685  */
4686
4687
4688 /**
4689  * g_type_interface_get_plugin:
4690  * @instance_type: the #GType value of an instantiatable type.
4691  * @interface_type: the #GType value of an interface type.
4692  *
4693  * Returns the #GTypePlugin structure for the dynamic interface
4694  * @interface_type which has been added to @instance_type, or %NULL if
4695  * @interface_type has not been added to @instance_type or does not
4696  * have a #GTypePlugin structure. See g_type_add_interface_dynamic().
4697  *
4698  * Returns: (transfer none): the #GTypePlugin for the dynamic interface @interface_type of @instance_type.
4699  */
4700
4701
4702 /**
4703  * g_type_interface_peek:
4704  * @instance_class: (type GObject.TypeClass): A #GTypeClass structure.
4705  * @iface_type: An interface ID which this class conforms to.
4706  *
4707  * Returns the #GTypeInterface structure of an interface to which the
4708  * passed in class conforms.
4709  *
4710  * Returns: (type GObject.TypeInterface) (transfer none): The GTypeInterface structure of iface_type if implemented by @instance_class, %NULL otherwise
4711  */
4712
4713
4714 /**
4715  * g_type_interface_peek_parent:
4716  * @g_iface: (type GObject.TypeInterface): A #GTypeInterface structure.
4717  *
4718  * Returns the corresponding #GTypeInterface structure of the parent type
4719  * of the instance type to which @g_iface belongs. This is useful when
4720  * deriving the implementation of an interface from the parent type and
4721  * then possibly overriding some methods.
4722  *
4723  * Returns: (transfer none) (type GObject.TypeInterface): The corresponding #GTypeInterface structure of the parent type of the instance type to which @g_iface belongs, or %NULL if the parent type doesn't conform to the interface.
4724  */
4725
4726
4727 /**
4728  * g_type_interface_prerequisites:
4729  * @interface_type: an interface type
4730  * @n_prerequisites: (out) (allow-none): location to return the number of prerequisites, or %NULL
4731  *
4732  * Returns the prerequisites of an interfaces type.
4733  *
4734  * Since: 2.2
4735  * Returns: (array length=n_prerequisites) (transfer full): a newly-allocated zero-terminated array of #GType containing the prerequisites of @interface_type
4736  */
4737
4738
4739 /**
4740  * g_type_interfaces:
4741  * @type: The type to list interface types for.
4742  * @n_interfaces: (out) (allow-none): Optional #guint pointer to contain the number of interface types.
4743  *
4744  * Return a newly allocated and 0-terminated array of type IDs, listing the
4745  * interface types that @type conforms to. The return value has to be
4746  * g_free()ed after use.
4747  *
4748  * Returns: (array length=n_interfaces) (transfer full): Newly allocated and 0-terminated array of interface types.
4749  */
4750
4751
4752 /**
4753  * g_type_is_a:
4754  * @type: Type to check anchestry for.
4755  * @is_a_type: Possible anchestor of @type or interface @type could conform to.
4756  *
4757  * If @is_a_type is a derivable type, check whether @type is a
4758  * descendant of @is_a_type.  If @is_a_type is an interface, check
4759  * whether @type conforms to it.
4760  *
4761  * Returns: %TRUE if @type is_a @is_a_type holds true.
4762  */
4763
4764
4765 /**
4766  * g_type_module_add_interface:
4767  * @module: a #GTypeModule
4768  * @instance_type: type to which to add the interface.
4769  * @interface_type: interface type to add
4770  * @interface_info: type information structure
4771  *
4772  * Registers an additional interface for a type, whose interface lives
4773  * in the given type plugin. If the interface was already registered
4774  * for the type in this plugin, nothing will be done.
4775  *
4776  * As long as any instances of the type exist, the type plugin will
4777  * not be unloaded.
4778  */
4779
4780
4781 /**
4782  * g_type_module_register_enum:
4783  * @module: a #GTypeModule
4784  * @name: name for the type
4785  * @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.
4786  *
4787  * Looks up or registers an enumeration that is implemented with a particular
4788  * type plugin. If a type with name @type_name was previously registered,
4789  * the #GType identifier for the type is returned, otherwise the type
4790  * is newly registered, and the resulting #GType identifier returned.
4791  *
4792  * As long as any instances of the type exist, the type plugin will
4793  * not be unloaded.
4794  *
4795  * Since: 2.6
4796  * Returns: the new or existing type ID
4797  */
4798
4799
4800 /**
4801  * g_type_module_register_flags:
4802  * @module: a #GTypeModule
4803  * @name: name for the type
4804  * @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.
4805  *
4806  * Looks up or registers a flags type that is implemented with a particular
4807  * type plugin. If a type with name @type_name was previously registered,
4808  * the #GType identifier for the type is returned, otherwise the type
4809  * is newly registered, and the resulting #GType identifier returned.
4810  *
4811  * As long as any instances of the type exist, the type plugin will
4812  * not be unloaded.
4813  *
4814  * Since: 2.6
4815  * Returns: the new or existing type ID
4816  */
4817
4818
4819 /**
4820  * g_type_module_register_type:
4821  * @module: a #GTypeModule
4822  * @parent_type: the type for the parent class
4823  * @type_name: name for the type
4824  * @type_info: type information structure
4825  * @flags: flags field providing details about the type
4826  *
4827  * Looks up or registers a type that is implemented with a particular
4828  * type plugin. If a type with name @type_name was previously registered,
4829  * the #GType identifier for the type is returned, otherwise the type
4830  * is newly registered, and the resulting #GType identifier returned.
4831  *
4832  * When reregistering a type (typically because a module is unloaded
4833  * then reloaded, and reinitialized), @module and @parent_type must
4834  * be the same as they were previously.
4835  *
4836  * As long as any instances of the type exist, the type plugin will
4837  * not be unloaded.
4838  *
4839  * Returns: the new or existing type ID
4840  */
4841
4842
4843 /**
4844  * g_type_module_set_name:
4845  * @module: a #GTypeModule.
4846  * @name: a human-readable name to use in error messages.
4847  *
4848  * Sets the name for a #GTypeModule
4849  */
4850
4851
4852 /**
4853  * g_type_module_unuse:
4854  * @module: a #GTypeModule
4855  *
4856  * Decreases the use count of a #GTypeModule by one. If the
4857  * result is zero, the module will be unloaded. (However, the
4858  * #GTypeModule will not be freed, and types associated with the
4859  * #GTypeModule are not unregistered. Once a #GTypeModule is
4860  * initialized, it must exist forever.)
4861  */
4862
4863
4864 /**
4865  * g_type_module_use:
4866  * @module: a #GTypeModule
4867  *
4868  * Increases the use count of a #GTypeModule by one. If the
4869  * use count was zero before, the plugin will be loaded.
4870  * If loading the plugin fails, the use count is reset to
4871  * its prior value.
4872  *
4873  * Returns: %FALSE if the plugin needed to be loaded and loading the plugin failed.
4874  */
4875
4876
4877 /**
4878  * g_type_name:
4879  * @type: Type to return name for.
4880  *
4881  * Get the unique name that is assigned to a type ID.  Note that this
4882  * function (like all other GType API) cannot cope with invalid type
4883  * IDs. %G_TYPE_INVALID may be passed to this function, as may be any
4884  * other validly registered type ID, but randomized type IDs should
4885  * not be passed in and will most likely lead to a crash.
4886  *
4887  * Returns: Static type name or %NULL.
4888  */
4889
4890
4891 /**
4892  * g_type_next_base:
4893  * @leaf_type: Descendant of @root_type and the type to be returned.
4894  * @root_type: Immediate parent of the returned type.
4895  *
4896  * Given a @leaf_type and a @root_type which is contained in its
4897  * anchestry, return the type that @root_type is the immediate parent
4898  * of.  In other words, this function determines the type that is
4899  * derived directly from @root_type which is also a base class of
4900  * @leaf_type.  Given a root type and a leaf type, this function can
4901  * be used to determine the types and order in which the leaf type is
4902  * descended from the root type.
4903  *
4904  * Returns: Immediate child of @root_type and anchestor of @leaf_type.
4905  */
4906
4907
4908 /**
4909  * g_type_parent:
4910  * @type: The derived type.
4911  *
4912  * Return the direct parent type of the passed in type.  If the passed
4913  * in type has no parent, i.e. is a fundamental type, 0 is returned.
4914  *
4915  * Returns: The parent type.
4916  */
4917
4918
4919 /**
4920  * g_type_plugin_complete_interface_info:
4921  * @plugin: the #GTypePlugin
4922  * @instance_type: the #GType of an instantiable type to which the interface is added
4923  * @interface_type: the #GType of the interface whose info is completed
4924  * @info: the #GInterfaceInfo to fill in
4925  *
4926  * Calls the @complete_interface_info function from the
4927  * #GTypePluginClass of @plugin. There should be no need to use this
4928  * function outside of the GObject type system itself.
4929  */
4930
4931
4932 /**
4933  * g_type_plugin_complete_type_info:
4934  * @plugin: a #GTypePlugin
4935  * @g_type: the #GType whose info is completed
4936  * @info: the #GTypeInfo struct to fill in
4937  * @value_table: the #GTypeValueTable to fill in
4938  *
4939  * Calls the @complete_type_info function from the #GTypePluginClass of @plugin.
4940  * There should be no need to use this function outside of the GObject
4941  * type system itself.
4942  */
4943
4944
4945 /**
4946  * g_type_plugin_unuse:
4947  * @plugin: a #GTypePlugin
4948  *
4949  * Calls the @unuse_plugin function from the #GTypePluginClass of
4950  * @plugin.  There should be no need to use this function outside of
4951  * the GObject type system itself.
4952  */
4953
4954
4955 /**
4956  * g_type_plugin_use:
4957  * @plugin: a #GTypePlugin
4958  *
4959  * Calls the @use_plugin function from the #GTypePluginClass of
4960  * @plugin.  There should be no need to use this function outside of
4961  * the GObject type system itself.
4962  */
4963
4964
4965 /**
4966  * g_type_qname:
4967  * @type: Type to return quark of type name for.
4968  *
4969  * Get the corresponding quark of the type IDs name.
4970  *
4971  * Returns: The type names quark or 0.
4972  */
4973
4974
4975 /**
4976  * g_type_query:
4977  * @type: the #GType value of a static, classed type.
4978  * @query: (out caller-allocates): A user provided structure that is filled in with constant values upon success.
4979  *
4980  * Queries the type system for information about a specific type.
4981  * This function will fill in a user-provided structure to hold
4982  * type-specific information. If an invalid #GType is passed in, the
4983  * @type member of the #GTypeQuery is 0. All members filled into the
4984  * #GTypeQuery structure should be considered constant and have to be
4985  * left untouched.
4986  */
4987
4988
4989 /**
4990  * g_type_register_dynamic:
4991  * @parent_type: Type from which this type will be derived.
4992  * @type_name: 0-terminated string used as the name of the new type.
4993  * @plugin: The #GTypePlugin structure to retrieve the #GTypeInfo from.
4994  * @flags: Bitwise combination of #GTypeFlags values.
4995  *
4996  * Registers @type_name as the name of a new dynamic type derived from
4997  * @parent_type.  The type system uses the information contained in the
4998  * #GTypePlugin structure pointed to by @plugin to manage the type and its
4999  * instances (if not abstract).  The value of @flags determines the nature
5000  * (e.g. abstract or not) of the type.
5001  *
5002  * Returns: The new type identifier or #G_TYPE_INVALID if registration failed.
5003  */
5004
5005
5006 /**
5007  * g_type_register_fundamental:
5008  * @type_id: A predefined type identifier.
5009  * @type_name: 0-terminated string used as the name of the new type.
5010  * @info: The #GTypeInfo structure for this type.
5011  * @finfo: The #GTypeFundamentalInfo structure for this type.
5012  * @flags: Bitwise combination of #GTypeFlags values.
5013  *
5014  * Registers @type_id as the predefined identifier and @type_name as the
5015  * name of a fundamental type. If @type_id is already registered, or a type
5016  * named @type_name is already registered, the behaviour is undefined. The type
5017  * system uses the information contained in the #GTypeInfo structure pointed to
5018  * by @info and the #GTypeFundamentalInfo structure pointed to by @finfo to
5019  * manage the type and its instances. The value of @flags determines additional
5020  * characteristics of the fundamental type.
5021  *
5022  * Returns: The predefined type identifier.
5023  */
5024
5025
5026 /**
5027  * g_type_register_static:
5028  * @parent_type: Type from which this type will be derived.
5029  * @type_name: 0-terminated string used as the name of the new type.
5030  * @info: The #GTypeInfo structure for this type.
5031  * @flags: Bitwise combination of #GTypeFlags values.
5032  *
5033  * Registers @type_name as the name of a new static type derived from
5034  * @parent_type.  The type system uses the information contained in the
5035  * #GTypeInfo structure pointed to by @info to manage the type and its
5036  * instances (if not abstract).  The value of @flags determines the nature
5037  * (e.g. abstract or not) of the type.
5038  *
5039  * Returns: The new type identifier.
5040  */
5041
5042
5043 /**
5044  * g_type_register_static_simple: (skip)
5045  * @parent_type: Type from which this type will be derived.
5046  * @type_name: 0-terminated string used as the name of the new type.
5047  * @class_size: Size of the class structure (see #GTypeInfo)
5048  * @class_init: Location of the class initialization function (see #GTypeInfo)
5049  * @instance_size: Size of the instance structure (see #GTypeInfo)
5050  * @instance_init: Location of the instance initialization function (see #GTypeInfo)
5051  * @flags: Bitwise combination of #GTypeFlags values.
5052  *
5053  * Registers @type_name as the name of a new static type derived from
5054  * @parent_type.  The value of @flags determines the nature (e.g.
5055  * abstract or not) of the type. It works by filling a #GTypeInfo
5056  * struct and calling g_type_register_static().
5057  *
5058  * Since: 2.12
5059  * Returns: The new type identifier.
5060  */
5061
5062
5063 /**
5064  * g_type_remove_class_cache_func: (skip)
5065  * @cache_data: data that was given when adding @cache_func
5066  * @cache_func: a #GTypeClassCacheFunc
5067  *
5068  * Removes a previously installed #GTypeClassCacheFunc. The cache
5069  * maintained by @cache_func has to be empty when calling
5070  * g_type_remove_class_cache_func() to avoid leaks.
5071  */
5072
5073
5074 /**
5075  * g_type_remove_interface_check: (skip)
5076  * @check_data: callback data passed to g_type_add_interface_check()
5077  * @check_func: callback function passed to g_type_add_interface_check()
5078  *
5079  * Removes an interface check function added with
5080  * g_type_add_interface_check().
5081  *
5082  * Since: 2.4
5083  */
5084
5085
5086 /**
5087  * g_type_set_qdata:
5088  * @type: a #GType
5089  * @quark: a #GQuark id to identify the data
5090  * @data: the data
5091  *
5092  * Attaches arbitrary data to a type.
5093  */
5094
5095
5096 /**
5097  * g_type_value_table_peek: (skip)
5098  * @type: A #GType value.
5099  *
5100  * Returns the location of the #GTypeValueTable associated with @type.
5101  * <emphasis>Note that this function should only be used from source code
5102  * that implements or has internal knowledge of the implementation of
5103  * @type.</emphasis>
5104  *
5105  * Returns: Location of the #GTypeValueTable associated with @type or %NULL if there is no #GTypeValueTable associated with @type.
5106  */
5107
5108
5109 /**
5110  * g_value_array_append:
5111  * @value_array: #GValueArray to add an element to
5112  * @value: (allow-none): #GValue to copy into #GValueArray, or %NULL
5113  *
5114  * Insert a copy of @value as last element of @value_array. If @value is
5115  * %NULL, an uninitialized value is appended.
5116  *
5117  * Returns: (transfer none): the #GValueArray passed in as @value_array
5118  * Deprecated: 2.32: Use #GArray and g_array_append_val() instead.
5119  */
5120
5121
5122 /**
5123  * g_value_array_copy:
5124  * @value_array: #GValueArray to copy
5125  *
5126  * Construct an exact copy of a #GValueArray by duplicating all its
5127  * contents.
5128  *
5129  * Returns: (transfer full): Newly allocated copy of #GValueArray
5130  * Deprecated: 2.32: Use #GArray and g_array_ref() instead.
5131  */
5132
5133
5134 /**
5135  * g_value_array_free:
5136  * @value_array: #GValueArray to free
5137  *
5138  * Free a #GValueArray including its contents.
5139  *
5140  * Deprecated: 2.32: Use #GArray and g_array_unref() instead.
5141  */
5142
5143
5144 /**
5145  * g_value_array_get_nth:
5146  * @value_array: #GValueArray to get a value from
5147  * @index_: index of the value of interest
5148  *
5149  * Return a pointer to the value at @index_ containd in @value_array.
5150  *
5151  * Returns: (transfer none): pointer to a value at @index_ in @value_array
5152  * Deprecated: 2.32: Use g_array_index() instead.
5153  */
5154
5155
5156 /**
5157  * g_value_array_insert:
5158  * @value_array: #GValueArray to add an element to
5159  * @index_: insertion position, must be &lt;= value_array-&gt;n_values
5160  * @value: (allow-none): #GValue to copy into #GValueArray, or %NULL
5161  *
5162  * Insert a copy of @value at specified position into @value_array. If @value
5163  * is %NULL, an uninitialized value is inserted.
5164  *
5165  * Returns: (transfer none): the #GValueArray passed in as @value_array
5166  * Deprecated: 2.32: Use #GArray and g_array_insert_val() instead.
5167  */
5168
5169
5170 /**
5171  * g_value_array_new:
5172  * @n_prealloced: number of values to preallocate space for
5173  *
5174  * Allocate and initialize a new #GValueArray, optionally preserve space
5175  * for @n_prealloced elements. New arrays always contain 0 elements,
5176  * regardless of the value of @n_prealloced.
5177  *
5178  * Returns: a newly allocated #GValueArray with 0 values
5179  * Deprecated: 2.32: Use #GArray and g_array_sized_new() instead.
5180  */
5181
5182
5183 /**
5184  * g_value_array_prepend:
5185  * @value_array: #GValueArray to add an element to
5186  * @value: (allow-none): #GValue to copy into #GValueArray, or %NULL
5187  *
5188  * Insert a copy of @value as first element of @value_array. If @value is
5189  * %NULL, an uninitialized value is prepended.
5190  *
5191  * Returns: (transfer none): the #GValueArray passed in as @value_array
5192  * Deprecated: 2.32: Use #GArray and g_array_prepend_val() instead.
5193  */
5194
5195
5196 /**
5197  * g_value_array_remove:
5198  * @value_array: #GValueArray to remove an element from
5199  * @index_: position of value to remove, which must be less than <code>value_array-><link linkend="GValueArray.n-values">n_values</link></code>
5200  *
5201  * Remove the value at position @index_ from @value_array.
5202  *
5203  * Returns: (transfer none): the #GValueArray passed in as @value_array
5204  * Deprecated: 2.32: Use #GArray and g_array_remove_index() instead.
5205  */
5206
5207
5208 /**
5209  * g_value_array_sort:
5210  * @value_array: #GValueArray to sort
5211  * @compare_func: (scope call): function to compare elements
5212  *
5213  * Sort @value_array using @compare_func to compare the elements according to
5214  * the semantics of #GCompareFunc.
5215  *
5216  * The current implementation uses the same sorting algorithm as standard
5217  * C qsort() function.
5218  *
5219  * Returns: (transfer none): the #GValueArray passed in as @value_array
5220  * Deprecated: 2.32: Use #GArray and g_array_sort().
5221  */
5222
5223
5224 /**
5225  * g_value_array_sort_with_data:
5226  * @value_array: #GValueArray to sort
5227  * @compare_func: (scope call): function to compare elements
5228  * @user_data: (closure): extra data argument provided for @compare_func
5229  *
5230  * Sort @value_array using @compare_func to compare the elements according
5231  * to the semantics of #GCompareDataFunc.
5232  *
5233  * The current implementation uses the same sorting algorithm as standard
5234  * C qsort() function.
5235  *
5236  * Rename to: g_value_array_sort
5237  * Returns: (transfer none): the #GValueArray passed in as @value_array
5238  * Deprecated: 2.32: Use #GArray and g_array_sort_with_data().
5239  */
5240
5241
5242 /**
5243  * g_value_copy:
5244  * @src_value: An initialized #GValue structure.
5245  * @dest_value: An initialized #GValue structure of the same type as @src_value.
5246  *
5247  * Copies the value of @src_value into @dest_value.
5248  */
5249
5250
5251 /**
5252  * g_value_dup_boxed: (skip)
5253  * @value: a valid #GValue of %G_TYPE_BOXED derived type
5254  *
5255  * Get the contents of a %G_TYPE_BOXED derived #GValue.  Upon getting,
5256  * the boxed value is duplicated and needs to be later freed with
5257  * g_boxed_free(), e.g. like: g_boxed_free (G_VALUE_TYPE (@value),
5258  * return_value);
5259  *
5260  * Returns: boxed contents of @value
5261  */
5262
5263
5264 /**
5265  * g_value_dup_object:
5266  * @value: a valid #GValue whose type is derived from %G_TYPE_OBJECT
5267  *
5268  * Get the contents of a %G_TYPE_OBJECT derived #GValue, increasing
5269  * its reference count. If the contents of the #GValue are %NULL, then
5270  * %NULL will be returned.
5271  *
5272  * Returns: (type GObject.Object) (transfer full): object content of @value, should be unreferenced when no longer needed.
5273  */
5274
5275
5276 /**
5277  * g_value_dup_param: (skip)
5278  * @value: a valid #GValue whose type is derived from %G_TYPE_PARAM
5279  *
5280  * Get the contents of a %G_TYPE_PARAM #GValue, increasing its
5281  * reference count.
5282  *
5283  * Returns: #GParamSpec content of @value, should be unreferenced when no longer needed.
5284  */
5285
5286
5287 /**
5288  * g_value_dup_string:
5289  * @value: a valid #GValue of type %G_TYPE_STRING
5290  *
5291  * Get a copy the contents of a %G_TYPE_STRING #GValue.
5292  *
5293  * Returns: a newly allocated copy of the string content of @value
5294  */
5295
5296
5297 /**
5298  * g_value_dup_variant:
5299  * @value: a valid #GValue of type %G_TYPE_VARIANT
5300  *
5301  * Get the contents of a variant #GValue, increasing its refcount.
5302  *
5303  * Returns: variant contents of @value, should be unrefed using g_variant_unref() when no longer needed
5304  * Since: 2.26
5305  */
5306
5307
5308 /**
5309  * g_value_fits_pointer:
5310  * @value: An initialized #GValue structure.
5311  *
5312  * Determines if @value will fit inside the size of a pointer value.
5313  * This is an internal function introduced mainly for C marshallers.
5314  *
5315  * Returns: %TRUE if @value will fit inside a pointer value.
5316  */
5317
5318
5319 /**
5320  * g_value_get_boolean:
5321  * @value: a valid #GValue of type %G_TYPE_BOOLEAN
5322  *
5323  * Get the contents of a %G_TYPE_BOOLEAN #GValue.
5324  *
5325  * Returns: boolean contents of @value
5326  */
5327
5328
5329 /**
5330  * g_value_get_boxed:
5331  * @value: a valid #GValue of %G_TYPE_BOXED derived type
5332  *
5333  * Get the contents of a %G_TYPE_BOXED derived #GValue.
5334  *
5335  * Returns: (transfer none): boxed contents of @value
5336  */
5337
5338
5339 /**
5340  * g_value_get_char:
5341  * @value: a valid #GValue of type %G_TYPE_CHAR
5342  *
5343  * Do not use this function; it is broken on platforms where the %char
5344  * type is unsigned, such as ARM and PowerPC.  See g_value_get_schar().
5345  *
5346  * Get the contents of a %G_TYPE_CHAR #GValue.
5347  *
5348  * Returns: character contents of @value
5349  * Deprecated: 2.32: This function's return type is broken, see g_value_get_schar()
5350  */
5351
5352
5353 /**
5354  * g_value_get_double:
5355  * @value: a valid #GValue of type %G_TYPE_DOUBLE
5356  *
5357  * Get the contents of a %G_TYPE_DOUBLE #GValue.
5358  *
5359  * Returns: double contents of @value
5360  */
5361
5362
5363 /**
5364  * g_value_get_enum:
5365  * @value: a valid #GValue whose type is derived from %G_TYPE_ENUM
5366  *
5367  * Get the contents of a %G_TYPE_ENUM #GValue.
5368  *
5369  * Returns: enum contents of @value
5370  */
5371
5372
5373 /**
5374  * g_value_get_flags:
5375  * @value: a valid #GValue whose type is derived from %G_TYPE_FLAGS
5376  *
5377  * Get the contents of a %G_TYPE_FLAGS #GValue.
5378  *
5379  * Returns: flags contents of @value
5380  */
5381
5382
5383 /**
5384  * g_value_get_float:
5385  * @value: a valid #GValue of type %G_TYPE_FLOAT
5386  *
5387  * Get the contents of a %G_TYPE_FLOAT #GValue.
5388  *
5389  * Returns: float contents of @value
5390  */
5391
5392
5393 /**
5394  * g_value_get_gtype:
5395  * @value: a valid #GValue of type %G_TYPE_GTYPE
5396  *
5397  * Get the contents of a %G_TYPE_GTYPE #GValue.
5398  *
5399  * Since: 2.12
5400  * Returns: the #GType stored in @value
5401  */
5402
5403
5404 /**
5405  * g_value_get_int:
5406  * @value: a valid #GValue of type %G_TYPE_INT
5407  *
5408  * Get the contents of a %G_TYPE_INT #GValue.
5409  *
5410  * Returns: integer contents of @value
5411  */
5412
5413
5414 /**
5415  * g_value_get_int64:
5416  * @value: a valid #GValue of type %G_TYPE_INT64
5417  *
5418  * Get the contents of a %G_TYPE_INT64 #GValue.
5419  *
5420  * Returns: 64bit integer contents of @value
5421  */
5422
5423
5424 /**
5425  * g_value_get_long:
5426  * @value: a valid #GValue of type %G_TYPE_LONG
5427  *
5428  * Get the contents of a %G_TYPE_LONG #GValue.
5429  *
5430  * Returns: long integer contents of @value
5431  */
5432
5433
5434 /**
5435  * g_value_get_object:
5436  * @value: a valid #GValue of %G_TYPE_OBJECT derived type
5437  *
5438  * Get the contents of a %G_TYPE_OBJECT derived #GValue.
5439  *
5440  * Returns: (type GObject.Object) (transfer none): object contents of @value
5441  */
5442
5443
5444 /**
5445  * g_value_get_param:
5446  * @value: a valid #GValue whose type is derived from %G_TYPE_PARAM
5447  *
5448  * Get the contents of a %G_TYPE_PARAM #GValue.
5449  *
5450  * Returns: (transfer none): #GParamSpec content of @value
5451  */
5452
5453
5454 /**
5455  * g_value_get_pointer:
5456  * @value: a valid #GValue of %G_TYPE_POINTER
5457  *
5458  * Get the contents of a pointer #GValue.
5459  *
5460  * Returns: (transfer none): pointer contents of @value
5461  */
5462
5463
5464 /**
5465  * g_value_get_schar:
5466  * @value: a valid #GValue of type %G_TYPE_CHAR
5467  *
5468  * Get the contents of a %G_TYPE_CHAR #GValue.
5469  *
5470  * Returns: signed 8 bit integer contents of @value
5471  * Since: 2.32
5472  */
5473
5474
5475 /**
5476  * g_value_get_string:
5477  * @value: a valid #GValue of type %G_TYPE_STRING
5478  *
5479  * Get the contents of a %G_TYPE_STRING #GValue.
5480  *
5481  * Returns: string content of @value
5482  */
5483
5484
5485 /**
5486  * g_value_get_uchar:
5487  * @value: a valid #GValue of type %G_TYPE_UCHAR
5488  *
5489  * Get the contents of a %G_TYPE_UCHAR #GValue.
5490  *
5491  * Returns: unsigned character contents of @value
5492  */
5493
5494
5495 /**
5496  * g_value_get_uint:
5497  * @value: a valid #GValue of type %G_TYPE_UINT
5498  *
5499  * Get the contents of a %G_TYPE_UINT #GValue.
5500  *
5501  * Returns: unsigned integer contents of @value
5502  */
5503
5504
5505 /**
5506  * g_value_get_uint64:
5507  * @value: a valid #GValue of type %G_TYPE_UINT64
5508  *
5509  * Get the contents of a %G_TYPE_UINT64 #GValue.
5510  *
5511  * Returns: unsigned 64bit integer contents of @value
5512  */
5513
5514
5515 /**
5516  * g_value_get_ulong:
5517  * @value: a valid #GValue of type %G_TYPE_ULONG
5518  *
5519  * Get the contents of a %G_TYPE_ULONG #GValue.
5520  *
5521  * Returns: unsigned long integer contents of @value
5522  */
5523
5524
5525 /**
5526  * g_value_get_variant:
5527  * @value: a valid #GValue of type %G_TYPE_VARIANT
5528  *
5529  * Get the contents of a variant #GValue.
5530  *
5531  * Returns: variant contents of @value
5532  * Since: 2.26
5533  */
5534
5535
5536 /**
5537  * g_value_init:
5538  * @value: A zero-filled (uninitialized) #GValue structure.
5539  * @g_type: Type the #GValue should hold values of.
5540  *
5541  * Initializes @value with the default value of @type.
5542  *
5543  * Returns: (transfer none): the #GValue structure that has been passed in
5544  */
5545
5546
5547 /**
5548  * g_value_peek_pointer:
5549  * @value: An initialized #GValue structure.
5550  *
5551  * Returns: (transfer none): the value contents as pointer. This function asserts that g_value_fits_pointer() returned %TRUE for the passed in value.  This is an internal function introduced mainly for C marshallers.
5552  */
5553
5554
5555 /**
5556  * g_value_register_transform_func: (skip)
5557  * @src_type: Source type.
5558  * @dest_type: Target type.
5559  * @transform_func: a function which transforms values of type @src_type into value of type @dest_type
5560  *
5561  * Registers a value transformation function for use in g_value_transform().
5562  * A previously registered transformation function for @src_type and @dest_type
5563  * will be replaced.
5564  */
5565
5566
5567 /**
5568  * g_value_reset:
5569  * @value: An initialized #GValue structure.
5570  *
5571  * Clears the current value in @value and resets it to the default value
5572  * (as if the value had just been initialized).
5573  *
5574  * Returns: the #GValue structure that has been passed in
5575  */
5576
5577
5578 /**
5579  * g_value_set_boolean:
5580  * @value: a valid #GValue of type %G_TYPE_BOOLEAN
5581  * @v_boolean: boolean value to be set
5582  *
5583  * Set the contents of a %G_TYPE_BOOLEAN #GValue to @v_boolean.
5584  */
5585
5586
5587 /**
5588  * g_value_set_boxed:
5589  * @value: a valid #GValue of %G_TYPE_BOXED derived type
5590  * @v_boxed: (allow-none): boxed value to be set
5591  *
5592  * Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.
5593  */
5594
5595
5596 /**
5597  * g_value_set_boxed_take_ownership:
5598  * @value: a valid #GValue of %G_TYPE_BOXED derived type
5599  * @v_boxed: (allow-none): duplicated unowned boxed value to be set
5600  *
5601  * This is an internal function introduced mainly for C marshallers.
5602  *
5603  * Deprecated: 2.4: Use g_value_take_boxed() instead.
5604  */
5605
5606
5607 /**
5608  * g_value_set_char:
5609  * @value: a valid #GValue of type %G_TYPE_CHAR
5610  * @v_char: character value to be set
5611  *
5612  * Set the contents of a %G_TYPE_CHAR #GValue to @v_char.
5613  *
5614  * Deprecated: 2.32: This function's input type is broken, see g_value_set_schar()
5615  */
5616
5617
5618 /**
5619  * g_value_set_double:
5620  * @value: a valid #GValue of type %G_TYPE_DOUBLE
5621  * @v_double: double value to be set
5622  *
5623  * Set the contents of a %G_TYPE_DOUBLE #GValue to @v_double.
5624  */
5625
5626
5627 /**
5628  * g_value_set_enum:
5629  * @value: a valid #GValue whose type is derived from %G_TYPE_ENUM
5630  * @v_enum: enum value to be set
5631  *
5632  * Set the contents of a %G_TYPE_ENUM #GValue to @v_enum.
5633  */
5634
5635
5636 /**
5637  * g_value_set_flags:
5638  * @value: a valid #GValue whose type is derived from %G_TYPE_FLAGS
5639  * @v_flags: flags value to be set
5640  *
5641  * Set the contents of a %G_TYPE_FLAGS #GValue to @v_flags.
5642  */
5643
5644
5645 /**
5646  * g_value_set_float:
5647  * @value: a valid #GValue of type %G_TYPE_FLOAT
5648  * @v_float: float value to be set
5649  *
5650  * Set the contents of a %G_TYPE_FLOAT #GValue to @v_float.
5651  */
5652
5653
5654 /**
5655  * g_value_set_gtype:
5656  * @value: a valid #GValue of type %G_TYPE_GTYPE
5657  * @v_gtype: #GType to be set
5658  *
5659  * Set the contents of a %G_TYPE_GTYPE #GValue to @v_gtype.
5660  *
5661  * Since: 2.12
5662  */
5663
5664
5665 /**
5666  * g_value_set_instance:
5667  * @value: An initialized #GValue structure.
5668  * @instance: (allow-none): the instance
5669  *
5670  * Sets @value from an instantiatable type via the
5671  * value_table's collect_value() function.
5672  */
5673
5674
5675 /**
5676  * g_value_set_int:
5677  * @value: a valid #GValue of type %G_TYPE_INT
5678  * @v_int: integer value to be set
5679  *
5680  * Set the contents of a %G_TYPE_INT #GValue to @v_int.
5681  */
5682
5683
5684 /**
5685  * g_value_set_int64:
5686  * @value: a valid #GValue of type %G_TYPE_INT64
5687  * @v_int64: 64bit integer value to be set
5688  *
5689  * Set the contents of a %G_TYPE_INT64 #GValue to @v_int64.
5690  */
5691
5692
5693 /**
5694  * g_value_set_long:
5695  * @value: a valid #GValue of type %G_TYPE_LONG
5696  * @v_long: long integer value to be set
5697  *
5698  * Set the contents of a %G_TYPE_LONG #GValue to @v_long.
5699  */
5700
5701
5702 /**
5703  * g_value_set_object:
5704  * @value: a valid #GValue of %G_TYPE_OBJECT derived type
5705  * @v_object: (type GObject.Object) (allow-none): object value to be set
5706  *
5707  * Set the contents of a %G_TYPE_OBJECT derived #GValue to @v_object.
5708  *
5709  * g_value_set_object() increases the reference count of @v_object
5710  * (the #GValue holds a reference to @v_object).  If you do not wish
5711  * to increase the reference count of the object (i.e. you wish to
5712  * pass your current reference to the #GValue because you no longer
5713  * need it), use g_value_take_object() instead.
5714  *
5715  * It is important that your #GValue holds a reference to @v_object (either its
5716  * own, or one it has taken) to ensure that the object won't be destroyed while
5717  * the #GValue still exists).
5718  */
5719
5720
5721 /**
5722  * g_value_set_object_take_ownership: (skip)
5723  * @value: a valid #GValue of %G_TYPE_OBJECT derived type
5724  * @v_object: (allow-none): object value to be set
5725  *
5726  * This is an internal function introduced mainly for C marshallers.
5727  *
5728  * Deprecated: 2.4: Use g_value_take_object() instead.
5729  */
5730
5731
5732 /**
5733  * g_value_set_param:
5734  * @value: a valid #GValue of type %G_TYPE_PARAM
5735  * @param: (allow-none): the #GParamSpec to be set
5736  *
5737  * Set the contents of a %G_TYPE_PARAM #GValue to @param.
5738  */
5739
5740
5741 /**
5742  * g_value_set_param_take_ownership: (skip)
5743  * @value: a valid #GValue of type %G_TYPE_PARAM
5744  * @param: (allow-none): the #GParamSpec to be set
5745  *
5746  * This is an internal function introduced mainly for C marshallers.
5747  *
5748  * Deprecated: 2.4: Use g_value_take_param() instead.
5749  */
5750
5751
5752 /**
5753  * g_value_set_pointer:
5754  * @value: a valid #GValue of %G_TYPE_POINTER
5755  * @v_pointer: pointer value to be set
5756  *
5757  * Set the contents of a pointer #GValue to @v_pointer.
5758  */
5759
5760
5761 /**
5762  * g_value_set_schar:
5763  * @value: a valid #GValue of type %G_TYPE_CHAR
5764  * @v_char: signed 8 bit integer to be set
5765  *
5766  * Set the contents of a %G_TYPE_CHAR #GValue to @v_char.
5767  *
5768  * Since: 2.32
5769  */
5770
5771
5772 /**
5773  * g_value_set_static_boxed:
5774  * @value: a valid #GValue of %G_TYPE_BOXED derived type
5775  * @v_boxed: (allow-none): static boxed value to be set
5776  *
5777  * Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.
5778  * The boxed value is assumed to be static, and is thus not duplicated
5779  * when setting the #GValue.
5780  */
5781
5782
5783 /**
5784  * g_value_set_static_string:
5785  * @value: a valid #GValue of type %G_TYPE_STRING
5786  * @v_string: (allow-none): static string to be set
5787  *
5788  * Set the contents of a %G_TYPE_STRING #GValue to @v_string.
5789  * The string is assumed to be static, and is thus not duplicated
5790  * when setting the #GValue.
5791  */
5792
5793
5794 /**
5795  * g_value_set_string:
5796  * @value: a valid #GValue of type %G_TYPE_STRING
5797  * @v_string: (allow-none): caller-owned string to be duplicated for the #GValue
5798  *
5799  * Set the contents of a %G_TYPE_STRING #GValue to @v_string.
5800  */
5801
5802
5803 /**
5804  * g_value_set_string_take_ownership:
5805  * @value: a valid #GValue of type %G_TYPE_STRING
5806  * @v_string: (allow-none): duplicated unowned string to be set
5807  *
5808  * This is an internal function introduced mainly for C marshallers.
5809  *
5810  * Deprecated: 2.4: Use g_value_take_string() instead.
5811  */
5812
5813
5814 /**
5815  * g_value_set_uchar:
5816  * @value: a valid #GValue of type %G_TYPE_UCHAR
5817  * @v_uchar: unsigned character value to be set
5818  *
5819  * Set the contents of a %G_TYPE_UCHAR #GValue to @v_uchar.
5820  */
5821
5822
5823 /**
5824  * g_value_set_uint:
5825  * @value: a valid #GValue of type %G_TYPE_UINT
5826  * @v_uint: unsigned integer value to be set
5827  *
5828  * Set the contents of a %G_TYPE_UINT #GValue to @v_uint.
5829  */
5830
5831
5832 /**
5833  * g_value_set_uint64:
5834  * @value: a valid #GValue of type %G_TYPE_UINT64
5835  * @v_uint64: unsigned 64bit integer value to be set
5836  *
5837  * Set the contents of a %G_TYPE_UINT64 #GValue to @v_uint64.
5838  */
5839
5840
5841 /**
5842  * g_value_set_ulong:
5843  * @value: a valid #GValue of type %G_TYPE_ULONG
5844  * @v_ulong: unsigned long integer value to be set
5845  *
5846  * Set the contents of a %G_TYPE_ULONG #GValue to @v_ulong.
5847  */
5848
5849
5850 /**
5851  * g_value_set_variant:
5852  * @value: a valid #GValue of type %G_TYPE_VARIANT
5853  * @variant: (allow-none): a #GVariant, or %NULL
5854  *
5855  * Set the contents of a variant #GValue to @variant.
5856  * If the variant is floating, it is consumed.
5857  *
5858  * Since: 2.26
5859  */
5860
5861
5862 /**
5863  * g_value_take_boxed:
5864  * @value: a valid #GValue of %G_TYPE_BOXED derived type
5865  * @v_boxed: (allow-none): duplicated unowned boxed value to be set
5866  *
5867  * Sets the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed
5868  * and takes over the ownership of the callers reference to @v_boxed;
5869  * the caller doesn't have to unref it any more.
5870  *
5871  * Since: 2.4
5872  */
5873
5874
5875 /**
5876  * g_value_take_object: (skip)
5877  * @value: a valid #GValue of %G_TYPE_OBJECT derived type
5878  * @v_object: (allow-none): object value to be set
5879  *
5880  * Sets the contents of a %G_TYPE_OBJECT derived #GValue to @v_object
5881  * and takes over the ownership of the callers reference to @v_object;
5882  * the caller doesn't have to unref it any more (i.e. the reference
5883  * count of the object is not increased).
5884  *
5885  * If you want the #GValue to hold its own reference to @v_object, use
5886  * g_value_set_object() instead.
5887  *
5888  * Since: 2.4
5889  */
5890
5891
5892 /**
5893  * g_value_take_param: (skip)
5894  * @value: a valid #GValue of type %G_TYPE_PARAM
5895  * @param: (allow-none): the #GParamSpec to be set
5896  *
5897  * Sets the contents of a %G_TYPE_PARAM #GValue to @param and takes
5898  * over the ownership of the callers reference to @param; the caller
5899  * doesn't have to unref it any more.
5900  *
5901  * Since: 2.4
5902  */
5903
5904
5905 /**
5906  * g_value_take_string:
5907  * @value: a valid #GValue of type %G_TYPE_STRING
5908  * @v_string: (allow-none): string to take ownership of
5909  *
5910  * Sets the contents of a %G_TYPE_STRING #GValue to @v_string.
5911  *
5912  * Since: 2.4
5913  */
5914
5915
5916 /**
5917  * g_value_take_variant:
5918  * @value: a valid #GValue of type %G_TYPE_VARIANT
5919  * @variant: (allow-none): a #GVariant, or %NULL
5920  *
5921  * Set the contents of a variant #GValue to @variant, and takes over
5922  * the ownership of the caller's reference to @variant;
5923  * the caller doesn't have to unref it any more (i.e. the reference
5924  * count of the variant is not increased).
5925  *
5926  * If @variant was floating then its floating reference is converted to
5927  * a hard reference.
5928  *
5929  * If you want the #GValue to hold its own reference to @variant, use
5930  * g_value_set_variant() instead.
5931  *
5932  * This is an internal function introduced mainly for C marshallers.
5933  *
5934  * Since: 2.26
5935  */
5936
5937
5938 /**
5939  * g_value_transform:
5940  * @src_value: Source value.
5941  * @dest_value: Target value.
5942  *
5943  * Tries to cast the contents of @src_value into a type appropriate
5944  * to store in @dest_value, e.g. to transform a %G_TYPE_INT value
5945  * into a %G_TYPE_FLOAT value. Performing transformations between
5946  * value types might incur precision lossage. Especially
5947  * transformations into strings might reveal seemingly arbitrary
5948  * results and shouldn't be relied upon for production code (such
5949  * as rcfile value or object property serialization).
5950  *
5951  * Returns: Whether a transformation rule was found and could be applied. Upon failing transformations, @dest_value is left untouched.
5952  */
5953
5954
5955 /**
5956  * g_value_type_compatible:
5957  * @src_type: source type to be copied.
5958  * @dest_type: destination type for copying.
5959  *
5960  * Returns whether a #GValue of type @src_type can be copied into
5961  * a #GValue of type @dest_type.
5962  *
5963  * Returns: %TRUE if g_value_copy() is possible with @src_type and @dest_type.
5964  */
5965
5966
5967 /**
5968  * g_value_type_transformable:
5969  * @src_type: Source type.
5970  * @dest_type: Target type.
5971  *
5972  * Check whether g_value_transform() is able to transform values
5973  * of type @src_type into values of type @dest_type.
5974  *
5975  * Returns: %TRUE if the transformation is possible, %FALSE otherwise.
5976  */
5977
5978
5979 /**
5980  * g_value_unset:
5981  * @value: An initialized #GValue structure.
5982  *
5983  * Clears the current value in @value and "unsets" the type,
5984  * this releases all resources associated with this GValue.
5985  * An unset value is the same as an uninitialized (zero-filled)
5986  * #GValue structure.
5987  */
5988
5989
5990 /**
5991  * g_variant_get_gtype:
5992  *
5993  * Since: 2.24
5994  * Deprecated: 2.26
5995  */
5996
5997
5998 /**
5999  * g_weak_ref_clear: (skip)
6000  * @weak_ref: (inout): location of a weak reference, which may be empty
6001  *
6002  * Frees resources associated with a non-statically-allocated #GWeakRef.
6003  * After this call, the #GWeakRef is left in an undefined state.
6004  *
6005  * You should only call this on a #GWeakRef that previously had
6006  * g_weak_ref_init() called on it.
6007  *
6008  * Since: 2.32
6009  */
6010
6011
6012 /**
6013  * g_weak_ref_get: (skip)
6014  * @weak_ref: (inout): location of a weak reference to a #GObject
6015  *
6016  * If @weak_ref is not empty, atomically acquire a strong
6017  * reference to the object it points to, and return that reference.
6018  *
6019  * This function is needed because of the potential race between taking
6020  * the pointer value and g_object_ref() on it, if the object was losing
6021  * its last reference at the same time in a different thread.
6022  *
6023  * The caller should release the resulting reference in the usual way,
6024  * by using g_object_unref().
6025  *
6026  * Returns: (transfer full) (type GObject.Object): the object pointed to by @weak_ref, or %NULL if it was empty
6027  * Since: 2.32
6028  */
6029
6030
6031 /**
6032  * g_weak_ref_init: (skip)
6033  * @weak_ref: (inout): uninitialized or empty location for a weak reference
6034  * @object: (allow-none): a #GObject or %NULL
6035  *
6036  * Initialise a non-statically-allocated #GWeakRef.
6037  *
6038  * This function also calls g_weak_ref_set() with @object on the
6039  * freshly-initialised weak reference.
6040  *
6041  * This function should always be matched with a call to
6042  * g_weak_ref_clear().  It is not necessary to use this function for a
6043  * #GWeakRef in static storage because it will already be
6044  * properly initialised.  Just use g_weak_ref_set() directly.
6045  *
6046  * Since: 2.32
6047  */
6048
6049
6050 /**
6051  * g_weak_ref_set: (skip)
6052  * @weak_ref: location for a weak reference
6053  * @object: (allow-none): a #GObject or %NULL
6054  *
6055  * Change the object to which @weak_ref points, or set it to
6056  * %NULL.
6057  *
6058  * You must own a strong reference on @object while calling this
6059  * function.
6060  *
6061  * Since: 2.32
6062  */
6063
6064
6065
6066 /************************************************************/
6067 /* THIS FILE IS GENERATED DO NOT EDIT */
6068 /************************************************************/