Lines Matching full:signal
1 /* GObject - GLib Type, Object, Parameter and Signal Library
30 #include <signal.h>
48 * The basic concept of the signal system is that of the
49 * <emphasis>emission</emphasis> of a signal. Signals are introduced
52 * basically they are a per-type facility that is inherited. A signal
62 * handler" or "default (signal) handler", while user provided callbacks are
63 * usually just called "signal handler".
64 * The object method handler is provided at signal creation time (this most
67 * signal on certain object instances.
69 * A signal emission consists of five stages, unless prematurely stopped:
75 * 2 - Invocation of normal user-provided signal handlers (<emphasis>after</emphasis> flag %FALSE)
81 * 4 - Invocation of user provided signal handlers, connected with an <emphasis>after</emphasis> flag of %TRUE
87 * The user-provided signal handlers are called in the order they were
89 * All handlers may prematurely stop a signal emission, and any number of
91 * a signal emission.
93 * of a signal emission.
98 * Second, upon emission of a %G_SIGNAL_DETAILED signal, an additional
100 * argument of the signal handler currently subject to invocation.
101 * Specification of no detail argument for signal handlers (omission of the
102 * detail part of the signal specification upon connection) serves as a
240 Handler *tail_before; /* normal signal handlers are appended here */
296 /* --- signal nodes --- */
798 g_warning (G_STRLOC ": signal \"%s\" of type `%s' already destroyed",
810 * @instance: the object whose signal handlers you wish to stop.
811 * @signal_id: the signal identifier, as returned by g_signal_lookup().
812 * @detail: the detail which the signal was emitted with.
814 * Stops a signal's current emission.
816 * This will prevent the default method from running, if the signal was
820 * Prints a warning if used on a signal which isn't being emitted.
836 g_warning ("%s: signal id `%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
848 g_warning (G_STRLOC ": emission of signal \"%s\" for instance `%p' cannot be stopped from emission hook",
854 g_warning (G_STRLOC ": no emission of signal \"%s\" to stop for instance `%p'",
858 g_warning ("%s: signal id `%u' is invalid for instance `%p'", G_STRLOC, signal_id, instance);
879 * @signal_id: the signal identifier, as returned by g_signal_lookup().
885 * Adds an emission hook for a signal, which will get called for any emission
886 * of that signal, independent of the instance. This is possible only
910 g_warning ("%s: invalid signal id `%u'", G_STRLOC, signal_id);
916 g_warning ("%s: signal id `%u' does not support emission hooks (G_SIGNAL_NO_HOOKS flag set)", G_STRLOC, signal_id);
922 g_warning ("%s: signal id `%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
948 * @signal_id: the id of the signal
966 g_warning ("%s: invalid signal id `%u'", G_STRLOC, signal_id);
968 g_warning ("%s: signal \"%s\" had no hook (%lu) to remove", G_STRLOC, node->name, hook_id);
1000 gchar *signal = g_new (gchar, l + 1);
1002 memcpy (signal, name, l);
1003 signal[l] = 0;
1004 signal_id = signal_id_lookup (g_quark_try_string (signal), itype);
1005 g_free (signal);
1018 * @detailed_signal: a string of the form "signal-name::detail".
1019 * @itype: The interface/instance type that introduced "signal-name".
1020 * @signal_id_p: Location to store the signal id.
1024 * Internal function to parse a signal name into its @signal_id
1027 * Returns: Whether the signal name could successfully be parsed and @signal_id_p and @detail_p contain valid return values.
1062 * @instance: the object whose signal handlers you wish to stop.
1063 * @detailed_signal: a string of the form "signal-name::detail".
1065 * Stops a signal's current emission.
1068 * signal id for you.
1089 g_warning ("%s: signal `%s' does not support details", G_STRLOC, detailed_signal);
1091 g_warning ("%s: signal `%s' is invalid for instance `%p'", G_STRLOC, detailed_signal, instance);
1100 g_warning (G_STRLOC ": emission of signal \"%s\" for instance `%p' cannot be stopped from emission hook",
1106 g_warning (G_STRLOC ": no emission of signal \"%s\" to stop for instance `%p'",
1111 g_warning ("%s: signal `%s' is invalid for instance `%p'", G_STRLOC, detailed_signal, instance);
1117 * @name: the signal's name.
1118 * @itype: the type that the signal operates on.
1120 * Given the name of the signal and the type of object it connects to, gets
1121 * the signal's identifying integer. Emitting the signal by number is
1126 * See g_signal_new() for details on allowed signal names.
1128 * Returns: the signal's identifying number, or 0 if no signal was found.
1145 g_warning (G_STRLOC ": unable to lookup signal \"%s\" for invalid type id `%"G_GSIZE_FORMAT"'",
1148 g_warning (G_STRLOC ": unable to lookup signal \"%s\" for non instantiatable type `%s'",
1151 g_warning (G_STRLOC ": unable to lookup signal \"%s\" of unloaded type `%s'",
1161 * @n_ids: Location to store the number of signal ids for @itype.
1167 * Returns: Newly allocated array of signal IDs.
1191 /* Signal names with "_" in them are aliases to the same
1218 * @signal_id: the signal's identifying number.
1220 * Given the signal's identifier, finds its name.
1224 * Returns: the signal name, or %NULL if the signal number was invalid.
1242 * @signal_id: The signal id of the signal to query information for.
1246 * Queries the signal system for in-depth information about a
1247 * specific signal. This function will fill in a user-provided
1248 * structure to hold signal-specific information. If an invalid
1249 * signal id is passed in, the @signal_id member of the #GSignalQuery
1280 * @signal_name: the name for the signal
1281 * @itype: the type this signal pertains to. It will also pertain to
1288 * not associate a class method with this signal.
1289 * @accumulator: the accumulator for this signal; may be %NULL.
1292 * signal emissions into C language callback invocations.
1293 * @return_type: the type of return value, or #G_TYPE_NONE for a signal
1298 * Creates a new signal. (This is usually done in the class initializer.)
1300 * A signal name consists of segments consisting of ASCII letters and
1302 * character of a signal name must be a letter. Names which violate these
1305 * When registering a signal and looking up a signal, either separator can
1308 * Returns: the signal id
1353 * @signal_name: the name for the signal
1354 * @itype: the type this signal pertains to. It will also pertain to
1360 * this signal. Used to invoke a class method generically. Pass %NULL to
1361 * not associate a class method with this signal.
1362 * @accumulator: the accumulator for this signal; may be %NULL.
1365 * signal emissions into C language callback invocations.
1366 * @return_type: the type of return value, or #G_TYPE_NONE for a signal
1371 * Creates a new signal. (This is usually done in the class initializer.)
1374 * off a class offset for the signal's class handler. This function
1383 * See g_signal_new() for information about signal names.
1385 * Returns: the signal id
1484 * @signal_name: the name for the signal
1485 * @itype: the type this signal pertains to. It will also pertain to
1490 * @class_closure: The closure to invoke on signal emission; may be %NULL
1491 * @accumulator: the accumulator for this signal; may be %NULL
1494 * signal emissions into C language callback invocations
1495 * @return_type: the type of return value, or #G_TYPE_NONE for a signal
1500 * Creates a new signal. (This is usually done in the class initializer.)
1502 * See g_signal_new() for details on allowed signal names.
1504 * Returns: the signal id
1541 g_warning (G_STRLOC ": signal \"%s\" already exists in the `%s' %s",
1551 g_warning (G_STRLOC ": signal \"%s\" for type `%s' was previously created for type `%s'",
1562 g_warning (G_STRLOC ": parameter %d of type `%s' for signal \"%s::%s\" is not a value type",
1570 g_warning (G_STRLOC ": return value of type `%s' for signal \"%s::%s\" is not a value type",
1579 g_warning (G_STRLOC ": signal \"%s::%s\" has return type `%s' and is only G_SIGNAL_RUN_FIRST",
1586 signal node */
1642 * @signal_name: the name for the signal
1643 * @itype: the type this signal pertains to. It will also pertain to
1648 * @class_closure: The closure to invoke on signal emission; may be %NULL.
1649 * @accumulator: the accumulator for this signal; may be %NULL.
1652 * signal emissions into C language callback invocations.
1653 * @return_type: the type of return value, or #G_TYPE_NONE for a signal
1658 * Creates a new signal. (This is usually done in the class initializer.)
1660 * See g_signal_new() for details on allowed signal names.
1662 * Returns: the signal id
1723 g_critical (G_STRLOC ": signal \"%s\" being destroyed is currently in emission (instance `%p')",
1755 * @signal_id: the signal id
1757 * for the signal.
1760 * Overrides the class closure (i.e. the default handler) for the given signal
1762 * from the type to which the signal belongs.
1781 g_warning ("%s: type `%s' cannot be overridden for signal id `%u'", G_STRLOC, type_debug_name (instance_type), signal_id);
1787 g_warning ("%s: type `%s' is already overridden for signal id `%u'", G_STRLOC, type_debug_name (instance_type), signal_id);
1796 * @signal_name: the name for the signal
1798 * for the signal.
1802 * given signal for emissions on instances of @instance_type with
1804 * type to which the signal belongs.
1829 g_warning ("%s: signal name '%s' is invalid for type id '%"G_GSIZE_FORMAT"'",
1836 * @instance_and_params: the argument list of the signal emission. The first
1837 * element in the array is a #GValue for the instance the signal is being
1838 * emitted on. The rest are any arguments to be passed to the signal.
1841 * Calls the original class closure of a signal. This function should only
1886 g_warning ("%s: signal id `%u' cannot be chained from current emission stage for instance `%p'", G_STRLOC, node->signal_id, instance);
1889 g_warning ("%s: no signal is currently being emitted for instance `%p'", G_STRLOC, instance);
1908 * @instance: the instance the signal is being emitted on.
1910 * location for the return value. If the return type of the signal
1913 * Calls the original class closure of a signal. This function should
1958 g_warning ("%s: signal id `%u' cannot be chained from current emission stage for instance `%p'", G_STRLOC, node->signal_id, instance);
1961 g_warning ("%s: no signal is currently being emitted for instance `%p'", G_STRLOC, instance);
2076 * Returns the invocation hint of the innermost signal emission of instance.
2078 * Returns: the invocation hint of the innermost signal emission.
2097 * @signal_id: the id of the signal.
2101 * default handler of the signal.
2103 signal for a particular object.
2126 g_warning ("%s: signal id `%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
2128 g_warning ("%s: signal id `%u' is invalid for instance `%p'", G_STRLOC, signal_id, instance);
2143 g_warning ("%s: signal id `%u' is invalid for instance `%p'", G_STRLOC, signal_id, instance);
2152 * @detailed_signal: a string of the form "signal-name::detail".
2155 * default handler of the signal.
2157 * Connects a closure to a signal for a particular object.
2184 g_warning ("%s: signal `%s' does not support details", G_STRLOC, detailed_signal);
2186 g_warning ("%s: signal `%s' is invalid for instance `%p'", G_STRLOC, detailed_signal, instance);
2201 g_warning ("%s: signal `%s' is invalid for instance `%p'", G_STRLOC, detailed_signal, instance);
2210 * @detailed_signal: a string of the form "signal-name::detail".
2216 * Connects a #GCallback function to a signal for a particular object. Similar
2218 * which will be called when the signal handler is disconnected and no longer
2253 g_warning ("%s: signal `%s' does not support details", G_STRLOC, detailed_signal);
2255 g_warning ("%s: signal `%s' is invalid for instance `%p'", G_STRLOC, detailed_signal, instance);
2270 g_warning ("%s: signal `%s' is invalid for instance `%p'", G_STRLOC, detailed_signal, instance);
2278 * @instance: The instance to block the signal handler of.
2282 * signal emissions unless it is unblocked again. Thus "blocking" a
2283 * signal handler means to temporarily deactive it, a signal handler
2287 * The @handler_id has to be a valid signal handler id, connected to a
2288 * signal of @instance.
2316 * @instance: The instance to unblock the signal handler of.
2320 * blocked handler is skipped during signal emissions and will not be
2323 * recognized by the signal system and is called upon future or
2324 * currently ongoing signal emissions (since the order in which
2325 * handlers are called during signal emissions is deterministic,
2330 * The @handler_id has to be a valid id of a signal handler that is
2331 * connected to a signal of @instance and is currently blocked.
2358 * @instance: The instance to remove the signal handler from.
2362 * any future or currently ongoing emissions of the signal it has been
2365 * The @handler_id has to be a valid signal handler id, connected to a
2366 * signal of @instance.
2393 * @instance: The instance where a signal handler is sought.
2461 * @instance: The instance owning the signal handler to be found.
2464 * @signal_id: Signal the handler has to be connected to.
2465 * @detail: Signal detail the handler has to be connected to.
2470 * Finds the first signal handler that matches certain selection criteria.
2476 * Returns: A valid non-0 signal handler id for a successful match.
2544 * @signal_id: Signal the handlers have to be connected to.
2545 * @detail: Signal detail the handlers have to be connected to.
2591 * @signal_id: Signal the handlers have to be connected to.
2592 * @detail: Signal detail the handlers have to be connected to.
2639 * @signal_id: Signal the handlers have to be connected to.
2640 * @detail: Signal detail the handlers have to be connected to.
2684 * @instance: the object whose signal handlers are sought.
2685 * @signal_id: the signal id.
2690 * given signal id and detail.
2693 * signal are difficult to compute. A class implementor may opt to not
2694 * emit the signal if no one is attached anyway, thus saving the cost
2697 * Returns: %TRUE if a handler is connected to the signal, %FALSE
2719 g_warning ("%s: signal id `%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
2769 /* is this a no-recurse signal already in emission? */
2785 * @instance_and_params: argument list for the signal emission. The first
2786 * element in the array is a #GValue for the instance the signal is
2788 * signal.
2789 * @signal_id: the signal id
2791 * @return_value: Location to store the return value of the signal emission.
2793 * Emits a signal.
2824 g_warning ("%s: signal id `%u' is invalid for instance `%p'", G_STRLOC, signal_id, instance);
2831 g_warning ("%s: signal id `%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
2838 g_critical ("%s: value for `%s' parameter %u for signal \"%s\" is of type `%s'",
2851 g_critical ("%s: return value `%s' for signal \"%s\" is (NULL)",
2860 g_critical ("%s: return value `%s' for signal \"%s\" is of type `%s'",
2876 /* nothing to do to emit this signal */
2888 * @instance: the instance the signal is being emitted on.
2889 * @signal_id: the signal id
2891 * @var_args: a list of parameters to be passed to the signal, followed by a
2892 * location for the return value. If the return type of the signal
2895 * Emits a signal.
2919 g_warning ("%s: signal id `%u' is invalid for instance `%p'", G_STRLOC, signal_id, instance);
2926 g_warning ("%s: signal id `%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
2935 /* nothing to do to emit this signal */
3016 * @instance: the instance the signal is being emitted on.
3017 * @signal_id: the signal id
3019 * @...: parameters to be passed to the signal, followed by a
3020 * location for the return value. If the return type of the signal
3023 * Emits a signal.
3043 * @instance: the instance the signal is being emitted on.
3044 * @detailed_signal: a string of the form "signal-name::detail".
3045 * @...: parameters to be passed to the signal, followed by a
3046 * location for the return value. If the return type of the signal
3049 * Emits a signal.
3078 g_warning ("%s: signal name `%s' is invalid for instance `%p'", G_STRLOC, detailed_signal, instance);
3118 g_message ("%s::%s(%u) emitted (instance=%p, signal-node=%p)",
3409 * that a return of %TRUE stops the signal emission: no further
3412 * indicates that the callback <emphasis>handled</emphasis> the signal,