Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GObjectNotifyCallback

[988:7] extends: object

Generated low-level callback wrapper for GIR callback notify.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • GObjectNotifyCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, pspec, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: GObjectCtors

[963:14] static extends: object

Alternate constructors for GObject. Usage: GObjectCtors.<name>(...). The primary constructor lives directly on GObject.

Methods

  • newNewv (int object_type, list parameters)

    Creates a new instance of a #GObject subtype and sets its properties. Construction parameters (see %G_PARAM_CONSTRUCT, %G_PARAM_CONSTRUCT_ONLY) which are not explicitly specified are set to their default values.

    • @p object_type is the type id of the #GObject subtype to instantiate.
    • @p n_parameters is the length of the @parameters array.
    • @p parameters is an array of #GParameter.
    • @r A new GObject.

class: GObject

[30:7] extends: object

The base object type. GObject is the fundamental type providing the common attributes and methods for all object types in GTK, Pango and other libraries based on GObject. The GObject class provides methods for object construction and destruction, property access methods, and signal support. Signals are described in detail here. For a tutorial on implementing a new GObject class, see How to define and implement a new GObject. For a list of naming conventions for GObjects and their methods, see the GType conventions. For the high-level concepts behind GObject, read Instantiatable classed types: Objects. Since GLib 2.72, all GObjects are guaranteed to be aligned to at least the alignment of the largest basic GLib type (typically this is guint64 or gdouble). If you need larger alignment for an element in a GObject, you should allocate it on the heap (aligned), or arrange for your GObject to be appropriately padded. This guarantee applies to the GObject (or derived) struct, the GObjectClass (or derived) struct, and any private data allocated by G_ADD_PRIVATE().

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GObject (object_type = null, first_property_name = null, ___ = null, values = null)

    Creates a new instance of a #GObject subtype and sets its properties. Construction parameters (see %G_PARAM_CONSTRUCT, %G_PARAM_CONSTRUCT_ONLY) which are not explicitly specified are set to their default values. Any private data for the object is guaranteed to be initialized with zeros, as per g_type_create_instance(). Note that in C, small integer types in variable argument lists are promoted up to gint or guint as appropriate, and read back accordingly. gint is 32 bits on every platform on which GLib is currently supported. This means that you can use C expressions of type gint with g_object_new() and properties of type gint or guint or smaller. Specifically, you can use integer literals with these property types. When using property types of gint64 or guint64, you must ensure that the value that you provide is 64 bit. This means that you should use a cast or make use of the %G_GINT64_CONSTANT or %G_GUINT64_CONSTANT macros. Similarly, gfloat is promoted to gdouble, so you must ensure that the value you provide is a gdouble, even for a property of type gfloat. Since GLib 2.72, all #GObjects are guaranteed to be aligned to at least the alignment of the largest basic GLib type (typically this is guint64 or gdouble). If you need larger alignment for an element in a #GObject, you should allocate it on the heap (aligned), or arrange for your #GObject to be appropriately padded.

    • @p object_type is the type id of the #GObject subtype to instantiate.
    • @p first_property_name is the name of the first property.
    • @p ___ is the value of the first property, followed optionally by more name/value pairs, followed by %NULL.
    • @p values is the values of each property to be set.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnNotify (callback Fn, UserData = null)

    The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al. Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with %G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in ::notify being emitted, even if the new value is the same as the old. If they did pass %G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed. This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: |[ g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view) ]| It is important to note that you must use [canonical parameter names][class@GObject.ParamSpec#parameter-names] as detail strings for the notify signal.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (GObject Self, GParamSpec Pspec).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • add_toggle_ref (data)

    Increases the reference count of the object by one and sets a callback to be called when all other references to the object are dropped, or when this is already the last reference to the object and another reference is established. This functionality is intended for binding @object to a proxy object managed by another memory manager. This is done with two paired references: the strong reference added by g_object_add_toggle_ref() and a reverse reference to the proxy object which is either a strong reference or weak reference. The setup is that when there are no other references to @object, only a weak reference is held in the reverse direction from @object to the proxy object, but when there are other references held to @object, a strong reference is held. The @notify callback is called when the reference from @object to the proxy object should be "toggled" from strong to weak (@is_last_ref true) or weak to strong (@is_last_ref false). Since a (normal) reference must be held to the object before calling g_object_add_toggle_ref(), the initial state of the reverse link is always strong. Multiple toggle references may be added to the same gobject, however if there are multiple toggle references to an object, none of them will ever be notified until all but one are removed. For this reason, you should only ever use a toggle reference if there is important state in the proxy object. Note that if you unref the object on another thread, then @notify might still be invoked after g_object_remove_toggle_ref(), and the object argument might be a dangling pointer. If the object is destroyed on other threads, you must take care of that yourself. A g_object_add_toggle_ref() must be released with g_object_remove_toggle_ref().

    • @p notify is a function to call when this reference is the last reference to the object, or is no longer the last reference..
    • @p data is data to pass to @notify.
    • @r None.
  • add_weak_pointer ()

    Adds a weak reference from weak_pointer to @object to indicate that the pointer located at @weak_pointer_location is only valid during the lifetime of @object. When the @object is finalized, @weak_pointer will be set to %NULL. Note that as with g_object_weak_ref(), the weak references created by this method are not thread-safe: they cannot safely be used in one thread if the object's last g_object_unref() might happen in another thread. Use #GWeakRef if thread-safety is required.

    • @p weak_pointer_location is The memory address of a pointer..
    • @r None.
  • bind_property (string source_property, object target, string target_property, string flags)

    Creates a binding between @source_property on @source and

    • @target_property on @target. Whenever the @source_property is changed the
    • @target_property is updated using the same value. For instance: |[ g_object_bind_property (action, "active", widget, "sensitive", 0); ]| Will result in the "sensitive" property of the widget #GObject instance to be updated with the same value of the "active" property of the action #GObject instance. If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: if
    • @target_property on @target changes then the @source_property on @source will be updated as well. The binding will automatically be removed when either the @source or the @target instances are finalized. To remove the binding without affecting the @source and the @target you can just call g_object_unref() on the returned #GBinding instance. Removing the binding by calling g_object_unref() on it must only be done if the binding,
    • @source and @target are only used from a single thread and it is clear that both @source and @target outlive the binding. Especially it is not safe to rely on this if the binding, @source or @target can be finalized from different threads. Keep another reference to the binding and use g_binding_unbind() instead to be on the safe side. A #GObject can have multiple bindings.
    • @p source_property is the property on @source to bind.
    • @p target is the target #GObject.
    • @p target_property is the property on @target to bind.
    • @p flags is flags to pass to #GBinding.
    • @r the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero..
  • bind_property_full (string source_property, object target, string target_property, string flags, object transform_to, object notify)

    Complete version of g_object_bind_property(). Creates a binding between

    • @source_property on @source and @target_property on @target, allowing you to set the transformation functions to be used by the binding. If @flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: if
    • @target_property on @target changes then the @source_property on @source will be updated as well. The @transform_from function is only used in case of bidirectional bindings, otherwise it will be ignored The binding will automatically be removed when either the @source or the @target instances are finalized. This will release the reference that is being held on the #GBinding instance; if you want to hold on to the #GBinding instance, you will need to hold a reference to it. To remove the binding, call g_binding_unbind(). A #GObject can have multiple bindings. The same
    • @user_data parameter will be used for both @transform_to and
    • @transform_from transformation functions; the @notify function will be called once, when the binding is removed. If you need different data for each transformation function, please use g_object_bind_property_with_closures() instead.
    • @p source_property is the property on @source to bind.
    • @p target is the target #GObject.
    • @p target_property is the property on @target to bind.
    • @p flags is flags to pass to #GBinding.
    • @p transform_to is the transformation function from the @source to the
    • @target, or %NULL to use the default.
    • @p transform_from is the transformation function from the @target to the
    • @source, or %NULL to use the default.
    • @p user_data is custom data to be passed to the transformation functions, or %NULL.
    • @p notify is a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required.
    • @r the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero..
  • bind_property_with_closures (string source_property, object target, string target_property, string flags, object transform_to, object transform_from)

    Creates a binding between @source_property on @source and

    • @target_property on @target, allowing you to set the transformation functions to be used by the binding. This function is the language bindings friendly version of g_object_bind_property_full(), using #GClosures instead of function pointers.
    • @p source_property is the property on @source to bind.
    • @p target is the target #GObject.
    • @p target_property is the property on @target to bind.
    • @p flags is flags to pass to #GBinding.
    • @p transform_to is a #GClosure wrapping the transformation function from the @source to the @target, or %NULL to use the default.
    • @p transform_from is a #GClosure wrapping the transformation function from the @target to the @source, or %NULL to use the default.
    • @r the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero..
  • connect (string signal_spec, list varargs)

    A convenience function to connect multiple signals at once. The signal specs expected by this function have the form modifier::signal_name, where modifier can be one of the following: - signal: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_DEFAULT) - object-signal, object_signal: equivalent to g_signal_connect_object (..., G_CONNECT_DEFAULT) - swapped-signal, swapped_signal: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED) - swapped_object_signal, swapped-object-signal: equivalent to g_signal_connect_object (..., G_CONNECT_SWAPPED) - signal_after, signal-after: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_AFTER) - object_signal_after, object-signal-after: equivalent to g_signal_connect_object (..., G_CONNECT_AFTER) - swapped_signal_after, swapped-signal-after: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER) - swapped_object_signal_after, swapped-object-signal-after: equivalent to g_signal_connect_object (..., G_CONNECT_SWAPPED | G_CONNECT_AFTER) c menu->toplevel = g_object_connect (g_object_new (GTK_TYPE_WINDOW, "type", GTK_WINDOW_POPUP, "child", menu, NULL), "signal::event", gtk_menu_window_event, menu, "signal::size_request", gtk_menu_window_size_request, menu, "signal::destroy", gtk_widget_destroyed, &menu->toplevel, NULL);

    • @p signal_spec is the spec for the first signal.
    • @p ... is [type@GObject.Callback] for the first signal, followed by data for the first signal, followed optionally by more signal spec/callback/data triples, followed by NULL.
    • @r the object.
  • disconnect (string signal_spec, list varargs)

    A convenience function to disconnect multiple signals at once. The signal specs expected by this function have the form "any_signal", which means to disconnect any signal with matching callback and data, or "any_signal::signal_name", which only disconnects the signal named "signal_name".

    • @p signal_spec is the spec for the first signal.
    • @p ... is #GCallback for the first signal, followed by data for the first signal, followed optionally by more signal spec/callback/data triples, followed by %NULL.
    • @r None.
  • dup_data (string key, user_data)

    This is a variant of g_object_get_data() which returns a 'duplicate' of the value. @dup_func defines the meaning of 'duplicate' in this context, it could e.g. take a reference on a ref-counted object. If the @key is not set on the object then @dup_func will be called with a %NULL argument. Note that @dup_func is called while user data of @object is locked. This function can be useful to avoid races when multiple threads are using object data on the same key on the same object.

    • @p key is a string, naming the user data pointer.
    • @p dup_func is function to dup the value.
    • @p user_data is passed as user_data to @dup_func.
    • @r the result of calling @dup_func on the value associated with @key on
    • @object, or %NULL if not set. If @dup_func is %NULL, the value is returned unmodified..
  • force_floating ()

    This function is intended for #GObject implementations to re-enforce a floating object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling g_object_ref_sink().

    • @r None.
  • freeze_notify ()

    Increases the freeze count on @object. If the freeze count is non-zero, the emission of "notify" signals on @object is stopped. The signals are queued until the freeze count is decreased to zero. Duplicate notifications are squashed so that at most one #GObject::notify signal is emitted for each property modified while the object is frozen. This is necessary for accessors that modify multiple properties to prevent premature notification while the object is still being modified.

    • @r None.
  • get (string first_property_name, list varargs)

    Gets properties of an object. In general, a copy is made of the property contents and the caller is responsible for freeing the memory in the appropriate manner for the type, for instance by calling g_free() or g_object_unref(). Here is an example of using g_object_get() to get the contents of three properties: an integer, a string and an object: |[ gint intval; guint64 uint64val; gchar *strval; GObject *objval; g_object_get (my_object, "int-property", &intval, "uint64-property", &uint64val, "str-property", &strval, "obj-property", &objval, NULL); // Do something with intval, uint64val, strval, objval g_free (strval); g_object_unref (objval); ]|

    • @p first_property_name is name of the first property to get.
    • @p ... is return location for the first property, followed optionally by more name/return location pairs, followed by %NULL.
    • @r None.
  • get_data (string key)

    Gets a named field from the objects table of associations (see g_object_set_data()).

    • @p key is name of the key for that association.
    • @r the data if found, or %NULL if no such data exists..
  • get_property (string property_name, object value)

    Gets a property of an object. The @value can be: - an empty #GValue initialized by %G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) - a #GValue initialized with the expected type of the property - a #GValue initialized with a type to which the expected type of the property can be transformed In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling g_value_unset(). Note that g_object_get_property() is really intended for language bindings, g_object_get() is much more convenient for C programming.

    • @p property_name is the name of the property to get.
    • @p value is return location for the property value.
    • @r None.
  • getv (list names, list values)

    Gets @n_properties properties for an @object. Obtained properties will be set to @values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.

    • @p n_properties is the number of properties.
    • @p names is the names of each property to get.
    • @p values is the values of each property to get.
    • @r None.
  • is_floating ()

    Checks whether @object has a floating reference.

    • @r %TRUE if @object has a floating reference.
  • notify (string property_name)

    Emits a "notify" signal for the property @property_name on @object. When possible, eg. when signaling a property change from within the class that registered the property, you should use g_object_notify_by_pspec() instead. Note that emission of the notify signal may be blocked with g_object_freeze_notify(). In this case, the signal emissions are queued and will be emitted (in reverse order) when g_object_thaw_notify() is called.

    • @p property_name is the name of a property installed on the class of
    • @object.. ``
    • @r None.
  • notify_by_pspec (object pspec)

    Emits a "notify" signal for the property specified by @pspec on @object. This function omits the property name lookup, hence it is faster than g_object_notify(). One way to avoid using g_object_notify() from within the class that registered the properties, and using g_object_notify_by_pspec() instead, is to store the GParamSpec used with g_object_class_install_property() inside a static array, e.g.: |[ typedef enum { PROP_FOO = 1, PROP_LAST } MyObjectProperty; static GParamSpec *properties[PROP_LAST]; static void my_object_class_init (MyObjectClass *klass) { properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, 0, 100, 50, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_FOO, properties[PROP_FOO]); } ]| and then notify a change on the "foo" property with: |[ g_object_notify_by_pspec (self, properties[PROP_FOO]); ]|

    • @p pspec is the #GParamSpec of a property installed on the class of
    • @object.. ``
    • @r None.
  • ref ()

    Increases the reference count of @object. Since GLib 2.56, if GLIB_VERSION_MAX_ALLOWED is 2.56 or greater, the type of @object will be propagated to the return type (using the GCC typeof() extension), so any casting the caller needs to do on the return type must be explicit.

    • @r the same @object.
  • ref_sink ()

    Increase the reference count of @object, and possibly remove the floating reference, if @object has a floating reference. In other words, if the object is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference by clearing the floating flag while leaving the reference count unchanged. If the object is not floating, then this call adds a new normal reference increasing the reference count by one. Since GLib 2.56, the type of @object will be propagated to the return type under the same conditions as for g_object_ref().

    • @r @object.
  • remove_toggle_ref (data)

    Removes a reference added with g_object_add_toggle_ref(). The reference count of the object is decreased by one. Note that if you unref the object on another thread, then @notify might still be invoked after g_object_remove_toggle_ref(), and the object argument might be a dangling pointer. If the object is destroyed on other threads, you must take care of that yourself.

    • @p notify is a function to call when this reference is the last reference to the object, or is no longer the last reference..
    • @p data is data to pass to @notify, or %NULL to match any toggle refs with the @notify argument..
    • @r None.
  • remove_weak_pointer ()

    Removes a weak reference from @object that was previously added using g_object_add_weak_pointer(). The @weak_pointer_location has to match the one used with g_object_add_weak_pointer().

    • @p weak_pointer_location is The memory address of a pointer..
    • @r None.
  • replace_data (string key, oldval, newval, object destroy)

    Compares the user data for the key @key on @object with @oldval, and if they are the same, replaces @oldval with @newval. This is like a typical atomic compare-and-exchange operation, for user data on an object. If the previous value was replaced then ownership of the old value (@oldval) is passed to the caller, including the registered destroy notify for it (passed out in @old_destroy). It’s up to the caller to free this as needed, which may or may not include using @old_destroy as sometimes replacement should not destroy the object in the normal way. See g_object_set_data() for guidance on using a small, bounded set of values for @key.

    • @p key is a string, naming the user data pointer.
    • @p oldval is the old value to compare against.
    • @p newval is the new value.
    • @p destroy is a destroy notify for the new value.
    • @p old_destroy is destroy notify for the existing value.
    • @r %TRUE if the existing value for @key was replaced by @newval, %FALSE otherwise..
  • run_dispose ()

    Releases all references to other objects. This can be used to break reference cycles. This function should only be called from object system implementations.

    • @r None.
  • set (string first_property_name, list varargs)

    Sets properties on an object. The same caveats about passing integer literals as varargs apply as with g_object_new(). In particular, any integer literals set as the values for properties of type #gint64 or #guint64 must be 64 bits wide, using the %G_GINT64_CONSTANT or %G_GUINT64_CONSTANT macros. Note that the "notify" signals are queued and only emitted (in reverse order) after all properties have been set. See g_object_freeze_notify().

    • @p first_property_name is name of the first property to set.
    • @p ... is value for the first property, followed optionally by more name/value pairs, followed by %NULL.
    • @r None.
  • set_data (string key, data)

    Each object carries around a table of associations from strings to pointers. This function lets you set an association. If the object already had an association with that name, the old association will be destroyed. Internally, the @key is converted to a #GQuark using g_quark_from_string(). This means a copy of @key is kept permanently (even after @object has been finalized) — so it is recommended to only use a small, bounded set of values for @key in your program, to avoid the #GQuark storage growing unbounded.

    • @p key is name of the key.
    • @p data is data to associate with that key.
    • @r None.
  • set_data_full (string key, data, object destroy)

    Like g_object_set_data() except it adds notification for when the association is destroyed, either by setting it to a different value or when the object is destroyed. Note that the @destroy callback is not called if @data is %NULL.

    • @p key is name of the key.
    • @p data is data to associate with that key.
    • @p destroy is function to call when the association is destroyed.
    • @r None.
  • set_property (string property_name, object value)

    Sets a property on an object.

    • @p property_name is the name of the property to set.
    • @p value is the value.
    • @r None.
  • setv (list names, list values)

    Sets @n_properties properties for an @object. Properties to be set will be taken from @values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.

    • @p n_properties is the number of properties.
    • @p names is the names of each property to be set.
    • @p values is the values of each property to be set.
    • @r None.
  • steal_data (string key)

    Remove a specified datum from the object's data associations, without invoking the association's destroy handler.

    • @p key is name of the key.
    • @r the data if found, or %NULL if no such data exists..
  • take_ref ()

    If @object is floating, sink it. Otherwise, do nothing. In other words, this function will convert a floating reference (if present) into a full reference. Typically you want to use g_object_ref_sink() in order to automatically do the correct thing with respect to floating or non-floating references, but there is one specific scenario where this function is helpful. The situation where this function is helpful is when creating an API that allows the user to provide a callback function that returns a GObject. We certainly want to allow the user the flexibility to return a non-floating reference from this callback (for the case where the object that is being returned already exists). At the same time, the API style of some popular GObject-based libraries (such as Gtk) make it likely that for newly-created GObject instances, the user can be saved some typing if they are allowed to return a floating reference. Using this function on the return value of the user's callback allows the user to do whichever is more convenient for them. The caller will always receives exactly one full reference to the value: either the one that was returned in the first place, or a floating reference that has been converted to a full reference. This function has an odd interaction when combined with g_object_ref_sink() running at the same time in another thread on the same #GObject instance. If g_object_ref_sink() runs first then the result will be that the floating reference is converted to a hard reference. If g_object_take_ref() runs first then the result will be that the floating reference is converted to a hard reference and an additional reference on top of that one is added. It is best to avoid this situation.

    • @r @object.
  • thaw_notify ()

    Reverts the effect of a previous call to g_object_freeze_notify(). The freeze count is decreased on @object and when it reaches zero, queued "notify" signals are emitted. Duplicate notifications for each property are squashed so that at most one #GObject::notify signal is emitted for each property, in the reverse order in which they have been queued. It is an error to call this function when the freeze count is zero.

    • @r None.
  • unref ()

    Decreases the reference count of @object. When its reference count drops to 0, the object is finalized (i.e. its memory is freed). If the pointer to the #GObject may be reused in future (for example, if it is an instance variable of another object), it is recommended to clear the pointer to %NULL rather than retain a dangling pointer to a potentially invalid #GObject instance. Use g_clear_object() for this.

    • @r None.
  • watch_closure (object closure)

    This function essentially limits the life time of the @closure to the life time of the object. That is, when the object is finalized, the

    • @closure is invalidated by calling g_closure_invalidate() on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, g_object_ref() and g_object_unref() are added as marshal guards to the @closure, to ensure that an extra reference count is held on @object during invocation of the @closure. Usually, this function will be called on closures that use this @object as closure data.
    • @p closure is #GClosure to watch.
    • @r None.
  • weak_ref (data)

    Adds a weak reference callback to an object. Weak references are used for notification when an object is disposed. They are called "weak references" because they allow you to safely hold a pointer to an object without calling g_object_ref() (g_object_ref() adds a strong reference, that is, forces the object to stay alive). Note that the weak references created by this method are not thread-safe: they cannot safely be used in one thread if the object's last g_object_unref() might happen in another thread. Use #GWeakRef if thread-safety is required.

    • @p notify is callback to invoke before the object is freed.
    • @p data is extra data to pass to notify.
    • @r None.
  • weak_unref (data)

    Removes a weak reference callback to an object.

    • @p notify is callback to search for.
    • @p data is data to search for.
    • @r None.

class: GObjectMeta

[1059:14] static extends: object

Generated metadata helpers for Object class surfaces.

Methods

  • signals ()

    Returns signal metadata for Object.

    • @r A list.