SignalGroup

open class SignalGroup(pointer: <Error class: unknown class><<Error class: unknown class>>) : Object, KGTyped

GSignalGroup manages a collection of signals on a GObject.

GSignalGroup simplifies the process of connecting many signals to a GObject as a group. As such there is no API to disconnect a signal from the group.

In particular, this allows you to:

  • Change the target instance, which automatically causes disconnection of the signals from the old instance and connecting to the new instance.

  • Block and unblock signals as a group

  • Ensuring that blocked state transfers across target instances.

One place you might want to use such a structure is with GtkTextView and GtkTextBuffer. Often times, you'll need to connect to many signals on GtkTextBuffer from a GtkTextView subclass. This allows you to create a signal group during instance construction, simply bind the GtkTextView:buffer property to GSignalGroup:target and connect all the signals you need. When the GtkTextView:buffer property changes all of the signals will be transitioned correctly.

Skipped during bindings generation

  • parameter c_handler: Callback

  • method target: Property has no getter

  • method target-type: Property has no getter nor setter

Since

2.72

Constructors

Link copied to clipboard
constructor(targetType: <Error class: unknown class>)

Creates a new #GSignalGroup for target instances of @target_type.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard

Properties

Link copied to clipboard
val gobjectSignalGroupPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gPointer: <Error class: unknown class><GObject>

Functions

Link copied to clipboard
open fun addToggleRef(notify: ToggleNotify)

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.

Link copied to clipboard
inline fun <T : KGTyped> Object.asType(): T

Convert object into type T.

Link copied to clipboard
open fun bindProperty(sourceProperty: String, target: Object, targetProperty: String, flags: BindingFlags): Binding

Creates a binding between @source_property on @source and @target_property on @target.

Link copied to clipboard
open fun bindPropertyFull(sourceProperty: String, target: Object, targetProperty: String, flags: BindingFlags, transformTo: Closure, transformFrom: Closure): Binding

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.

Link copied to clipboard
open fun block()

Blocks all signal handlers managed by @self so they will not be called during any signal emissions. Must be unblocked exactly the same number of times it has been blocked to become active again.

Link copied to clipboard
open fun connect(detailedSignal: String, cHandler: Callback)

Connects @c_handler to the signal @detailed_signal on the target instance of @self.

Link copied to clipboard
open fun connectAfter(detailedSignal: String, cHandler: Callback)

Connects @c_handler to the signal @detailed_signal on the target instance of @self.

Link copied to clipboard
fun connectBind(connectFlags: ConnectFlags = ConnectFlags(0u), handler: (instance: Object) -> Unit): <Error class: unknown class>

This signal is emitted when #GSignalGroup:target is set to a new value other than null. It is similar to #GObject::notify on target except it will not emit when #GSignalGroup:target is null and also allows for receiving the #GObject without a data-race.

Link copied to clipboard
open fun connectClosure(detailedSignal: String, closure: Closure, after: Boolean)

Connects @closure to the signal @detailed_signal on #GSignalGroup:target.

Link copied to clipboard
open fun connectData(detailedSignal: String, cHandler: Callback, flags: ConnectFlags)

Connects @c_handler to the signal @detailed_signal on the target instance of @self.

Link copied to clipboard
fun connectNotify(connectFlags: ConnectFlags = ConnectFlags(0u), handler: (pspec: ParamSpec) -> Unit): <Error class: unknown class>

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.

Link copied to clipboard
open fun connectSwapped(detailedSignal: String, cHandler: Callback)

Connects @c_handler to the signal @detailed_signal on the target instance of @self.

Link copied to clipboard
fun connectUnbind(connectFlags: ConnectFlags = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

This signal is emitted when the target instance of @self is set to a new #GObject.

Link copied to clipboard
open fun dupData(key: String, dupFunc: <Error class: unknown class>?): <Error class: unknown class>?

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.

Link copied to clipboard
open fun dupQdata(quark: <Error class: unknown class>, dupFunc: <Error class: unknown class>?): <Error class: unknown class>?

This is a variant of g_object_get_qdata() 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.

Link copied to clipboard
open fun dupTarget(): Object?

Gets the target instance used when connecting signals.

Link copied to clipboard
open fun forceFloating()

This function is intended for #GObject implementations to re-enforce a floating-ref 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().

Link copied to clipboard
open fun freezeNotify()

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.

Link copied to clipboard
Link copied to clipboard
open fun getData(key: String): <Error class: unknown class>?

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

Link copied to clipboard
fun Object.getIntProperty(propertyName: String): Int
Link copied to clipboard
open fun getProperty(propertyName: String, value: Value)

Gets a property of an object.

Link copied to clipboard
open fun getQdata(quark: <Error class: unknown class>): <Error class: unknown class>?

This function gets back user data pointers stored via g_object_set_qdata().

Link copied to clipboard
fun Object.getStringProperty(propertyName: String): String?
Link copied to clipboard
open fun isFloating(): Boolean

Checks whether @object has a floating-ref reference.

Link copied to clipboard
open fun notify(propertyName: String)

Emits a "notify" signal for the property @property_name on @object.

Link copied to clipboard
open fun notifyByPspec(pspec: ParamSpec)

Emits a "notify" signal for the property specified by @pspec on @object.

Link copied to clipboard
open fun ref(): Object

Increases the reference count of @object.

Link copied to clipboard
open fun refSink(): Object

Increase the reference count of @object, and possibly remove the floating-ref reference, if @object has a floating reference.

Link copied to clipboard
open fun removeToggleRef(notify: ToggleNotify)

Removes a reference added with g_object_add_toggle_ref(). The reference count of the object is decreased by one.

Link copied to clipboard
open fun runDispose()

Releases all references to other objects. This can be used to break reference cycles.

Link copied to clipboard
open fun setData(key: String, data: <Error class: unknown class>? = null)

Each object carries around a table of associations from strings to pointers. This function lets you set an association.

Link copied to clipboard
open fun setProperty(propertyName: String, value: Value)

Sets a property on an object.

Link copied to clipboard
fun Object.setProperty(propertyName: String, value: Boolean)
fun Object.setProperty(propertyName: String, value: Int)
fun Object.setProperty(propertyName: String, value: String?)
Link copied to clipboard
open fun setQdata(quark: <Error class: unknown class>, data: <Error class: unknown class>? = null)

This sets an opaque, named pointer on an object. The name is specified through a #GQuark (retrieved e.g. via g_quark_from_static_string()), and the pointer can be gotten back from the @object with g_object_get_qdata() until the @object is finalized. Setting a previously set user data pointer, overrides (frees) the old pointer set, using #NULL as pointer essentially removes the data stored.

Link copied to clipboard
open fun setTarget(target: Object? = null)

Sets the target instance used when connecting signals. Any signal that has been registered with g_signal_group_connect_object() or similar functions will be connected to this object.

Link copied to clipboard
open fun stealData(key: String): <Error class: unknown class>?

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

Link copied to clipboard
open fun stealQdata(quark: <Error class: unknown class>): <Error class: unknown class>?

This function gets back user data pointers stored via g_object_set_qdata() and removes the @data from object without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example: |[ void object_add_to_user_list (GObject *object, const gchar *new_string) { // the quark, naming the object data GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); // retrieve the old string list GList *list = g_object_steal_qdata (object, quark_string_list);

Link copied to clipboard
open fun takeRef(): Object

If @object is floating, sink it. Otherwise, do nothing.

Link copied to clipboard
open fun thawNotify()

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.

Link copied to clipboard
open fun unblock()

Unblocks all signal handlers managed by @self so they will be called again during any signal emissions unless it is blocked again. Must be unblocked exactly the same number of times it has been blocked to become active again.

Link copied to clipboard
open fun unref()

Decreases the reference count of @object. When its reference count drops to 0, the object is finalized (i.e. its memory is freed).

Link copied to clipboard
open fun watchClosure(closure: 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

Link copied to clipboard
open fun weakRef(notify: WeakNotify)

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).

Link copied to clipboard
open fun weakUnref(notify: WeakNotify)

Removes a weak reference callback to an object.