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