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