SignalGroup

#DzlSignalGroup manages to simplify 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 #DzlSignalGroup:target and connect all the signals you need. When the #GtkTextView:buffer property changes all of the signals will be transitioned correctly.

Constructors

this
this(DzlSignalGroup* dzlSignalGroup, bool ownedRef = false)

Sets our main struct and passes it to the parent class.

this
this(GType targetType)

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

Members

Functions

addOnBind
gulong addOnBind(void delegate(ObjectG, SignalGroup) dlg, ConnectFlags connectFlags = cast(ConnectFlags)0)

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

addOnUnbind
gulong addOnUnbind(void delegate(SignalGroup) dlg, ConnectFlags connectFlags = cast(ConnectFlags)0)

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

block
void 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.

connect
void connect(string detailedSignal, GCallback cHandler, void* data)

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

connectAfter
void connectAfter(string detailedSignal, GCallback cHandler, void* data)

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

connectData
void connectData(string detailedSignal, GCallback cHandler, void* data, GClosureNotify notify, GConnectFlags flags)

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

connectObject
void connectObject(string detailedSignal, GCallback cHandler, void* object, GConnectFlags flags)

Connects @callback to the signal @detailed_signal on the target object of @self.

connectSwapped
void connectSwapped(string detailedSignal, GCallback cHandler, void* data)

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

getSignalGroupStruct
DzlSignalGroup* getSignalGroupStruct(bool transferOwnership = false)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getTarget
ObjectG getTarget()

Gets the target instance used when connecting signals.

setTarget
void setTarget(ObjectG target)

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

unblock
void 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.

Static functions

getType
GType getType()

Variables

dzlSignalGroup
DzlSignalGroup* dzlSignalGroup;

the main Gtk struct

Meta