Top |
void | g_signal_group_block () |
void | g_signal_group_connect () |
void | g_signal_group_connect_after () |
void | g_signal_group_connect_data () |
void | g_signal_group_connect_object () |
void | g_signal_group_connect_swapped () |
void | g_signal_group_connect_closure () |
gpointer | g_signal_group_dup_target () |
GType | g_signal_group_get_type () |
GSignalGroup * | g_signal_group_new () |
void | g_signal_group_set_target () |
void | g_signal_group_unblock () |
GSignalGroup 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 “buffer” property to “target” and connect all the signals you need. When the “buffer” property changes all of the signals will be transitioned correctly.
void
g_signal_group_block (GSignalGroup *self
);
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.
This blocked state will be kept across changes of the target instance.
Since: 2.72
void g_signal_group_connect (GSignalGroup *self
,const gchar *detailed_signal
,GCallback c_handler
,gpointer data
);
Connects c_handler
to the signal detailed_signal
on the target instance of self
.
You cannot connect a signal handler after “target” has been set.
[skip]
self |
||
detailed_signal |
a string of the form "signal-name::detail" |
|
c_handler |
the GCallback to connect. |
[scope notified] |
data |
the data to pass to |
Since: 2.72
void g_signal_group_connect_after (GSignalGroup *self
,const gchar *detailed_signal
,GCallback c_handler
,gpointer data
);
Connects c_handler
to the signal detailed_signal
on the target instance of self
.
The c_handler
will be called after the default handler of the signal.
You cannot connect a signal handler after “target” has been set.
[skip]
self |
||
detailed_signal |
a string of the form "signal-name::detail" |
|
c_handler |
the GCallback to connect. |
[scope notified] |
data |
the data to pass to |
Since: 2.72
void g_signal_group_connect_data (GSignalGroup *self
,const gchar *detailed_signal
,GCallback c_handler
,gpointer data
,GClosureNotify notify
,GConnectFlags flags
);
Connects c_handler
to the signal detailed_signal
on the target instance of self
.
You cannot connect a signal handler after “target” has been set.
self |
||
detailed_signal |
a string of the form "signal-name::detail" |
|
c_handler |
the GCallback to connect. |
[scope notified][closure data][destroy notify] |
data |
the data to pass to |
|
notify |
function to be called when disposing of |
|
flags |
the flags used to create the signal connection |
Since: 2.72
void g_signal_group_connect_object (GSignalGroup *self
,const gchar *detailed_signal
,GCallback c_handler
,gpointer object
,GConnectFlags flags
);
Connects c_handler
to the signal detailed_signal
on “target”.
Ensures that the object
stays alive during the call to c_handler
by temporarily adding a reference count. When the object
is destroyed
the signal handler will automatically be removed.
You cannot connect a signal handler after “target” has been set.
[skip]
self |
||
detailed_signal |
a string of the form |
|
c_handler |
the GCallback to connect. |
[scope notified] |
object |
the GObject to pass as data to |
[not nullable][transfer none] |
flags |
GConnectFlags for the signal connection |
Since: 2.72
void g_signal_group_connect_swapped (GSignalGroup *self
,const gchar *detailed_signal
,GCallback c_handler
,gpointer data
);
Connects c_handler
to the signal detailed_signal
on the target instance of self
.
The instance on which the signal is emitted and data
will be swapped when calling c_handler
.
You cannot connect a signal handler after “target” has been set.
self |
||
detailed_signal |
a string of the form "signal-name::detail" |
|
c_handler |
the GCallback to connect. |
[scope async] |
data |
the data to pass to |
Since: 2.72
void g_signal_group_connect_closure (GSignalGroup *self
,const gchar *detailed_signal
,GClosure *closure
,gboolean after
);
Connects closure
to the signal detailed_signal
on “target”.
You cannot connect a signal handler after “target” has been set.
self |
||
detailed_signal |
a string of the form |
|
closure |
the closure to connect. |
[not nullable] |
after |
whether the handler should be called before or after the default handler of the signal. |
Since: 2.74
gpointer
g_signal_group_dup_target (GSignalGroup *self
);
Gets the target instance used when connecting signals.
Since: 2.72
GSignalGroup *
g_signal_group_new (GType target_type
);
Creates a new GSignalGroup for target instances of target_type
.
Since: 2.72
void g_signal_group_set_target (GSignalGroup *self
,gpointer target
);
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.
If the target instance was previously set, signals will be
disconnected from that object prior to connecting to target
.
self |
the GSignalGroup. |
|
target |
The target instance used when connecting signals. |
[nullable][type GObject][transfer none] |
Since: 2.72
void
g_signal_group_unblock (GSignalGroup *self
);
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.
Since: 2.72
typedef struct _GSignalGroup GSignalGroup;
GSignalGroup is an opaque structure whose members cannot be accessed directly.
Since: 2.72
“target”
property“target” GObject *
The target instance used when connecting signals.
Owner: GSignalGroup
Flags: Read / Write
Since: 2.72
“bind”
signalvoid user_function (GSignalGroup *self, GObject *instance, gpointer user_data)
This signal is emitted when “target” is set to a new value
other than NULL
. It is similar to “notify” on target
except it
will not emit when “target” is NULL
and also allows for
receiving the GObject without a data-race.
self |
the GSignalGroup |
|
instance |
||
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.72
“unbind”
signalvoid user_function (GSignalGroup *self, gpointer user_data)
This signal is emitted when the target instance of self
is set to a
new GObject.
This signal will only be emitted if the previous target of self
is
non-NULL
.
Flags: Run Last
Since: 2.72