1 /************************************************************/
2 /* THIS FILE IS GENERATED DO NOT EDIT */
3 /************************************************************/
8 * Flags to be used to control the #GBinding
17 * The #GObject that should be used as the source of the binding
24 * GBinding:source-property:
26 * The name of the property of #GBinding:source that should be used
27 * as the source of the binding
36 * The #GObject that should be used as the target of the binding
43 * GBinding:target-property:
45 * The name of the property of #GBinding:target that should be used
46 * as the target of the binding
54 * @gobject: the object which received the signal.
55 * @pspec: the #GParamSpec of the property which changed.
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.
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 * |[<!-- language="C" -->
67 * g_signal_connect (text_view->buffer, "notify::paste-target-list",
68 * G_CALLBACK (gtk_text_view_target_list_notify),
71 * It is important to note that you must use
72 * [canonical][canonical-parameter-name] parameter names as
73 * detail strings for the notify signal.
80 * A #GParamSpecPool maintains a collection of #GParamSpecs 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
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).
96 * Like #GValue, #GWeakRef can be statically allocated, stack- or
97 * heap-allocated, or embedded in larger structures.
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
104 * If the object's #GObjectClass.dispose method results in additional
105 * references to the object being held, any #GWeakRefs taken
106 * before it was disposed will continue to point to %NULL. If
107 * #GWeakRefs 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.
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(),
118 * g_param_spec_flags()
120 * The GLib type system provides fundamental types for enumeration and
121 * flags types. (Flags types are like enumerations, but allow their
122 * values to be combined by bitwise or). A registered enumeration or
123 * flags type associates a name and a nickname with each allowed
124 * value, and the methods g_enum_get_value_by_name(),
125 * g_enum_get_value_by_nick(), g_flags_get_value_by_name() and
126 * g_flags_get_value_by_nick() can look up values by their name or
127 * nickname. When an enumeration or flags type is registered with the
128 * GLib type system, it can be used as value type for object
129 * properties, using g_param_spec_enum() or g_param_spec_flags().
131 * GObject ships with a utility called [glib-mkenums][glib-mkenums],
132 * that can construct suitable type registration functions from C enumeration
135 * Example of how to get a string representation of an enum value:
136 * |[<!-- language="C" -->
137 * GEnumClass *enum_class;
138 * GEnumValue *enum_value;
140 * enum_class = g_type_class_ref (MAMAN_TYPE_MY_ENUM);
141 * enum_value = g_enum_get_value (enum_class, MAMAN_MY_ENUM_FOO);
143 * g_print ("Name: %s\n", enum_value->value_name);
145 * g_type_class_unref (enum_class);
153 * @Short_Description: Bind two object properties
155 * #GBinding is the representation of a binding between a property on a
156 * #GObject instance (or source) and another property on another #GObject
157 * instance (or target). Whenever the source property changes, the same
158 * value is applied to the target property; for instance, the following
161 * |[<!-- language="C" -->
162 * g_object_bind_property (object1, "property-a",
163 * object2, "property-b",
164 * G_BINDING_DEFAULT);
167 * will cause the property named "property-b" of @object2 to be updated
168 * every time g_object_set() or the specific accessor changes the value of
169 * the property "property-a" of @object1.
171 * It is possible to create a bidirectional binding between two properties
172 * of two #GObject instances, so that if either property changes, the
173 * other is updated as well, for instance:
175 * |[<!-- language="C" -->
176 * g_object_bind_property (object1, "property-a",
177 * object2, "property-b",
178 * G_BINDING_BIDIRECTIONAL);
181 * will keep the two properties in sync.
183 * It is also possible to set a custom transformation function (in both
184 * directions, in case of a bidirectional binding) to apply a custom
185 * transformation from the source value to the target value before
186 * applying it; for instance, the following binding:
188 * |[<!-- language="C" -->
189 * g_object_bind_property_full (adjustment1, "value",
190 * adjustment2, "value",
191 * G_BINDING_BIDIRECTIONAL,
192 * celsius_to_fahrenheit,
193 * fahrenheit_to_celsius,
197 * will keep the "value" property of the two adjustments in sync; the
198 * @celsius_to_fahrenheit function will be called whenever the "value"
199 * property of @adjustment1 changes and will transform the current value
200 * of the property before applying it to the "value" property of @adjustment2.
202 * Vice versa, the @fahrenheit_to_celsius function will be called whenever
203 * the "value" property of @adjustment2 changes, and will transform the
204 * current value of the property before applying it to the "value" property
207 * Note that #GBinding does not resolve cycles by itself; a cycle like
210 * object1:propertyA -> object2:propertyB
211 * object2:propertyB -> object3:propertyC
212 * object3:propertyC -> object1:propertyA
215 * might lead to an infinite loop. The loop, in this particular case,
216 * can be avoided if the objects emit the #GObject::notify signal only
217 * if the value has effectively been changed. A binding is implemented
218 * using the #GObject::notify signal, so it is susceptible to all the
219 * various ways of blocking a signal emission, like g_signal_stop_emission()
220 * or g_signal_handler_block().
222 * A binding will be severed, and the resources it allocates freed, whenever
223 * either one of the #GObject instances it refers to are finalized, or when
224 * the #GBinding instance loses its last reference.
226 * Bindings for languages with garbage collection can use
227 * g_binding_unbind() to explicitly release a binding between the source
228 * and target properties, instead of relying on the last reference on the
229 * binding, source, and target instances to drop.
231 * #GBinding is available since GObject 2.26
237 * @short_description: A mechanism to wrap opaque C structures registered
239 * @see_also: #GParamSpecBoxed, g_param_spec_boxed()
240 * @title: Boxed Types
242 * GBoxed is a generic wrapper mechanism for arbitrary C structures. The only
243 * thing the type system needs to know about the structures is how to copy and
244 * free them, beyond that they are treated as opaque chunks of memory.
246 * Boxed types are useful for simple value-holder structures like rectangles or
247 * points. They can also be used for wrapping structures defined in non-GObject
254 * @short_description: Functions as first-class objects
257 * A #GClosure represents a callback supplied by the programmer. It
258 * will generally comprise a function of some kind and a marshaller
259 * used to call it. It is the responsibility of the marshaller to
260 * convert the arguments for the invocation from #GValues into
261 * a suitable form, perform the callback on the converted arguments,
262 * and transform the return value back into a #GValue.
264 * In the case of C programs, a closure usually just holds a pointer
265 * to a function and maybe a data argument, and the marshaller
266 * converts between #GValue and native C types. The GObject
267 * library provides the #GCClosure type for this purpose. Bindings for
268 * other languages need marshallers which convert between #GValue<!--
269 * -->s and suitable representations in the runtime of the language in
270 * order to use functions written in that languages as callbacks.
272 * Within GObject, closures play an important role in the
273 * implementation of signals. When a signal is registered, the
274 * @c_marshaller argument to g_signal_new() specifies the default C
275 * marshaller for any closure which is connected to this
276 * signal. GObject provides a number of C marshallers for this
277 * purpose, see the g_cclosure_marshal_*() functions. Additional C
278 * marshallers can be generated with the [glib-genmarshal][glib-genmarshal]
279 * utility. Closures can be explicitly connected to signals with
280 * g_signal_connect_closure(), but it usually more convenient to let
281 * GObject create a closure automatically by using one of the
282 * g_signal_connect_*() functions which take a callback function/user
285 * Using closures has a number of important advantages over a simple
286 * callback function/data pointer combination:
288 * - Closures allow the callee to get the types of the callback parameters,
289 * which means that language bindings don't have to write individual glue
290 * for each callback type.
292 * - The reference counting of #GClosure makes it easy to handle reentrancy
293 * right; if a callback is removed while it is being invoked, the closure
294 * and its parameters won't be freed until the invocation finishes.
296 * - g_closure_invalidate() and invalidation notifiers allow callbacks to be
297 * automatically removed when the objects they point to go away.
302 * SECTION:generic_values
303 * @short_description: A polymorphic type that can hold values of any
305 * @see_also: The fundamental types which all support #GValue
306 * operations and thus can be used as a type initializer for
307 * g_value_init() are defined by a separate interface. See the
308 * [standard values API][gobject-Standard-Parameter-and-Value-Types]
310 * @title: Generic values
312 * The #GValue structure is basically a variable container that consists
313 * of a type identifier and a specific value of that type.
314 * The type identifier within a #GValue structure always determines the
315 * type of the associated value.
316 * To create a undefined #GValue structure, simply create a zero-filled
317 * #GValue structure. To initialize the #GValue, use the g_value_init()
318 * function. A #GValue cannot be used until it is initialized.
319 * The basic type operations (such as freeing and copying) are determined
320 * by the #GTypeValueTable associated with the type ID stored in the #GValue.
321 * Other #GValue operations (such as converting values between types) are
322 * provided by this interface.
324 * The code in the example program below demonstrates #GValue's
327 * |[<!-- language="C" -->
328 * #include <glib-object.h>
331 * int2string (const GValue *src_value,
332 * GValue *dest_value)
334 * if (g_value_get_int (src_value) == 42)
335 * g_value_set_static_string (dest_value, "An important number");
337 * g_value_set_static_string (dest_value, "What's that?");
344 * // GValues must be initialized
345 * GValue a = G_VALUE_INIT;
346 * GValue b = G_VALUE_INIT;
347 * const gchar *message;
349 * // The GValue starts empty
350 * g_assert (!G_VALUE_HOLDS_STRING (&a));
352 * // Put a string in it
353 * g_value_init (&a, G_TYPE_STRING);
354 * g_assert (G_VALUE_HOLDS_STRING (&a));
355 * g_value_set_static_string (&a, "Hello, world!");
356 * g_printf ("%s\n", g_value_get_string (&a));
358 * // Reset it to its pristine state
359 * g_value_unset (&a);
361 * // It can then be reused for another type
362 * g_value_init (&a, G_TYPE_INT);
363 * g_value_set_int (&a, 42);
365 * // Attempt to transform it into a GValue of type STRING
366 * g_value_init (&b, G_TYPE_STRING);
368 * // An INT is transformable to a STRING
369 * g_assert (g_value_type_transformable (G_TYPE_INT, G_TYPE_STRING));
371 * g_value_transform (&a, &b);
372 * g_printf ("%s\n", g_value_get_string (&b));
374 * // Attempt to transform it again using a custom transform function
375 * g_value_register_transform_func (G_TYPE_INT, G_TYPE_STRING, int2string);
376 * g_value_transform (&a, &b);
377 * g_printf ("%s\n", g_value_get_string (&b));
386 * @short_description: Metadata for parameter specifications
387 * @see_also: g_object_class_install_property(), g_object_set(),
388 * g_object_get(), g_object_set_property(), g_object_get_property(),
389 * g_value_register_transform_func()
392 * #GParamSpec is an object structure that encapsulates the metadata
393 * required to specify parameters, such as e.g. #GObject properties.
395 * ## Parameter names # {#canonical-parameter-names}
397 * Parameter names need to start with a letter (a-z or A-Z).
398 * Subsequent characters can be letters, numbers or a '-'.
399 * All other characters are replaced by a '-' during construction.
400 * The result of this replacement is called the canonical name of
407 * @short_description: The GLib Runtime type identification and
409 * @title: Type Information
411 * The GType API is the foundation of the GObject system. It provides the
412 * facilities for registering and managing all fundamental data types,
413 * user-defined object and interface types.
415 * For type creation and registration purposes, all types fall into one of
416 * two categories: static or dynamic. Static types are never loaded or
417 * unloaded at run-time as dynamic types may be. Static types are created
418 * with g_type_register_static() that gets type specific information passed
419 * in via a #GTypeInfo structure.
421 * Dynamic types are created with g_type_register_dynamic() which takes a
422 * #GTypePlugin structure instead. The remaining type information (the
423 * #GTypeInfo structure) is retrieved during runtime through #GTypePlugin
424 * and the g_type_plugin_*() API.
426 * These registration functions are usually called only once from a
427 * function whose only purpose is to return the type identifier for a
428 * specific class. Once the type (or class or interface) is registered,
429 * it may be instantiated, inherited, or implemented depending on exactly
430 * what sort of type it is.
432 * There is also a third registration function for registering fundamental
433 * types called g_type_register_fundamental() which requires both a #GTypeInfo
434 * structure and a #GTypeFundamentalInfo structure but it is seldom used
435 * since most fundamental types are predefined rather than user-defined.
437 * Type instance and class structs are limited to a total of 64 KiB,
438 * including all parent types. Similarly, type instances' private data
439 * (as created by g_type_class_add_private()) are limited to a total of
440 * 64 KiB. If a type instance needs a large static buffer, allocate it
441 * separately (typically by using #GArray or #GPtrArray) and put a pointer
442 * to the buffer in the structure.
444 * As mentioned in the [GType conventions][gtype-conventions], type names must
445 * be at least three characters long. There is no upper length limit. The first
446 * character must be a letter (a–z or A–Z) or an underscore (‘_’). Subsequent
447 * characters can be letters, numbers or any of ‘-_+’.
452 * SECTION:gtypemodule
453 * @short_description: Type loading modules
454 * @see_also: #GTypePlugin, #GModule
455 * @title: GTypeModule
457 * #GTypeModule provides a simple implementation of the #GTypePlugin
458 * interface. The model of #GTypeModule is a dynamically loaded module
459 * which implements some number of types and interface implementations.
460 * When the module is loaded, it registers its types and interfaces
461 * using g_type_module_register_type() and g_type_module_add_interface().
462 * As long as any instances of these types and interface implementations
463 * are in use, the module is kept loaded. When the types and interfaces
464 * are gone, the module may be unloaded. If the types and interfaces
465 * become used again, the module will be reloaded. Note that the last
466 * unref cannot happen in module code, since that would lead to the
467 * caller's code being unloaded before g_object_unref() returns to it.
469 * Keeping track of whether the module should be loaded or not is done by
470 * using a use count - it starts at zero, and whenever it is greater than
471 * zero, the module is loaded. The use count is maintained internally by
472 * the type system, but also can be explicitly controlled by
473 * g_type_module_use() and g_type_module_unuse(). Typically, when loading
474 * a module for the first type, g_type_module_use() will be used to load
475 * it so that it can initialize its types. At some later point, when the
476 * module no longer needs to be loaded except for the type
477 * implementations it contains, g_type_module_unuse() is called.
479 * #GTypeModule does not actually provide any implementation of module
480 * loading and unloading. To create a particular module type you must
481 * derive from #GTypeModule and implement the load and unload functions
482 * in #GTypeModuleClass.
487 * SECTION:gtypeplugin
488 * @short_description: An interface for dynamically loadable types
489 * @see_also: #GTypeModule and g_type_register_dynamic().
490 * @title: GTypePlugin
492 * The GObject type system supports dynamic loading of types.
493 * The #GTypePlugin interface is used to handle the lifecycle
494 * of dynamically loaded types. It goes as follows:
496 * 1. The type is initially introduced (usually upon loading the module
497 * the first time, or by your main application that knows what modules
498 * introduces what types), like this:
499 * |[<!-- language="C" -->
500 * new_type_id = g_type_register_dynamic (parent_type_id,
505 * where @new_type_plugin is an implementation of the
506 * #GTypePlugin interface.
508 * 2. The type's implementation is referenced, e.g. through
509 * g_type_class_ref() or through g_type_create_instance() (this is
510 * being called by g_object_new()) or through one of the above done on
511 * a type derived from @new_type_id.
513 * 3. This causes the type system to load the type's implementation by
514 * calling g_type_plugin_use() and g_type_plugin_complete_type_info()
515 * on @new_type_plugin.
517 * 4. At some point the type's implementation isn't required anymore,
518 * e.g. after g_type_class_unref() or g_type_free_instance() (called
519 * when the reference count of an instance drops to zero).
521 * 5. This causes the type system to throw away the information retrieved
522 * from g_type_plugin_complete_type_info() and then it calls
523 * g_type_plugin_unuse() on @new_type_plugin.
525 * 6. Things may repeat from the second step.
527 * So basically, you need to implement a #GTypePlugin type that
528 * carries a use_count, once use_count goes from zero to one, you need
529 * to load the implementation to successfully handle the upcoming
530 * g_type_plugin_complete_type_info() call. Later, maybe after
531 * succeeding use/unuse calls, once use_count drops to zero, you can
532 * unload the implementation again. The type system makes sure to call
533 * g_type_plugin_use() and g_type_plugin_complete_type_info() again
534 * when the type is needed again.
536 * #GTypeModule is an implementation of #GTypePlugin that already
537 * implements most of this except for the actual module loading and
538 * unloading. It even handles multiple registered types per module.
545 * @short_description: The base object type
546 * @see_also: #GParamSpecObject, g_param_spec_object()
548 * GObject is the fundamental type providing the common attributes and
549 * methods for all object types in GTK+, Pango and other libraries
550 * based on GObject. The GObject class provides methods for object
551 * construction and destruction, property access methods, and signal
552 * support. Signals are described in detail [here][gobject-Signals].
554 * For a tutorial on implementing a new GObject class, see [How to define and
555 * implement a new GObject][howto-gobject]. For a list of naming conventions for
556 * GObjects and their methods, see the [GType conventions][gtype-conventions].
557 * For the high-level concepts behind GObject, read [Instantiable classed types:
558 * Objects][gtype-instantiable-classed].
560 * ## Floating references # {#floating-ref}
562 * GInitiallyUnowned is derived from GObject. The only difference between
563 * the two is that the initial reference of a GInitiallyUnowned is flagged
564 * as a "floating" reference. This means that it is not specifically
565 * claimed to be "owned" by any code portion. The main motivation for
566 * providing floating references is C convenience. In particular, it
567 * allows code to be written as:
568 * |[<!-- language="C" -->
569 * container = create_container ();
570 * container_add_child (container, create_child());
572 * If container_add_child() calls g_object_ref_sink() on the passed-in child,
573 * no reference of the newly created child is leaked. Without floating
574 * references, container_add_child() can only g_object_ref() the new child,
575 * so to implement this code without reference leaks, it would have to be
577 * |[<!-- language="C" -->
579 * container = create_container ();
580 * child = create_child ();
581 * container_add_child (container, child);
582 * g_object_unref (child);
584 * The floating reference can be converted into an ordinary reference by
585 * calling g_object_ref_sink(). For already sunken objects (objects that
586 * don't have a floating reference anymore), g_object_ref_sink() is equivalent
587 * to g_object_ref() and returns a new reference.
589 * Since floating references are useful almost exclusively for C convenience,
590 * language bindings that provide automated reference and memory ownership
591 * maintenance (such as smart pointers or garbage collection) should not
592 * expose floating references in their API.
594 * Some object implementations may need to save an objects floating state
595 * across certain code portions (an example is #GtkMenu), to achieve this,
596 * the following sequence can be used:
598 * |[<!-- language="C" -->
599 * // save floating state
600 * gboolean was_floating = g_object_is_floating (object);
601 * g_object_ref_sink (object);
602 * // protected code portion
606 * // restore floating state
608 * g_object_force_floating (object);
610 * g_object_unref (object); // release previously acquired reference
616 * SECTION:param_value_types
617 * @short_description: Standard Parameter and Value Types
618 * @see_also: #GParamSpec, #GValue, g_object_class_install_property().
619 * @title: Parameters and Values
621 * #GValue provides an abstract container structure which can be
622 * copied, transformed and compared while holding a value of any
623 * (derived) type, which is registered as a #GType with a
624 * #GTypeValueTable in its #GTypeInfo structure. Parameter
625 * specifications for most value types can be created as #GParamSpec
626 * derived instances, to implement e.g. #GObject properties which
627 * operate on #GValue containers.
629 * Parameter names need to start with a letter (a-z or A-Z). Subsequent
630 * characters can be letters, numbers or a '-'.
631 * All other characters are replaced by a '-' during construction.
637 * @short_description: A means for customization of object behaviour
638 * and a general purpose notification mechanism
641 * The basic concept of the signal system is that of the emission
642 * of a signal. Signals are introduced per-type and are identified
643 * through strings. Signals introduced for a parent type are available
644 * in derived types as well, so basically they are a per-type facility
647 * A signal emission mainly involves invocation of a certain set of
648 * callbacks in precisely defined manner. There are two main categories
649 * of such callbacks, per-object ones and user provided ones.
650 * (Although signals can deal with any kind of instantiatable type, I'm
651 * referring to those types as "object types" in the following, simply
652 * because that is the context most users will encounter signals in.)
653 * The per-object callbacks are most often referred to as "object method
654 * handler" or "default (signal) handler", while user provided callbacks are
655 * usually just called "signal handler".
657 * The object method handler is provided at signal creation time (this most
658 * frequently happens at the end of an object class' creation), while user
659 * provided handlers are frequently connected and disconnected to/from a
660 * certain signal on certain object instances.
662 * A signal emission consists of five stages, unless prematurely stopped:
664 * 1. Invocation of the object method handler for %G_SIGNAL_RUN_FIRST signals
666 * 2. Invocation of normal user-provided signal handlers (where the @after
669 * 3. Invocation of the object method handler for %G_SIGNAL_RUN_LAST signals
671 * 4. Invocation of user provided signal handlers (where the @after flag is set)
673 * 5. Invocation of the object method handler for %G_SIGNAL_RUN_CLEANUP signals
675 * The user-provided signal handlers are called in the order they were
678 * All handlers may prematurely stop a signal emission, and any number of
679 * handlers may be connected, disconnected, blocked or unblocked during
682 * There are certain criteria for skipping user handlers in stages 2 and 4
683 * of a signal emission.
685 * First, user handlers may be blocked. Blocked handlers are omitted during
686 * callback invocation, to return from the blocked state, a handler has to
687 * get unblocked exactly the same amount of times it has been blocked before.
689 * Second, upon emission of a %G_SIGNAL_DETAILED signal, an additional
690 * @detail argument passed in to g_signal_emit() has to match the detail
691 * argument of the signal handler currently subject to invocation.
692 * Specification of no detail argument for signal handlers (omission of the
693 * detail part of the signal specification upon connection) serves as a
694 * wildcard and matches any detail argument passed in to emission.
696 * ## Memory management of signal handlers # {#signal-memory-management}
698 * If you are connecting handlers to signals and using a #GObject instance as
699 * your signal handler user data, you should remember to pair calls to
700 * g_signal_connect() with calls to g_signal_handler_disconnect() or
701 * g_signal_handlers_disconnect_by_func(). While signal handlers are
702 * automatically disconnected when the object emitting the signal is finalised,
703 * they are not automatically disconnected when the signal handler user data is
704 * destroyed. If this user data is a #GObject instance, using it from a
705 * signal handler after it has been finalised is an error.
707 * There are two strategies for managing such user data. The first is to
708 * disconnect the signal handler (using g_signal_handler_disconnect() or
709 * g_signal_handlers_disconnect_by_func()) when the user data (object) is
710 * finalised; this has to be implemented manually. For non-threaded programs,
711 * g_signal_connect_object() can be used to implement this automatically.
712 * Currently, however, it is unsafe to use in threaded programs.
714 * The second is to hold a strong reference on the user data until after the
715 * signal is disconnected for other reasons. This can be implemented
716 * automatically using g_signal_connect_data().
718 * The first approach is recommended, as the second approach can result in
719 * effective memory leaks of the user data if the signal handler is never
720 * disconnected for some reason.
725 * SECTION:value_arrays
726 * @short_description: A container structure to maintain an array of
728 * @see_also: #GValue, #GParamSpecValueArray, g_param_spec_value_array()
729 * @title: Value arrays
731 * The prime purpose of a #GValueArray is for it to be used as an
732 * object property that holds an array of values. A #GValueArray wraps
733 * an array of #GValue elements in order for it to be used as a boxed
734 * type through %G_TYPE_VALUE_ARRAY.
736 * #GValueArray is deprecated in favour of #GArray since GLib 2.32. It
737 * is possible to create a #GArray that behaves like a #GValueArray by
738 * using the size of #GValue as the element size, and by setting
739 * g_value_unset() as the clear function using g_array_set_clear_func(),
740 * for instance, the following code:
742 * |[<!-- language="C" -->
743 * GValueArray *array = g_value_array_new (10);
746 * can be replaced by:
748 * |[<!-- language="C" -->
749 * GArray *array = g_array_sized_new (FALSE, TRUE, sizeof (GValue), 10);
750 * g_array_set_clear_func (array, (GDestroyNotify) g_value_unset);
756 * g_binding_get_flags:
757 * @binding: a #GBinding
759 * Retrieves the flags passed when constructing the #GBinding.
761 * Returns: the #GBindingFlags used by the #GBinding
767 * g_binding_get_source:
768 * @binding: a #GBinding
770 * Retrieves the #GObject instance used as the source of the binding.
772 * Returns: (transfer none): the source #GObject
778 * g_binding_get_source_property:
779 * @binding: a #GBinding
781 * Retrieves the name of the property of #GBinding:source used as the source
784 * Returns: the name of the source property
790 * g_binding_get_target:
791 * @binding: a #GBinding
793 * Retrieves the #GObject instance used as the target of the binding.
795 * Returns: (transfer none): the target #GObject
801 * g_binding_get_target_property:
802 * @binding: a #GBinding
804 * Retrieves the name of the property of #GBinding:target used as the target
807 * Returns: the name of the target property
814 * @binding: a #GBinding
816 * Explicitly releases the binding between the source and the target
817 * property expressed by @binding.
819 * This function will release the reference that is being held on
820 * the @binding instance; if you want to hold on to the #GBinding instance
821 * after calling g_binding_unbind(), you will need to hold a reference
830 * @boxed_type: The type of @src_boxed.
831 * @src_boxed: (not nullable): The boxed structure to be copied.
833 * Provide a copy of a boxed structure @src_boxed which is of type @boxed_type.
835 * Returns: (transfer full) (not nullable): The newly created copy of the boxed
842 * @boxed_type: The type of @boxed.
843 * @boxed: (not nullable): The boxed structure to be freed.
845 * Free the boxed structure @boxed which is of type @boxed_type.
850 * g_boxed_type_register_static:
851 * @name: Name of the new boxed type.
852 * @boxed_copy: Boxed structure copy function.
853 * @boxed_free: Boxed structure free function.
855 * This function creates a new %G_TYPE_BOXED derived type id for a new
856 * boxed type with name @name. Boxed type handling functions have to be
857 * provided to copy and free opaque boxed structures of this type.
859 * Returns: New %G_TYPE_BOXED derived type id for @name.
864 * g_cclosure_marshal_BOOLEAN__BOXED_BOXED:
865 * @closure: A #GClosure.
866 * @return_value: A #GValue to store the return value. May be %NULL
867 * if the callback of closure doesn't return a value.
868 * @n_param_values: The length of the @param_values array.
869 * @param_values: An array of #GValues holding the arguments
870 * on which to invoke the callback of closure.
871 * @invocation_hint: The invocation hint given as the last argument to
872 * g_closure_invoke().
873 * @marshal_data: Additional data specified when registering the
874 * marshaller, see g_closure_set_marshal() and
875 * g_closure_set_meta_marshal()
877 * A #GClosureMarshal function for use with signals with handlers that
878 * take two boxed pointers as arguments and return a boolean. If you
879 * have such a signal, you will probably also need to use an
880 * accumulator, such as g_signal_accumulator_true_handled().
885 * g_cclosure_marshal_BOOLEAN__BOXED_BOXEDv:
886 * @closure: the #GClosure to which the marshaller belongs
887 * @return_value: (allow-none): a #GValue to store the return
888 * value. May be %NULL if the callback of @closure doesn't return a
890 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
891 * @args: va_list of arguments to be passed to the closure.
892 * @marshal_data: (allow-none): additional data specified when
893 * registering the marshaller, see g_closure_set_marshal() and
894 * g_closure_set_meta_marshal()
895 * @n_params: the length of the @param_types array
896 * @param_types: (array length=n_params): the #GType of each argument from
899 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_BOOLEAN__BOXED_BOXED().
904 * g_cclosure_marshal_BOOLEAN__FLAGS:
905 * @closure: A #GClosure.
906 * @return_value: A #GValue to store the return value. May be %NULL
907 * if the callback of closure doesn't return a value.
908 * @n_param_values: The length of the @param_values array.
909 * @param_values: An array of #GValues holding the arguments
910 * on which to invoke the callback of closure.
911 * @invocation_hint: The invocation hint given as the last argument to
912 * g_closure_invoke().
913 * @marshal_data: Additional data specified when registering the
914 * marshaller, see g_closure_set_marshal() and
915 * g_closure_set_meta_marshal()
917 * A #GClosureMarshal function for use with signals with handlers that
918 * take a flags type as an argument and return a boolean. If you have
919 * such a signal, you will probably also need to use an accumulator,
920 * such as g_signal_accumulator_true_handled().
925 * g_cclosure_marshal_BOOLEAN__FLAGSv:
926 * @closure: the #GClosure to which the marshaller belongs
927 * @return_value: (allow-none): a #GValue to store the return
928 * value. May be %NULL if the callback of @closure doesn't return a
930 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
931 * @args: va_list of arguments to be passed to the closure.
932 * @marshal_data: (allow-none): additional data specified when
933 * registering the marshaller, see g_closure_set_marshal() and
934 * g_closure_set_meta_marshal()
935 * @n_params: the length of the @param_types array
936 * @param_types: (array length=n_params): the #GType of each argument from
939 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_BOOLEAN__FLAGS().
944 * g_cclosure_marshal_BOOLEAN__OBJECT_BOXED_BOXED:
945 * @closure: the #GClosure to which the marshaller belongs
946 * @return_value: a #GValue, which can store the returned string
948 * @param_values: a #GValue array holding instance, arg1 and arg2
949 * @invocation_hint: the invocation hint given as the last argument
950 * to g_closure_invoke()
951 * @marshal_data: additional data specified when registering the marshaller
953 * A marshaller for a #GCClosure with a callback of type
954 * `gboolean (*callback) (gpointer instance, GBoxed *arg1, GBoxed *arg2, gpointer user_data)`.
961 * g_cclosure_marshal_BOOL__BOXED_BOXED:
962 * @closure: A #GClosure.
963 * @return_value: A #GValue to store the return value. May be %NULL
964 * if the callback of closure doesn't return a value.
965 * @n_param_values: The length of the @param_values array.
966 * @param_values: An array of #GValues holding the arguments
967 * on which to invoke the callback of closure.
968 * @invocation_hint: The invocation hint given as the last argument to
969 * g_closure_invoke().
970 * @marshal_data: Additional data specified when registering the
971 * marshaller, see g_closure_set_marshal() and
972 * g_closure_set_meta_marshal()
974 * An old alias for g_cclosure_marshal_BOOLEAN__BOXED_BOXED().
979 * g_cclosure_marshal_BOOL__FLAGS:
980 * @closure: A #GClosure.
981 * @return_value: A #GValue to store the return value. May be %NULL
982 * if the callback of closure doesn't return a value.
983 * @n_param_values: The length of the @param_values array.
984 * @param_values: An array of #GValues holding the arguments
985 * on which to invoke the callback of closure.
986 * @invocation_hint: The invocation hint given as the last argument to
987 * g_closure_invoke().
988 * @marshal_data: Additional data specified when registering the
989 * marshaller, see g_closure_set_marshal() and
990 * g_closure_set_meta_marshal()
992 * An old alias for g_cclosure_marshal_BOOLEAN__FLAGS().
997 * g_cclosure_marshal_STRING__OBJECT_POINTER:
998 * @closure: A #GClosure.
999 * @return_value: A #GValue to store the return value. May be %NULL
1000 * if the callback of closure doesn't return a value.
1001 * @n_param_values: The length of the @param_values array.
1002 * @param_values: An array of #GValues holding the arguments
1003 * on which to invoke the callback of closure.
1004 * @invocation_hint: The invocation hint given as the last argument to
1005 * g_closure_invoke().
1006 * @marshal_data: Additional data specified when registering the
1007 * marshaller, see g_closure_set_marshal() and
1008 * g_closure_set_meta_marshal()
1010 * A #GClosureMarshal function for use with signals with handlers that
1011 * take a #GObject and a pointer and produce a string. It is highly
1012 * unlikely that your signal handler fits this description.
1017 * g_cclosure_marshal_STRING__OBJECT_POINTERv:
1018 * @closure: the #GClosure to which the marshaller belongs
1019 * @return_value: (allow-none): a #GValue to store the return
1020 * value. May be %NULL if the callback of @closure doesn't return a
1022 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1023 * @args: va_list of arguments to be passed to the closure.
1024 * @marshal_data: (allow-none): additional data specified when
1025 * registering the marshaller, see g_closure_set_marshal() and
1026 * g_closure_set_meta_marshal()
1027 * @n_params: the length of the @param_types array
1028 * @param_types: (array length=n_params): the #GType of each argument from
1031 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_STRING__OBJECT_POINTER().
1036 * g_cclosure_marshal_VOID__BOOLEAN:
1037 * @closure: A #GClosure.
1038 * @return_value: A #GValue to store the return value. May be %NULL
1039 * if the callback of closure doesn't return a value.
1040 * @n_param_values: The length of the @param_values array.
1041 * @param_values: An array of #GValues holding the arguments
1042 * on which to invoke the callback of closure.
1043 * @invocation_hint: The invocation hint given as the last argument to
1044 * g_closure_invoke().
1045 * @marshal_data: Additional data specified when registering the
1046 * marshaller, see g_closure_set_marshal() and
1047 * g_closure_set_meta_marshal()
1049 * A #GClosureMarshal function for use with signals with a single
1055 * g_cclosure_marshal_VOID__BOOLEANv:
1056 * @closure: the #GClosure to which the marshaller belongs
1057 * @return_value: (allow-none): a #GValue to store the return
1058 * value. May be %NULL if the callback of @closure doesn't return a
1060 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1061 * @args: va_list of arguments to be passed to the closure.
1062 * @marshal_data: (allow-none): additional data specified when
1063 * registering the marshaller, see g_closure_set_marshal() and
1064 * g_closure_set_meta_marshal()
1065 * @n_params: the length of the @param_types array
1066 * @param_types: (array length=n_params): the #GType of each argument from
1069 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__BOOLEAN().
1074 * g_cclosure_marshal_VOID__BOXED:
1075 * @closure: A #GClosure.
1076 * @return_value: A #GValue to store the return value. May be %NULL
1077 * if the callback of closure doesn't return a value.
1078 * @n_param_values: The length of the @param_values array.
1079 * @param_values: An array of #GValues holding the arguments
1080 * on which to invoke the callback of closure.
1081 * @invocation_hint: The invocation hint given as the last argument to
1082 * g_closure_invoke().
1083 * @marshal_data: Additional data specified when registering the
1084 * marshaller, see g_closure_set_marshal() and
1085 * g_closure_set_meta_marshal()
1087 * A #GClosureMarshal function for use with signals with a single
1088 * argument which is any boxed pointer type.
1093 * g_cclosure_marshal_VOID__BOXEDv:
1094 * @closure: the #GClosure to which the marshaller belongs
1095 * @return_value: (allow-none): a #GValue to store the return
1096 * value. May be %NULL if the callback of @closure doesn't return a
1098 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1099 * @args: va_list of arguments to be passed to the closure.
1100 * @marshal_data: (allow-none): additional data specified when
1101 * registering the marshaller, see g_closure_set_marshal() and
1102 * g_closure_set_meta_marshal()
1103 * @n_params: the length of the @param_types array
1104 * @param_types: (array length=n_params): the #GType of each argument from
1107 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__BOXED().
1112 * g_cclosure_marshal_VOID__CHAR:
1113 * @closure: A #GClosure.
1114 * @return_value: A #GValue to store the return value. May be %NULL
1115 * if the callback of closure doesn't return a value.
1116 * @n_param_values: The length of the @param_values array.
1117 * @param_values: An array of #GValues holding the arguments
1118 * on which to invoke the callback of closure.
1119 * @invocation_hint: The invocation hint given as the last argument to
1120 * g_closure_invoke().
1121 * @marshal_data: Additional data specified when registering the
1122 * marshaller, see g_closure_set_marshal() and
1123 * g_closure_set_meta_marshal()
1125 * A #GClosureMarshal function for use with signals with a single
1126 * character argument.
1131 * g_cclosure_marshal_VOID__CHARv:
1132 * @closure: the #GClosure to which the marshaller belongs
1133 * @return_value: (allow-none): a #GValue to store the return
1134 * value. May be %NULL if the callback of @closure doesn't return a
1136 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1137 * @args: va_list of arguments to be passed to the closure.
1138 * @marshal_data: (allow-none): additional data specified when
1139 * registering the marshaller, see g_closure_set_marshal() and
1140 * g_closure_set_meta_marshal()
1141 * @n_params: the length of the @param_types array
1142 * @param_types: (array length=n_params): the #GType of each argument from
1145 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__CHAR().
1150 * g_cclosure_marshal_VOID__DOUBLE:
1151 * @closure: A #GClosure.
1152 * @return_value: A #GValue to store the return value. May be %NULL
1153 * if the callback of closure doesn't return a value.
1154 * @n_param_values: The length of the @param_values array.
1155 * @param_values: An array of #GValues holding the arguments
1156 * on which to invoke the callback of closure.
1157 * @invocation_hint: The invocation hint given as the last argument to
1158 * g_closure_invoke().
1159 * @marshal_data: Additional data specified when registering the
1160 * marshaller, see g_closure_set_marshal() and
1161 * g_closure_set_meta_marshal()
1163 * A #GClosureMarshal function for use with signals with one
1164 * double-precision floating point argument.
1169 * g_cclosure_marshal_VOID__DOUBLEv:
1170 * @closure: the #GClosure to which the marshaller belongs
1171 * @return_value: (allow-none): a #GValue to store the return
1172 * value. May be %NULL if the callback of @closure doesn't return a
1174 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1175 * @args: va_list of arguments to be passed to the closure.
1176 * @marshal_data: (allow-none): additional data specified when
1177 * registering the marshaller, see g_closure_set_marshal() and
1178 * g_closure_set_meta_marshal()
1179 * @n_params: the length of the @param_types array
1180 * @param_types: (array length=n_params): the #GType of each argument from
1183 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__DOUBLE().
1188 * g_cclosure_marshal_VOID__ENUM:
1189 * @closure: A #GClosure.
1190 * @return_value: A #GValue to store the return value. May be %NULL
1191 * if the callback of closure doesn't return a value.
1192 * @n_param_values: The length of the @param_values array.
1193 * @param_values: An array of #GValues holding the arguments
1194 * on which to invoke the callback of closure.
1195 * @invocation_hint: The invocation hint given as the last argument to
1196 * g_closure_invoke().
1197 * @marshal_data: Additional data specified when registering the
1198 * marshaller, see g_closure_set_marshal() and
1199 * g_closure_set_meta_marshal()
1201 * A #GClosureMarshal function for use with signals with a single
1202 * argument with an enumerated type.
1207 * g_cclosure_marshal_VOID__ENUMv:
1208 * @closure: the #GClosure to which the marshaller belongs
1209 * @return_value: (allow-none): a #GValue to store the return
1210 * value. May be %NULL if the callback of @closure doesn't return a
1212 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1213 * @args: va_list of arguments to be passed to the closure.
1214 * @marshal_data: (allow-none): additional data specified when
1215 * registering the marshaller, see g_closure_set_marshal() and
1216 * g_closure_set_meta_marshal()
1217 * @n_params: the length of the @param_types array
1218 * @param_types: (array length=n_params): the #GType of each argument from
1221 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__ENUM().
1226 * g_cclosure_marshal_VOID__FLAGS:
1227 * @closure: A #GClosure.
1228 * @return_value: A #GValue to store the return value. May be %NULL
1229 * if the callback of closure doesn't return a value.
1230 * @n_param_values: The length of the @param_values array.
1231 * @param_values: An array of #GValues holding the arguments
1232 * on which to invoke the callback of closure.
1233 * @invocation_hint: The invocation hint given as the last argument to
1234 * g_closure_invoke().
1235 * @marshal_data: Additional data specified when registering the
1236 * marshaller, see g_closure_set_marshal() and
1237 * g_closure_set_meta_marshal()
1239 * A #GClosureMarshal function for use with signals with a single
1240 * argument with a flags types.
1245 * g_cclosure_marshal_VOID__FLAGSv:
1246 * @closure: the #GClosure to which the marshaller belongs
1247 * @return_value: (allow-none): a #GValue to store the return
1248 * value. May be %NULL if the callback of @closure doesn't return a
1250 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1251 * @args: va_list of arguments to be passed to the closure.
1252 * @marshal_data: (allow-none): additional data specified when
1253 * registering the marshaller, see g_closure_set_marshal() and
1254 * g_closure_set_meta_marshal()
1255 * @n_params: the length of the @param_types array
1256 * @param_types: (array length=n_params): the #GType of each argument from
1259 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__FLAGS().
1264 * g_cclosure_marshal_VOID__FLOAT:
1265 * @closure: A #GClosure.
1266 * @return_value: A #GValue to store the return value. May be %NULL
1267 * if the callback of closure doesn't return a value.
1268 * @n_param_values: The length of the @param_values array.
1269 * @param_values: An array of #GValues holding the arguments
1270 * on which to invoke the callback of closure.
1271 * @invocation_hint: The invocation hint given as the last argument to
1272 * g_closure_invoke().
1273 * @marshal_data: Additional data specified when registering the
1274 * marshaller, see g_closure_set_marshal() and
1275 * g_closure_set_meta_marshal()
1277 * A #GClosureMarshal function for use with signals with one
1278 * single-precision floating point argument.
1283 * g_cclosure_marshal_VOID__FLOATv:
1284 * @closure: the #GClosure to which the marshaller belongs
1285 * @return_value: (allow-none): a #GValue to store the return
1286 * value. May be %NULL if the callback of @closure doesn't return a
1288 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1289 * @args: va_list of arguments to be passed to the closure.
1290 * @marshal_data: (allow-none): additional data specified when
1291 * registering the marshaller, see g_closure_set_marshal() and
1292 * g_closure_set_meta_marshal()
1293 * @n_params: the length of the @param_types array
1294 * @param_types: (array length=n_params): the #GType of each argument from
1297 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__FLOAT().
1302 * g_cclosure_marshal_VOID__INT:
1303 * @closure: A #GClosure.
1304 * @return_value: A #GValue to store the return value. May be %NULL
1305 * if the callback of closure doesn't return a value.
1306 * @n_param_values: The length of the @param_values array.
1307 * @param_values: An array of #GValues holding the arguments
1308 * on which to invoke the callback of closure.
1309 * @invocation_hint: The invocation hint given as the last argument to
1310 * g_closure_invoke().
1311 * @marshal_data: Additional data specified when registering the
1312 * marshaller, see g_closure_set_marshal() and
1313 * g_closure_set_meta_marshal()
1315 * A #GClosureMarshal function for use with signals with a single
1321 * g_cclosure_marshal_VOID__INTv:
1322 * @closure: the #GClosure to which the marshaller belongs
1323 * @return_value: (allow-none): a #GValue to store the return
1324 * value. May be %NULL if the callback of @closure doesn't return a
1326 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1327 * @args: va_list of arguments to be passed to the closure.
1328 * @marshal_data: (allow-none): additional data specified when
1329 * registering the marshaller, see g_closure_set_marshal() and
1330 * g_closure_set_meta_marshal()
1331 * @n_params: the length of the @param_types array
1332 * @param_types: (array length=n_params): the #GType of each argument from
1335 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__INT().
1340 * g_cclosure_marshal_VOID__LONG:
1341 * @closure: A #GClosure.
1342 * @return_value: A #GValue to store the return value. May be %NULL
1343 * if the callback of closure doesn't return a value.
1344 * @n_param_values: The length of the @param_values array.
1345 * @param_values: An array of #GValues holding the arguments
1346 * on which to invoke the callback of closure.
1347 * @invocation_hint: The invocation hint given as the last argument to
1348 * g_closure_invoke().
1349 * @marshal_data: Additional data specified when registering the
1350 * marshaller, see g_closure_set_marshal() and
1351 * g_closure_set_meta_marshal()
1353 * A #GClosureMarshal function for use with signals with with a single
1354 * long integer argument.
1359 * g_cclosure_marshal_VOID__LONGv:
1360 * @closure: the #GClosure to which the marshaller belongs
1361 * @return_value: (allow-none): a #GValue to store the return
1362 * value. May be %NULL if the callback of @closure doesn't return a
1364 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1365 * @args: va_list of arguments to be passed to the closure.
1366 * @marshal_data: (allow-none): additional data specified when
1367 * registering the marshaller, see g_closure_set_marshal() and
1368 * g_closure_set_meta_marshal()
1369 * @n_params: the length of the @param_types array
1370 * @param_types: (array length=n_params): the #GType of each argument from
1373 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__LONG().
1378 * g_cclosure_marshal_VOID__OBJECT:
1379 * @closure: A #GClosure.
1380 * @return_value: A #GValue to store the return value. May be %NULL
1381 * if the callback of closure doesn't return a value.
1382 * @n_param_values: The length of the @param_values array.
1383 * @param_values: An array of #GValues holding the arguments
1384 * on which to invoke the callback of closure.
1385 * @invocation_hint: The invocation hint given as the last argument to
1386 * g_closure_invoke().
1387 * @marshal_data: Additional data specified when registering the
1388 * marshaller, see g_closure_set_marshal() and
1389 * g_closure_set_meta_marshal()
1391 * A #GClosureMarshal function for use with signals with a single
1392 * #GObject argument.
1397 * g_cclosure_marshal_VOID__OBJECTv:
1398 * @closure: the #GClosure to which the marshaller belongs
1399 * @return_value: (allow-none): a #GValue to store the return
1400 * value. May be %NULL if the callback of @closure doesn't return a
1402 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1403 * @args: va_list of arguments to be passed to the closure.
1404 * @marshal_data: (allow-none): additional data specified when
1405 * registering the marshaller, see g_closure_set_marshal() and
1406 * g_closure_set_meta_marshal()
1407 * @n_params: the length of the @param_types array
1408 * @param_types: (array length=n_params): the #GType of each argument from
1411 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__OBJECT().
1416 * g_cclosure_marshal_VOID__PARAM:
1417 * @closure: A #GClosure.
1418 * @return_value: A #GValue to store the return value. May be %NULL
1419 * if the callback of closure doesn't return a value.
1420 * @n_param_values: The length of the @param_values array.
1421 * @param_values: An array of #GValues holding the arguments
1422 * on which to invoke the callback of closure.
1423 * @invocation_hint: The invocation hint given as the last argument to
1424 * g_closure_invoke().
1425 * @marshal_data: Additional data specified when registering the
1426 * marshaller, see g_closure_set_marshal() and
1427 * g_closure_set_meta_marshal()
1429 * A #GClosureMarshal function for use with signals with a single
1430 * argument of type #GParamSpec.
1435 * g_cclosure_marshal_VOID__PARAMv:
1436 * @closure: the #GClosure to which the marshaller belongs
1437 * @return_value: (allow-none): a #GValue to store the return
1438 * value. May be %NULL if the callback of @closure doesn't return a
1440 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1441 * @args: va_list of arguments to be passed to the closure.
1442 * @marshal_data: (allow-none): additional data specified when
1443 * registering the marshaller, see g_closure_set_marshal() and
1444 * g_closure_set_meta_marshal()
1445 * @n_params: the length of the @param_types array
1446 * @param_types: (array length=n_params): the #GType of each argument from
1449 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__PARAM().
1454 * g_cclosure_marshal_VOID__POINTER:
1455 * @closure: A #GClosure.
1456 * @return_value: A #GValue to store the return value. May be %NULL
1457 * if the callback of closure doesn't return a value.
1458 * @n_param_values: The length of the @param_values array.
1459 * @param_values: An array of #GValues holding the arguments
1460 * on which to invoke the callback of closure.
1461 * @invocation_hint: The invocation hint given as the last argument to
1462 * g_closure_invoke().
1463 * @marshal_data: Additional data specified when registering the
1464 * marshaller, see g_closure_set_marshal() and
1465 * g_closure_set_meta_marshal()
1467 * A #GClosureMarshal function for use with signals with a single raw
1468 * pointer argument type.
1470 * If it is possible, it is better to use one of the more specific
1471 * functions such as g_cclosure_marshal_VOID__OBJECT() or
1472 * g_cclosure_marshal_VOID__OBJECT().
1477 * g_cclosure_marshal_VOID__POINTERv:
1478 * @closure: the #GClosure to which the marshaller belongs
1479 * @return_value: (allow-none): a #GValue to store the return
1480 * value. May be %NULL if the callback of @closure doesn't return a
1482 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1483 * @args: va_list of arguments to be passed to the closure.
1484 * @marshal_data: (allow-none): additional data specified when
1485 * registering the marshaller, see g_closure_set_marshal() and
1486 * g_closure_set_meta_marshal()
1487 * @n_params: the length of the @param_types array
1488 * @param_types: (array length=n_params): the #GType of each argument from
1491 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__POINTER().
1496 * g_cclosure_marshal_VOID__STRING:
1497 * @closure: A #GClosure.
1498 * @return_value: A #GValue to store the return value. May be %NULL
1499 * if the callback of closure doesn't return a value.
1500 * @n_param_values: The length of the @param_values array.
1501 * @param_values: An array of #GValues holding the arguments
1502 * on which to invoke the callback of closure.
1503 * @invocation_hint: The invocation hint given as the last argument to
1504 * g_closure_invoke().
1505 * @marshal_data: Additional data specified when registering the
1506 * marshaller, see g_closure_set_marshal() and
1507 * g_closure_set_meta_marshal()
1509 * A #GClosureMarshal function for use with signals with a single string
1515 * g_cclosure_marshal_VOID__STRINGv:
1516 * @closure: the #GClosure to which the marshaller belongs
1517 * @return_value: (allow-none): a #GValue to store the return
1518 * value. May be %NULL if the callback of @closure doesn't return a
1520 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1521 * @args: va_list of arguments to be passed to the closure.
1522 * @marshal_data: (allow-none): additional data specified when
1523 * registering the marshaller, see g_closure_set_marshal() and
1524 * g_closure_set_meta_marshal()
1525 * @n_params: the length of the @param_types array
1526 * @param_types: (array length=n_params): the #GType of each argument from
1529 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__STRING().
1534 * g_cclosure_marshal_VOID__UCHAR:
1535 * @closure: A #GClosure.
1536 * @return_value: A #GValue to store the return value. May be %NULL
1537 * if the callback of closure doesn't return a value.
1538 * @n_param_values: The length of the @param_values array.
1539 * @param_values: An array of #GValues holding the arguments
1540 * on which to invoke the callback of closure.
1541 * @invocation_hint: The invocation hint given as the last argument to
1542 * g_closure_invoke().
1543 * @marshal_data: Additional data specified when registering the
1544 * marshaller, see g_closure_set_marshal() and
1545 * g_closure_set_meta_marshal()
1547 * A #GClosureMarshal function for use with signals with a single
1548 * unsigned character argument.
1553 * g_cclosure_marshal_VOID__UCHARv:
1554 * @closure: the #GClosure to which the marshaller belongs
1555 * @return_value: (allow-none): a #GValue to store the return
1556 * value. May be %NULL if the callback of @closure doesn't return a
1558 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1559 * @args: va_list of arguments to be passed to the closure.
1560 * @marshal_data: (allow-none): additional data specified when
1561 * registering the marshaller, see g_closure_set_marshal() and
1562 * g_closure_set_meta_marshal()
1563 * @n_params: the length of the @param_types array
1564 * @param_types: (array length=n_params): the #GType of each argument from
1567 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__UCHAR().
1572 * g_cclosure_marshal_VOID__UINT:
1573 * @closure: A #GClosure.
1574 * @return_value: A #GValue to store the return value. May be %NULL
1575 * if the callback of closure doesn't return a value.
1576 * @n_param_values: The length of the @param_values array.
1577 * @param_values: An array of #GValues holding the arguments
1578 * on which to invoke the callback of closure.
1579 * @invocation_hint: The invocation hint given as the last argument to
1580 * g_closure_invoke().
1581 * @marshal_data: Additional data specified when registering the
1582 * marshaller, see g_closure_set_marshal() and
1583 * g_closure_set_meta_marshal()
1585 * A #GClosureMarshal function for use with signals with with a single
1586 * unsigned integer argument.
1591 * g_cclosure_marshal_VOID__UINT_POINTER:
1592 * @closure: A #GClosure.
1593 * @return_value: A #GValue to store the return value. May be %NULL
1594 * if the callback of closure doesn't return a value.
1595 * @n_param_values: The length of the @param_values array.
1596 * @param_values: An array of #GValues holding the arguments
1597 * on which to invoke the callback of closure.
1598 * @invocation_hint: The invocation hint given as the last argument to
1599 * g_closure_invoke().
1600 * @marshal_data: Additional data specified when registering the
1601 * marshaller, see g_closure_set_marshal() and
1602 * g_closure_set_meta_marshal()
1604 * A #GClosureMarshal function for use with signals with a unsigned int
1605 * and a pointer as arguments.
1610 * g_cclosure_marshal_VOID__UINT_POINTERv:
1611 * @closure: the #GClosure to which the marshaller belongs
1612 * @return_value: (allow-none): a #GValue to store the return
1613 * value. May be %NULL if the callback of @closure doesn't return a
1615 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1616 * @args: va_list of arguments to be passed to the closure.
1617 * @marshal_data: (allow-none): additional data specified when
1618 * registering the marshaller, see g_closure_set_marshal() and
1619 * g_closure_set_meta_marshal()
1620 * @n_params: the length of the @param_types array
1621 * @param_types: (array length=n_params): the #GType of each argument from
1624 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__UINT_POINTER().
1629 * g_cclosure_marshal_VOID__UINTv:
1630 * @closure: the #GClosure to which the marshaller belongs
1631 * @return_value: (allow-none): a #GValue to store the return
1632 * value. May be %NULL if the callback of @closure doesn't return a
1634 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1635 * @args: va_list of arguments to be passed to the closure.
1636 * @marshal_data: (allow-none): additional data specified when
1637 * registering the marshaller, see g_closure_set_marshal() and
1638 * g_closure_set_meta_marshal()
1639 * @n_params: the length of the @param_types array
1640 * @param_types: (array length=n_params): the #GType of each argument from
1643 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__UINT().
1648 * g_cclosure_marshal_VOID__ULONG:
1649 * @closure: A #GClosure.
1650 * @return_value: A #GValue to store the return value. May be %NULL
1651 * if the callback of closure doesn't return a value.
1652 * @n_param_values: The length of the @param_values array.
1653 * @param_values: An array of #GValues holding the arguments
1654 * on which to invoke the callback of closure.
1655 * @invocation_hint: The invocation hint given as the last argument to
1656 * g_closure_invoke().
1657 * @marshal_data: Additional data specified when registering the
1658 * marshaller, see g_closure_set_marshal() and
1659 * g_closure_set_meta_marshal()
1661 * A #GClosureMarshal function for use with signals with a single
1662 * unsigned long integer argument.
1667 * g_cclosure_marshal_VOID__ULONGv:
1668 * @closure: the #GClosure to which the marshaller belongs
1669 * @return_value: (allow-none): a #GValue to store the return
1670 * value. May be %NULL if the callback of @closure doesn't return a
1672 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1673 * @args: va_list of arguments to be passed to the closure.
1674 * @marshal_data: (allow-none): additional data specified when
1675 * registering the marshaller, see g_closure_set_marshal() and
1676 * g_closure_set_meta_marshal()
1677 * @n_params: the length of the @param_types array
1678 * @param_types: (array length=n_params): the #GType of each argument from
1681 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__ULONG().
1686 * g_cclosure_marshal_VOID__VARIANT:
1687 * @closure: A #GClosure.
1688 * @return_value: A #GValue to store the return value. May be %NULL
1689 * if the callback of closure doesn't return a value.
1690 * @n_param_values: The length of the @param_values array.
1691 * @param_values: An array of #GValues holding the arguments
1692 * on which to invoke the callback of closure.
1693 * @invocation_hint: The invocation hint given as the last argument to
1694 * g_closure_invoke().
1695 * @marshal_data: Additional data specified when registering the
1696 * marshaller, see g_closure_set_marshal() and
1697 * g_closure_set_meta_marshal()
1699 * A #GClosureMarshal function for use with signals with a single
1700 * #GVariant argument.
1705 * g_cclosure_marshal_VOID__VARIANTv:
1706 * @closure: the #GClosure to which the marshaller belongs
1707 * @return_value: (allow-none): a #GValue to store the return
1708 * value. May be %NULL if the callback of @closure doesn't return a
1710 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1711 * @args: va_list of arguments to be passed to the closure.
1712 * @marshal_data: (allow-none): additional data specified when
1713 * registering the marshaller, see g_closure_set_marshal() and
1714 * g_closure_set_meta_marshal()
1715 * @n_params: the length of the @param_types array
1716 * @param_types: (array length=n_params): the #GType of each argument from
1719 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__VARIANT().
1724 * g_cclosure_marshal_VOID__VOID:
1725 * @closure: A #GClosure.
1726 * @return_value: A #GValue to store the return value. May be %NULL
1727 * if the callback of closure doesn't return a value.
1728 * @n_param_values: The length of the @param_values array.
1729 * @param_values: An array of #GValues holding the arguments
1730 * on which to invoke the callback of closure.
1731 * @invocation_hint: The invocation hint given as the last argument to
1732 * g_closure_invoke().
1733 * @marshal_data: Additional data specified when registering the
1734 * marshaller, see g_closure_set_marshal() and
1735 * g_closure_set_meta_marshal()
1737 * A #GClosureMarshal function for use with signals with no arguments.
1742 * g_cclosure_marshal_VOID__VOIDv:
1743 * @closure: the #GClosure to which the marshaller belongs
1744 * @return_value: (allow-none): a #GValue to store the return
1745 * value. May be %NULL if the callback of @closure doesn't return a
1747 * @instance: (type GObject.TypeInstance): the instance on which the closure is invoked.
1748 * @args: va_list of arguments to be passed to the closure.
1749 * @marshal_data: (allow-none): additional data specified when
1750 * registering the marshaller, see g_closure_set_marshal() and
1751 * g_closure_set_meta_marshal()
1752 * @n_params: the length of the @param_types array
1753 * @param_types: (array length=n_params): the #GType of each argument from
1756 * The #GVaClosureMarshal equivalent to g_cclosure_marshal_VOID__VOID().
1761 * g_cclosure_marshal_generic:
1762 * @closure: A #GClosure.
1763 * @return_gvalue: A #GValue to store the return value. May be %NULL
1764 * if the callback of closure doesn't return a value.
1765 * @n_param_values: The length of the @param_values array.
1766 * @param_values: An array of #GValues holding the arguments
1767 * on which to invoke the callback of closure.
1768 * @invocation_hint: The invocation hint given as the last argument to
1769 * g_closure_invoke().
1770 * @marshal_data: Additional data specified when registering the
1771 * marshaller, see g_closure_set_marshal() and
1772 * g_closure_set_meta_marshal()
1774 * A generic marshaller function implemented via
1775 * [libffi](http://sourceware.org/libffi/).
1777 * Normally this function is not passed explicitly to g_signal_new(),
1778 * but used automatically by GLib when specifying a %NULL marshaller.
1785 * g_cclosure_marshal_generic_va:
1786 * @closure: the #GClosure to which the marshaller belongs
1787 * @return_value: (allow-none): a #GValue to store the return
1788 * value. May be %NULL if the callback of @closure doesn't return a
1790 * @instance: (type GObject.TypeInstance): the instance on which the closure is
1792 * @args_list: va_list of arguments to be passed to the closure.
1793 * @marshal_data: (allow-none): additional data specified when
1794 * registering the marshaller, see g_closure_set_marshal() and
1795 * g_closure_set_meta_marshal()
1796 * @n_params: the length of the @param_types array
1797 * @param_types: (array length=n_params): the #GType of each argument from
1800 * A generic #GVaClosureMarshal function implemented via
1801 * [libffi](http://sourceware.org/libffi/).
1808 * g_cclosure_new: (skip)
1809 * @callback_func: the function to invoke
1810 * @user_data: (closure callback_func): user data to pass to @callback_func
1811 * @destroy_data: destroy notify to be called when @user_data is no longer used
1813 * Creates a new closure which invokes @callback_func with @user_data as
1814 * the last parameter.
1816 * Returns: a new #GCClosure
1821 * g_cclosure_new_object: (skip)
1822 * @callback_func: the function to invoke
1823 * @object: a #GObject pointer to pass to @callback_func
1825 * A variant of g_cclosure_new() which uses @object as @user_data and
1826 * calls g_object_watch_closure() on @object and the created
1827 * closure. This function is useful when you have a callback closely
1828 * associated with a #GObject, and want the callback to no longer run
1829 * after the object is is freed.
1831 * Returns: a new #GCClosure
1836 * g_cclosure_new_object_swap: (skip)
1837 * @callback_func: the function to invoke
1838 * @object: a #GObject pointer to pass to @callback_func
1840 * A variant of g_cclosure_new_swap() which uses @object as @user_data
1841 * and calls g_object_watch_closure() on @object and the created
1842 * closure. This function is useful when you have a callback closely
1843 * associated with a #GObject, and want the callback to no longer run
1844 * after the object is is freed.
1846 * Returns: a new #GCClosure
1851 * g_cclosure_new_swap: (skip)
1852 * @callback_func: the function to invoke
1853 * @user_data: (closure callback_func): user data to pass to @callback_func
1854 * @destroy_data: destroy notify to be called when @user_data is no longer used
1856 * Creates a new closure which invokes @callback_func with @user_data as
1857 * the first parameter.
1859 * Returns: (transfer full): a new #GCClosure
1864 * g_clear_object: (skip)
1865 * @object_ptr: a pointer to a #GObject reference
1867 * Clears a reference to a #GObject.
1869 * @object_ptr must not be %NULL.
1871 * If the reference is %NULL then this function does nothing.
1872 * Otherwise, the reference count of the object is decreased and the
1873 * pointer is set to %NULL.
1875 * A macro is also included that allows this function to be used without
1883 * g_closure_add_finalize_notifier: (skip)
1884 * @closure: a #GClosure
1885 * @notify_data: (closure notify_func): data to pass to @notify_func
1886 * @notify_func: the callback function to register
1888 * Registers a finalization notifier which will be called when the
1889 * reference count of @closure goes down to 0. Multiple finalization
1890 * notifiers on a single closure are invoked in unspecified order. If
1891 * a single call to g_closure_unref() results in the closure being
1892 * both invalidated and finalized, then the invalidate notifiers will
1893 * be run before the finalize notifiers.
1898 * g_closure_add_invalidate_notifier: (skip)
1899 * @closure: a #GClosure
1900 * @notify_data: (closure notify_func): data to pass to @notify_func
1901 * @notify_func: the callback function to register
1903 * Registers an invalidation notifier which will be called when the
1904 * @closure is invalidated with g_closure_invalidate(). Invalidation
1905 * notifiers are invoked before finalization notifiers, in an
1906 * unspecified order.
1911 * g_closure_add_marshal_guards: (skip)
1912 * @closure: a #GClosure
1913 * @pre_marshal_data: (closure pre_marshal_notify): data to pass
1914 * to @pre_marshal_notify
1915 * @pre_marshal_notify: a function to call before the closure callback
1916 * @post_marshal_data: (closure post_marshal_notify): data to pass
1917 * to @post_marshal_notify
1918 * @post_marshal_notify: a function to call after the closure callback
1920 * Adds a pair of notifiers which get invoked before and after the
1921 * closure callback, respectively. This is typically used to protect
1922 * the extra arguments for the duration of the callback. See
1923 * g_object_watch_closure() for an example of marshal guards.
1928 * g_closure_invalidate:
1929 * @closure: GClosure to invalidate
1931 * Sets a flag on the closure to indicate that its calling
1932 * environment has become invalid, and thus causes any future
1933 * invocations of g_closure_invoke() on this @closure to be
1934 * ignored. Also, invalidation notifiers installed on the closure will
1935 * be called at this point. Note that unless you are holding a
1936 * reference to the closure yourself, the invalidation notifiers may
1937 * unref the closure and cause it to be destroyed, so if you need to
1938 * access the closure after calling g_closure_invalidate(), make sure
1939 * that you've previously called g_closure_ref().
1941 * Note that g_closure_invalidate() will also be called when the
1942 * reference count of a closure drops to zero (unless it has already
1943 * been invalidated before).
1949 * @closure: a #GClosure
1950 * @return_value: (optional) (out): a #GValue to store the return
1951 * value. May be %NULL if the callback of @closure
1952 * doesn't return a value.
1953 * @n_param_values: the length of the @param_values array
1954 * @param_values: (array length=n_param_values): an array of
1955 * #GValues holding the arguments on which to
1956 * invoke the callback of @closure
1957 * @invocation_hint: (allow-none): a context-dependent invocation hint
1959 * Invokes the closure, i.e. executes the callback represented by the @closure.
1964 * g_closure_new_object:
1965 * @sizeof_closure: the size of the structure to allocate, must be at least
1966 * `sizeof (GClosure)`
1967 * @object: a #GObject pointer to store in the @data field of the newly
1968 * allocated #GClosure
1970 * A variant of g_closure_new_simple() which stores @object in the
1971 * @data field of the closure and calls g_object_watch_closure() on
1972 * @object and the created closure. This function is mainly useful
1973 * when implementing new types of closures.
1975 * Returns: (transfer full): a newly allocated #GClosure
1980 * g_closure_new_simple:
1981 * @sizeof_closure: the size of the structure to allocate, must be at least
1982 * `sizeof (GClosure)`
1983 * @data: data to store in the @data field of the newly allocated #GClosure
1985 * Allocates a struct of the given size and initializes the initial
1986 * part as a #GClosure. This function is mainly useful when
1987 * implementing new types of closures.
1989 * |[<!-- language="C" -->
1990 * typedef struct _MyClosure MyClosure;
1994 * // extra data goes here
1998 * my_closure_finalize (gpointer notify_data,
1999 * GClosure *closure)
2001 * MyClosure *my_closure = (MyClosure *)closure;
2003 * // free extra data here
2006 * MyClosure *my_closure_new (gpointer data)
2008 * GClosure *closure;
2009 * MyClosure *my_closure;
2011 * closure = g_closure_new_simple (sizeof (MyClosure), data);
2012 * my_closure = (MyClosure *) closure;
2014 * // initialize extra data here
2016 * g_closure_add_finalize_notifier (closure, notify_data,
2017 * my_closure_finalize);
2018 * return my_closure;
2022 * Returns: (transfer full): a newly allocated #GClosure
2028 * @closure: #GClosure to increment the reference count on
2030 * Increments the reference count on a closure to force it staying
2031 * alive while the caller holds a pointer to it.
2033 * Returns: (transfer none): The @closure passed in, for convenience
2038 * g_closure_remove_finalize_notifier: (skip)
2039 * @closure: a #GClosure
2040 * @notify_data: data which was passed to g_closure_add_finalize_notifier()
2041 * when registering @notify_func
2042 * @notify_func: the callback function to remove
2044 * Removes a finalization notifier.
2046 * Notice that notifiers are automatically removed after they are run.
2051 * g_closure_remove_invalidate_notifier: (skip)
2052 * @closure: a #GClosure
2053 * @notify_data: data which was passed to g_closure_add_invalidate_notifier()
2054 * when registering @notify_func
2055 * @notify_func: the callback function to remove
2057 * Removes an invalidation notifier.
2059 * Notice that notifiers are automatically removed after they are run.
2064 * g_closure_set_marshal: (skip)
2065 * @closure: a #GClosure
2066 * @marshal: a #GClosureMarshal function
2068 * Sets the marshaller of @closure. The `marshal_data`
2069 * of @marshal provides a way for a meta marshaller to provide additional
2070 * information to the marshaller. (See g_closure_set_meta_marshal().) For
2071 * GObject's C predefined marshallers (the g_cclosure_marshal_*()
2072 * functions), what it provides is a callback function to use instead of
2073 * @closure->callback.
2078 * g_closure_set_meta_marshal: (skip)
2079 * @closure: a #GClosure
2080 * @marshal_data: (closure meta_marshal): context-dependent data to pass
2082 * @meta_marshal: a #GClosureMarshal function
2084 * Sets the meta marshaller of @closure. A meta marshaller wraps
2085 * @closure->marshal and modifies the way it is called in some
2086 * fashion. The most common use of this facility is for C callbacks.
2087 * The same marshallers (generated by [glib-genmarshal][glib-genmarshal]),
2088 * are used everywhere, but the way that we get the callback function
2089 * differs. In most cases we want to use @closure->callback, but in
2090 * other cases we want to use some different technique to retrieve the
2091 * callback function.
2093 * For example, class closures for signals (see
2094 * g_signal_type_cclosure_new()) retrieve the callback function from a
2095 * fixed offset in the class structure. The meta marshaller retrieves
2096 * the right callback and passes it to the marshaller as the
2097 * @marshal_data argument.
2103 * @closure: #GClosure to decrement the initial reference count on, if it's
2106 * Takes over the initial ownership of a closure. Each closure is
2107 * initially created in a "floating" state, which means that the initial
2108 * reference count is not owned by any caller. g_closure_sink() checks
2109 * to see if the object is still floating, and if so, unsets the
2110 * floating state and decreases the reference count. If the closure
2111 * is not floating, g_closure_sink() does nothing. The reason for the
2112 * existence of the floating state is to prevent cumbersome code
2114 * |[<!-- language="C" -->
2115 * closure = g_cclosure_new (cb_func, cb_data);
2116 * g_source_set_closure (source, closure);
2117 * g_closure_unref (closure); // GObject doesn't really need this
2119 * Because g_source_set_closure() (and similar functions) take ownership of the
2120 * initial reference count, if it is unowned, we instead can write:
2121 * |[<!-- language="C" -->
2122 * g_source_set_closure (source, g_cclosure_new (cb_func, cb_data));
2125 * Generally, this function is used together with g_closure_ref(). Ane example
2126 * of storing a closure for later notification looks like:
2127 * |[<!-- language="C" -->
2128 * static GClosure *notify_closure = NULL;
2130 * foo_notify_set_closure (GClosure *closure)
2132 * if (notify_closure)
2133 * g_closure_unref (notify_closure);
2134 * notify_closure = closure;
2135 * if (notify_closure)
2137 * g_closure_ref (notify_closure);
2138 * g_closure_sink (notify_closure);
2143 * Because g_closure_sink() may decrement the reference count of a closure
2144 * (if it hasn't been called on @closure yet) just like g_closure_unref(),
2145 * g_closure_ref() should be called prior to this function.
2151 * @closure: #GClosure to decrement the reference count on
2153 * Decrements the reference count of a closure after it was previously
2154 * incremented by the same caller. If no other callers are using the
2155 * closure, then the closure will be destroyed and freed.
2160 * g_enum_complete_type_info:
2161 * @g_enum_type: the type identifier of the type being completed
2162 * @info: (out callee-allocates): the #GTypeInfo struct to be filled in
2163 * @const_values: An array of #GEnumValue structs for the possible
2164 * enumeration values. The array is terminated by a struct with all
2167 * This function is meant to be called from the `complete_type_info`
2168 * function of a #GTypePlugin implementation, as in the following
2171 * |[<!-- language="C" -->
2173 * my_enum_complete_type_info (GTypePlugin *plugin,
2176 * GTypeValueTable *value_table)
2178 * static const GEnumValue values[] = {
2179 * { MY_ENUM_FOO, "MY_ENUM_FOO", "foo" },
2180 * { MY_ENUM_BAR, "MY_ENUM_BAR", "bar" },
2184 * g_enum_complete_type_info (type, info, values);
2192 * @enum_class: a #GEnumClass
2193 * @value: the value to look up
2195 * Returns the #GEnumValue for a value.
2197 * Returns: (transfer none): the #GEnumValue for @value, or %NULL
2198 * if @value is not a member of the enumeration
2203 * g_enum_get_value_by_name:
2204 * @enum_class: a #GEnumClass
2205 * @name: the name to look up
2207 * Looks up a #GEnumValue by name.
2209 * Returns: (transfer none): the #GEnumValue with name @name,
2210 * or %NULL if the enumeration doesn't have a member
2216 * g_enum_get_value_by_nick:
2217 * @enum_class: a #GEnumClass
2218 * @nick: the nickname to look up
2220 * Looks up a #GEnumValue by nickname.
2222 * Returns: (transfer none): the #GEnumValue with nickname @nick,
2223 * or %NULL if the enumeration doesn't have a member
2224 * with that nickname
2229 * g_enum_register_static:
2230 * @name: A nul-terminated string used as the name of the new type.
2231 * @const_static_values: An array of #GEnumValue structs for the possible
2232 * enumeration values. The array is terminated by a struct with all
2233 * members being 0. GObject keeps a reference to the data, so it cannot
2234 * be stack-allocated.
2236 * Registers a new static enumeration type with the name @name.
2238 * It is normally more convenient to let [glib-mkenums][glib-mkenums],
2239 * generate a my_enum_get_type() function from a usual C enumeration
2240 * definition than to write one yourself using g_enum_register_static().
2242 * Returns: The new type identifier.
2247 * g_flags_complete_type_info:
2248 * @g_flags_type: the type identifier of the type being completed
2249 * @info: (out callee-allocates): the #GTypeInfo struct to be filled in
2250 * @const_values: An array of #GFlagsValue structs for the possible
2251 * enumeration values. The array is terminated by a struct with all
2254 * This function is meant to be called from the complete_type_info()
2255 * function of a #GTypePlugin implementation, see the example for
2256 * g_enum_complete_type_info() above.
2261 * g_flags_get_first_value:
2262 * @flags_class: a #GFlagsClass
2265 * Returns the first #GFlagsValue which is set in @value.
2267 * Returns: (transfer none): the first #GFlagsValue which is set in
2268 * @value, or %NULL if none is set
2273 * g_flags_get_value_by_name:
2274 * @flags_class: a #GFlagsClass
2275 * @name: the name to look up
2277 * Looks up a #GFlagsValue by name.
2279 * Returns: (transfer none): the #GFlagsValue with name @name,
2280 * or %NULL if there is no flag with that name
2285 * g_flags_get_value_by_nick:
2286 * @flags_class: a #GFlagsClass
2287 * @nick: the nickname to look up
2289 * Looks up a #GFlagsValue by nickname.
2291 * Returns: (transfer none): the #GFlagsValue with nickname @nick,
2292 * or %NULL if there is no flag with that nickname
2297 * g_flags_register_static:
2298 * @name: A nul-terminated string used as the name of the new type.
2299 * @const_static_values: An array of #GFlagsValue structs for the possible
2300 * flags values. The array is terminated by a struct with all members being 0.
2301 * GObject keeps a reference to the data, so it cannot be stack-allocated.
2303 * Registers a new static flags type with the name @name.
2305 * It is normally more convenient to let [glib-mkenums][glib-mkenums]
2306 * generate a my_flags_get_type() function from a usual C enumeration
2307 * definition than to write one yourself using g_flags_register_static().
2309 * Returns: The new type identifier.
2314 * g_object_add_toggle_ref: (skip)
2315 * @object: a #GObject
2316 * @notify: a function to call when this reference is the
2317 * last reference to the object, or is no longer
2318 * the last reference.
2319 * @data: data to pass to @notify
2321 * Increases the reference count of the object by one and sets a
2322 * callback to be called when all other references to the object are
2323 * dropped, or when this is already the last reference to the object
2324 * and another reference is established.
2326 * This functionality is intended for binding @object to a proxy
2327 * object managed by another memory manager. This is done with two
2328 * paired references: the strong reference added by
2329 * g_object_add_toggle_ref() and a reverse reference to the proxy
2330 * object which is either a strong reference or weak reference.
2332 * The setup is that when there are no other references to @object,
2333 * only a weak reference is held in the reverse direction from @object
2334 * to the proxy object, but when there are other references held to
2335 * @object, a strong reference is held. The @notify callback is called
2336 * when the reference from @object to the proxy object should be
2337 * "toggled" from strong to weak (@is_last_ref true) or weak to strong
2338 * (@is_last_ref false).
2340 * Since a (normal) reference must be held to the object before
2341 * calling g_object_add_toggle_ref(), the initial state of the reverse
2342 * link is always strong.
2344 * Multiple toggle references may be added to the same gobject,
2345 * however if there are multiple toggle references to an object, none
2346 * of them will ever be notified until all but one are removed. For
2347 * this reason, you should only ever use a toggle reference if there
2348 * is important state in the proxy object.
2355 * g_object_add_weak_pointer: (skip)
2356 * @object: The object that should be weak referenced.
2357 * @weak_pointer_location: (inout) (not optional) (nullable): The memory address
2360 * Adds a weak reference from weak_pointer to @object to indicate that
2361 * the pointer located at @weak_pointer_location is only valid during
2362 * the lifetime of @object. When the @object is finalized,
2363 * @weak_pointer will be set to %NULL.
2365 * Note that as with g_object_weak_ref(), the weak references created by
2366 * this method are not thread-safe: they cannot safely be used in one
2367 * thread if the object's last g_object_unref() might happen in another
2368 * thread. Use #GWeakRef if thread-safety is required.
2373 * g_object_bind_property:
2374 * @source: (type GObject.Object): the source #GObject
2375 * @source_property: the property on @source to bind
2376 * @target: (type GObject.Object): the target #GObject
2377 * @target_property: the property on @target to bind
2378 * @flags: flags to pass to #GBinding
2380 * Creates a binding between @source_property on @source and @target_property
2381 * on @target. Whenever the @source_property is changed the @target_property is
2382 * updated using the same value. For instance:
2385 * g_object_bind_property (action, "active", widget, "sensitive", 0);
2388 * Will result in the "sensitive" property of the widget #GObject instance to be
2389 * updated with the same value of the "active" property of the action #GObject
2392 * If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
2393 * if @target_property on @target changes then the @source_property on @source
2394 * will be updated as well.
2396 * The binding will automatically be removed when either the @source or the
2397 * @target instances are finalized. To remove the binding without affecting the
2398 * @source and the @target you can just call g_object_unref() on the returned
2399 * #GBinding instance.
2401 * A #GObject can have multiple bindings.
2403 * Returns: (transfer none): the #GBinding instance representing the
2404 * binding between the two #GObject instances. The binding is released
2405 * whenever the #GBinding reference count reaches zero.
2411 * g_object_bind_property_full:
2412 * @source: (type GObject.Object): the source #GObject
2413 * @source_property: the property on @source to bind
2414 * @target: (type GObject.Object): the target #GObject
2415 * @target_property: the property on @target to bind
2416 * @flags: flags to pass to #GBinding
2417 * @transform_to: (scope notified) (allow-none): the transformation function
2418 * from the @source to the @target, or %NULL to use the default
2419 * @transform_from: (scope notified) (allow-none): the transformation function
2420 * from the @target to the @source, or %NULL to use the default
2421 * @user_data: custom data to be passed to the transformation functions,
2423 * @notify: function to be called when disposing the binding, to free the
2424 * resources used by the transformation functions
2426 * Complete version of g_object_bind_property().
2428 * Creates a binding between @source_property on @source and @target_property
2429 * on @target, allowing you to set the transformation functions to be used by
2432 * If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
2433 * if @target_property on @target changes then the @source_property on @source
2434 * will be updated as well. The @transform_from function is only used in case
2435 * of bidirectional bindings, otherwise it will be ignored
2437 * The binding will automatically be removed when either the @source or the
2438 * @target instances are finalized. To remove the binding without affecting the
2439 * @source and the @target you can just call g_object_unref() on the returned
2440 * #GBinding instance.
2442 * A #GObject can have multiple bindings.
2444 * The same @user_data parameter will be used for both @transform_to
2445 * and @transform_from transformation functions; the @notify function will
2446 * be called once, when the binding is removed. If you need different data
2447 * for each transformation function, please use
2448 * g_object_bind_property_with_closures() instead.
2450 * Returns: (transfer none): the #GBinding instance representing the
2451 * binding between the two #GObject instances. The binding is released
2452 * whenever the #GBinding reference count reaches zero.
2458 * g_object_bind_property_with_closures: (rename-to g_object_bind_property_full)
2459 * @source: (type GObject.Object): the source #GObject
2460 * @source_property: the property on @source to bind
2461 * @target: (type GObject.Object): the target #GObject
2462 * @target_property: the property on @target to bind
2463 * @flags: flags to pass to #GBinding
2464 * @transform_to: a #GClosure wrapping the transformation function
2465 * from the @source to the @target, or %NULL to use the default
2466 * @transform_from: a #GClosure wrapping the transformation function
2467 * from the @target to the @source, or %NULL to use the default
2469 * Creates a binding between @source_property on @source and @target_property
2470 * on @target, allowing you to set the transformation functions to be used by
2473 * This function is the language bindings friendly version of
2474 * g_object_bind_property_full(), using #GClosures instead of
2475 * function pointers.
2477 * Returns: (transfer none): the #GBinding instance representing the
2478 * binding between the two #GObject instances. The binding is released
2479 * whenever the #GBinding reference count reaches zero.
2485 * g_object_class_find_property:
2486 * @oclass: a #GObjectClass
2487 * @property_name: the name of the property to look up
2489 * Looks up the #GParamSpec for a property of a class.
2491 * Returns: (transfer none): the #GParamSpec for the property, or
2492 * %NULL if the class doesn't have a property of that name
2497 * g_object_class_install_properties:
2498 * @oclass: a #GObjectClass
2499 * @n_pspecs: the length of the #GParamSpecs array
2500 * @pspecs: (array length=n_pspecs): the #GParamSpecs array
2501 * defining the new properties
2503 * Installs new properties from an array of #GParamSpecs.
2505 * All properties should be installed during the class initializer. It
2506 * is possible to install properties after that, but doing so is not
2507 * recommend, and specifically, is not guaranteed to be thread-safe vs.
2508 * use of properties on the same type on other threads.
2510 * The property id of each property is the index of each #GParamSpec in
2511 * the @pspecs array.
2513 * The property id of 0 is treated specially by #GObject and it should not
2514 * be used to store a #GParamSpec.
2516 * This function should be used if you plan to use a static array of
2517 * #GParamSpecs and g_object_notify_by_pspec(). For instance, this
2518 * class initialization:
2520 * |[<!-- language="C" -->
2522 * PROP_0, PROP_FOO, PROP_BAR, N_PROPERTIES
2525 * static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, };
2528 * my_object_class_init (MyObjectClass *klass)
2530 * GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
2532 * obj_properties[PROP_FOO] =
2533 * g_param_spec_int ("foo", "Foo", "Foo",
2536 * G_PARAM_READWRITE);
2538 * obj_properties[PROP_BAR] =
2539 * g_param_spec_string ("bar", "Bar", "Bar",
2541 * G_PARAM_READWRITE);
2543 * gobject_class->set_property = my_object_set_property;
2544 * gobject_class->get_property = my_object_get_property;
2545 * g_object_class_install_properties (gobject_class,
2551 * allows calling g_object_notify_by_pspec() to notify of property changes:
2553 * |[<!-- language="C" -->
2555 * my_object_set_foo (MyObject *self, gint foo)
2557 * if (self->foo != foo)
2560 * g_object_notify_by_pspec (G_OBJECT (self), obj_properties[PROP_FOO]);
2570 * g_object_class_install_property:
2571 * @oclass: a #GObjectClass
2572 * @property_id: the id for the new property
2573 * @pspec: the #GParamSpec for the new property
2575 * Installs a new property.
2577 * All properties should be installed during the class initializer. It
2578 * is possible to install properties after that, but doing so is not
2579 * recommend, and specifically, is not guaranteed to be thread-safe vs.
2580 * use of properties on the same type on other threads.
2582 * Note that it is possible to redefine a property in a derived class,
2583 * by installing a property with the same name. This can be useful at times,
2584 * e.g. to change the range of allowed values or the default value.
2589 * g_object_class_list_properties:
2590 * @oclass: a #GObjectClass
2591 * @n_properties: (out): return location for the length of the returned array
2593 * Get an array of #GParamSpec* for all properties of a class.
2595 * Returns: (array length=n_properties) (transfer container): an array of
2596 * #GParamSpec* which should be freed after use
2601 * g_object_class_override_property:
2602 * @oclass: a #GObjectClass
2603 * @property_id: the new property ID
2604 * @name: the name of a property registered in a parent class or
2605 * in an interface of this class.
2607 * Registers @property_id as referring to a property with the name
2608 * @name in a parent class or in an interface implemented by @oclass.
2609 * This allows this class to "override" a property implementation in
2610 * a parent class or to provide the implementation of a property from
2613 * Internally, overriding is implemented by creating a property of type
2614 * #GParamSpecOverride; generally operations that query the properties of
2615 * the object class, such as g_object_class_find_property() or
2616 * g_object_class_list_properties() will return the overridden
2617 * property. However, in one case, the @construct_properties argument of
2618 * the @constructor virtual function, the #GParamSpecOverride is passed
2619 * instead, so that the @param_id field of the #GParamSpec will be
2620 * correct. For virtually all uses, this makes no difference. If you
2621 * need to get the overridden property, you can call
2622 * g_param_spec_get_redirect_target().
2629 * g_object_connect: (skip)
2630 * @object: (type GObject.Object): a #GObject
2631 * @signal_spec: the spec for the first signal
2632 * @...: #GCallback for the first signal, followed by data for the
2633 * first signal, followed optionally by more signal
2634 * spec/callback/data triples, followed by %NULL
2636 * A convenience function to connect multiple signals at once.
2638 * The signal specs expected by this function have the form
2639 * "modifier::signal_name", where modifier can be one of the following:
2640 * * - signal: equivalent to g_signal_connect_data (..., NULL, 0)
2641 * - object-signal, object_signal: equivalent to g_signal_connect_object (..., 0)
2642 * - swapped-signal, swapped_signal: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED)
2643 * - swapped_object_signal, swapped-object-signal: equivalent to g_signal_connect_object (..., G_CONNECT_SWAPPED)
2644 * - signal_after, signal-after: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_AFTER)
2645 * - object_signal_after, object-signal-after: equivalent to g_signal_connect_object (..., G_CONNECT_AFTER)
2646 * - swapped_signal_after, swapped-signal-after: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER)
2647 * - swapped_object_signal_after, swapped-object-signal-after: equivalent to g_signal_connect_object (..., G_CONNECT_SWAPPED | G_CONNECT_AFTER)
2649 * |[<!-- language="C" -->
2650 * menu->toplevel = g_object_connect (g_object_new (GTK_TYPE_WINDOW,
2651 * "type", GTK_WINDOW_POPUP,
2654 * "signal::event", gtk_menu_window_event, menu,
2655 * "signal::size_request", gtk_menu_window_size_request, menu,
2656 * "signal::destroy", gtk_widget_destroyed, &menu->toplevel,
2660 * Returns: (transfer none) (type GObject.Object): @object
2665 * g_object_disconnect: (skip)
2666 * @object: (type GObject.Object): a #GObject
2667 * @signal_spec: the spec for the first signal
2668 * @...: #GCallback for the first signal, followed by data for the first signal,
2669 * followed optionally by more signal spec/callback/data triples,
2672 * A convenience function to disconnect multiple signals at once.
2674 * The signal specs expected by this function have the form
2675 * "any_signal", which means to disconnect any signal with matching
2676 * callback and data, or "any_signal::signal_name", which only
2677 * disconnects the signal named "signal_name".
2682 * g_object_dup_data:
2683 * @object: the #GObject to store user data on
2684 * @key: a string, naming the user data pointer
2685 * @dup_func: (allow-none): function to dup the value
2686 * @user_data: (allow-none): passed as user_data to @dup_func
2688 * This is a variant of g_object_get_data() which returns
2689 * a 'duplicate' of the value. @dup_func defines the
2690 * meaning of 'duplicate' in this context, it could e.g.
2691 * take a reference on a ref-counted object.
2693 * If the @key is not set on the object then @dup_func
2694 * will be called with a %NULL argument.
2696 * Note that @dup_func is called while user data of @object
2699 * This function can be useful to avoid races when multiple
2700 * threads are using object data on the same key on the same
2703 * Returns: the result of calling @dup_func on the value
2704 * associated with @key on @object, or %NULL if not set.
2705 * If @dup_func is %NULL, the value is returned
2712 * g_object_dup_qdata:
2713 * @object: the #GObject to store user data on
2714 * @quark: a #GQuark, naming the user data pointer
2715 * @dup_func: (allow-none): function to dup the value
2716 * @user_data: (allow-none): passed as user_data to @dup_func
2718 * This is a variant of g_object_get_qdata() which returns
2719 * a 'duplicate' of the value. @dup_func defines the
2720 * meaning of 'duplicate' in this context, it could e.g.
2721 * take a reference on a ref-counted object.
2723 * If the @quark is not set on the object then @dup_func
2724 * will be called with a %NULL argument.
2726 * Note that @dup_func is called while user data of @object
2729 * This function can be useful to avoid races when multiple
2730 * threads are using object data on the same key on the same
2733 * Returns: the result of calling @dup_func on the value
2734 * associated with @quark on @object, or %NULL if not set.
2735 * If @dup_func is %NULL, the value is returned
2742 * g_object_force_floating:
2743 * @object: a #GObject
2745 * This function is intended for #GObject implementations to re-enforce
2746 * a [floating][floating-ref] object reference. Doing this is seldom
2747 * required: all #GInitiallyUnowneds are created with a floating reference
2748 * which usually just needs to be sunken by calling g_object_ref_sink().
2755 * g_object_freeze_notify:
2756 * @object: a #GObject
2758 * Increases the freeze count on @object. If the freeze count is
2759 * non-zero, the emission of "notify" signals on @object is
2760 * stopped. The signals are queued until the freeze count is decreased
2761 * to zero. Duplicate notifications are squashed so that at most one
2762 * #GObject::notify signal is emitted for each property modified while the
2765 * This is necessary for accessors that modify multiple properties to prevent
2766 * premature notification while the object is still being modified.
2771 * g_object_get: (skip)
2772 * @object: (type GObject.Object): a #GObject
2773 * @first_property_name: name of the first property to get
2774 * @...: return location for the first property, followed optionally by more
2775 * name/return location pairs, followed by %NULL
2777 * Gets properties of an object.
2779 * In general, a copy is made of the property contents and the caller
2780 * is responsible for freeing the memory in the appropriate manner for
2781 * the type, for instance by calling g_free() or g_object_unref().
2783 * Here is an example of using g_object_get() to get the contents
2784 * of three properties: an integer, a string and an object:
2785 * |[<!-- language="C" -->
2790 * g_object_get (my_object,
2791 * "int-property", &intval,
2792 * "str-property", &strval,
2793 * "obj-property", &objval,
2796 * // Do something with intval, strval, objval
2799 * g_object_unref (objval);
2805 * g_object_get_data:
2806 * @object: #GObject containing the associations
2807 * @key: name of the key for that association
2809 * Gets a named field from the objects table of associations (see g_object_set_data()).
2811 * Returns: (transfer none): the data if found, or %NULL if no such data exists.
2816 * g_object_get_property:
2817 * @object: a #GObject
2818 * @property_name: the name of the property to get
2819 * @value: return location for the property value
2821 * Gets a property of an object. @value must have been initialized to the
2822 * expected type of the property (or a type to which the expected type can be
2823 * transformed) using g_value_init().
2825 * In general, a copy is made of the property contents and the caller is
2826 * responsible for freeing the memory by calling g_value_unset().
2828 * Note that g_object_get_property() is really intended for language
2829 * bindings, g_object_get() is much more convenient for C programming.
2834 * g_object_get_qdata:
2835 * @object: The GObject to get a stored user data pointer from
2836 * @quark: A #GQuark, naming the user data pointer
2838 * This function gets back user data pointers stored via
2839 * g_object_set_qdata().
2841 * Returns: (transfer none): The user data pointer set, or %NULL
2846 * g_object_get_valist: (skip)
2847 * @object: a #GObject
2848 * @first_property_name: name of the first property to get
2849 * @var_args: return location for the first property, followed optionally by more
2850 * name/return location pairs, followed by %NULL
2852 * Gets properties of an object.
2854 * In general, a copy is made of the property contents and the caller
2855 * is responsible for freeing the memory in the appropriate manner for
2856 * the type, for instance by calling g_free() or g_object_unref().
2858 * See g_object_get().
2863 * g_object_interface_find_property:
2864 * @g_iface: (type GObject.TypeInterface): any interface vtable for the
2865 * interface, or the default vtable for the interface
2866 * @property_name: name of a property to lookup.
2868 * Find the #GParamSpec with the given name for an
2869 * interface. Generally, the interface vtable passed in as @g_iface
2870 * will be the default vtable from g_type_default_interface_ref(), or,
2871 * if you know the interface has already been loaded,
2872 * g_type_default_interface_peek().
2875 * Returns: (transfer none): the #GParamSpec for the property of the
2876 * interface with the name @property_name, or %NULL if no
2877 * such property exists.
2882 * g_object_interface_install_property:
2883 * @g_iface: (type GObject.TypeInterface): any interface vtable for the
2884 * interface, or the default
2885 * vtable for the interface.
2886 * @pspec: the #GParamSpec for the new property
2888 * Add a property to an interface; this is only useful for interfaces
2889 * that are added to GObject-derived types. Adding a property to an
2890 * interface forces all objects classes with that interface to have a
2891 * compatible property. The compatible property could be a newly
2892 * created #GParamSpec, but normally
2893 * g_object_class_override_property() will be used so that the object
2894 * class only needs to provide an implementation and inherits the
2895 * property description, default value, bounds, and so forth from the
2896 * interface property.
2898 * This function is meant to be called from the interface's default
2899 * vtable initialization function (the @class_init member of
2900 * #GTypeInfo.) It must not be called after after @class_init has
2901 * been called for any object types implementing this interface.
2908 * g_object_interface_list_properties:
2909 * @g_iface: (type GObject.TypeInterface): any interface vtable for the
2910 * interface, or the default vtable for the interface
2911 * @n_properties_p: (out): location to store number of properties returned.
2913 * Lists the properties of an interface.Generally, the interface
2914 * vtable passed in as @g_iface will be the default vtable from
2915 * g_type_default_interface_ref(), or, if you know the interface has
2916 * already been loaded, g_type_default_interface_peek().
2919 * Returns: (array length=n_properties_p) (transfer container): a
2920 * pointer to an array of pointers to #GParamSpec
2921 * structures. The paramspecs are owned by GLib, but the
2922 * array should be freed with g_free() when you are done with
2928 * g_object_is_floating:
2929 * @object: (type GObject.Object): a #GObject
2931 * Checks whether @object has a [floating][floating-ref] reference.
2934 * Returns: %TRUE if @object has a floating reference
2939 * g_object_new: (skip)
2940 * @object_type: the type id of the #GObject subtype to instantiate
2941 * @first_property_name: the name of the first property
2942 * @...: the value of the first property, followed optionally by more
2943 * name/value pairs, followed by %NULL
2945 * Creates a new instance of a #GObject subtype and sets its properties.
2947 * Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY)
2948 * which are not explicitly specified are set to their default values.
2950 * Returns: (transfer full) (type GObject.Object): a new instance of
2956 * g_object_new_valist: (skip)
2957 * @object_type: the type id of the #GObject subtype to instantiate
2958 * @first_property_name: the name of the first property
2959 * @var_args: the value of the first property, followed optionally by more
2960 * name/value pairs, followed by %NULL
2962 * Creates a new instance of a #GObject subtype and sets its properties.
2964 * Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY)
2965 * which are not explicitly specified are set to their default values.
2967 * Returns: a new instance of @object_type
2972 * g_object_newv: (rename-to g_object_new)
2973 * @object_type: the type id of the #GObject subtype to instantiate
2974 * @n_parameters: the length of the @parameters array
2975 * @parameters: (array length=n_parameters): an array of #GParameter
2977 * Creates a new instance of a #GObject subtype and sets its properties.
2979 * Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY)
2980 * which are not explicitly specified are set to their default values.
2982 * Returns: (type GObject.Object) (transfer full): a new instance of
2989 * @object: a #GObject
2990 * @property_name: the name of a property installed on the class of @object.
2992 * Emits a "notify" signal for the property @property_name on @object.
2994 * When possible, eg. when signaling a property change from within the class
2995 * that registered the property, you should use g_object_notify_by_pspec()
2998 * Note that emission of the notify signal may be blocked with
2999 * g_object_freeze_notify(). In this case, the signal emissions are queued
3000 * and will be emitted (in reverse order) when g_object_thaw_notify() is
3006 * g_object_notify_by_pspec:
3007 * @object: a #GObject
3008 * @pspec: the #GParamSpec of a property installed on the class of @object.
3010 * Emits a "notify" signal for the property specified by @pspec on @object.
3012 * This function omits the property name lookup, hence it is faster than
3013 * g_object_notify().
3015 * One way to avoid using g_object_notify() from within the
3016 * class that registered the properties, and using g_object_notify_by_pspec()
3017 * instead, is to store the GParamSpec used with
3018 * g_object_class_install_property() inside a static array, e.g.:
3020 * |[<!-- language="C" -->
3028 * static GParamSpec *properties[PROP_LAST];
3031 * my_object_class_init (MyObjectClass *klass)
3033 * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
3036 * G_PARAM_READWRITE);
3037 * g_object_class_install_property (gobject_class,
3039 * properties[PROP_FOO]);
3043 * and then notify a change on the "foo" property with:
3045 * |[<!-- language="C" -->
3046 * g_object_notify_by_pspec (self, properties[PROP_FOO]);
3055 * @object: (type GObject.Object): a #GObject
3057 * Increases the reference count of @object.
3059 * Returns: (type GObject.Object) (transfer none): the same @object
3064 * g_object_ref_sink:
3065 * @object: (type GObject.Object): a #GObject
3067 * Increase the reference count of @object, and possibly remove the
3068 * [floating][floating-ref] reference, if @object has a floating reference.
3070 * In other words, if the object is floating, then this call "assumes
3071 * ownership" of the floating reference, converting it to a normal
3072 * reference by clearing the floating flag while leaving the reference
3073 * count unchanged. If the object is not floating, then this call
3074 * adds a new normal reference increasing the reference count by one.
3077 * Returns: (type GObject.Object) (transfer none): @object
3082 * g_object_remove_toggle_ref: (skip)
3083 * @object: a #GObject
3084 * @notify: a function to call when this reference is the
3085 * last reference to the object, or is no longer
3086 * the last reference.
3087 * @data: data to pass to @notify
3089 * Removes a reference added with g_object_add_toggle_ref(). The
3090 * reference count of the object is decreased by one.
3097 * g_object_remove_weak_pointer: (skip)
3098 * @object: The object that is weak referenced.
3099 * @weak_pointer_location: (inout) (not optional) (nullable): The memory address
3102 * Removes a weak reference from @object that was previously added
3103 * using g_object_add_weak_pointer(). The @weak_pointer_location has
3104 * to match the one used with g_object_add_weak_pointer().
3109 * g_object_replace_data:
3110 * @object: the #GObject to store user data on
3111 * @key: a string, naming the user data pointer
3112 * @oldval: (allow-none): the old value to compare against
3113 * @newval: (allow-none): the new value
3114 * @destroy: (allow-none): a destroy notify for the new value
3115 * @old_destroy: (allow-none): destroy notify for the existing value
3117 * Compares the user data for the key @key on @object with
3118 * @oldval, and if they are the same, replaces @oldval with
3121 * This is like a typical atomic compare-and-exchange
3122 * operation, for user data on an object.
3124 * If the previous value was replaced then ownership of the
3125 * old value (@oldval) is passed to the caller, including
3126 * the registered destroy notify for it (passed out in @old_destroy).
3127 * Its up to the caller to free this as he wishes, which may
3128 * or may not include using @old_destroy as sometimes replacement
3129 * should not destroy the object in the normal way.
3131 * Returns: %TRUE if the existing value for @key was replaced
3132 * by @newval, %FALSE otherwise.
3138 * g_object_replace_qdata:
3139 * @object: the #GObject to store user data on
3140 * @quark: a #GQuark, naming the user data pointer
3141 * @oldval: (allow-none): the old value to compare against
3142 * @newval: (allow-none): the new value
3143 * @destroy: (allow-none): a destroy notify for the new value
3144 * @old_destroy: (allow-none): destroy notify for the existing value
3146 * Compares the user data for the key @quark on @object with
3147 * @oldval, and if they are the same, replaces @oldval with
3150 * This is like a typical atomic compare-and-exchange
3151 * operation, for user data on an object.
3153 * If the previous value was replaced then ownership of the
3154 * old value (@oldval) is passed to the caller, including
3155 * the registered destroy notify for it (passed out in @old_destroy).
3156 * Its up to the caller to free this as he wishes, which may
3157 * or may not include using @old_destroy as sometimes replacement
3158 * should not destroy the object in the normal way.
3160 * Returns: %TRUE if the existing value for @quark was replaced
3161 * by @newval, %FALSE otherwise.
3167 * g_object_run_dispose:
3168 * @object: a #GObject
3170 * Releases all references to other objects. This can be used to break
3173 * This function should only be called from object system implementations.
3178 * g_object_set: (skip)
3179 * @object: (type GObject.Object): a #GObject
3180 * @first_property_name: name of the first property to set
3181 * @...: value for the first property, followed optionally by more
3182 * name/value pairs, followed by %NULL
3184 * Sets properties on an object.
3186 * Note that the "notify" signals are queued and only emitted (in
3187 * reverse order) after all properties have been set. See
3188 * g_object_freeze_notify().
3193 * g_object_set_data:
3194 * @object: #GObject containing the associations.
3195 * @key: name of the key
3196 * @data: data to associate with that key
3198 * Each object carries around a table of associations from
3199 * strings to pointers. This function lets you set an association.
3201 * If the object already had an association with that name,
3202 * the old association will be destroyed.
3207 * g_object_set_data_full: (skip)
3208 * @object: #GObject containing the associations
3209 * @key: name of the key
3210 * @data: data to associate with that key
3211 * @destroy: function to call when the association is destroyed
3213 * Like g_object_set_data() except it adds notification
3214 * for when the association is destroyed, either by setting it
3215 * to a different value or when the object is destroyed.
3217 * Note that the @destroy callback is not called if @data is %NULL.
3222 * g_object_set_property:
3223 * @object: a #GObject
3224 * @property_name: the name of the property to set
3227 * Sets a property on an object.
3232 * g_object_set_qdata: (skip)
3233 * @object: The GObject to set store a user data pointer
3234 * @quark: A #GQuark, naming the user data pointer
3235 * @data: An opaque user data pointer
3237 * This sets an opaque, named pointer on an object.
3238 * The name is specified through a #GQuark (retrived e.g. via
3239 * g_quark_from_static_string()), and the pointer
3240 * can be gotten back from the @object with g_object_get_qdata()
3241 * until the @object is finalized.
3242 * Setting a previously set user data pointer, overrides (frees)
3243 * the old pointer set, using #NULL as pointer essentially
3244 * removes the data stored.
3249 * g_object_set_qdata_full: (skip)
3250 * @object: The GObject to set store a user data pointer
3251 * @quark: A #GQuark, naming the user data pointer
3252 * @data: An opaque user data pointer
3253 * @destroy: Function to invoke with @data as argument, when @data
3256 * This function works like g_object_set_qdata(), but in addition,
3257 * a void (*destroy) (gpointer) function may be specified which is
3258 * called with @data as argument when the @object is finalized, or
3259 * the data is being overwritten by a call to g_object_set_qdata()
3260 * with the same @quark.
3265 * g_object_set_valist: (skip)
3266 * @object: a #GObject
3267 * @first_property_name: name of the first property to set
3268 * @var_args: value for the first property, followed optionally by more
3269 * name/value pairs, followed by %NULL
3271 * Sets properties on an object.
3276 * g_object_steal_data:
3277 * @object: #GObject containing the associations
3278 * @key: name of the key
3280 * Remove a specified datum from the object's data associations,
3281 * without invoking the association's destroy handler.
3283 * Returns: (transfer full): the data if found, or %NULL if no such data exists.
3288 * g_object_steal_qdata:
3289 * @object: The GObject to get a stored user data pointer from
3290 * @quark: A #GQuark, naming the user data pointer
3292 * This function gets back user data pointers stored via
3293 * g_object_set_qdata() and removes the @data from object
3294 * without invoking its destroy() function (if any was
3296 * Usually, calling this function is only required to update
3297 * user data pointers with a destroy notifier, for example:
3298 * |[<!-- language="C" -->
3300 * object_add_to_user_list (GObject *object,
3301 * const gchar *new_string)
3303 * // the quark, naming the object data
3304 * GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
3305 * // retrive the old string list
3306 * GList *list = g_object_steal_qdata (object, quark_string_list);
3308 * // prepend new string
3309 * list = g_list_prepend (list, g_strdup (new_string));
3310 * // this changed 'list', so we need to set it again
3311 * g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
3314 * free_string_list (gpointer data)
3316 * GList *node, *list = data;
3318 * for (node = list; node; node = node->next)
3319 * g_free (node->data);
3320 * g_list_free (list);
3323 * Using g_object_get_qdata() in the above example, instead of
3324 * g_object_steal_qdata() would have left the destroy function set,
3325 * and thus the partial string list would have been freed upon
3326 * g_object_set_qdata_full().
3328 * Returns: (transfer full): The user data pointer set, or %NULL
3333 * g_object_thaw_notify:
3334 * @object: a #GObject
3336 * Reverts the effect of a previous call to
3337 * g_object_freeze_notify(). The freeze count is decreased on @object
3338 * and when it reaches zero, queued "notify" signals are emitted.
3340 * Duplicate notifications for each property are squashed so that at most one
3341 * #GObject::notify signal is emitted for each property, in the reverse order
3342 * in which they have been queued.
3344 * It is an error to call this function when the freeze count is zero.
3350 * @object: (type GObject.Object): a #GObject
3352 * Decreases the reference count of @object. When its reference count
3353 * drops to 0, the object is finalized (i.e. its memory is freed).
3355 * If the pointer to the #GObject may be reused in future (for example, if it is
3356 * an instance variable of another object), it is recommended to clear the
3357 * pointer to %NULL rather than retain a dangling pointer to a potentially
3358 * invalid #GObject instance. Use g_clear_object() for this.
3363 * g_object_watch_closure:
3364 * @object: GObject restricting lifetime of @closure
3365 * @closure: GClosure to watch
3367 * This function essentially limits the life time of the @closure to
3368 * the life time of the object. That is, when the object is finalized,
3369 * the @closure is invalidated by calling g_closure_invalidate() on
3370 * it, in order to prevent invocations of the closure with a finalized
3371 * (nonexisting) object. Also, g_object_ref() and g_object_unref() are
3372 * added as marshal guards to the @closure, to ensure that an extra
3373 * reference count is held on @object during invocation of the
3374 * @closure. Usually, this function will be called on closures that
3375 * use this @object as closure data.
3380 * g_object_weak_ref: (skip)
3381 * @object: #GObject to reference weakly
3382 * @notify: callback to invoke before the object is freed
3383 * @data: extra data to pass to notify
3385 * Adds a weak reference callback to an object. Weak references are
3386 * used for notification when an object is finalized. They are called
3387 * "weak references" because they allow you to safely hold a pointer
3388 * to an object without calling g_object_ref() (g_object_ref() adds a
3389 * strong reference, that is, forces the object to stay alive).
3391 * Note that the weak references created by this method are not
3392 * thread-safe: they cannot safely be used in one thread if the
3393 * object's last g_object_unref() might happen in another thread.
3394 * Use #GWeakRef if thread-safety is required.
3399 * g_object_weak_unref: (skip)
3400 * @object: #GObject to remove a weak reference from
3401 * @notify: callback to search for
3402 * @data: data to search for
3404 * Removes a weak reference callback to an object.
3409 * g_param_spec_boolean:
3410 * @name: canonical name of the property specified
3411 * @nick: nick name for the property specified
3412 * @blurb: description of the property specified
3413 * @default_value: default value for the property specified
3414 * @flags: flags for the property specified
3416 * Creates a new #GParamSpecBoolean instance specifying a %G_TYPE_BOOLEAN
3417 * property. In many cases, it may be more appropriate to use an enum with
3418 * g_param_spec_enum(), both to improve code clarity by using explicitly named
3419 * values, and to allow for more values to be added in future without breaking
3422 * See g_param_spec_internal() for details on property names.
3424 * Returns: (transfer full): a newly created parameter specification
3429 * g_param_spec_boxed:
3430 * @name: canonical name of the property specified
3431 * @nick: nick name for the property specified
3432 * @blurb: description of the property specified
3433 * @boxed_type: %G_TYPE_BOXED derived type of this property
3434 * @flags: flags for the property specified
3436 * Creates a new #GParamSpecBoxed instance specifying a %G_TYPE_BOXED
3439 * See g_param_spec_internal() for details on property names.
3441 * Returns: (transfer full): a newly created parameter specification
3446 * g_param_spec_char:
3447 * @name: canonical name of the property specified
3448 * @nick: nick name for the property specified
3449 * @blurb: description of the property specified
3450 * @minimum: minimum value for the property specified
3451 * @maximum: maximum value for the property specified
3452 * @default_value: default value for the property specified
3453 * @flags: flags for the property specified
3455 * Creates a new #GParamSpecChar instance specifying a %G_TYPE_CHAR property.
3457 * Returns: (transfer full): a newly created parameter specification
3462 * g_param_spec_double:
3463 * @name: canonical name of the property specified
3464 * @nick: nick name for the property specified
3465 * @blurb: description of the property specified
3466 * @minimum: minimum value for the property specified
3467 * @maximum: maximum value for the property specified
3468 * @default_value: default value for the property specified
3469 * @flags: flags for the property specified
3471 * Creates a new #GParamSpecDouble instance specifying a %G_TYPE_DOUBLE
3474 * See g_param_spec_internal() for details on property names.
3476 * Returns: (transfer full): a newly created parameter specification
3481 * g_param_spec_enum:
3482 * @name: canonical name of the property specified
3483 * @nick: nick name for the property specified
3484 * @blurb: description of the property specified
3485 * @enum_type: a #GType derived from %G_TYPE_ENUM
3486 * @default_value: default value for the property specified
3487 * @flags: flags for the property specified
3489 * Creates a new #GParamSpecEnum instance specifying a %G_TYPE_ENUM
3492 * See g_param_spec_internal() for details on property names.
3494 * Returns: (transfer full): a newly created parameter specification
3499 * g_param_spec_flags:
3500 * @name: canonical name of the property specified
3501 * @nick: nick name for the property specified
3502 * @blurb: description of the property specified
3503 * @flags_type: a #GType derived from %G_TYPE_FLAGS
3504 * @default_value: default value for the property specified
3505 * @flags: flags for the property specified
3507 * Creates a new #GParamSpecFlags instance specifying a %G_TYPE_FLAGS
3510 * See g_param_spec_internal() for details on property names.
3512 * Returns: (transfer full): a newly created parameter specification
3517 * g_param_spec_float:
3518 * @name: canonical name of the property specified
3519 * @nick: nick name for the property specified
3520 * @blurb: description of the property specified
3521 * @minimum: minimum value for the property specified
3522 * @maximum: maximum value for the property specified
3523 * @default_value: default value for the property specified
3524 * @flags: flags for the property specified
3526 * Creates a new #GParamSpecFloat instance specifying a %G_TYPE_FLOAT property.
3528 * See g_param_spec_internal() for details on property names.
3530 * Returns: (transfer full): a newly created parameter specification
3535 * g_param_spec_get_blurb:
3536 * @pspec: a valid #GParamSpec
3538 * Get the short description of a #GParamSpec.
3540 * Returns: the short description of @pspec.
3545 * g_param_spec_get_default_value:
3546 * @pspec: a #GParamSpec
3548 * Gets the default value of @pspec as a pointer to a #GValue.
3550 * The #GValue will remain value for the life of @pspec.
3552 * Returns: a pointer to a #GValue which must not be modified
3558 * g_param_spec_get_name:
3559 * @pspec: a valid #GParamSpec
3561 * Get the name of a #GParamSpec.
3563 * The name is always an "interned" string (as per g_intern_string()).
3564 * This allows for pointer-value comparisons.
3566 * Returns: the name of @pspec.
3571 * g_param_spec_get_name_quark:
3572 * @pspec: a #GParamSpec
3574 * Gets the GQuark for the name.
3576 * Returns: the GQuark for @pspec->name.
3582 * g_param_spec_get_nick:
3583 * @pspec: a valid #GParamSpec
3585 * Get the nickname of a #GParamSpec.
3587 * Returns: the nickname of @pspec.
3592 * g_param_spec_get_qdata:
3593 * @pspec: a valid #GParamSpec
3594 * @quark: a #GQuark, naming the user data pointer
3596 * Gets back user data pointers stored via g_param_spec_set_qdata().
3598 * Returns: (transfer none): the user data pointer set, or %NULL
3603 * g_param_spec_get_redirect_target:
3604 * @pspec: a #GParamSpec
3606 * If the paramspec redirects operations to another paramspec,
3607 * returns that paramspec. Redirect is used typically for
3608 * providing a new implementation of a property in a derived
3609 * type while preserving all the properties from the parent
3610 * type. Redirection is established by creating a property
3611 * of type #GParamSpecOverride. See g_object_class_override_property()
3612 * for an example of the use of this capability.
3615 * Returns: (transfer none): paramspec to which requests on this
3616 * paramspec should be redirected, or %NULL if none.
3621 * g_param_spec_gtype:
3622 * @name: canonical name of the property specified
3623 * @nick: nick name for the property specified
3624 * @blurb: description of the property specified
3625 * @is_a_type: a #GType whose subtypes are allowed as values
3626 * of the property (use %G_TYPE_NONE for any type)
3627 * @flags: flags for the property specified
3629 * Creates a new #GParamSpecGType instance specifying a
3630 * %G_TYPE_GTYPE property.
3632 * See g_param_spec_internal() for details on property names.
3635 * Returns: (transfer full): a newly created parameter specification
3641 * @name: canonical name of the property specified
3642 * @nick: nick name for the property specified
3643 * @blurb: description of the property specified
3644 * @minimum: minimum value for the property specified
3645 * @maximum: maximum value for the property specified
3646 * @default_value: default value for the property specified
3647 * @flags: flags for the property specified
3649 * Creates a new #GParamSpecInt instance specifying a %G_TYPE_INT property.
3651 * See g_param_spec_internal() for details on property names.
3653 * Returns: (transfer full): a newly created parameter specification
3658 * g_param_spec_int64:
3659 * @name: canonical name of the property specified
3660 * @nick: nick name for the property specified
3661 * @blurb: description of the property specified
3662 * @minimum: minimum value for the property specified
3663 * @maximum: maximum value for the property specified
3664 * @default_value: default value for the property specified
3665 * @flags: flags for the property specified
3667 * Creates a new #GParamSpecInt64 instance specifying a %G_TYPE_INT64 property.
3669 * See g_param_spec_internal() for details on property names.
3671 * Returns: (transfer full): a newly created parameter specification
3676 * g_param_spec_internal: (skip)
3677 * @param_type: the #GType for the property; must be derived from #G_TYPE_PARAM
3678 * @name: the canonical name of the property
3679 * @nick: the nickname of the property
3680 * @blurb: a short description of the property
3681 * @flags: a combination of #GParamFlags
3683 * Creates a new #GParamSpec instance.
3685 * A property name consists of segments consisting of ASCII letters and
3686 * digits, separated by either the '-' or '_' character. The first
3687 * character of a property name must be a letter. Names which violate these
3688 * rules lead to undefined behaviour.
3690 * When creating and looking up a #GParamSpec, either separator can be
3691 * used, but they cannot be mixed. Using '-' is considerably more
3692 * efficient and in fact required when using property names as detail
3693 * strings for signals.
3695 * Beyond the name, #GParamSpecs have two more descriptive
3696 * strings associated with them, the @nick, which should be suitable
3697 * for use as a label for the property in a property editor, and the
3698 * @blurb, which should be a somewhat longer description, suitable for
3699 * e.g. a tooltip. The @nick and @blurb should ideally be localized.
3701 * Returns: (type GObject.ParamSpec): a newly allocated #GParamSpec instance
3706 * g_param_spec_long:
3707 * @name: canonical name of the property specified
3708 * @nick: nick name for the property specified
3709 * @blurb: description of the property specified
3710 * @minimum: minimum value for the property specified
3711 * @maximum: maximum value for the property specified
3712 * @default_value: default value for the property specified
3713 * @flags: flags for the property specified
3715 * Creates a new #GParamSpecLong instance specifying a %G_TYPE_LONG property.
3717 * See g_param_spec_internal() for details on property names.
3719 * Returns: (transfer full): a newly created parameter specification
3724 * g_param_spec_object:
3725 * @name: canonical name of the property specified
3726 * @nick: nick name for the property specified
3727 * @blurb: description of the property specified
3728 * @object_type: %G_TYPE_OBJECT derived type of this property
3729 * @flags: flags for the property specified
3731 * Creates a new #GParamSpecBoxed instance specifying a %G_TYPE_OBJECT
3734 * See g_param_spec_internal() for details on property names.
3736 * Returns: (transfer full): a newly created parameter specification
3741 * g_param_spec_override: (skip)
3742 * @name: the name of the property.
3743 * @overridden: The property that is being overridden
3745 * Creates a new property of type #GParamSpecOverride. This is used
3746 * to direct operations to another paramspec, and will not be directly
3747 * useful unless you are implementing a new base type similar to GObject.
3750 * Returns: the newly created #GParamSpec
3755 * g_param_spec_param:
3756 * @name: canonical name of the property specified
3757 * @nick: nick name for the property specified
3758 * @blurb: description of the property specified
3759 * @param_type: a #GType derived from %G_TYPE_PARAM
3760 * @flags: flags for the property specified
3762 * Creates a new #GParamSpecParam instance specifying a %G_TYPE_PARAM
3765 * See g_param_spec_internal() for details on property names.
3767 * Returns: (transfer full): a newly created parameter specification
3772 * g_param_spec_pointer:
3773 * @name: canonical name of the property specified
3774 * @nick: nick name for the property specified
3775 * @blurb: description of the property specified
3776 * @flags: flags for the property specified
3778 * Creates a new #GParamSpecPointer instance specifying a pointer property.
3779 * Where possible, it is better to use g_param_spec_object() or
3780 * g_param_spec_boxed() to expose memory management information.
3782 * See g_param_spec_internal() for details on property names.
3784 * Returns: (transfer full): a newly created parameter specification
3789 * g_param_spec_pool_insert:
3790 * @pool: a #GParamSpecPool.
3791 * @pspec: the #GParamSpec to insert
3792 * @owner_type: a #GType identifying the owner of @pspec
3794 * Inserts a #GParamSpec in the pool.
3799 * g_param_spec_pool_list:
3800 * @pool: a #GParamSpecPool
3801 * @owner_type: the owner to look for
3802 * @n_pspecs_p: (out): return location for the length of the returned array
3804 * Gets an array of all #GParamSpecs owned by @owner_type in
3807 * Returns: (array length=n_pspecs_p) (transfer container): a newly
3808 * allocated array containing pointers to all #GParamSpecs
3809 * owned by @owner_type in the pool
3814 * g_param_spec_pool_list_owned:
3815 * @pool: a #GParamSpecPool
3816 * @owner_type: the owner to look for
3818 * Gets an #GList of all #GParamSpecs owned by @owner_type in
3821 * Returns: (transfer container) (element-type GObject.ParamSpec): a
3822 * #GList of all #GParamSpecs owned by @owner_type in
3823 * the pool#GParamSpecs.
3828 * g_param_spec_pool_lookup:
3829 * @pool: a #GParamSpecPool
3830 * @param_name: the name to look for
3831 * @owner_type: the owner to look for
3832 * @walk_ancestors: If %TRUE, also try to find a #GParamSpec with @param_name
3833 * owned by an ancestor of @owner_type.
3835 * Looks up a #GParamSpec in the pool.
3837 * Returns: (transfer none): The found #GParamSpec, or %NULL if no
3838 * matching #GParamSpec was found.
3843 * g_param_spec_pool_new:
3844 * @type_prefixing: Whether the pool will support type-prefixed property names.
3846 * Creates a new #GParamSpecPool.
3848 * If @type_prefixing is %TRUE, lookups in the newly created pool will
3849 * allow to specify the owner as a colon-separated prefix of the
3850 * property name, like "GtkContainer:border-width". This feature is
3851 * deprecated, so you should always set @type_prefixing to %FALSE.
3853 * Returns: (transfer none): a newly allocated #GParamSpecPool.
3858 * g_param_spec_pool_remove:
3859 * @pool: a #GParamSpecPool
3860 * @pspec: the #GParamSpec to remove
3862 * Removes a #GParamSpec from the pool.
3867 * g_param_spec_ref: (skip)
3868 * @pspec: a valid #GParamSpec
3870 * Increments the reference count of @pspec.
3872 * Returns: the #GParamSpec that was passed into this function
3877 * g_param_spec_ref_sink: (skip)
3878 * @pspec: a valid #GParamSpec
3880 * Convenience function to ref and sink a #GParamSpec.
3883 * Returns: the #GParamSpec that was passed into this function
3888 * g_param_spec_set_qdata:
3889 * @pspec: the #GParamSpec to set store a user data pointer
3890 * @quark: a #GQuark, naming the user data pointer
3891 * @data: an opaque user data pointer
3893 * Sets an opaque, named pointer on a #GParamSpec. The name is
3894 * specified through a #GQuark (retrieved e.g. via
3895 * g_quark_from_static_string()), and the pointer can be gotten back
3896 * from the @pspec with g_param_spec_get_qdata(). Setting a
3897 * previously set user data pointer, overrides (frees) the old pointer
3898 * set, using %NULL as pointer essentially removes the data stored.
3903 * g_param_spec_set_qdata_full: (skip)
3904 * @pspec: the #GParamSpec to set store a user data pointer
3905 * @quark: a #GQuark, naming the user data pointer
3906 * @data: an opaque user data pointer
3907 * @destroy: function to invoke with @data as argument, when @data needs to
3910 * This function works like g_param_spec_set_qdata(), but in addition,
3911 * a `void (*destroy) (gpointer)` function may be
3912 * specified which is called with @data as argument when the @pspec is
3913 * finalized, or the data is being overwritten by a call to
3914 * g_param_spec_set_qdata() with the same @quark.
3919 * g_param_spec_sink:
3920 * @pspec: a valid #GParamSpec
3922 * The initial reference count of a newly created #GParamSpec is 1,
3923 * even though no one has explicitly called g_param_spec_ref() on it
3924 * yet. So the initial reference count is flagged as "floating", until
3925 * someone calls `g_param_spec_ref (pspec); g_param_spec_sink
3926 * (pspec);` in sequence on it, taking over the initial
3927 * reference count (thus ending up with a @pspec that has a reference
3928 * count of 1 still, but is not flagged "floating" anymore).
3933 * g_param_spec_steal_qdata:
3934 * @pspec: the #GParamSpec to get a stored user data pointer from
3935 * @quark: a #GQuark, naming the user data pointer
3937 * Gets back user data pointers stored via g_param_spec_set_qdata()
3938 * and removes the @data from @pspec without invoking its destroy()
3939 * function (if any was set). Usually, calling this function is only
3940 * required to update user data pointers with a destroy notifier.
3942 * Returns: (transfer none): the user data pointer set, or %NULL
3947 * g_param_spec_string:
3948 * @name: canonical name of the property specified
3949 * @nick: nick name for the property specified
3950 * @blurb: description of the property specified
3951 * @default_value: (nullable): default value for the property specified
3952 * @flags: flags for the property specified
3954 * Creates a new #GParamSpecString instance.
3956 * See g_param_spec_internal() for details on property names.
3958 * Returns: (transfer full): a newly created parameter specification
3963 * g_param_spec_uchar:
3964 * @name: canonical name of the property specified
3965 * @nick: nick name for the property specified
3966 * @blurb: description of the property specified
3967 * @minimum: minimum value for the property specified
3968 * @maximum: maximum value for the property specified
3969 * @default_value: default value for the property specified
3970 * @flags: flags for the property specified
3972 * Creates a new #GParamSpecUChar instance specifying a %G_TYPE_UCHAR property.
3974 * Returns: (transfer full): a newly created parameter specification
3979 * g_param_spec_uint:
3980 * @name: canonical name of the property specified
3981 * @nick: nick name for the property specified
3982 * @blurb: description of the property specified
3983 * @minimum: minimum value for the property specified
3984 * @maximum: maximum value for the property specified
3985 * @default_value: default value for the property specified
3986 * @flags: flags for the property specified
3988 * Creates a new #GParamSpecUInt instance specifying a %G_TYPE_UINT property.
3990 * See g_param_spec_internal() for details on property names.
3992 * Returns: (transfer full): a newly created parameter specification
3997 * g_param_spec_uint64:
3998 * @name: canonical name of the property specified
3999 * @nick: nick name for the property specified
4000 * @blurb: description of the property specified
4001 * @minimum: minimum value for the property specified
4002 * @maximum: maximum value for the property specified
4003 * @default_value: default value for the property specified
4004 * @flags: flags for the property specified
4006 * Creates a new #GParamSpecUInt64 instance specifying a %G_TYPE_UINT64
4009 * See g_param_spec_internal() for details on property names.
4011 * Returns: (transfer full): a newly created parameter specification
4016 * g_param_spec_ulong:
4017 * @name: canonical name of the property specified
4018 * @nick: nick name for the property specified
4019 * @blurb: description of the property specified
4020 * @minimum: minimum value for the property specified
4021 * @maximum: maximum value for the property specified
4022 * @default_value: default value for the property specified
4023 * @flags: flags for the property specified
4025 * Creates a new #GParamSpecULong instance specifying a %G_TYPE_ULONG
4028 * See g_param_spec_internal() for details on property names.
4030 * Returns: (transfer full): a newly created parameter specification
4035 * g_param_spec_unichar:
4036 * @name: canonical name of the property specified
4037 * @nick: nick name for the property specified
4038 * @blurb: description of the property specified
4039 * @default_value: default value for the property specified
4040 * @flags: flags for the property specified
4042 * Creates a new #GParamSpecUnichar instance specifying a %G_TYPE_UINT
4043 * property. #GValue structures for this property can be accessed with
4044 * g_value_set_uint() and g_value_get_uint().
4046 * See g_param_spec_internal() for details on property names.
4048 * Returns: (transfer full): a newly created parameter specification
4053 * g_param_spec_unref: (skip)
4054 * @pspec: a valid #GParamSpec
4056 * Decrements the reference count of a @pspec.
4061 * g_param_spec_value_array: (skip)
4062 * @name: canonical name of the property specified
4063 * @nick: nick name for the property specified
4064 * @blurb: description of the property specified
4065 * @element_spec: a #GParamSpec describing the elements contained in
4066 * arrays of this property, may be %NULL
4067 * @flags: flags for the property specified
4069 * Creates a new #GParamSpecValueArray instance specifying a
4070 * %G_TYPE_VALUE_ARRAY property. %G_TYPE_VALUE_ARRAY is a
4071 * %G_TYPE_BOXED type, as such, #GValue structures for this property
4072 * can be accessed with g_value_set_boxed() and g_value_get_boxed().
4074 * See g_param_spec_internal() for details on property names.
4076 * Returns: a newly created parameter specification
4081 * g_param_spec_variant:
4082 * @name: canonical name of the property specified
4083 * @nick: nick name for the property specified
4084 * @blurb: description of the property specified
4085 * @type: a #GVariantType
4086 * @default_value: (allow-none) (transfer full): a #GVariant of type @type to
4087 * use as the default value, or %NULL
4088 * @flags: flags for the property specified
4090 * Creates a new #GParamSpecVariant instance specifying a #GVariant
4093 * If @default_value is floating, it is consumed.
4095 * See g_param_spec_internal() for details on property names.
4097 * Returns: (transfer full): the newly created #GParamSpec
4103 * g_param_type_register_static:
4104 * @name: 0-terminated string used as the name of the new #GParamSpec type.
4105 * @pspec_info: The #GParamSpecTypeInfo for this #GParamSpec type.
4107 * Registers @name as the name of a new static type derived from
4108 * #G_TYPE_PARAM. The type system uses the information contained in
4109 * the #GParamSpecTypeInfo structure pointed to by @info to manage the
4110 * #GParamSpec type and its instances.
4112 * Returns: The new type identifier.
4117 * g_param_value_convert:
4118 * @pspec: a valid #GParamSpec
4119 * @src_value: souce #GValue
4120 * @dest_value: destination #GValue of correct type for @pspec
4121 * @strict_validation: %TRUE requires @dest_value to conform to @pspec
4122 * without modifications
4124 * Transforms @src_value into @dest_value if possible, and then
4125 * validates @dest_value, in order for it to conform to @pspec. If
4126 * @strict_validation is %TRUE this function will only succeed if the
4127 * transformed @dest_value complied to @pspec without modifications.
4129 * See also g_value_type_transformable(), g_value_transform() and
4130 * g_param_value_validate().
4132 * Returns: %TRUE if transformation and validation were successful,
4133 * %FALSE otherwise and @dest_value is left untouched.
4138 * g_param_value_defaults:
4139 * @pspec: a valid #GParamSpec
4140 * @value: a #GValue of correct type for @pspec
4142 * Checks whether @value contains the default value as specified in @pspec.
4144 * Returns: whether @value contains the canonical default for this @pspec
4149 * g_param_value_set_default:
4150 * @pspec: a valid #GParamSpec
4151 * @value: a #GValue of correct type for @pspec
4153 * Sets @value to its default value as specified in @pspec.
4158 * g_param_value_validate:
4159 * @pspec: a valid #GParamSpec
4160 * @value: a #GValue of correct type for @pspec
4162 * Ensures that the contents of @value comply with the specifications
4163 * set out by @pspec. For example, a #GParamSpecInt might require
4164 * that integers stored in @value may not be smaller than -42 and not be
4165 * greater than +42. If @value contains an integer outside of this range,
4166 * it is modified accordingly, so the resulting value will fit into the
4169 * Returns: whether modifying @value was necessary to ensure validity
4174 * g_param_values_cmp:
4175 * @pspec: a valid #GParamSpec
4176 * @value1: a #GValue of correct type for @pspec
4177 * @value2: a #GValue of correct type for @pspec
4179 * Compares @value1 with @value2 according to @pspec, and return -1, 0 or +1,
4180 * if @value1 is found to be less than, equal to or greater than @value2,
4183 * Returns: -1, 0 or +1, for a less than, equal to or greater than result
4188 * g_pointer_type_register_static:
4189 * @name: the name of the new pointer type.
4191 * Creates a new %G_TYPE_POINTER derived type id for a new
4192 * pointer type with name @name.
4194 * Returns: a new %G_TYPE_POINTER derived type id for @name.
4199 * g_signal_accumulator_first_wins:
4200 * @ihint: standard #GSignalAccumulator parameter
4201 * @return_accu: standard #GSignalAccumulator parameter
4202 * @handler_return: standard #GSignalAccumulator parameter
4203 * @dummy: standard #GSignalAccumulator parameter
4205 * A predefined #GSignalAccumulator for signals intended to be used as a
4206 * hook for application code to provide a particular value. Usually
4207 * only one such value is desired and multiple handlers for the same
4208 * signal don't make much sense (except for the case of the default
4209 * handler defined in the class structure, in which case you will
4210 * usually want the signal connection to override the class handler).
4212 * This accumulator will use the return value from the first signal
4213 * handler that is run as the return value for the signal and not run
4214 * any further handlers (ie: the first handler "wins").
4216 * Returns: standard #GSignalAccumulator result
4222 * g_signal_accumulator_true_handled:
4223 * @ihint: standard #GSignalAccumulator parameter
4224 * @return_accu: standard #GSignalAccumulator parameter
4225 * @handler_return: standard #GSignalAccumulator parameter
4226 * @dummy: standard #GSignalAccumulator parameter
4228 * A predefined #GSignalAccumulator for signals that return a
4229 * boolean values. The behavior that this accumulator gives is
4230 * that a return of %TRUE stops the signal emission: no further
4231 * callbacks will be invoked, while a return of %FALSE allows
4232 * the emission to continue. The idea here is that a %TRUE return
4233 * indicates that the callback handled the signal, and no further
4234 * handling is needed.
4237 * Returns: standard #GSignalAccumulator result
4242 * g_signal_add_emission_hook:
4243 * @signal_id: the signal identifier, as returned by g_signal_lookup().
4244 * @detail: the detail on which to call the hook.
4245 * @hook_func: a #GSignalEmissionHook function.
4246 * @hook_data: user data for @hook_func.
4247 * @data_destroy: a #GDestroyNotify for @hook_data.
4249 * Adds an emission hook for a signal, which will get called for any emission
4250 * of that signal, independent of the instance. This is possible only
4251 * for signals which don't have #G_SIGNAL_NO_HOOKS flag set.
4253 * Returns: the hook id, for later use with g_signal_remove_emission_hook().
4258 * g_signal_chain_from_overridden:
4259 * @instance_and_params: (array): the argument list of the signal emission.
4260 * The first element in the array is a #GValue for the instance the signal
4261 * is being emitted on. The rest are any arguments to be passed to the signal.
4262 * @return_value: Location for the return value.
4264 * Calls the original class closure of a signal. This function should only
4265 * be called from an overridden class closure; see
4266 * g_signal_override_class_closure() and
4267 * g_signal_override_class_handler().
4272 * g_signal_chain_from_overridden_handler: (skip)
4273 * @instance: (type GObject.TypeInstance): the instance the signal is being
4275 * @...: parameters to be passed to the parent class closure, followed by a
4276 * location for the return value. If the return type of the signal
4277 * is #G_TYPE_NONE, the return value location can be omitted.
4279 * Calls the original class closure of a signal. This function should
4280 * only be called from an overridden class closure; see
4281 * g_signal_override_class_closure() and
4282 * g_signal_override_class_handler().
4289 * g_signal_connect_closure:
4290 * @instance: (type GObject.Object): the instance to connect to.
4291 * @detailed_signal: a string of the form "signal-name::detail".
4292 * @closure: the closure to connect.
4293 * @after: whether the handler should be called before or after the
4294 * default handler of the signal.
4296 * Connects a closure to a signal for a particular object.
4298 * Returns: the handler id (always greater than 0 for successful connections)
4303 * g_signal_connect_closure_by_id:
4304 * @instance: (type GObject.Object): the instance to connect to.
4305 * @signal_id: the id of the signal.
4306 * @detail: the detail.
4307 * @closure: the closure to connect.
4308 * @after: whether the handler should be called before or after the
4309 * default handler of the signal.
4311 * Connects a closure to a signal for a particular object.
4313 * Returns: the handler id (always greater than 0 for successful connections)
4318 * g_signal_connect_data:
4319 * @instance: (type GObject.Object): the instance to connect to.
4320 * @detailed_signal: a string of the form "signal-name::detail".
4321 * @c_handler: the #GCallback to connect.
4322 * @data: data to pass to @c_handler calls.
4323 * @destroy_data: a #GClosureNotify for @data.
4324 * @connect_flags: a combination of #GConnectFlags.
4326 * Connects a #GCallback function to a signal for a particular object. Similar
4327 * to g_signal_connect(), but allows to provide a #GClosureNotify for the data
4328 * which will be called when the signal handler is disconnected and no longer
4329 * used. Specify @connect_flags if you need `..._after()` or
4330 * `..._swapped()` variants of this function.
4332 * Returns: the handler id (always greater than 0 for successful connections)
4337 * g_signal_connect_object: (skip)
4338 * @instance: (type GObject.TypeInstance): the instance to connect to.
4339 * @detailed_signal: a string of the form "signal-name::detail".
4340 * @c_handler: the #GCallback to connect.
4341 * @gobject: (type GObject.Object) (nullable): the object to pass as data
4343 * @connect_flags: a combination of #GConnectFlags.
4345 * This is similar to g_signal_connect_data(), but uses a closure which
4346 * ensures that the @gobject stays alive during the call to @c_handler
4347 * by temporarily adding a reference count to @gobject.
4349 * When the @gobject is destroyed the signal handler will be automatically
4350 * disconnected. Note that this is not currently threadsafe (ie:
4351 * emitting a signal while @gobject is being destroyed in another thread
4354 * Returns: the handler id.
4360 * @instance: (type GObject.Object): the instance the signal is being emitted on.
4361 * @signal_id: the signal id
4362 * @detail: the detail
4363 * @...: parameters to be passed to the signal, followed by a
4364 * location for the return value. If the return type of the signal
4365 * is #G_TYPE_NONE, the return value location can be omitted.
4369 * Note that g_signal_emit() resets the return value to the default
4370 * if no handlers are connected, in contrast to g_signal_emitv().
4375 * g_signal_emit_by_name:
4376 * @instance: (type GObject.Object): the instance the signal is being emitted on.
4377 * @detailed_signal: a string of the form "signal-name::detail".
4378 * @...: parameters to be passed to the signal, followed by a
4379 * location for the return value. If the return type of the signal
4380 * is #G_TYPE_NONE, the return value location can be omitted.
4384 * Note that g_signal_emit_by_name() resets the return value to the default
4385 * if no handlers are connected, in contrast to g_signal_emitv().
4390 * g_signal_emit_valist: (skip)
4391 * @instance: (type GObject.TypeInstance): the instance the signal is being
4393 * @signal_id: the signal id
4394 * @detail: the detail
4395 * @var_args: a list of parameters to be passed to the signal, followed by a
4396 * location for the return value. If the return type of the signal
4397 * is #G_TYPE_NONE, the return value location can be omitted.
4401 * Note that g_signal_emit_valist() resets the return value to the default
4402 * if no handlers are connected, in contrast to g_signal_emitv().
4408 * @instance_and_params: (array): argument list for the signal emission.
4409 * The first element in the array is a #GValue for the instance the signal
4410 * is being emitted on. The rest are any arguments to be passed to the signal.
4411 * @signal_id: the signal id
4412 * @detail: the detail
4413 * @return_value: (inout) (optional): Location to
4414 * store the return value of the signal emission. This must be provided if the
4415 * specified signal returns a value, but may be ignored otherwise.
4419 * Note that g_signal_emitv() doesn't change @return_value if no handlers are
4420 * connected, in contrast to g_signal_emit() and g_signal_emit_valist().
4425 * g_signal_get_invocation_hint:
4426 * @instance: (type GObject.Object): the instance to query
4428 * Returns the invocation hint of the innermost signal emission of instance.
4430 * Returns: (transfer none): the invocation hint of the innermost signal emission.
4435 * g_signal_handler_block:
4436 * @instance: (type GObject.Object): The instance to block the signal handler of.
4437 * @handler_id: Handler id of the handler to be blocked.
4439 * Blocks a handler of an instance so it will not be called during any
4440 * signal emissions unless it is unblocked again. Thus "blocking" a
4441 * signal handler means to temporarily deactive it, a signal handler
4442 * has to be unblocked exactly the same amount of times it has been
4443 * blocked before to become active again.
4445 * The @handler_id has to be a valid signal handler id, connected to a
4446 * signal of @instance.
4451 * g_signal_handler_disconnect:
4452 * @instance: (type GObject.Object): The instance to remove the signal handler from.
4453 * @handler_id: Handler id of the handler to be disconnected.
4455 * Disconnects a handler from an instance so it will not be called during
4456 * any future or currently ongoing emissions of the signal it has been
4457 * connected to. The @handler_id becomes invalid and may be reused.
4459 * The @handler_id has to be a valid signal handler id, connected to a
4460 * signal of @instance.
4465 * g_signal_handler_find:
4466 * @instance: (type GObject.Object): The instance owning the signal handler to be found.
4467 * @mask: Mask indicating which of @signal_id, @detail, @closure, @func
4468 * and/or @data the handler has to match.
4469 * @signal_id: Signal the handler has to be connected to.
4470 * @detail: Signal detail the handler has to be connected to.
4471 * @closure: (allow-none): The closure the handler will invoke.
4472 * @func: The C closure callback of the handler (useless for non-C closures).
4473 * @data: The closure data of the handler's closure.
4475 * Finds the first signal handler that matches certain selection criteria.
4476 * The criteria mask is passed as an OR-ed combination of #GSignalMatchType
4477 * flags, and the criteria values are passed as arguments.
4478 * The match @mask has to be non-0 for successful matches.
4479 * If no handler was found, 0 is returned.
4481 * Returns: A valid non-0 signal handler id for a successful match.
4486 * g_signal_handler_is_connected:
4487 * @instance: (type GObject.Object): The instance where a signal handler is sought.
4488 * @handler_id: the handler id.
4490 * Returns whether @handler_id is the id of a handler connected to @instance.
4492 * Returns: whether @handler_id identifies a handler connected to @instance.
4497 * g_signal_handler_unblock:
4498 * @instance: (type GObject.Object): The instance to unblock the signal handler of.
4499 * @handler_id: Handler id of the handler to be unblocked.
4501 * Undoes the effect of a previous g_signal_handler_block() call. A
4502 * blocked handler is skipped during signal emissions and will not be
4503 * invoked, unblocking it (for exactly the amount of times it has been
4504 * blocked before) reverts its "blocked" state, so the handler will be
4505 * recognized by the signal system and is called upon future or
4506 * currently ongoing signal emissions (since the order in which
4507 * handlers are called during signal emissions is deterministic,
4508 * whether the unblocked handler in question is called as part of a
4509 * currently ongoing emission depends on how far that emission has
4512 * The @handler_id has to be a valid id of a signal handler that is
4513 * connected to a signal of @instance and is currently blocked.
4518 * g_signal_handlers_block_matched:
4519 * @instance: (type GObject.Object): The instance to block handlers from.
4520 * @mask: Mask indicating which of @signal_id, @detail, @closure, @func
4521 * and/or @data the handlers have to match.
4522 * @signal_id: Signal the handlers have to be connected to.
4523 * @detail: Signal detail the handlers have to be connected to.
4524 * @closure: (allow-none): The closure the handlers will invoke.
4525 * @func: The C closure callback of the handlers (useless for non-C closures).
4526 * @data: The closure data of the handlers' closures.
4528 * Blocks all handlers on an instance that match a certain selection criteria.
4529 * The criteria mask is passed as an OR-ed combination of #GSignalMatchType
4530 * flags, and the criteria values are passed as arguments.
4531 * Passing at least one of the %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC
4532 * or %G_SIGNAL_MATCH_DATA match flags is required for successful matches.
4533 * If no handlers were found, 0 is returned, the number of blocked handlers
4536 * Returns: The number of handlers that matched.
4541 * g_signal_handlers_destroy:
4542 * @instance: (type GObject.Object): The instance whose signal handlers are destroyed
4544 * Destroy all signal handlers of a type instance. This function is
4545 * an implementation detail of the #GObject dispose implementation,
4546 * and should not be used outside of the type system.
4551 * g_signal_handlers_disconnect_matched:
4552 * @instance: (type GObject.Object): The instance to remove handlers from.
4553 * @mask: Mask indicating which of @signal_id, @detail, @closure, @func
4554 * and/or @data the handlers have to match.
4555 * @signal_id: Signal the handlers have to be connected to.
4556 * @detail: Signal detail the handlers have to be connected to.
4557 * @closure: (allow-none): The closure the handlers will invoke.
4558 * @func: The C closure callback of the handlers (useless for non-C closures).
4559 * @data: The closure data of the handlers' closures.
4561 * Disconnects all handlers on an instance that match a certain
4562 * selection criteria. The criteria mask is passed as an OR-ed
4563 * combination of #GSignalMatchType flags, and the criteria values are
4564 * passed as arguments. Passing at least one of the
4565 * %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC or
4566 * %G_SIGNAL_MATCH_DATA match flags is required for successful
4567 * matches. If no handlers were found, 0 is returned, the number of
4568 * disconnected handlers otherwise.
4570 * Returns: The number of handlers that matched.
4575 * g_signal_handlers_unblock_matched:
4576 * @instance: (type GObject.Object): The instance to unblock handlers from.
4577 * @mask: Mask indicating which of @signal_id, @detail, @closure, @func
4578 * and/or @data the handlers have to match.
4579 * @signal_id: Signal the handlers have to be connected to.
4580 * @detail: Signal detail the handlers have to be connected to.
4581 * @closure: (allow-none): The closure the handlers will invoke.
4582 * @func: The C closure callback of the handlers (useless for non-C closures).
4583 * @data: The closure data of the handlers' closures.
4585 * Unblocks all handlers on an instance that match a certain selection
4586 * criteria. The criteria mask is passed as an OR-ed combination of
4587 * #GSignalMatchType flags, and the criteria values are passed as arguments.
4588 * Passing at least one of the %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC
4589 * or %G_SIGNAL_MATCH_DATA match flags is required for successful matches.
4590 * If no handlers were found, 0 is returned, the number of unblocked handlers
4591 * otherwise. The match criteria should not apply to any handlers that are
4592 * not currently blocked.
4594 * Returns: The number of handlers that matched.
4599 * g_signal_has_handler_pending:
4600 * @instance: (type GObject.Object): the object whose signal handlers are sought.
4601 * @signal_id: the signal id.
4602 * @detail: the detail.
4603 * @may_be_blocked: whether blocked handlers should count as match.
4605 * Returns whether there are any handlers connected to @instance for the
4606 * given signal id and detail.
4608 * If @detail is 0 then it will only match handlers that were connected
4609 * without detail. If @detail is non-zero then it will match handlers
4610 * connected both without detail and with the given detail. This is
4611 * consistent with how a signal emitted with @detail would be delivered
4612 * to those handlers.
4614 * Since 2.46 this also checks for a non-default class closure being
4615 * installed, as this is basically always what you want.
4617 * One example of when you might use this is when the arguments to the
4618 * signal are difficult to compute. A class implementor may opt to not
4619 * emit the signal if no one is attached anyway, thus saving the cost
4620 * of building the arguments.
4622 * Returns: %TRUE if a handler is connected to the signal, %FALSE
4628 * g_signal_list_ids:
4629 * @itype: Instance or interface type.
4630 * @n_ids: Location to store the number of signal ids for @itype.
4632 * Lists the signals by id that a certain instance or interface type
4633 * created. Further information about the signals can be acquired through
4636 * Returns: (array length=n_ids) (transfer full): Newly allocated array of signal IDs.
4642 * @name: the signal's name.
4643 * @itype: the type that the signal operates on.
4645 * Given the name of the signal and the type of object it connects to, gets
4646 * the signal's identifying integer. Emitting the signal by number is
4647 * somewhat faster than using the name each time.
4649 * Also tries the ancestors of the given type.
4651 * See g_signal_new() for details on allowed signal names.
4653 * Returns: the signal's identifying number, or 0 if no signal was found.
4659 * @signal_id: the signal's identifying number.
4661 * Given the signal's identifier, finds its name.
4663 * Two different signals may have the same name, if they have differing types.
4665 * Returns: the signal name, or %NULL if the signal number was invalid.
4671 * @signal_name: the name for the signal
4672 * @itype: the type this signal pertains to. It will also pertain to
4673 * types which are derived from this type.
4674 * @signal_flags: a combination of #GSignalFlags specifying detail of when
4675 * the default handler is to be invoked. You should at least specify
4676 * %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST.
4677 * @class_offset: The offset of the function pointer in the class structure
4678 * for this type. Used to invoke a class method generically. Pass 0 to
4679 * not associate a class method slot with this signal.
4680 * @accumulator: the accumulator for this signal; may be %NULL.
4681 * @accu_data: user data for the @accumulator.
4682 * @c_marshaller: (allow-none): the function to translate arrays of parameter
4683 * values to signal emissions into C language callback invocations or %NULL.
4684 * @return_type: the type of return value, or #G_TYPE_NONE for a signal
4685 * without a return value.
4686 * @n_params: the number of parameter types to follow.
4687 * @...: a list of types, one for each parameter.
4689 * Creates a new signal. (This is usually done in the class initializer.)
4691 * A signal name consists of segments consisting of ASCII letters and
4692 * digits, separated by either the '-' or '_' character. The first
4693 * character of a signal name must be a letter. Names which violate these
4694 * rules lead to undefined behaviour of the GSignal system.
4696 * When registering a signal and looking up a signal, either separator can
4697 * be used, but they cannot be mixed.
4699 * If 0 is used for @class_offset subclasses cannot override the class handler
4700 * in their class_init method by doing super_class->signal_handler = my_signal_handler.
4701 * Instead they will have to use g_signal_override_class_handler().
4703 * If c_marshaller is %NULL, g_cclosure_marshal_generic() will be used as
4704 * the marshaller for this signal.
4706 * Returns: the signal id
4711 * g_signal_new_class_handler:
4712 * @signal_name: the name for the signal
4713 * @itype: the type this signal pertains to. It will also pertain to
4714 * types which are derived from this type.
4715 * @signal_flags: a combination of #GSignalFlags specifying detail of when
4716 * the default handler is to be invoked. You should at least specify
4717 * %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST.
4718 * @class_handler: a #GCallback which acts as class implementation of
4719 * this signal. Used to invoke a class method generically. Pass %NULL to
4720 * not associate a class method with this signal.
4721 * @accumulator: the accumulator for this signal; may be %NULL.
4722 * @accu_data: user data for the @accumulator.
4723 * @c_marshaller: (allow-none): the function to translate arrays of parameter
4724 * values to signal emissions into C language callback invocations or %NULL.
4725 * @return_type: the type of return value, or #G_TYPE_NONE for a signal
4726 * without a return value.
4727 * @n_params: the number of parameter types to follow.
4728 * @...: a list of types, one for each parameter.
4730 * Creates a new signal. (This is usually done in the class initializer.)
4732 * This is a variant of g_signal_new() that takes a C callback instead
4733 * off a class offset for the signal's class handler. This function
4734 * doesn't need a function pointer exposed in the class structure of
4735 * an object definition, instead the function pointer is passed
4736 * directly and can be overriden by derived classes with
4737 * g_signal_override_class_closure() or
4738 * g_signal_override_class_handler()and chained to with
4739 * g_signal_chain_from_overridden() or
4740 * g_signal_chain_from_overridden_handler().
4742 * See g_signal_new() for information about signal names.
4744 * If c_marshaller is %NULL, g_cclosure_marshal_generic() will be used as
4745 * the marshaller for this signal.
4747 * Returns: the signal id
4753 * g_signal_new_valist:
4754 * @signal_name: the name for the signal
4755 * @itype: the type this signal pertains to. It will also pertain to
4756 * types which are derived from this type.
4757 * @signal_flags: a combination of #GSignalFlags specifying detail of when
4758 * the default handler is to be invoked. You should at least specify
4759 * %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST.
4760 * @class_closure: The closure to invoke on signal emission; may be %NULL.
4761 * @accumulator: the accumulator for this signal; may be %NULL.
4762 * @accu_data: user data for the @accumulator.
4763 * @c_marshaller: (allow-none): the function to translate arrays of parameter
4764 * values to signal emissions into C language callback invocations or %NULL.
4765 * @return_type: the type of return value, or #G_TYPE_NONE for a signal
4766 * without a return value.
4767 * @n_params: the number of parameter types in @args.
4768 * @args: va_list of #GType, one for each parameter.
4770 * Creates a new signal. (This is usually done in the class initializer.)
4772 * See g_signal_new() for details on allowed signal names.
4774 * If c_marshaller is %NULL, g_cclosure_marshal_generic() will be used as
4775 * the marshaller for this signal.
4777 * Returns: the signal id
4783 * @signal_name: the name for the signal
4784 * @itype: the type this signal pertains to. It will also pertain to
4785 * types which are derived from this type
4786 * @signal_flags: a combination of #GSignalFlags specifying detail of when
4787 * the default handler is to be invoked. You should at least specify
4788 * %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST
4789 * @class_closure: (allow-none): The closure to invoke on signal emission;
4791 * @accumulator: (allow-none): the accumulator for this signal; may be %NULL
4792 * @accu_data: user data for the @accumulator
4793 * @c_marshaller: (allow-none): the function to translate arrays of
4794 * parameter values to signal emissions into C language callback
4795 * invocations or %NULL
4796 * @return_type: the type of return value, or #G_TYPE_NONE for a signal
4797 * without a return value
4798 * @n_params: the length of @param_types
4799 * @param_types: (array length=n_params): an array of types, one for
4802 * Creates a new signal. (This is usually done in the class initializer.)
4804 * See g_signal_new() for details on allowed signal names.
4806 * If c_marshaller is %NULL, g_cclosure_marshal_generic() will be used as
4807 * the marshaller for this signal.
4809 * Returns: the signal id
4814 * g_signal_override_class_closure:
4815 * @signal_id: the signal id
4816 * @instance_type: the instance type on which to override the class closure
4818 * @class_closure: the closure.
4820 * Overrides the class closure (i.e. the default handler) for the given signal
4821 * for emissions on instances of @instance_type. @instance_type must be derived
4822 * from the type to which the signal belongs.
4824 * See g_signal_chain_from_overridden() and
4825 * g_signal_chain_from_overridden_handler() for how to chain up to the
4826 * parent class closure from inside the overridden one.
4831 * g_signal_override_class_handler:
4832 * @signal_name: the name for the signal
4833 * @instance_type: the instance type on which to override the class handler
4835 * @class_handler: the handler.
4837 * Overrides the class closure (i.e. the default handler) for the
4838 * given signal for emissions on instances of @instance_type with
4839 * callback @class_handler. @instance_type must be derived from the
4840 * type to which the signal belongs.
4842 * See g_signal_chain_from_overridden() and
4843 * g_signal_chain_from_overridden_handler() for how to chain up to the
4844 * parent class closure from inside the overridden one.
4851 * g_signal_parse_name:
4852 * @detailed_signal: a string of the form "signal-name::detail".
4853 * @itype: The interface/instance type that introduced "signal-name".
4854 * @signal_id_p: (out): Location to store the signal id.
4855 * @detail_p: (out): Location to store the detail quark.
4856 * @force_detail_quark: %TRUE forces creation of a #GQuark for the detail.
4858 * Internal function to parse a signal name into its @signal_id
4859 * and @detail quark.
4861 * Returns: Whether the signal name could successfully be parsed and @signal_id_p and @detail_p contain valid return values.
4867 * @signal_id: The signal id of the signal to query information for.
4868 * @query: (out caller-allocates): A user provided structure that is
4869 * filled in with constant values upon success.
4871 * Queries the signal system for in-depth information about a
4872 * specific signal. This function will fill in a user-provided
4873 * structure to hold signal-specific information. If an invalid
4874 * signal id is passed in, the @signal_id member of the #GSignalQuery
4875 * is 0. All members filled into the #GSignalQuery structure should
4876 * be considered constant and have to be left untouched.
4881 * g_signal_remove_emission_hook:
4882 * @signal_id: the id of the signal
4883 * @hook_id: the id of the emission hook, as returned by
4884 * g_signal_add_emission_hook()
4886 * Deletes an emission hook.
4891 * g_signal_set_va_marshaller:
4892 * @signal_id: the signal id
4893 * @instance_type: the instance type on which to set the marshaller.
4894 * @va_marshaller: the marshaller to set.
4896 * Change the #GSignalCVaMarshaller used for a given signal. This is a
4897 * specialised form of the marshaller that can often be used for the
4898 * common case of a single connected signal handler and avoids the
4899 * overhead of #GValue. Its use is optional.
4906 * g_signal_stop_emission:
4907 * @instance: (type GObject.Object): the object whose signal handlers you wish to stop.
4908 * @signal_id: the signal identifier, as returned by g_signal_lookup().
4909 * @detail: the detail which the signal was emitted with.
4911 * Stops a signal's current emission.
4913 * This will prevent the default method from running, if the signal was
4914 * %G_SIGNAL_RUN_LAST and you connected normally (i.e. without the "after"
4917 * Prints a warning if used on a signal which isn't being emitted.
4922 * g_signal_stop_emission_by_name:
4923 * @instance: (type GObject.Object): the object whose signal handlers you wish to stop.
4924 * @detailed_signal: a string of the form "signal-name::detail".
4926 * Stops a signal's current emission.
4928 * This is just like g_signal_stop_emission() except it will look up the
4929 * signal id for you.
4934 * g_signal_type_cclosure_new:
4935 * @itype: the #GType identifier of an interface or classed type
4936 * @struct_offset: the offset of the member function of @itype's class
4937 * structure which is to be invoked by the new closure
4939 * Creates a new closure which invokes the function found at the offset
4940 * @struct_offset in the class structure of the interface or classed type
4941 * identified by @itype.
4943 * Returns: a new #GCClosure
4948 * g_source_set_closure:
4949 * @source: the source
4950 * @closure: a #GClosure
4952 * Set the callback for a source as a #GClosure.
4954 * If the source is not one of the standard GLib types, the @closure_callback
4955 * and @closure_marshal fields of the #GSourceFuncs structure must have been
4956 * filled in with pointers to appropriate functions.
4961 * g_source_set_dummy_callback:
4962 * @source: the source
4964 * Sets a dummy callback for @source. The callback will do nothing, and
4965 * if the source expects a #gboolean return value, it will return %TRUE.
4966 * (If the source expects any other type of return value, it will return
4967 * a 0/%NULL value; whatever g_value_init() initializes a #GValue to for
4970 * If the source is not one of the standard GLib types, the
4971 * @closure_callback and @closure_marshal fields of the #GSourceFuncs
4972 * structure must have been filled in with pointers to appropriate
4978 * g_strdup_value_contents:
4979 * @value: #GValue which contents are to be described.
4981 * Return a newly allocated string, which describes the contents of a
4982 * #GValue. The main purpose of this function is to describe #GValue
4983 * contents for debugging output, the way in which the contents are
4984 * described may change between different GLib versions.
4986 * Returns: Newly allocated string.
4991 * g_type_add_class_cache_func: (skip)
4992 * @cache_data: data to be passed to @cache_func
4993 * @cache_func: a #GTypeClassCacheFunc
4995 * Adds a #GTypeClassCacheFunc to be called before the reference count of a
4996 * class goes from one to zero. This can be used to prevent premature class
4997 * destruction. All installed #GTypeClassCacheFunc functions will be chained
4998 * until one of them returns %TRUE. The functions have to check the class id
4999 * passed in to figure whether they actually want to cache the class of this
5000 * type, since all classes are routed through the same #GTypeClassCacheFunc
5006 * g_type_add_class_private:
5007 * @class_type: GType of an classed type
5008 * @private_size: size of private structure
5010 * Registers a private class structure for a classed type;
5011 * when the class is allocated, the private structures for
5012 * the class and all of its parent types are allocated
5013 * sequentially in the same memory block as the public
5014 * structures, and are zero-filled.
5016 * This function should be called in the
5017 * type's get_type() function after the type is registered.
5018 * The private structure can be retrieved using the
5019 * G_TYPE_CLASS_GET_PRIVATE() macro.
5026 * g_type_add_interface_check: (skip)
5027 * @check_data: data to pass to @check_func
5028 * @check_func: function to be called after each interface
5031 * Adds a function to be called after an interface vtable is
5032 * initialized for any class (i.e. after the @interface_init
5033 * member of #GInterfaceInfo has been called).
5035 * This function is useful when you want to check an invariant
5036 * that depends on the interfaces of a class. For instance, the
5037 * implementation of #GObject uses this facility to check that an
5038 * object implements all of the properties that are defined on its
5046 * g_type_add_interface_dynamic:
5047 * @instance_type: #GType value of an instantiable type
5048 * @interface_type: #GType value of an interface type
5049 * @plugin: #GTypePlugin structure to retrieve the #GInterfaceInfo from
5051 * Adds the dynamic @interface_type to @instantiable_type. The information
5052 * contained in the #GTypePlugin structure pointed to by @plugin
5053 * is used to manage the relationship.
5058 * g_type_add_interface_static:
5059 * @instance_type: #GType value of an instantiable type
5060 * @interface_type: #GType value of an interface type
5061 * @info: #GInterfaceInfo structure for this
5062 * (@instance_type, @interface_type) combination
5064 * Adds the static @interface_type to @instantiable_type.
5065 * The information contained in the #GInterfaceInfo structure
5066 * pointed to by @info is used to manage the relationship.
5071 * g_type_check_instance:
5072 * @instance: a valid #GTypeInstance structure
5074 * Private helper function to aid implementation of the
5075 * G_TYPE_CHECK_INSTANCE() macro.
5077 * Returns: %TRUE if @instance is valid, %FALSE otherwise
5083 * @type: the parent type
5084 * @n_children: (out) (allow-none): location to store the length of
5085 * the returned array, or %NULL
5087 * Return a newly allocated and 0-terminated array of type IDs, listing
5088 * the child types of @type.
5090 * Returns: (array length=n_children) (transfer full): Newly allocated
5091 * and 0-terminated array of child types, free with g_free()
5096 * g_type_class_add_private:
5097 * @g_class: (type GObject.TypeClass): class structure for an instantiatable
5099 * @private_size: size of private structure
5101 * Registers a private structure for an instantiatable type.
5103 * When an object is allocated, the private structures for
5104 * the type and all of its parent types are allocated
5105 * sequentially in the same memory block as the public
5106 * structures, and are zero-filled.
5108 * Note that the accumulated size of the private structures of
5109 * a type and all its parent types cannot exceed 64 KiB.
5111 * This function should be called in the type's class_init() function.
5112 * The private structure can be retrieved using the
5113 * G_TYPE_INSTANCE_GET_PRIVATE() macro.
5115 * The following example shows attaching a private structure
5116 * MyObjectPrivate to an object MyObject defined in the standard
5117 * GObject fashion in the type's class_init() function.
5119 * Note the use of a structure member "priv" to avoid the overhead
5120 * of repeatedly calling MY_OBJECT_GET_PRIVATE().
5122 * |[<!-- language="C" -->
5123 * typedef struct _MyObject MyObject;
5124 * typedef struct _MyObjectPrivate MyObjectPrivate;
5126 * struct _MyObject {
5129 * MyObjectPrivate *priv;
5132 * struct _MyObjectPrivate {
5137 * my_object_class_init (MyObjectClass *klass)
5139 * g_type_class_add_private (klass, sizeof (MyObjectPrivate));
5143 * my_object_init (MyObject *my_object)
5145 * my_object->priv = G_TYPE_INSTANCE_GET_PRIVATE (my_object,
5148 * // my_object->priv->some_field will be automatically initialised to 0
5152 * my_object_get_some_field (MyObject *my_object)
5154 * MyObjectPrivate *priv;
5156 * g_return_val_if_fail (MY_IS_OBJECT (my_object), 0);
5158 * priv = my_object->priv;
5160 * return priv->some_field;
5169 * g_type_class_get_instance_private_offset: (skip)
5170 * @g_class: (type GObject.TypeClass): a #GTypeClass
5172 * Gets the offset of the private data for instances of @g_class.
5174 * This is how many bytes you should add to the instance pointer of a
5175 * class in order to get the private data for the type represented by
5178 * You can only call this function after you have registered a private
5179 * data area for @g_class using g_type_class_add_private().
5181 * Returns: the offset, in bytes
5187 * g_type_class_peek:
5188 * @type: type ID of a classed type
5190 * This function is essentially the same as g_type_class_ref(),
5191 * except that the classes reference count isn't incremented.
5192 * As a consequence, this function may return %NULL if the class
5193 * of the type passed in does not currently exist (hasn't been
5194 * referenced before).
5196 * Returns: (type GObject.TypeClass) (transfer none): the #GTypeClass
5197 * structure for the given type ID or %NULL if the class does not
5203 * g_type_class_peek_parent:
5204 * @g_class: (type GObject.TypeClass): the #GTypeClass structure to
5205 * retrieve the parent class for
5207 * This is a convenience function often needed in class initializers.
5208 * It returns the class structure of the immediate parent type of the
5209 * class passed in. Since derived classes hold a reference count on
5210 * their parent classes as long as they are instantiated, the returned
5211 * class will always exist.
5213 * This function is essentially equivalent to:
5214 * g_type_class_peek (g_type_parent (G_TYPE_FROM_CLASS (g_class)))
5216 * Returns: (type GObject.TypeClass) (transfer none): the parent class
5222 * g_type_class_peek_static:
5223 * @type: type ID of a classed type
5225 * A more efficient version of g_type_class_peek() which works only for
5228 * Returns: (type GObject.TypeClass) (transfer none): the #GTypeClass
5229 * structure for the given type ID or %NULL if the class does not
5230 * currently exist or is dynamically loaded
5237 * @type: type ID of a classed type
5239 * Increments the reference count of the class structure belonging to
5240 * @type. This function will demand-create the class if it doesn't
5243 * Returns: (type GObject.TypeClass) (transfer none): the #GTypeClass
5244 * structure for the given type ID
5249 * g_type_class_unref:
5250 * @g_class: (type GObject.TypeClass): a #GTypeClass structure to unref
5252 * Decrements the reference count of the class structure being passed in.
5253 * Once the last reference count of a class has been released, classes
5254 * may be finalized by the type system, so further dereferencing of a
5255 * class pointer after g_type_class_unref() are invalid.
5260 * g_type_class_unref_uncached: (skip)
5261 * @g_class: (type GObject.TypeClass): a #GTypeClass structure to unref
5263 * A variant of g_type_class_unref() for use in #GTypeClassCacheFunc
5264 * implementations. It unreferences a class without consulting the chain
5265 * of #GTypeClassCacheFuncs, avoiding the recursion which would occur
5271 * g_type_create_instance: (skip)
5272 * @type: an instantiatable type to create an instance for
5274 * Creates and initializes an instance of @type if @type is valid and
5275 * can be instantiated. The type system only performs basic allocation
5276 * and structure setups for instances: actual instance creation should
5277 * happen through functions supplied by the type's fundamental type
5278 * implementation. So use of g_type_create_instance() is reserved for
5279 * implementators of fundamental types only. E.g. instances of the
5280 * #GObject hierarchy should be created via g_object_new() and never
5281 * directly through g_type_create_instance() which doesn't handle things
5282 * like singleton objects or object construction.
5284 * The extended members of the returned instance are guaranteed to be filled
5287 * Note: Do not use this function, unless you're implementing a
5288 * fundamental type. Also language bindings should not use this
5289 * function, but g_object_new() instead.
5291 * Returns: an allocated and initialized instance, subject to further
5292 * treatment by the fundamental type implementation
5297 * g_type_default_interface_peek:
5298 * @g_type: an interface type
5300 * If the interface type @g_type is currently in use, returns its
5301 * default interface vtable.
5304 * Returns: (type GObject.TypeInterface) (transfer none): the default
5305 * vtable for the interface, or %NULL if the type is not currently
5311 * g_type_default_interface_ref:
5312 * @g_type: an interface type
5314 * Increments the reference count for the interface type @g_type,
5315 * and returns the default interface vtable for the type.
5317 * If the type is not currently in use, then the default vtable
5318 * for the type will be created and initalized by calling
5319 * the base interface init and default vtable init functions for
5320 * the type (the @base_init and @class_init members of #GTypeInfo).
5321 * Calling g_type_default_interface_ref() is useful when you
5322 * want to make sure that signals and properties for an interface
5323 * have been installed.
5326 * Returns: (type GObject.TypeInterface) (transfer none): the default
5327 * vtable for the interface; call g_type_default_interface_unref()
5328 * when you are done using the interface.
5333 * g_type_default_interface_unref:
5334 * @g_iface: (type GObject.TypeInterface): the default vtable
5335 * structure for a interface, as returned by g_type_default_interface_ref()
5337 * Decrements the reference count for the type corresponding to the
5338 * interface default vtable @g_iface. If the type is dynamic, then
5339 * when no one is using the interface and all references have
5340 * been released, the finalize function for the interface's default
5341 * vtable (the @class_finalize member of #GTypeInfo) will be called.
5351 * Returns the length of the ancestry of the passed in type. This
5352 * includes the type itself, so that e.g. a fundamental type has depth 1.
5354 * Returns: the depth of @type
5362 * Ensures that the indicated @type has been registered with the
5363 * type system, and its _class_init() method has been run.
5365 * In theory, simply calling the type's _get_type() method (or using
5366 * the corresponding macro) is supposed take care of this. However,
5367 * _get_type() methods are often marked %G_GNUC_CONST for performance
5368 * reasons, even though this is technically incorrect (since
5369 * %G_GNUC_CONST requires that the function not have side effects,
5370 * which _get_type() methods do on the first call). As a result, if
5371 * you write a bare call to a _get_type() macro, it may get optimized
5372 * out by the compiler. Using g_type_ensure() guarantees that the
5373 * type's _get_type() method is called.
5380 * g_type_free_instance:
5381 * @instance: an instance of a type
5383 * Frees an instance of a type, returning it to the instance pool for
5384 * the type, if there is one.
5386 * Like g_type_create_instance(), this function is reserved for
5387 * implementors of fundamental types.
5393 * @name: type name to lookup
5395 * Lookup the type ID from a given type name, returning 0 if no type
5396 * has been registered under this name (this is the preferred method
5397 * to find out by name whether a specific type has been registered
5400 * Returns: corresponding type ID or 0
5405 * g_type_fundamental:
5406 * @type_id: valid type ID
5408 * Internal function, used to extract the fundamental type ID portion.
5409 * Use G_TYPE_FUNDAMENTAL() instead.
5411 * Returns: fundamental type ID
5416 * g_type_fundamental_next:
5418 * Returns the next free fundamental type id which can be used to
5419 * register a new fundamental type with g_type_register_fundamental().
5420 * The returned type ID represents the highest currently registered
5421 * fundamental type identifier.
5423 * Returns: the next available fundamental type ID to be registered,
5424 * or 0 if the type system ran out of fundamental type IDs
5429 * g_type_get_instance_count:
5432 * Returns the number of instances allocated of the particular type;
5433 * this is only available if GLib is built with debugging support and
5434 * the instance_count debug flag is set (by setting the GOBJECT_DEBUG
5435 * variable to include instance-count).
5437 * Returns: the number of instances allocated of the given type;
5438 * if instance counts are not available, returns 0.
5444 * g_type_get_plugin:
5445 * @type: #GType to retrieve the plugin for
5447 * Returns the #GTypePlugin structure for @type.
5449 * Returns: (transfer none): the corresponding plugin
5450 * if @type is a dynamic type, %NULL otherwise
5457 * @quark: a #GQuark id to identify the data
5459 * Obtains data which has previously been attached to @type
5460 * with g_type_set_qdata().
5462 * Note that this does not take subtyping into account; data
5463 * attached to one type with g_type_set_qdata() cannot
5464 * be retrieved from a subtype using g_type_get_qdata().
5466 * Returns: (transfer none): the data, or %NULL if no data was found
5471 * g_type_get_type_registration_serial:
5473 * Returns an opaque serial number that represents the state of the set
5474 * of registered types. Any time a type is registered this serial changes,
5475 * which means you can cache information based on type lookups (such as
5476 * g_type_from_name()) and know if the cache is still valid at a later
5477 * time by comparing the current serial with the one at the type lookup.
5480 * Returns: An unsigned int, representing the state of type registrations
5487 * This function used to initialise the type system. Since GLib 2.36,
5488 * the type system is initialised automatically and this function does
5491 * Deprecated: 2.36: the type system is now initialised automatically
5496 * g_type_init_with_debug_flags:
5497 * @debug_flags: bitwise combination of #GTypeDebugFlags values for
5498 * debugging purposes
5500 * This function used to initialise the type system with debugging
5501 * flags. Since GLib 2.36, the type system is initialised automatically
5502 * and this function does nothing.
5504 * If you need to enable debugging features, use the GOBJECT_DEBUG
5505 * environment variable.
5507 * Deprecated: 2.36: the type system is now initialised automatically
5512 * g_type_interface_add_prerequisite:
5513 * @interface_type: #GType value of an interface type
5514 * @prerequisite_type: #GType value of an interface or instantiatable type
5516 * Adds @prerequisite_type to the list of prerequisites of @interface_type.
5517 * This means that any type implementing @interface_type must also implement
5518 * @prerequisite_type. Prerequisites can be thought of as an alternative to
5519 * interface derivation (which GType doesn't support). An interface can have
5520 * at most one instantiatable prerequisite type.
5525 * g_type_interface_get_plugin:
5526 * @instance_type: #GType of an instantiatable type
5527 * @interface_type: #GType of an interface type
5529 * Returns the #GTypePlugin structure for the dynamic interface
5530 * @interface_type which has been added to @instance_type, or %NULL
5531 * if @interface_type has not been added to @instance_type or does
5532 * not have a #GTypePlugin structure. See g_type_add_interface_dynamic().
5534 * Returns: (transfer none): the #GTypePlugin for the dynamic
5535 * interface @interface_type of @instance_type
5540 * g_type_interface_peek:
5541 * @instance_class: (type GObject.TypeClass): a #GTypeClass structure
5542 * @iface_type: an interface ID which this class conforms to
5544 * Returns the #GTypeInterface structure of an interface to which the
5545 * passed in class conforms.
5547 * Returns: (type GObject.TypeInterface) (transfer none): the #GTypeInterface
5548 * structure of @iface_type if implemented by @instance_class, %NULL
5554 * g_type_interface_peek_parent:
5555 * @g_iface: (type GObject.TypeInterface): a #GTypeInterface structure
5557 * Returns the corresponding #GTypeInterface structure of the parent type
5558 * of the instance type to which @g_iface belongs. This is useful when
5559 * deriving the implementation of an interface from the parent type and
5560 * then possibly overriding some methods.
5562 * Returns: (transfer none) (type GObject.TypeInterface): the
5563 * corresponding #GTypeInterface structure of the parent type of the
5564 * instance type to which @g_iface belongs, or %NULL if the parent
5565 * type doesn't conform to the interface
5570 * g_type_interface_prerequisites:
5571 * @interface_type: an interface type
5572 * @n_prerequisites: (out) (allow-none): location to return the number
5573 * of prerequisites, or %NULL
5575 * Returns the prerequisites of an interfaces type.
5578 * Returns: (array length=n_prerequisites) (transfer full): a
5579 * newly-allocated zero-terminated array of #GType containing
5580 * the prerequisites of @interface_type
5585 * g_type_interfaces:
5586 * @type: the type to list interface types for
5587 * @n_interfaces: (out) (allow-none): location to store the length of
5588 * the returned array, or %NULL
5590 * Return a newly allocated and 0-terminated array of type IDs, listing
5591 * the interface types that @type conforms to.
5593 * Returns: (array length=n_interfaces) (transfer full): Newly allocated
5594 * and 0-terminated array of interface types, free with g_free()
5600 * @type: type to check anchestry for
5601 * @is_a_type: possible anchestor of @type or interface that @type
5604 * If @is_a_type is a derivable type, check whether @type is a
5605 * descendant of @is_a_type. If @is_a_type is an interface, check
5606 * whether @type conforms to it.
5608 * Returns: %TRUE if @type is a @is_a_type
5613 * g_type_module_add_interface:
5614 * @module: a #GTypeModule
5615 * @instance_type: type to which to add the interface.
5616 * @interface_type: interface type to add
5617 * @interface_info: type information structure
5619 * Registers an additional interface for a type, whose interface lives
5620 * in the given type plugin. If the interface was already registered
5621 * for the type in this plugin, nothing will be done.
5623 * As long as any instances of the type exist, the type plugin will
5629 * g_type_module_register_enum:
5630 * @module: a #GTypeModule
5631 * @name: name for the type
5632 * @const_static_values: an array of #GEnumValue structs for the
5633 * possible enumeration values. The array is
5634 * terminated by a struct with all members being
5637 * Looks up or registers an enumeration that is implemented with a particular
5638 * type plugin. If a type with name @type_name was previously registered,
5639 * the #GType identifier for the type is returned, otherwise the type
5640 * is newly registered, and the resulting #GType identifier returned.
5642 * As long as any instances of the type exist, the type plugin will
5646 * Returns: the new or existing type ID
5651 * g_type_module_register_flags:
5652 * @module: a #GTypeModule
5653 * @name: name for the type
5654 * @const_static_values: an array of #GFlagsValue structs for the
5655 * possible flags values. The array is
5656 * terminated by a struct with all members being
5659 * Looks up or registers a flags type that is implemented with a particular
5660 * type plugin. If a type with name @type_name was previously registered,
5661 * the #GType identifier for the type is returned, otherwise the type
5662 * is newly registered, and the resulting #GType identifier returned.
5664 * As long as any instances of the type exist, the type plugin will
5668 * Returns: the new or existing type ID
5673 * g_type_module_register_type:
5674 * @module: a #GTypeModule
5675 * @parent_type: the type for the parent class
5676 * @type_name: name for the type
5677 * @type_info: type information structure
5678 * @flags: flags field providing details about the type
5680 * Looks up or registers a type that is implemented with a particular
5681 * type plugin. If a type with name @type_name was previously registered,
5682 * the #GType identifier for the type is returned, otherwise the type
5683 * is newly registered, and the resulting #GType identifier returned.
5685 * When reregistering a type (typically because a module is unloaded
5686 * then reloaded, and reinitialized), @module and @parent_type must
5687 * be the same as they were previously.
5689 * As long as any instances of the type exist, the type plugin will
5692 * Returns: the new or existing type ID
5697 * g_type_module_set_name:
5698 * @module: a #GTypeModule.
5699 * @name: a human-readable name to use in error messages.
5701 * Sets the name for a #GTypeModule
5706 * g_type_module_unuse:
5707 * @module: a #GTypeModule
5709 * Decreases the use count of a #GTypeModule by one. If the
5710 * result is zero, the module will be unloaded. (However, the
5711 * #GTypeModule will not be freed, and types associated with the
5712 * #GTypeModule are not unregistered. Once a #GTypeModule is
5713 * initialized, it must exist forever.)
5718 * g_type_module_use:
5719 * @module: a #GTypeModule
5721 * Increases the use count of a #GTypeModule by one. If the
5722 * use count was zero before, the plugin will be loaded.
5723 * If loading the plugin fails, the use count is reset to
5726 * Returns: %FALSE if the plugin needed to be loaded and
5727 * loading the plugin failed.
5733 * @type: type to return name for
5735 * Get the unique name that is assigned to a type ID. Note that this
5736 * function (like all other GType API) cannot cope with invalid type
5737 * IDs. %G_TYPE_INVALID may be passed to this function, as may be any
5738 * other validly registered type ID, but randomized type IDs should
5739 * not be passed in and will most likely lead to a crash.
5741 * Returns: static type name or %NULL
5747 * @leaf_type: descendant of @root_type and the type to be returned
5748 * @root_type: immediate parent of the returned type
5750 * Given a @leaf_type and a @root_type which is contained in its
5751 * anchestry, return the type that @root_type is the immediate parent
5752 * of. In other words, this function determines the type that is
5753 * derived directly from @root_type which is also a base class of
5754 * @leaf_type. Given a root type and a leaf type, this function can
5755 * be used to determine the types and order in which the leaf type is
5756 * descended from the root type.
5758 * Returns: immediate child of @root_type and anchestor of @leaf_type
5764 * @type: the derived type
5766 * Return the direct parent type of the passed in type. If the passed
5767 * in type has no parent, i.e. is a fundamental type, 0 is returned.
5769 * Returns: the parent type
5774 * g_type_plugin_complete_interface_info:
5775 * @plugin: the #GTypePlugin
5776 * @instance_type: the #GType of an instantiable type to which the interface
5778 * @interface_type: the #GType of the interface whose info is completed
5779 * @info: the #GInterfaceInfo to fill in
5781 * Calls the @complete_interface_info function from the
5782 * #GTypePluginClass of @plugin. There should be no need to use this
5783 * function outside of the GObject type system itself.
5788 * g_type_plugin_complete_type_info:
5789 * @plugin: a #GTypePlugin
5790 * @g_type: the #GType whose info is completed
5791 * @info: the #GTypeInfo struct to fill in
5792 * @value_table: the #GTypeValueTable to fill in
5794 * Calls the @complete_type_info function from the #GTypePluginClass of @plugin.
5795 * There should be no need to use this function outside of the GObject
5796 * type system itself.
5801 * g_type_plugin_unuse:
5802 * @plugin: a #GTypePlugin
5804 * Calls the @unuse_plugin function from the #GTypePluginClass of
5805 * @plugin. There should be no need to use this function outside of
5806 * the GObject type system itself.
5811 * g_type_plugin_use:
5812 * @plugin: a #GTypePlugin
5814 * Calls the @use_plugin function from the #GTypePluginClass of
5815 * @plugin. There should be no need to use this function outside of
5816 * the GObject type system itself.
5822 * @type: type to return quark of type name for
5824 * Get the corresponding quark of the type IDs name.
5826 * Returns: the type names quark or 0
5832 * @type: #GType of a static, classed type
5833 * @query: (out caller-allocates): a user provided structure that is
5834 * filled in with constant values upon success
5836 * Queries the type system for information about a specific type.
5837 * This function will fill in a user-provided structure to hold
5838 * type-specific information. If an invalid #GType is passed in, the
5839 * @type member of the #GTypeQuery is 0. All members filled into the
5840 * #GTypeQuery structure should be considered constant and have to be
5846 * g_type_register_dynamic:
5847 * @parent_type: type from which this type will be derived
5848 * @type_name: 0-terminated string used as the name of the new type
5849 * @plugin: #GTypePlugin structure to retrieve the #GTypeInfo from
5850 * @flags: bitwise combination of #GTypeFlags values
5852 * Registers @type_name as the name of a new dynamic type derived from
5853 * @parent_type. The type system uses the information contained in the
5854 * #GTypePlugin structure pointed to by @plugin to manage the type and its
5855 * instances (if not abstract). The value of @flags determines the nature
5856 * (e.g. abstract or not) of the type.
5858 * Returns: the new type identifier or #G_TYPE_INVALID if registration failed
5863 * g_type_register_fundamental:
5864 * @type_id: a predefined type identifier
5865 * @type_name: 0-terminated string used as the name of the new type
5866 * @info: #GTypeInfo structure for this type
5867 * @finfo: #GTypeFundamentalInfo structure for this type
5868 * @flags: bitwise combination of #GTypeFlags values
5870 * Registers @type_id as the predefined identifier and @type_name as the
5871 * name of a fundamental type. If @type_id is already registered, or a
5872 * type named @type_name is already registered, the behaviour is undefined.
5873 * The type system uses the information contained in the #GTypeInfo structure
5874 * pointed to by @info and the #GTypeFundamentalInfo structure pointed to by
5875 * @finfo to manage the type and its instances. The value of @flags determines
5876 * additional characteristics of the fundamental type.
5878 * Returns: the predefined type identifier
5883 * g_type_register_static:
5884 * @parent_type: type from which this type will be derived
5885 * @type_name: 0-terminated string used as the name of the new type
5886 * @info: #GTypeInfo structure for this type
5887 * @flags: bitwise combination of #GTypeFlags values
5889 * Registers @type_name as the name of a new static type derived from
5890 * @parent_type. The type system uses the information contained in the
5891 * #GTypeInfo structure pointed to by @info to manage the type and its
5892 * instances (if not abstract). The value of @flags determines the nature
5893 * (e.g. abstract or not) of the type.
5895 * Returns: the new type identifier
5900 * g_type_register_static_simple: (skip)
5901 * @parent_type: type from which this type will be derived
5902 * @type_name: 0-terminated string used as the name of the new type
5903 * @class_size: size of the class structure (see #GTypeInfo)
5904 * @class_init: location of the class initialization function (see #GTypeInfo)
5905 * @instance_size: size of the instance structure (see #GTypeInfo)
5906 * @instance_init: location of the instance initialization function (see #GTypeInfo)
5907 * @flags: bitwise combination of #GTypeFlags values
5909 * Registers @type_name as the name of a new static type derived from
5910 * @parent_type. The value of @flags determines the nature (e.g.
5911 * abstract or not) of the type. It works by filling a #GTypeInfo
5912 * struct and calling g_type_register_static().
5915 * Returns: the new type identifier
5920 * g_type_remove_class_cache_func: (skip)
5921 * @cache_data: data that was given when adding @cache_func
5922 * @cache_func: a #GTypeClassCacheFunc
5924 * Removes a previously installed #GTypeClassCacheFunc. The cache
5925 * maintained by @cache_func has to be empty when calling
5926 * g_type_remove_class_cache_func() to avoid leaks.
5931 * g_type_remove_interface_check: (skip)
5932 * @check_data: callback data passed to g_type_add_interface_check()
5933 * @check_func: callback function passed to g_type_add_interface_check()
5935 * Removes an interface check function added with
5936 * g_type_add_interface_check().
5945 * @quark: a #GQuark id to identify the data
5948 * Attaches arbitrary data to a type.
5953 * g_type_value_table_peek: (skip)
5956 * Returns the location of the #GTypeValueTable associated with @type.
5958 * Note that this function should only be used from source code
5959 * that implements or has internal knowledge of the implementation of
5962 * Returns: location of the #GTypeValueTable associated with @type or
5963 * %NULL if there is no #GTypeValueTable associated with @type
5968 * g_value_array_append:
5969 * @value_array: #GValueArray to add an element to
5970 * @value: (allow-none): #GValue to copy into #GValueArray, or %NULL
5972 * Insert a copy of @value as last element of @value_array. If @value is
5973 * %NULL, an uninitialized value is appended.
5975 * Returns: (transfer none): the #GValueArray passed in as @value_array
5976 * Deprecated: 2.32: Use #GArray and g_array_append_val() instead.
5981 * g_value_array_copy:
5982 * @value_array: #GValueArray to copy
5984 * Construct an exact copy of a #GValueArray by duplicating all its
5987 * Returns: (transfer full): Newly allocated copy of #GValueArray
5988 * Deprecated: 2.32: Use #GArray and g_array_ref() instead.
5993 * g_value_array_free:
5994 * @value_array: #GValueArray to free
5996 * Free a #GValueArray including its contents.
5998 * Deprecated: 2.32: Use #GArray and g_array_unref() instead.
6003 * g_value_array_get_nth:
6004 * @value_array: #GValueArray to get a value from
6005 * @index_: index of the value of interest
6007 * Return a pointer to the value at @index_ containd in @value_array.
6009 * Returns: (transfer none): pointer to a value at @index_ in @value_array
6010 * Deprecated: 2.32: Use g_array_index() instead.
6015 * g_value_array_insert:
6016 * @value_array: #GValueArray to add an element to
6017 * @index_: insertion position, must be <= value_array->;n_values
6018 * @value: (allow-none): #GValue to copy into #GValueArray, or %NULL
6020 * Insert a copy of @value at specified position into @value_array. If @value
6021 * is %NULL, an uninitialized value is inserted.
6023 * Returns: (transfer none): the #GValueArray passed in as @value_array
6024 * Deprecated: 2.32: Use #GArray and g_array_insert_val() instead.
6029 * g_value_array_new:
6030 * @n_prealloced: number of values to preallocate space for
6032 * Allocate and initialize a new #GValueArray, optionally preserve space
6033 * for @n_prealloced elements. New arrays always contain 0 elements,
6034 * regardless of the value of @n_prealloced.
6036 * Returns: a newly allocated #GValueArray with 0 values
6037 * Deprecated: 2.32: Use #GArray and g_array_sized_new() instead.
6042 * g_value_array_prepend:
6043 * @value_array: #GValueArray to add an element to
6044 * @value: (allow-none): #GValue to copy into #GValueArray, or %NULL
6046 * Insert a copy of @value as first element of @value_array. If @value is
6047 * %NULL, an uninitialized value is prepended.
6049 * Returns: (transfer none): the #GValueArray passed in as @value_array
6050 * Deprecated: 2.32: Use #GArray and g_array_prepend_val() instead.
6055 * g_value_array_remove:
6056 * @value_array: #GValueArray to remove an element from
6057 * @index_: position of value to remove, which must be less than
6058 * @value_array->n_values
6060 * Remove the value at position @index_ from @value_array.
6062 * Returns: (transfer none): the #GValueArray passed in as @value_array
6063 * Deprecated: 2.32: Use #GArray and g_array_remove_index() instead.
6068 * g_value_array_sort:
6069 * @value_array: #GValueArray to sort
6070 * @compare_func: (scope call): function to compare elements
6072 * Sort @value_array using @compare_func to compare the elements according to
6073 * the semantics of #GCompareFunc.
6075 * The current implementation uses the same sorting algorithm as standard
6076 * C qsort() function.
6078 * Returns: (transfer none): the #GValueArray passed in as @value_array
6079 * Deprecated: 2.32: Use #GArray and g_array_sort().
6084 * g_value_array_sort_with_data: (rename-to g_value_array_sort)
6085 * @value_array: #GValueArray to sort
6086 * @compare_func: (scope call): function to compare elements
6087 * @user_data: (closure): extra data argument provided for @compare_func
6089 * Sort @value_array using @compare_func to compare the elements according
6090 * to the semantics of #GCompareDataFunc.
6092 * The current implementation uses the same sorting algorithm as standard
6093 * C qsort() function.
6095 * Returns: (transfer none): the #GValueArray passed in as @value_array
6096 * Deprecated: 2.32: Use #GArray and g_array_sort_with_data().
6102 * @src_value: An initialized #GValue structure.
6103 * @dest_value: An initialized #GValue structure of the same type as @src_value.
6105 * Copies the value of @src_value into @dest_value.
6110 * g_value_dup_boxed: (skip)
6111 * @value: a valid #GValue of %G_TYPE_BOXED derived type
6113 * Get the contents of a %G_TYPE_BOXED derived #GValue. Upon getting,
6114 * the boxed value is duplicated and needs to be later freed with
6115 * g_boxed_free(), e.g. like: g_boxed_free (G_VALUE_TYPE (@value),
6118 * Returns: boxed contents of @value
6123 * g_value_dup_object:
6124 * @value: a valid #GValue whose type is derived from %G_TYPE_OBJECT
6126 * Get the contents of a %G_TYPE_OBJECT derived #GValue, increasing
6127 * its reference count. If the contents of the #GValue are %NULL, then
6128 * %NULL will be returned.
6130 * Returns: (type GObject.Object) (transfer full): object content of @value,
6131 * should be unreferenced when no longer needed.
6136 * g_value_dup_param: (skip)
6137 * @value: a valid #GValue whose type is derived from %G_TYPE_PARAM
6139 * Get the contents of a %G_TYPE_PARAM #GValue, increasing its
6142 * Returns: #GParamSpec content of @value, should be unreferenced when
6148 * g_value_dup_string:
6149 * @value: a valid #GValue of type %G_TYPE_STRING
6151 * Get a copy the contents of a %G_TYPE_STRING #GValue.
6153 * Returns: a newly allocated copy of the string content of @value
6158 * g_value_dup_variant:
6159 * @value: a valid #GValue of type %G_TYPE_VARIANT
6161 * Get the contents of a variant #GValue, increasing its refcount.
6163 * Returns: variant contents of @value, should be unrefed using
6164 * g_variant_unref() when no longer needed
6170 * g_value_fits_pointer:
6171 * @value: An initialized #GValue structure.
6173 * Determines if @value will fit inside the size of a pointer value.
6174 * This is an internal function introduced mainly for C marshallers.
6176 * Returns: %TRUE if @value will fit inside a pointer value.
6181 * g_value_get_boolean:
6182 * @value: a valid #GValue of type %G_TYPE_BOOLEAN
6184 * Get the contents of a %G_TYPE_BOOLEAN #GValue.
6186 * Returns: boolean contents of @value
6191 * g_value_get_boxed:
6192 * @value: a valid #GValue of %G_TYPE_BOXED derived type
6194 * Get the contents of a %G_TYPE_BOXED derived #GValue.
6196 * Returns: (transfer none): boxed contents of @value
6202 * @value: a valid #GValue of type %G_TYPE_CHAR
6204 * Do not use this function; it is broken on platforms where the %char
6205 * type is unsigned, such as ARM and PowerPC. See g_value_get_schar().
6207 * Get the contents of a %G_TYPE_CHAR #GValue.
6209 * Returns: character contents of @value
6210 * Deprecated: 2.32: This function's return type is broken, see g_value_get_schar()
6215 * g_value_get_double:
6216 * @value: a valid #GValue of type %G_TYPE_DOUBLE
6218 * Get the contents of a %G_TYPE_DOUBLE #GValue.
6220 * Returns: double contents of @value
6226 * @value: a valid #GValue whose type is derived from %G_TYPE_ENUM
6228 * Get the contents of a %G_TYPE_ENUM #GValue.
6230 * Returns: enum contents of @value
6235 * g_value_get_flags:
6236 * @value: a valid #GValue whose type is derived from %G_TYPE_FLAGS
6238 * Get the contents of a %G_TYPE_FLAGS #GValue.
6240 * Returns: flags contents of @value
6245 * g_value_get_float:
6246 * @value: a valid #GValue of type %G_TYPE_FLOAT
6248 * Get the contents of a %G_TYPE_FLOAT #GValue.
6250 * Returns: float contents of @value
6255 * g_value_get_gtype:
6256 * @value: a valid #GValue of type %G_TYPE_GTYPE
6258 * Get the contents of a %G_TYPE_GTYPE #GValue.
6261 * Returns: the #GType stored in @value
6267 * @value: a valid #GValue of type %G_TYPE_INT
6269 * Get the contents of a %G_TYPE_INT #GValue.
6271 * Returns: integer contents of @value
6276 * g_value_get_int64:
6277 * @value: a valid #GValue of type %G_TYPE_INT64
6279 * Get the contents of a %G_TYPE_INT64 #GValue.
6281 * Returns: 64bit integer contents of @value
6287 * @value: a valid #GValue of type %G_TYPE_LONG
6289 * Get the contents of a %G_TYPE_LONG #GValue.
6291 * Returns: long integer contents of @value
6296 * g_value_get_object:
6297 * @value: a valid #GValue of %G_TYPE_OBJECT derived type
6299 * Get the contents of a %G_TYPE_OBJECT derived #GValue.
6301 * Returns: (type GObject.Object) (transfer none): object contents of @value
6306 * g_value_get_param:
6307 * @value: a valid #GValue whose type is derived from %G_TYPE_PARAM
6309 * Get the contents of a %G_TYPE_PARAM #GValue.
6311 * Returns: (transfer none): #GParamSpec content of @value
6316 * g_value_get_pointer:
6317 * @value: a valid #GValue of %G_TYPE_POINTER
6319 * Get the contents of a pointer #GValue.
6321 * Returns: (transfer none): pointer contents of @value
6326 * g_value_get_schar:
6327 * @value: a valid #GValue of type %G_TYPE_CHAR
6329 * Get the contents of a %G_TYPE_CHAR #GValue.
6331 * Returns: signed 8 bit integer contents of @value
6337 * g_value_get_string:
6338 * @value: a valid #GValue of type %G_TYPE_STRING
6340 * Get the contents of a %G_TYPE_STRING #GValue.
6342 * Returns: string content of @value
6347 * g_value_get_uchar:
6348 * @value: a valid #GValue of type %G_TYPE_UCHAR
6350 * Get the contents of a %G_TYPE_UCHAR #GValue.
6352 * Returns: unsigned character contents of @value
6358 * @value: a valid #GValue of type %G_TYPE_UINT
6360 * Get the contents of a %G_TYPE_UINT #GValue.
6362 * Returns: unsigned integer contents of @value
6367 * g_value_get_uint64:
6368 * @value: a valid #GValue of type %G_TYPE_UINT64
6370 * Get the contents of a %G_TYPE_UINT64 #GValue.
6372 * Returns: unsigned 64bit integer contents of @value
6377 * g_value_get_ulong:
6378 * @value: a valid #GValue of type %G_TYPE_ULONG
6380 * Get the contents of a %G_TYPE_ULONG #GValue.
6382 * Returns: unsigned long integer contents of @value
6387 * g_value_get_variant:
6388 * @value: a valid #GValue of type %G_TYPE_VARIANT
6390 * Get the contents of a variant #GValue.
6392 * Returns: variant contents of @value
6399 * @value: A zero-filled (uninitialized) #GValue structure.
6400 * @g_type: Type the #GValue should hold values of.
6402 * Initializes @value with the default value of @type.
6404 * Returns: (transfer none): the #GValue structure that has been passed in
6409 * g_value_init_from_instance:
6410 * @value: An uninitialized #GValue structure.
6411 * @instance: (type GObject.TypeInstance): the instance
6413 * Initializes and sets @value from an instantiatable type via the
6414 * value_table's collect_value() function.
6416 * Note: The @value will be initialised with the exact type of
6417 * @instance. If you wish to set the @value's type to a different GType
6418 * (such as a parent class GType), you need to manually call
6419 * g_value_init() and g_value_set_instance().
6426 * g_value_peek_pointer:
6427 * @value: An initialized #GValue structure
6429 * Returns the value contents as pointer. This function asserts that
6430 * g_value_fits_pointer() returned %TRUE for the passed in value.
6431 * This is an internal function introduced mainly for C marshallers.
6433 * Returns: (transfer none): the value contents as pointer
6438 * g_value_register_transform_func: (skip)
6439 * @src_type: Source type.
6440 * @dest_type: Target type.
6441 * @transform_func: a function which transforms values of type @src_type
6442 * into value of type @dest_type
6444 * Registers a value transformation function for use in g_value_transform().
6445 * A previously registered transformation function for @src_type and @dest_type
6452 * @value: An initialized #GValue structure.
6454 * Clears the current value in @value and resets it to the default value
6455 * (as if the value had just been initialized).
6457 * Returns: the #GValue structure that has been passed in
6462 * g_value_set_boolean:
6463 * @value: a valid #GValue of type %G_TYPE_BOOLEAN
6464 * @v_boolean: boolean value to be set
6466 * Set the contents of a %G_TYPE_BOOLEAN #GValue to @v_boolean.
6471 * g_value_set_boxed:
6472 * @value: a valid #GValue of %G_TYPE_BOXED derived type
6473 * @v_boxed: (allow-none): boxed value to be set
6475 * Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.
6480 * g_value_set_boxed_take_ownership:
6481 * @value: a valid #GValue of %G_TYPE_BOXED derived type
6482 * @v_boxed: (allow-none): duplicated unowned boxed value to be set
6484 * This is an internal function introduced mainly for C marshallers.
6486 * Deprecated: 2.4: Use g_value_take_boxed() instead.
6492 * @value: a valid #GValue of type %G_TYPE_CHAR
6493 * @v_char: character value to be set
6495 * Set the contents of a %G_TYPE_CHAR #GValue to @v_char.
6497 * Deprecated: 2.32: This function's input type is broken, see g_value_set_schar()
6502 * g_value_set_double:
6503 * @value: a valid #GValue of type %G_TYPE_DOUBLE
6504 * @v_double: double value to be set
6506 * Set the contents of a %G_TYPE_DOUBLE #GValue to @v_double.
6512 * @value: a valid #GValue whose type is derived from %G_TYPE_ENUM
6513 * @v_enum: enum value to be set
6515 * Set the contents of a %G_TYPE_ENUM #GValue to @v_enum.
6520 * g_value_set_flags:
6521 * @value: a valid #GValue whose type is derived from %G_TYPE_FLAGS
6522 * @v_flags: flags value to be set
6524 * Set the contents of a %G_TYPE_FLAGS #GValue to @v_flags.
6529 * g_value_set_float:
6530 * @value: a valid #GValue of type %G_TYPE_FLOAT
6531 * @v_float: float value to be set
6533 * Set the contents of a %G_TYPE_FLOAT #GValue to @v_float.
6538 * g_value_set_gtype:
6539 * @value: a valid #GValue of type %G_TYPE_GTYPE
6540 * @v_gtype: #GType to be set
6542 * Set the contents of a %G_TYPE_GTYPE #GValue to @v_gtype.
6549 * g_value_set_instance:
6550 * @value: An initialized #GValue structure.
6551 * @instance: (allow-none): the instance
6553 * Sets @value from an instantiatable type via the
6554 * value_table's collect_value() function.
6560 * @value: a valid #GValue of type %G_TYPE_INT
6561 * @v_int: integer value to be set
6563 * Set the contents of a %G_TYPE_INT #GValue to @v_int.
6568 * g_value_set_int64:
6569 * @value: a valid #GValue of type %G_TYPE_INT64
6570 * @v_int64: 64bit integer value to be set
6572 * Set the contents of a %G_TYPE_INT64 #GValue to @v_int64.
6578 * @value: a valid #GValue of type %G_TYPE_LONG
6579 * @v_long: long integer value to be set
6581 * Set the contents of a %G_TYPE_LONG #GValue to @v_long.
6586 * g_value_set_object:
6587 * @value: a valid #GValue of %G_TYPE_OBJECT derived type
6588 * @v_object: (type GObject.Object) (allow-none): object value to be set
6590 * Set the contents of a %G_TYPE_OBJECT derived #GValue to @v_object.
6592 * g_value_set_object() increases the reference count of @v_object
6593 * (the #GValue holds a reference to @v_object). If you do not wish
6594 * to increase the reference count of the object (i.e. you wish to
6595 * pass your current reference to the #GValue because you no longer
6596 * need it), use g_value_take_object() instead.
6598 * It is important that your #GValue holds a reference to @v_object (either its
6599 * own, or one it has taken) to ensure that the object won't be destroyed while
6600 * the #GValue still exists).
6605 * g_value_set_object_take_ownership: (skip)
6606 * @value: a valid #GValue of %G_TYPE_OBJECT derived type
6607 * @v_object: (allow-none): object value to be set
6609 * This is an internal function introduced mainly for C marshallers.
6611 * Deprecated: 2.4: Use g_value_take_object() instead.
6616 * g_value_set_param:
6617 * @value: a valid #GValue of type %G_TYPE_PARAM
6618 * @param: (allow-none): the #GParamSpec to be set
6620 * Set the contents of a %G_TYPE_PARAM #GValue to @param.
6625 * g_value_set_param_take_ownership: (skip)
6626 * @value: a valid #GValue of type %G_TYPE_PARAM
6627 * @param: (allow-none): the #GParamSpec to be set
6629 * This is an internal function introduced mainly for C marshallers.
6631 * Deprecated: 2.4: Use g_value_take_param() instead.
6636 * g_value_set_pointer:
6637 * @value: a valid #GValue of %G_TYPE_POINTER
6638 * @v_pointer: pointer value to be set
6640 * Set the contents of a pointer #GValue to @v_pointer.
6645 * g_value_set_schar:
6646 * @value: a valid #GValue of type %G_TYPE_CHAR
6647 * @v_char: signed 8 bit integer to be set
6649 * Set the contents of a %G_TYPE_CHAR #GValue to @v_char.
6656 * g_value_set_static_boxed:
6657 * @value: a valid #GValue of %G_TYPE_BOXED derived type
6658 * @v_boxed: (allow-none): static boxed value to be set
6660 * Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.
6661 * The boxed value is assumed to be static, and is thus not duplicated
6662 * when setting the #GValue.
6667 * g_value_set_static_string:
6668 * @value: a valid #GValue of type %G_TYPE_STRING
6669 * @v_string: (allow-none): static string to be set
6671 * Set the contents of a %G_TYPE_STRING #GValue to @v_string.
6672 * The string is assumed to be static, and is thus not duplicated
6673 * when setting the #GValue.
6678 * g_value_set_string:
6679 * @value: a valid #GValue of type %G_TYPE_STRING
6680 * @v_string: (allow-none): caller-owned string to be duplicated for the #GValue
6682 * Set the contents of a %G_TYPE_STRING #GValue to @v_string.
6687 * g_value_set_string_take_ownership:
6688 * @value: a valid #GValue of type %G_TYPE_STRING
6689 * @v_string: (allow-none): duplicated unowned string to be set
6691 * This is an internal function introduced mainly for C marshallers.
6693 * Deprecated: 2.4: Use g_value_take_string() instead.
6698 * g_value_set_uchar:
6699 * @value: a valid #GValue of type %G_TYPE_UCHAR
6700 * @v_uchar: unsigned character value to be set
6702 * Set the contents of a %G_TYPE_UCHAR #GValue to @v_uchar.
6708 * @value: a valid #GValue of type %G_TYPE_UINT
6709 * @v_uint: unsigned integer value to be set
6711 * Set the contents of a %G_TYPE_UINT #GValue to @v_uint.
6716 * g_value_set_uint64:
6717 * @value: a valid #GValue of type %G_TYPE_UINT64
6718 * @v_uint64: unsigned 64bit integer value to be set
6720 * Set the contents of a %G_TYPE_UINT64 #GValue to @v_uint64.
6725 * g_value_set_ulong:
6726 * @value: a valid #GValue of type %G_TYPE_ULONG
6727 * @v_ulong: unsigned long integer value to be set
6729 * Set the contents of a %G_TYPE_ULONG #GValue to @v_ulong.
6734 * g_value_set_variant:
6735 * @value: a valid #GValue of type %G_TYPE_VARIANT
6736 * @variant: (allow-none): a #GVariant, or %NULL
6738 * Set the contents of a variant #GValue to @variant.
6739 * If the variant is floating, it is consumed.
6746 * g_value_take_boxed:
6747 * @value: a valid #GValue of %G_TYPE_BOXED derived type
6748 * @v_boxed: (allow-none): duplicated unowned boxed value to be set
6750 * Sets the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed
6751 * and takes over the ownership of the callers reference to @v_boxed;
6752 * the caller doesn't have to unref it any more.
6759 * g_value_take_object: (skip)
6760 * @value: a valid #GValue of %G_TYPE_OBJECT derived type
6761 * @v_object: (allow-none): object value to be set
6763 * Sets the contents of a %G_TYPE_OBJECT derived #GValue to @v_object
6764 * and takes over the ownership of the callers reference to @v_object;
6765 * the caller doesn't have to unref it any more (i.e. the reference
6766 * count of the object is not increased).
6768 * If you want the #GValue to hold its own reference to @v_object, use
6769 * g_value_set_object() instead.
6776 * g_value_take_param: (skip)
6777 * @value: a valid #GValue of type %G_TYPE_PARAM
6778 * @param: (allow-none): the #GParamSpec to be set
6780 * Sets the contents of a %G_TYPE_PARAM #GValue to @param and takes
6781 * over the ownership of the callers reference to @param; the caller
6782 * doesn't have to unref it any more.
6789 * g_value_take_string:
6790 * @value: a valid #GValue of type %G_TYPE_STRING
6791 * @v_string: (allow-none): string to take ownership of
6793 * Sets the contents of a %G_TYPE_STRING #GValue to @v_string.
6800 * g_value_take_variant:
6801 * @value: a valid #GValue of type %G_TYPE_VARIANT
6802 * @variant: (nullable) (transfer full): a #GVariant, or %NULL
6804 * Set the contents of a variant #GValue to @variant, and takes over
6805 * the ownership of the caller's reference to @variant;
6806 * the caller doesn't have to unref it any more (i.e. the reference
6807 * count of the variant is not increased).
6809 * If @variant was floating then its floating reference is converted to
6812 * If you want the #GValue to hold its own reference to @variant, use
6813 * g_value_set_variant() instead.
6815 * This is an internal function introduced mainly for C marshallers.
6822 * g_value_transform:
6823 * @src_value: Source value.
6824 * @dest_value: Target value.
6826 * Tries to cast the contents of @src_value into a type appropriate
6827 * to store in @dest_value, e.g. to transform a %G_TYPE_INT value
6828 * into a %G_TYPE_FLOAT value. Performing transformations between
6829 * value types might incur precision lossage. Especially
6830 * transformations into strings might reveal seemingly arbitrary
6831 * results and shouldn't be relied upon for production code (such
6832 * as rcfile value or object property serialization).
6834 * Returns: Whether a transformation rule was found and could be applied.
6835 * Upon failing transformations, @dest_value is left untouched.
6840 * g_value_type_compatible:
6841 * @src_type: source type to be copied.
6842 * @dest_type: destination type for copying.
6844 * Returns whether a #GValue of type @src_type can be copied into
6845 * a #GValue of type @dest_type.
6847 * Returns: %TRUE if g_value_copy() is possible with @src_type and @dest_type.
6852 * g_value_type_transformable:
6853 * @src_type: Source type.
6854 * @dest_type: Target type.
6856 * Check whether g_value_transform() is able to transform values
6857 * of type @src_type into values of type @dest_type. Note that for
6858 * the types to be transformable, they must be compatible or a
6859 * transformation function must be registered.
6861 * Returns: %TRUE if the transformation is possible, %FALSE otherwise.
6867 * @value: An initialized #GValue structure.
6869 * Clears the current value in @value (if any) and "unsets" the type,
6870 * this releases all resources associated with this GValue. An unset
6871 * value is the same as an uninitialized (zero-filled) #GValue
6877 * g_weak_ref_clear: (skip)
6878 * @weak_ref: (inout): location of a weak reference, which
6881 * Frees resources associated with a non-statically-allocated #GWeakRef.
6882 * After this call, the #GWeakRef is left in an undefined state.
6884 * You should only call this on a #GWeakRef that previously had
6885 * g_weak_ref_init() called on it.
6892 * g_weak_ref_get: (skip)
6893 * @weak_ref: (inout): location of a weak reference to a #GObject
6895 * If @weak_ref is not empty, atomically acquire a strong
6896 * reference to the object it points to, and return that reference.
6898 * This function is needed because of the potential race between taking
6899 * the pointer value and g_object_ref() on it, if the object was losing
6900 * its last reference at the same time in a different thread.
6902 * The caller should release the resulting reference in the usual way,
6903 * by using g_object_unref().
6905 * Returns: (transfer full) (type GObject.Object): the object pointed to
6906 * by @weak_ref, or %NULL if it was empty
6912 * g_weak_ref_init: (skip)
6913 * @weak_ref: (inout): uninitialized or empty location for a weak
6915 * @object: (type GObject.Object) (nullable): a #GObject or %NULL
6917 * Initialise a non-statically-allocated #GWeakRef.
6919 * This function also calls g_weak_ref_set() with @object on the
6920 * freshly-initialised weak reference.
6922 * This function should always be matched with a call to
6923 * g_weak_ref_clear(). It is not necessary to use this function for a
6924 * #GWeakRef in static storage because it will already be
6925 * properly initialised. Just use g_weak_ref_set() directly.
6932 * g_weak_ref_set: (skip)
6933 * @weak_ref: location for a weak reference
6934 * @object: (type GObject.Object) (nullable): a #GObject or %NULL
6936 * Change the object to which @weak_ref points, or set it to
6939 * You must own a strong reference on @object while calling this
6947 /************************************************************/
6948 /* THIS FILE IS GENERATED DO NOT EDIT */
6949 /************************************************************/