1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 A means for customization of object behaviour and a general purpose notification mechanism
7 <!-- ##### SECTION Long_Description ##### -->
9 The basic concept of the signal system is that of the <emphasis>emission</emphasis>
11 Signals are introduced per-type and are identified through strings.
12 Signals introduced for a parent type are available in derived types as well,
13 so basically they are a per-type facility that is inherited.
14 A signal emission mainly involves invocation of a certain set of callbacks in
15 precisely defined manner. There are two main categories of such callbacks,
17 <footnote><para>Although signals can deal with any kind of instantiatable type,
18 i'm referring to those types as "object types" in the following, simply
19 because that is the context most users will encounter signals in.
21 ones and user provided ones.
22 The per-object callbacks are most often referred to as "object method
23 handler" or "default (signal) handler", while user provided callbacks are
24 usually just called "signal handler".
25 The object method handler is provided at signal creation time (this most
26 frequently happens at the end of an object class' creation), while user
27 provided handlers are frequently connected and disconnected to/from a certain
28 signal on certain object instances.
31 A signal emission consists of five stages, unless prematurely stopped:
33 <varlistentry><term></term><listitem><para>
34 1 - Invocation of the object method handler for %G_SIGNAL_RUN_FIRST signals
35 </para></listitem></varlistentry>
36 <varlistentry><term></term><listitem><para>
37 2 - Invocation of normal user-provided signal handlers (<emphasis>after</emphasis> flag %FALSE)
38 </para></listitem></varlistentry>
39 <varlistentry><term></term><listitem><para>
40 3 - Invocation of the object method handler for %G_SIGNAL_RUN_LAST signals
41 </para></listitem></varlistentry>
42 <varlistentry><term></term><listitem><para>
43 4 - Invocation of user provided signal handlers, connected with an <emphasis>after</emphasis> flag of %TRUE
44 </para></listitem></varlistentry>
45 <varlistentry><term></term><listitem><para>
46 5 - Invocation of the object method handler for %G_SIGNAL_RUN_CLEANUP signals
47 </para></listitem></varlistentry>
49 The user-provided signal handlers are called in the order they were
51 All handlers may prematurely stop a signal emission, and any number of
52 handlers may be connected, disconnected, blocked or unblocked during
54 There are certain criteria for skipping user handlers in stages 2 and 4
56 First, user handlers may be <emphasis>blocked</emphasis>, blocked handlers are omitted
57 during callback invocation, to return from the "blocked" state, a
58 handler has to get unblocked exactly the same amount of times
59 it has been blocked before.
60 Second, upon emission of a %G_SIGNAL_DETAILED signal, an additional
61 "detail" argument passed in to g_signal_emit() has to match the detail
62 argument of the signal handler currently subject to invocation.
63 Specification of no detail argument for signal handlers (omission of the
64 detail part of the signal specification upon connection) serves as a
65 wildcard and matches any detail argument passed in to emission.
68 <!-- ##### SECTION See_Also ##### -->
73 <!-- ##### STRUCT GSignalInvocationHint ##### -->
75 The #GSignalInvocationHint structure is used to pass on additional information
76 to callbacks during a signal emission.
79 @signal_id: The signal id of the signal invoking the callback
80 @detail: The detail passed on for this emission
81 @run_type: The stage the signal emission is currently in, this
82 field will contain one of %G_SIGNAL_RUN_FIRST,
83 %G_SIGNAL_RUN_LAST or %G_SIGNAL_RUN_CLEANUP.
85 <!-- ##### USER_FUNCTION GSignalAccumulator ##### -->
87 The signal accumulator is a special callback function that can be used
88 to collect return values of the various callbacks that are called
89 during a signal emission. The signal accumulator is specified at signal
90 creation time, if it is left %NULL, no accumulation of callback return
91 values is performed. The return value of signal emissions is then the
92 value returned by the last callback.
95 @ihint: Signal invocation hint, see #GSignalInvocationHint.
96 @return_accu: Accumulator to collect callback return values in, this
97 is the return value of the current signal emission.
100 @Returns: The accumulator function returns whether the signal emission
101 should be aborted. Returning %FALSE means to abort the
102 current emission and %TRUE is returned for continuation.
105 <!-- ##### TYPEDEF GSignalCMarshaller ##### -->
107 This is the signature of marshaller functions, required to marshall
108 arrays of parameter values to signal emissions into C language callback
109 invocations. It is merely an alias to #GClosureMarshal since the #GClosure
110 mechanism takes over responsibility of actual function invocation for the
115 <!-- ##### USER_FUNCTION GSignalEmissionHook ##### -->
117 A simple function pointer to get invoked when the signal is emitted. This
118 allows you to tie a hook to the signal type, so that it will trap all
119 emissions of that signal, from any object.
122 You may not attach these to signals created with the #G_SIGNAL_NO_HOOKS flag.
125 @ihint: Signal invocation hint, see #GSignalInvocationHint.
126 @n_param_values: the number of parameters to the function, including
127 the instance on which the signal was emitted.
128 @param_values: the instance on which the signal was emitted, followed by the
129 parameters of the emission.
130 @data: user data associated with the hook.
131 @Returns: whether it wants to stay connected. If it returns %FALSE, the signal
132 hook is disconnected (and destroyed).
135 <!-- ##### ENUM GSignalFlags ##### -->
137 The signal flags are used to specify a signal's behaviour, the overall
138 signal description outlines how especially the RUN flags control the
139 stages of a signal emission.
142 @G_SIGNAL_RUN_FIRST: Invoke the object method handler in the first emission stage.
143 @G_SIGNAL_RUN_LAST: Invoke the object method handler in the third emission stage.
144 @G_SIGNAL_RUN_CLEANUP: Invoke the object method handler in the last emission stage.
145 @G_SIGNAL_NO_RECURSE: Signals being emitted for an object while currently being in
146 emission for this very object will not be emitted recursively,
147 but instead cause the first emission to be restarted.
148 @G_SIGNAL_DETAILED: This signal supports "::detail" appendixes to the signal name
149 upon handler connections and emissions.
150 @G_SIGNAL_ACTION: Action signals are signals that may freely be emitted on alive
151 objects from user code via g_signal_emit() and friends, without
152 the need of being embedded into extra code that performs pre or
153 post emission adjustments on the object. They can also be thought
154 of as by third-party code generically callable object methods.
155 @G_SIGNAL_NO_HOOKS: No emissions hooks are supported for this signal.
157 <!-- ##### ENUM GSignalMatchType ##### -->
159 The match types specify what g_signal_handlers_block_matched(),
160 g_signal_handlers_unblock_matched() and g_signal_handlers_disconnect_matched()
164 @G_SIGNAL_MATCH_ID: The signal id must be equal.
165 @G_SIGNAL_MATCH_DETAIL: The signal detail be equal.
166 @G_SIGNAL_MATCH_CLOSURE: The closure must be the same.
167 @G_SIGNAL_MATCH_FUNC: The C closure callback must be the same.
168 @G_SIGNAL_MATCH_DATA: The closure data must be the same.
169 @G_SIGNAL_MATCH_UNBLOCKED: Only unblocked signals may matched.
171 <!-- ##### STRUCT GSignalQuery ##### -->
173 A structure holding in-depth information for a specific signal. It is
174 filled in by the g_signal_query() function.
177 @signal_id: The signal id of the signal being queried, or 0 if the
178 signal to be queried was unknown.
179 @signal_name: The signal name.
180 @itype: The interface/instance type that this signal can be emitted for.
181 @signal_flags: The signal flags as passed in to g_signal_new().
182 @return_type: The return type for user callbacks.
183 @n_params: The number of parameters that user callbacks take.
184 @param_types: The individual parameter types for user callbacks, note that the
185 effective callback signature is:
187 @return_type callback (#gpointer data1,
188 [#param_types param_names,]
192 <!-- ##### MACRO G_SIGNAL_TYPE_STATIC_SCOPE ##### -->
194 This macro flags signal argument types for which the signal system may
195 assume that instances thereof remain persistent across all signal emissions
196 they are used in. This is only useful for non ref-counted, value-copy types.
199 To flag a signal argument in this way, add
200 <literal>| G_SIGNAL_TYPE_STATIC_SCOPE</literal> to the corresponding argument
205 g_signal_new ("size_request",
206 G_TYPE_FROM_CLASS (gobject_class),
208 G_STRUCT_OFFSET (GtkWidgetClass, size_request),
210 _gtk_marshal_VOID__BOXED,
212 GTK_TYPE_REQUISITION | G_SIGNAL_TYPE_STATIC_SCOPE);
218 <!-- ##### MACRO G_SIGNAL_MATCH_MASK ##### -->
225 <!-- ##### MACRO G_SIGNAL_FLAGS_MASK ##### -->
232 <!-- ##### FUNCTION g_signal_new ##### -->
234 Creates a new signal. (This is usually done in the class initializer.)
237 A signal name consists of segments consisting of ASCII letters and
238 digits, separated by either the '-' or '_' character. The first
239 character of a signal name must be a letter. Names which violate these
240 rules lead to undefined behaviour of the GSignal system.
243 When registering a signal and looking up a signal, either separator can
244 be used, but they cannot be mixed.
247 @signal_name: the name for the signal
248 @itype: the type this signal pertains to. It will also pertain to
249 types which are derived from this type.
250 @signal_flags: a combination of #GSignalFlags specifying detail of when
251 the default handler is to be invoked. You should at least specify
252 %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST.
253 @class_offset: The offset of the function pointer in the class structure
254 for this type. Used to invoke a class method generically.
255 @accumulator: the accumulator for this signal; may be %NULL.
256 @accu_data: user data for the @accumulator.
257 @c_marshaller: the function to translate arrays of parameter values to
258 signal emissions into C language callback invocations.
259 @return_type: the type of return value, or #G_TYPE_NONE for a signal
260 without a return value.
261 @n_params: the number of parameter types to follow.
262 @Varargs: a list of types, one for each parameter.
263 @Returns: the signal id
266 <!-- ##### FUNCTION g_signal_newv ##### -->
268 Creates a new signal. (This is usually done in the class initializer.)
271 See g_signal_new() for details on allowed signal names.
274 @signal_name: the name for the signal
275 @itype: the type this signal pertains to. It will also pertain to
276 types which are derived from this type.
277 @signal_flags: a combination of #GSignalFlags specifying detail of when
278 the default handler is to be invoked. You should at least specify
279 %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST.
280 @class_closure: The closure to invoke on signal emission.
281 @accumulator: the accumulator for this signal; may be %NULL.
282 @accu_data: user data for the @accumulator.
283 @c_marshaller: the function to translate arrays of parameter values to
284 signal emissions into C language callback invocations.
285 @return_type: the type of return value, or #G_TYPE_NONE for a signal
286 without a return value.
287 @n_params: the length of @param_types.
288 @param_types: an array types, one for each parameter.
289 @Returns: the signal id
292 <!-- ##### FUNCTION g_signal_new_valist ##### -->
294 Creates a new signal. (This is usually done in the class initializer.)
297 See g_signal_new() for details on allowed signal names.
300 @signal_name: the name for the signal
301 @itype: the type this signal pertains to. It will also pertain to
302 types which are derived from this type.
303 @signal_flags: a combination of #GSignalFlags specifying detail of when
304 the default handler is to be invoked. You should at least specify
305 %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST.
306 @class_closure: The closure to invoke on signal emission.
307 @accumulator: the accumulator for this signal; may be %NULL.
308 @accu_data: user data for the @accumulator.
309 @c_marshaller: the function to translate arrays of parameter values to
310 signal emissions into C language callback invocations.
311 @return_type: the type of return value, or #G_TYPE_NONE for a signal
312 without a return value.
313 @n_params: the number of parameter types in @args.
314 @args: va_list of #GType, one for each parameter.
315 @Returns: the signal id
318 <!-- ##### FUNCTION g_signal_query ##### -->
320 Queries the signal system for in-depth information about a
321 specific signal. This function will fill in a user-provided
322 structure to hold signal-specific information. If an invalid
323 signal id is passed in, the @signal_id member of the #GSignalQuery
324 is 0. All members filled into the #GSignalQuery structure should
325 be considered constant and have to be left untouched.
328 @signal_id: The signal id of the signal to query information for.
329 @query: A user provided structure that is filled in with constant
333 <!-- ##### FUNCTION g_signal_lookup ##### -->
335 Given the name of the signal and the type of object it connects to, gets
336 the signal's identifying integer. Emitting the signal by number is
337 somewhat faster than using the name each time.
340 Also tries the ancestors of the given type.
343 See g_signal_new() for details on allowed signal names.
346 @name: the signal's name.
347 @itype: the type that the signal operates on.
348 @Returns: the signal's identifying number, or 0 if no signal was found.
351 <!-- ##### FUNCTION g_signal_name ##### -->
353 Given the signal's identifier, finds its name.
356 Two different signals may have the same name, if they have differing types.
359 @signal_id: the signal's identifying number.
360 @Returns: the signal name, or %NULL if the signal number was invalid.
363 <!-- ##### FUNCTION g_signal_list_ids ##### -->
365 Lists the signals by id that a certain instance or interface type
366 created. Further information about the signals can be acquired through
370 @itype: Instance or interface type.
371 @n_ids: Location to store the number of signal ids for @itype.
372 @Returns: Newly allocated array of signal IDs.
375 <!-- ##### FUNCTION g_signal_emit ##### -->
380 Note that g_signal_emit() resets the return value to the default
381 if no handlers are connected, in contrast to g_signal_emitv().
384 @instance: the instance the signal is being emitted on.
385 @signal_id: the signal id
387 @Varargs: parameters to be passed to the signal, followed by a
388 location for the return value. If the return type of the signal
389 is #G_TYPE_NONE, the return value location can be omitted.
392 <!-- ##### FUNCTION g_signal_emit_by_name ##### -->
397 Note that g_signal_emit_by_name() resets the return value to the default
398 if no handlers are connected, in contrast to g_signal_emitv().
401 @instance: the instance the signal is being emitted on.
402 @detailed_signal: a string of the form "signal-name::detail".
403 @Varargs: parameters to be passed to the signal, followed by a
404 location for the return value. If the return type of the signal
405 is #G_TYPE_NONE, the return value location can be omitted.
408 <!-- ##### FUNCTION g_signal_emitv ##### -->
413 Note that g_signal_emitv() doesn't change @return_value if no handlers are
414 connected, in contrast to g_signal_emit() and g_signal_emit_valist().
417 @instance_and_params: argument list for the signal emission. The first
418 element in the array is a #GValue for the instance the signal is
419 being emitted on. The rest are any arguments to be passed to the
421 @signal_id: the signal id
423 @return_value: Location to store the return value of the signal emission.
426 <!-- ##### FUNCTION g_signal_emit_valist ##### -->
431 Note that g_signal_emit_valist() resets the return value to the default
432 if no handlers are connected, in contrast to g_signal_emitv().
435 @instance: the instance the signal is being emitted on.
436 @signal_id: the signal id
438 @var_args: a list of parameters to be passed to the signal, followed by a
439 location for the return value. If the return type of the signal
440 is #G_TYPE_NONE, the return value location can be omitted.
443 <!-- ##### MACRO g_signal_connect ##### -->
445 Connects a #GCallback function to a signal for a particular object.
448 The handler will be called before the default handler of the signal.
451 @instance: the instance to connect to.
452 @detailed_signal: a string of the form "signal-name::detail".
453 @c_handler: the #GCallback to connect.
454 @data: data to pass to @c_handler calls.
455 @Returns: the handler id
458 <!-- ##### MACRO g_signal_connect_after ##### -->
460 Connects a #GCallback function to a signal for a particular object.
463 The handler will be called after the default handler of the signal.
466 @instance: the instance to connect to.
467 @detailed_signal: a string of the form "signal-name::detail".
468 @c_handler: the #GCallback to connect.
469 @data: data to pass to @c_handler calls.
470 @Returns: the handler id
473 <!-- ##### MACRO g_signal_connect_swapped ##### -->
475 Connects a #GCallback function to a signal for a particular object.
478 The instance on which the signal is emitted and @data will be swapped when
482 @instance: the instance to connect to.
483 @detailed_signal: a string of the form "signal-name::detail".
484 @c_handler: the #GCallback to connect.
485 @data: data to pass to @c_handler calls.
486 @Returns: the handler id
489 <!-- ##### FUNCTION g_signal_connect_object ##### -->
491 This is similar to g_signal_connect_data(), but uses a closure which
492 ensures that the object stays alive during the call to @c_handler.
495 @instance: the instance to connect to.
496 @detailed_signal: a string of the form "signal-name::detail".
497 @c_handler: the #GCallback to connect.
498 @gobject: the object to pass as data to @c_handler.
499 @connect_flags: a combination of #GConnnectFlags.
500 @Returns: the handler id.
503 <!-- ##### ENUM GConnectFlags ##### -->
505 The connection flags are used to specify the behaviour of a signal's
509 @G_CONNECT_AFTER: whether the handler should be called before or after the
510 default handler of the signal.
511 @G_CONNECT_SWAPPED: whether the instance and data should be swapped when
514 <!-- ##### FUNCTION g_signal_connect_data ##### -->
516 Connects a #GCallback function to a signal for a particular object.
519 @instance: the instance to connect to.
520 @detailed_signal: a string of the form "signal-name::detail".
521 @c_handler: the #GCallback to connect.
522 @data: data to pass to @c_handler calls.
523 @destroy_data: a #GDestroyNotify for @data.
524 @connect_flags: a combination of #GConnectFlags.
525 @Returns: the handler id
528 <!-- ##### FUNCTION g_signal_connect_closure ##### -->
530 Connects a closure to a signal for a particular object.
533 @instance: the instance to connect to.
534 @detailed_signal: a string of the form "signal-name::detail".
535 @closure: the closure to connect.
536 @after: whether the handler should be called before or after the
537 default handler of the signal.
538 @Returns: the handler id
541 <!-- ##### FUNCTION g_signal_connect_closure_by_id ##### -->
543 Connects a closure to a signal for a particular object.
546 @instance: the instance to connect to.
547 @signal_id: the id of the signal.
549 @closure: the closure to connect.
550 @after: whether the handler should be called before or after the
551 default handler of the signal.
552 @Returns: the handler id
555 <!-- ##### FUNCTION g_signal_handler_block ##### -->
557 Blocks a handler of an instance so it will not be called during
558 any signal emissions unless it is unblocked again. Thus "blocking"
559 a signal handler means to temporarily deactive it, a signal handler
560 has to be unblocked exactly the same amount of times it has been
561 blocked before to become active again.
564 The @handler_id has to be a valid signal handler id, connected to a
568 @instance: The instance to block the signal handler of.
569 @handler_id: Handler id of the handler to be blocked.
572 <!-- ##### FUNCTION g_signal_handler_unblock ##### -->
574 Undoes the effect of a previous g_signal_handler_block() call.
575 A blocked handler is skipped during signal emissions and will not be
576 invoked, unblocking it (for exactly the amount of times it has been
577 blocked before) reverts its "blocked" state, so the handler will be
578 recognized by the signal system and is called upon future or currently
579 ongoing signal emissions (since the order in which handlers are
580 called during signal emissions is deterministic, whether the
581 unblocked handler in question is called as part of a currently
582 ongoing emission depends on how far that emission has proceeded
586 The @handler_id has to be a valid id of a signal handler that is
587 connected to a signal of @instance and is currently blocked.
590 @instance: The instance to unblock the signal handler of.
591 @handler_id: Handler id of the handler to be unblocked.
594 <!-- ##### FUNCTION g_signal_handler_disconnect ##### -->
596 Disconnects a handler from an instance so it will not be called during
597 any future or currently ongoing emissions of the signal it has been
598 connected to. The @handler_id becomes invalid and may be reused.
601 The @handler_id has to be a valid signal handler id, connected to a
605 @instance: The instance to remove the signal handler from.
606 @handler_id: Handler id of the handler to be disconnected.
609 <!-- ##### FUNCTION g_signal_handler_find ##### -->
611 Finds the first signal handler that matches certain selection criteria.
612 The criteria mask is passed as an OR-ed combination of #GSignalMatchType
613 flags, and the criteria values are passed as arguments.
614 The match @mask has to be non-0 for successful matches.
615 If no handler was found, 0 is returned.
618 @instance: The instance owning the signal handler to be found.
619 @mask: Mask indicating which of @signal_id, @detail, @closure, @func
620 and/or @data the handler has to match.
621 @signal_id: Signal the handler has to be connected to.
622 @detail: Signal detail the handler has to be connected to.
623 @closure: The closure the handler will invoke.
624 @func: The C closure callback of the handler (useless for non-C closures).
625 @data: The closure data of the handler's closure.
626 @Returns: A valid non-0 signal handler id for a successful match.
629 <!-- ##### FUNCTION g_signal_handlers_block_matched ##### -->
631 Blocks all handlers on an instance that match a certain selection criteria.
632 The criteria mask is passed as an OR-ed combination of #GSignalMatchType
633 flags, and the criteria values are passed as arguments.
634 Passing at least one of the %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC
635 or %G_SIGNAL_MATCH_DATA match flags is required for successful matches.
636 If no handlers were found, 0 is returned, the number of blocked handlers
640 @instance: The instance to block handlers from.
641 @mask: Mask indicating which of @signal_id, @detail, @closure, @func
642 and/or @data the handlers have to match.
643 @signal_id: Signal the handlers have to be connected to.
644 @detail: Signal detail the handlers have to be connected to.
645 @closure: The closure the handlers will invoke.
646 @func: The C closure callback of the handlers (useless for non-C closures).
647 @data: The closure data of the handlers' closures.
648 @Returns: The amount of handlers that got blocked.
651 <!-- ##### FUNCTION g_signal_handlers_unblock_matched ##### -->
653 Unblocks all handlers on an instance that match a certain selection
654 criteria. The criteria mask is passed as an OR-ed combination of
655 #GSignalMatchType flags, and the criteria values are passed as arguments.
656 Passing at least one of the %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC
657 or %G_SIGNAL_MATCH_DATA match flags is required for successful matches.
658 If no handlers were found, 0 is returned, the number of unblocked handlers
659 otherwise. The match criteria should not apply to any handlers that are
660 not currently blocked.
663 @instance: The instance to unblock handlers from.
664 @mask: Mask indicating which of @signal_id, @detail, @closure, @func
665 and/or @data the handlers have to match.
666 @signal_id: Signal the handlers have to be connected to.
667 @detail: Signal detail the handlers have to be connected to.
668 @closure: The closure the handlers will invoke.
669 @func: The C closure callback of the handlers (useless for non-C closures).
670 @data: The closure data of the handlers' closures.
671 @Returns: The amount of handlers that got unblocked.
674 <!-- ##### FUNCTION g_signal_handlers_disconnect_matched ##### -->
676 Disconnects all handlers on an instance that match a certain selection
677 criteria. The criteria mask is passed as an OR-ed combination of
678 #GSignalMatchType flags, and the criteria values are passed as arguments.
679 Passing at least one of the %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC
680 or %G_SIGNAL_MATCH_DATA match flags is required for successful matches.
681 If no handlers were found, 0 is returned, the number of disconnected
685 @instance: The instance to remove handlers from.
686 @mask: Mask indicating which of @signal_id, @detail, @closure, @func
687 and/or @data the handlers have to match.
688 @signal_id: Signal the handlers have to be connected to.
689 @detail: Signal detail the handlers have to be connected to.
690 @closure: The closure the handlers will invoke.
691 @func: The C closure callback of the handlers (useless for non-C closures).
692 @data: The closure data of the handlers' closures.
693 @Returns: The amount of handlers that got disconnected.
696 <!-- ##### FUNCTION g_signal_handler_is_connected ##### -->
698 Returns whether @handler_id is the id of a handler connected to @instance.
701 @instance: The instance where a signal handler is sought.
702 @handler_id: the handler id.
703 @Returns: whether @handler_id identifies a handler connected to @instance.
706 <!-- ##### MACRO g_signal_handlers_block_by_func ##### -->
708 Blocks all handlers on an instance that match @func and @data.
711 @instance: The instance to block handlers from.
712 @func: The C closure callback of the handlers (useless for non-C closures).
713 @data: The closure data of the handlers' closures.
714 @Returns: The number of handlers that got blocked.
717 <!-- ##### MACRO g_signal_handlers_unblock_by_func ##### -->
719 Unblocks all handlers on an instance that match @func and @data.
722 @instance: The instance to unblock handlers from.
723 @func: The C closure callback of the handlers (useless for non-C closures).
724 @data: The closure data of the handlers' closures.
725 @Returns: The number of handlers that got unblocked.
728 <!-- ##### MACRO g_signal_handlers_disconnect_by_func ##### -->
730 Disconnects all handlers on an instance that match @func and @data.
733 @instance: The instance to remove handlers from.
734 @func: The C closure callback of the handlers (useless for non-C closures).
735 @data: The closure data of the handlers' closures.
736 @Returns: The number of handlers that got disconnected.
739 <!-- ##### FUNCTION g_signal_has_handler_pending ##### -->
741 Returns whether there are any handlers connected to @instance for the
742 given signal id and detail.
745 One example of when you might use this is when the arguments to the
746 signal are difficult to compute. A class implementor may opt to not emit
747 the signal if no one is attached anyway, thus saving the cost of building
751 @instance: the object whose signal handlers are sought.
752 @signal_id: the signal id.
754 @may_be_blocked: whether blocked handlers should count as match.
755 @Returns: %TRUE if a handler is connected to the signal,
759 <!-- ##### FUNCTION g_signal_stop_emission ##### -->
761 Stops a signal's current emission.
764 This will prevent the default method from running, if the signal was
765 %G_SIGNAL_RUN_LAST and you connected normally (i.e. without the "after"
769 Prints a warning if used on a signal which isn't being emitted.
772 @instance: the object whose signal handlers you wish to stop.
773 @signal_id: the signal identifier, as returned by g_signal_lookup().
774 @detail: the detail which the signal was emitted with.
777 <!-- ##### FUNCTION g_signal_stop_emission_by_name ##### -->
779 Stops a signal's current emission.
782 This is just like g_signal_stop_emission() except it will look up the
786 @instance: the object whose signal handlers you wish to stop.
787 @detailed_signal: a string of the form "signal-name::detail".
790 <!-- ##### FUNCTION g_signal_override_class_closure ##### -->
792 Overrides the class closure (i.e. the default handler) for the given signal
793 for emissions on instances of @instance_type. @instance_type must be derived
794 from the type to which the signal belongs.
797 @signal_id: the signal id
798 @instance_type: the instance type on which to override the class closure
800 @class_closure: the closure.
803 <!-- ##### FUNCTION g_signal_chain_from_overridden ##### -->
805 Calls the original class closure of a signal. This function should only
806 be called from an overridden class closure; see
807 g_signal_override_class_closure().
810 @instance_and_params: the argument list of the signal emission. The first
811 element in the array is a #GValue for the instance the signal is being
812 emitted on. The rest are any arguments to be passed to the signal.
813 @return_value: Location for the return value.
816 <!-- ##### FUNCTION g_signal_add_emission_hook ##### -->
818 Adds an emission hook for a signal, which will get called for any emission
819 of that signal, independent of the instance.
822 @signal_id: the signal identifier, as returned by g_signal_lookup().
823 @detail: the detail on which to call the hook.
824 @hook_func: a #GSignalEmissionHook function.
825 @hook_data: user data for @hook_func.
826 @data_destroy: a #GDestroyNotify for @hook_data.
827 @Returns: the hook id, for later use with g_signal_remove_emission_hook().
830 <!-- ##### FUNCTION g_signal_remove_emission_hook ##### -->
832 Deletes an emission hook.
835 @signal_id: the id of the signal
836 @hook_id: the id of the emission hook, as returned by
837 g_signal_add_emission_hook()
840 <!-- ##### FUNCTION g_signal_parse_name ##### -->
842 Internal function to parse a signal name into its @signal_id
846 @detailed_signal: a string of the form "signal-name::detail".
847 @itype: The interface/instance type that introduced "signal-name".
848 @signal_id_p: Location to store the signal id.
849 @detail_p: Location to store the detail quark.
850 @force_detail_quark: %TRUE forces creation of a #GQuark for the detail.
851 @Returns: Whether the signal name could successfully be parsed and @signal_id_p and @detail_p contain valid return values.
854 <!-- ##### FUNCTION g_signal_get_invocation_hint ##### -->
856 Returns the invocation hint of the innermost signal emission of instance.
859 @instance: the instance to query
860 @Returns: the invocation hint of the innermost signal emission.
863 <!-- ##### FUNCTION g_signal_type_cclosure_new ##### -->
873 <!-- ##### FUNCTION g_signal_accumulator_true_handled ##### -->
875 A predefined #GSignalAccumulator for signals that return a
876 boolean values. The behavior that this accumulator gives is
877 that a return of %TRUE stops the signal emission: no further
878 callbacks will be invokced, while a return of %FALSE allows
879 the emission to coninue. The idea here is that a %TRUE return
880 indicates that the callback <emphasis>handled</emphasis> the signal,
881 and no further handling is needed.
884 @ihint: standard #GSignalAccumulator parameter
885 @return_accu: standard #GSignalAccumulator parameter
886 @handler_return: standard #GSignalAccumulator parameter
887 @dummy: standard #GSignalAccumulator parameter
888 @Returns: standard #GSignalAccumulator result