<refentry id="gobject-Signals">
<refmeta>
<refentrytitle role="top_of_page" id="gobject-Signals.top_of_page">Signals</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GOBJECT Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Signals</refname>
<refpurpose>A means for customization of object behaviour
    and a general purpose notification mechanism</refpurpose>
</refnamediv>

<refsynopsisdiv id="gobject-Signals.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;glib-object.h&gt;

                    <link linkend="GSignalInvocationHint">GSignalInvocationHint</link>;
<link linkend="gboolean">gboolean</link>            (<link linkend="GSignalAccumulator">*GSignalAccumulator</link>)               (<link linkend="GSignalInvocationHint">GSignalInvocationHint</link> *ihint,
                                                         <link linkend="GValue">GValue</link> *return_accu,
                                                         const <link linkend="GValue">GValue</link> *handler_return,
                                                         <link linkend="gpointer">gpointer</link> data);
typedef             <link linkend="GSignalCMarshaller">GSignalCMarshaller</link>;
<link linkend="gboolean">gboolean</link>            (<link linkend="GSignalEmissionHook">*GSignalEmissionHook</link>)              (<link linkend="GSignalInvocationHint">GSignalInvocationHint</link> *ihint,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> data);
enum                <link linkend="GSignalFlags">GSignalFlags</link>;
enum                <link linkend="GSignalMatchType">GSignalMatchType</link>;
                    <link linkend="GSignalQuery">GSignalQuery</link>;
#define             <link linkend="G-SIGNAL-TYPE-STATIC-SCOPE--CAPS">G_SIGNAL_TYPE_STATIC_SCOPE</link>
#define             <link linkend="G-SIGNAL-MATCH-MASK--CAPS">G_SIGNAL_MATCH_MASK</link>
#define             <link linkend="G-SIGNAL-FLAGS-MASK--CAPS">G_SIGNAL_FLAGS_MASK</link>
<link linkend="guint">guint</link>               <link linkend="g-signal-new">g_signal_new</link>                        (const <link linkend="gchar">gchar</link> *signal_name,
                                                         <link linkend="GType">GType</link> itype,
                                                         <link linkend="GSignalFlags">GSignalFlags</link> signal_flags,
                                                         <link linkend="guint">guint</link> class_offset,
                                                         <link linkend="GSignalAccumulator">GSignalAccumulator</link> accumulator,
                                                         <link linkend="gpointer">gpointer</link> accu_data,
                                                         <link linkend="GSignalCMarshaller">GSignalCMarshaller</link> c_marshaller,
                                                         <link linkend="GType">GType</link> return_type,
                                                         <link linkend="guint">guint</link> n_params,
                                                         ...);
<link linkend="guint">guint</link>               <link linkend="g-signal-newv">g_signal_newv</link>                       (const <link linkend="gchar">gchar</link> *signal_name,
                                                         <link linkend="GType">GType</link> itype,
                                                         <link linkend="GSignalFlags">GSignalFlags</link> signal_flags,
                                                         <link linkend="GClosure">GClosure</link> *class_closure,
                                                         <link linkend="GSignalAccumulator">GSignalAccumulator</link> accumulator,
                                                         <link linkend="gpointer">gpointer</link> accu_data,
                                                         <link linkend="GSignalCMarshaller">GSignalCMarshaller</link> c_marshaller,
                                                         <link linkend="GType">GType</link> return_type,
                                                         <link linkend="guint">guint</link> n_params,
                                                         <link linkend="GType">GType</link> *param_types);
<link linkend="guint">guint</link>               <link linkend="g-signal-new-valist">g_signal_new_valist</link>                 (const <link linkend="gchar">gchar</link> *signal_name,
                                                         <link linkend="GType">GType</link> itype,
                                                         <link linkend="GSignalFlags">GSignalFlags</link> signal_flags,
                                                         <link linkend="GClosure">GClosure</link> *class_closure,
                                                         <link linkend="GSignalAccumulator">GSignalAccumulator</link> accumulator,
                                                         <link linkend="gpointer">gpointer</link> accu_data,
                                                         <link linkend="GSignalCMarshaller">GSignalCMarshaller</link> c_marshaller,
                                                         <link linkend="GType">GType</link> return_type,
                                                         <link linkend="guint">guint</link> n_params,
                                                         <link linkend="va-list">va_list</link> args);
<link linkend="void">void</link>                <link linkend="g-signal-query">g_signal_query</link>                      (<link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GSignalQuery">GSignalQuery</link> *query);
<link linkend="guint">guint</link>               <link linkend="g-signal-lookup">g_signal_lookup</link>                     (const <link linkend="gchar">gchar</link> *name,
                                                         <link linkend="GType">GType</link> itype);
const <link linkend="gchar">gchar</link>*        <link linkend="g-signal-name">g_signal_name</link>                       (<link linkend="guint">guint</link> signal_id);
<link linkend="guint">guint</link>*              <link linkend="g-signal-list-ids">g_signal_list_ids</link>                   (<link linkend="GType">GType</link> itype,
                                                         <link linkend="guint">guint</link> *n_ids);
<link linkend="void">void</link>                <link linkend="g-signal-emit">g_signal_emit</link>                       (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         ...);
<link linkend="void">void</link>                <link linkend="g-signal-emit-by-name">g_signal_emit_by_name</link>               (<link linkend="gpointer">gpointer</link> instance,
                                                         const <link linkend="gchar">gchar</link> *detailed_signal,
                                                         ...);
<link linkend="void">void</link>                <link linkend="g-signal-emitv">g_signal_emitv</link>                      (const <link linkend="GValue">GValue</link> *instance_and_params,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="GValue">GValue</link> *return_value);
<link linkend="void">void</link>                <link linkend="g-signal-emit-valist">g_signal_emit_valist</link>                (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="va-list">va_list</link> var_args);
#define             <link linkend="g-signal-connect">g_signal_connect</link>                    (instance, detailed_signal, c_handler, data)
#define             <link linkend="g-signal-connect-after">g_signal_connect_after</link>              (instance, detailed_signal, c_handler, data)
#define             <link linkend="g-signal-connect-swapped">g_signal_connect_swapped</link>            (instance, detailed_signal, c_handler, data)
<link linkend="gulong">gulong</link>              <link linkend="g-signal-connect-object">g_signal_connect_object</link>             (<link linkend="gpointer">gpointer</link> instance,
                                                         const <link linkend="gchar">gchar</link> *detailed_signal,
                                                         <link linkend="GCallback">GCallback</link> c_handler,
                                                         <link linkend="gpointer">gpointer</link> gobject,
                                                         <link linkend="GConnectFlags">GConnectFlags</link> connect_flags);
enum                <link linkend="GConnectFlags">GConnectFlags</link>;
<link linkend="gulong">gulong</link>              <link linkend="g-signal-connect-data">g_signal_connect_data</link>               (<link linkend="gpointer">gpointer</link> instance,
                                                         const <link linkend="gchar">gchar</link> *detailed_signal,
                                                         <link linkend="GCallback">GCallback</link> c_handler,
                                                         <link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> destroy_data,
                                                         <link linkend="GConnectFlags">GConnectFlags</link> connect_flags);
<link linkend="gulong">gulong</link>              <link linkend="g-signal-connect-closure">g_signal_connect_closure</link>            (<link linkend="gpointer">gpointer</link> instance,
                                                         const <link linkend="gchar">gchar</link> *detailed_signal,
                                                         <link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gboolean">gboolean</link> after);
<link linkend="gulong">gulong</link>              <link linkend="g-signal-connect-closure-by-id">g_signal_connect_closure_by_id</link>      (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gboolean">gboolean</link> after);
<link linkend="void">void</link>                <link linkend="g-signal-handler-block">g_signal_handler_block</link>              (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="gulong">gulong</link> handler_id);
<link linkend="void">void</link>                <link linkend="g-signal-handler-unblock">g_signal_handler_unblock</link>            (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="gulong">gulong</link> handler_id);
<link linkend="void">void</link>                <link linkend="g-signal-handler-disconnect">g_signal_handler_disconnect</link>         (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="gulong">gulong</link> handler_id);
<link linkend="gulong">gulong</link>              <link linkend="g-signal-handler-find">g_signal_handler_find</link>               (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="GSignalMatchType">GSignalMatchType</link> mask,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> func,
                                                         <link linkend="gpointer">gpointer</link> data);
<link linkend="guint">guint</link>               <link linkend="g-signal-handlers-block-matched">g_signal_handlers_block_matched</link>     (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="GSignalMatchType">GSignalMatchType</link> mask,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> func,
                                                         <link linkend="gpointer">gpointer</link> data);
<link linkend="guint">guint</link>               <link linkend="g-signal-handlers-unblock-matched">g_signal_handlers_unblock_matched</link>   (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="GSignalMatchType">GSignalMatchType</link> mask,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> func,
                                                         <link linkend="gpointer">gpointer</link> data);
<link linkend="guint">guint</link>               <link linkend="g-signal-handlers-disconnect-matched">g_signal_handlers_disconnect_matched</link>
                                                        (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="GSignalMatchType">GSignalMatchType</link> mask,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> func,
                                                         <link linkend="gpointer">gpointer</link> data);
<link linkend="gboolean">gboolean</link>            <link linkend="g-signal-handler-is-connected">g_signal_handler_is_connected</link>       (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="gulong">gulong</link> handler_id);
#define             <link linkend="g-signal-handlers-block-by-func">g_signal_handlers_block_by_func</link>     (instance, func, data)
#define             <link linkend="g-signal-handlers-unblock-by-func">g_signal_handlers_unblock_by_func</link>   (instance, func, data)
#define             <link linkend="g-signal-handlers-disconnect-by-func">g_signal_handlers_disconnect_by_func</link>(instance, func, data)
<link linkend="gboolean">gboolean</link>            <link linkend="g-signal-has-handler-pending">g_signal_has_handler_pending</link>        (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="gboolean">gboolean</link> may_be_blocked);
<link linkend="void">void</link>                <link linkend="g-signal-stop-emission">g_signal_stop_emission</link>              (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail);
<link linkend="void">void</link>                <link linkend="g-signal-stop-emission-by-name">g_signal_stop_emission_by_name</link>      (<link linkend="gpointer">gpointer</link> instance,
                                                         const <link linkend="gchar">gchar</link> *detailed_signal);
<link linkend="void">void</link>                <link linkend="g-signal-override-class-closure">g_signal_override_class_closure</link>     (<link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GType">GType</link> instance_type,
                                                         <link linkend="GClosure">GClosure</link> *class_closure);
<link linkend="void">void</link>                <link linkend="g-signal-chain-from-overridden">g_signal_chain_from_overridden</link>      (const <link linkend="GValue">GValue</link> *instance_and_params,
                                                         <link linkend="GValue">GValue</link> *return_value);
<link linkend="guint">guint</link>               <link linkend="g-signal-new-class-handler">g_signal_new_class_handler</link>          (const <link linkend="gchar">gchar</link> *signal_name,
                                                         <link linkend="GType">GType</link> itype,
                                                         <link linkend="GSignalFlags">GSignalFlags</link> signal_flags,
                                                         <link linkend="GCallback">GCallback</link> class_handler,
                                                         <link linkend="GSignalAccumulator">GSignalAccumulator</link> accumulator,
                                                         <link linkend="gpointer">gpointer</link> accu_data,
                                                         <link linkend="GSignalCMarshaller">GSignalCMarshaller</link> c_marshaller,
                                                         <link linkend="GType">GType</link> return_type,
                                                         <link linkend="guint">guint</link> n_params,
                                                         ...);
<link linkend="void">void</link>                <link linkend="g-signal-override-class-handler">g_signal_override_class_handler</link>     (const <link linkend="gchar">gchar</link> *signal_name,
                                                         <link linkend="GType">GType</link> instance_type,
                                                         <link linkend="GCallback">GCallback</link> class_handler);
<link linkend="void">void</link>                <link linkend="g-signal-chain-from-overridden-handler">g_signal_chain_from_overridden_handler</link>
                                                        (<link linkend="gpointer">gpointer</link> instance,
                                                         ...);
<link linkend="gulong">gulong</link>              <link linkend="g-signal-add-emission-hook">g_signal_add_emission_hook</link>          (<link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="GSignalEmissionHook">GSignalEmissionHook</link> hook_func,
                                                         <link linkend="gpointer">gpointer</link> hook_data,
                                                         <link linkend="GDestroyNotify">GDestroyNotify</link> data_destroy);
<link linkend="void">void</link>                <link linkend="g-signal-remove-emission-hook">g_signal_remove_emission_hook</link>       (<link linkend="guint">guint</link> signal_id,
                                                         <link linkend="gulong">gulong</link> hook_id);
<link linkend="gboolean">gboolean</link>            <link linkend="g-signal-parse-name">g_signal_parse_name</link>                 (const <link linkend="gchar">gchar</link> *detailed_signal,
                                                         <link linkend="GType">GType</link> itype,
                                                         <link linkend="guint">guint</link> *signal_id_p,
                                                         <link linkend="GQuark">GQuark</link> *detail_p,
                                                         <link linkend="gboolean">gboolean</link> force_detail_quark);
<link linkend="GSignalInvocationHint">GSignalInvocationHint</link>* <link linkend="g-signal-get-invocation-hint">g_signal_get_invocation_hint</link>     (<link linkend="gpointer">gpointer</link> instance);
<link linkend="GClosure">GClosure</link>*           <link linkend="g-signal-type-cclosure-new">g_signal_type_cclosure_new</link>          (<link linkend="GType">GType</link> itype,
                                                         <link linkend="guint">guint</link> struct_offset);
<link linkend="gboolean">gboolean</link>            <link linkend="g-signal-accumulator-true-handled">g_signal_accumulator_true_handled</link>   (<link linkend="GSignalInvocationHint">GSignalInvocationHint</link> *ihint,
                                                         <link linkend="GValue">GValue</link> *return_accu,
                                                         const <link linkend="GValue">GValue</link> *handler_return,
                                                         <link linkend="gpointer">gpointer</link> dummy);
</synopsis>
</refsynopsisdiv>









<refsect1 id="gobject-Signals.description" role="desc">
<title role="desc.title">Description</title>
<para>
The basic concept of the signal system is that of the
<emphasis>emission</emphasis> of a signal. Signals are introduced
per-type and are identified through strings.  Signals introduced
for a parent type are available in derived types as well, so
basically they are a per-type facility that is inherited.  A signal
emission mainly involves invocation of a certain set of callbacks
in precisely defined manner. There are two main categories of such
callbacks, per-object 
<footnote><para>Although signals can deal with any kind of instantiatable 
type, i'm referring to those types as "object types" in the following, 
simply because that is the context most users will encounter signals in.
</para></footnote>
ones and user provided ones.
The per-object callbacks are most often referred to as "object method
handler" or "default (signal) handler", while user provided callbacks are
usually just called "signal handler".
The object method handler is provided at signal creation time (this most
frequently happens at the end of an object class' creation), while user
provided handlers are frequently connected and disconnected to/from a certain
signal on certain object instances.
</para>
<para>
A signal emission consists of five stages, unless prematurely stopped:
<variablelist>
<varlistentry><term></term><listitem><para>
	1 - Invocation of the object method handler for <link linkend="G-SIGNAL-RUN-FIRST--CAPS"><literal>G_SIGNAL_RUN_FIRST</literal></link> signals
</para></listitem></varlistentry>
<varlistentry><term></term><listitem><para>
	2 - Invocation of normal user-provided signal handlers (<emphasis>after</emphasis> flag <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>)
</para></listitem></varlistentry>
<varlistentry><term></term><listitem><para>
	3 - Invocation of the object method handler for <link linkend="G-SIGNAL-RUN-LAST--CAPS"><literal>G_SIGNAL_RUN_LAST</literal></link> signals
</para></listitem></varlistentry>
<varlistentry><term></term><listitem><para>
	4 - Invocation of user provided signal handlers, connected with an <emphasis>after</emphasis> flag of <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>
</para></listitem></varlistentry>
<varlistentry><term></term><listitem><para>
	5 - Invocation of the object method handler for <link linkend="G-SIGNAL-RUN-CLEANUP--CAPS"><literal>G_SIGNAL_RUN_CLEANUP</literal></link> signals
</para></listitem></varlistentry>
</variablelist>
The user-provided signal handlers are called in the order they were
connected in.
All handlers may prematurely stop a signal emission, and any number of
handlers may be connected, disconnected, blocked or unblocked during
a signal emission.
There are certain criteria for skipping user handlers in stages 2 and 4
of a signal emission.
First, user handlers may be <emphasis>blocked</emphasis>, blocked handlers are omitted
during callback invocation, to return from the "blocked" state, a
handler has to get unblocked exactly the same amount of times
it has been blocked before.
Second, upon emission of a <link linkend="G-SIGNAL-DETAILED--CAPS"><literal>G_SIGNAL_DETAILED</literal></link> signal, an additional
"detail" argument passed in to <link linkend="g-signal-emit"><function>g_signal_emit()</function></link> has to match the detail
argument of the signal handler currently subject to invocation.
Specification of no detail argument for signal handlers (omission of the
detail part of the signal specification upon connection) serves as a
wildcard and matches any detail argument passed in to emission.</para>
<para>
</para>
</refsect1>

<refsect1 id="gobject-Signals.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GSignalInvocationHint" role="struct">
<title>GSignalInvocationHint</title>
<indexterm zone="GSignalInvocationHint"><primary sortas="SignalInvocationHint">GSignalInvocationHint</primary></indexterm><programlisting>typedef struct {
  guint		signal_id;
  GQuark	detail;
  GSignalFlags	run_type;
} GSignalInvocationHint;
</programlisting>
<para>
The <link linkend="GSignalInvocationHint"><type>GSignalInvocationHint</type></link> structure is used to pass on additional information
to callbacks during a signal emission.</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="guint">guint</link>&#160;<structfield>signal_id</structfield>;</term>
<listitem><simpara> The signal id of the signal invoking the callback
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GQuark">GQuark</link>&#160;<structfield>detail</structfield>;</term>
<listitem><simpara> The detail passed on for this emission
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GSignalFlags">GSignalFlags</link>&#160;<structfield>run_type</structfield>;</term>
<listitem><simpara> The stage the signal emission is currently in, this
 field will contain one of <link linkend="G-SIGNAL-RUN-FIRST--CAPS"><literal>G_SIGNAL_RUN_FIRST</literal></link>,
 <link linkend="G-SIGNAL-RUN-LAST--CAPS"><literal>G_SIGNAL_RUN_LAST</literal></link> or <link linkend="G-SIGNAL-RUN-CLEANUP--CAPS"><literal>G_SIGNAL_RUN_CLEANUP</literal></link>.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GSignalAccumulator" role="function">
<title>GSignalAccumulator ()</title>
<indexterm zone="GSignalAccumulator"><primary sortas="SignalAccumulator">GSignalAccumulator</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            (*GSignalAccumulator)               (<link linkend="GSignalInvocationHint">GSignalInvocationHint</link> *ihint,
                                                         <link linkend="GValue">GValue</link> *return_accu,
                                                         const <link linkend="GValue">GValue</link> *handler_return,
                                                         <link linkend="gpointer">gpointer</link> data);</programlisting>
<para>
The signal accumulator is a special callback function that can be used
to collect return values of the various callbacks that are called
during a signal emission. The signal accumulator is specified at signal
creation time, if it is left <link linkend="NULL--CAPS"><literal>NULL</literal></link>, no accumulation of callback return
values is performed. The return value of signal emissions is then the
value returned by the last callback.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>ihint</parameter>&#160;:</term>
<listitem><simpara> Signal invocation hint, see <link linkend="GSignalInvocationHint"><type>GSignalInvocationHint</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_accu</parameter>&#160;:</term>
<listitem><simpara> Accumulator to collect callback return values in, this
 is the return value of the current signal emission.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>handler_return</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="GValue"><type>GValue</type></link> holding the return value of the signal handler.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> Callback data that was specified when creating the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The accumulator function returns whether the signal emission
 should be aborted. Returning <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> means to abort the
 current emission and <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> is returned for continuation.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GSignalCMarshaller" role="typedef">
<title>GSignalCMarshaller</title>
<indexterm zone="GSignalCMarshaller"><primary sortas="SignalCMarshaller">GSignalCMarshaller</primary></indexterm><programlisting>typedef GClosureMarshal			 GSignalCMarshaller;
</programlisting>
<para>
This is the signature of marshaller functions, required to marshall
arrays of parameter values to signal emissions into C language callback
invocations. It is merely an alias to <link linkend="GClosureMarshal"><type>GClosureMarshal</type></link> since the <link linkend="GClosure"><type>GClosure</type></link>
mechanism takes over responsibility of actual function invocation for the
signal system.</para>
<para>
</para></refsect2>
<refsect2 id="GSignalEmissionHook" role="function">
<title>GSignalEmissionHook ()</title>
<indexterm zone="GSignalEmissionHook"><primary sortas="SignalEmissionHook">GSignalEmissionHook</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            (*GSignalEmissionHook)              (<link linkend="GSignalInvocationHint">GSignalInvocationHint</link> *ihint,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> data);</programlisting>
<para>
A simple function pointer to get invoked when the signal is emitted. This 
allows you to tie a hook to the signal type, so that it will trap all 
emissions of that signal, from any object.
</para>
<para>
You may not attach these to signals created with the <link linkend="G-SIGNAL-NO-HOOKS--CAPS"><type>G_SIGNAL_NO_HOOKS</type></link> flag.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>ihint</parameter>&#160;:</term>
<listitem><simpara> Signal invocation hint, see <link linkend="GSignalInvocationHint"><type>GSignalInvocationHint</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> the number of parameters to the function, including
 the instance on which the signal was emitted.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> the instance on which the signal was emitted, followed by the 
 parameters of the emission.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> user data associated with the hook.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> whether it wants to stay connected. If it returns <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>, the signal 
 hook is disconnected (and destroyed).
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GSignalFlags" role="enum">
<title>enum GSignalFlags</title>
<indexterm zone="GSignalFlags"><primary sortas="SignalFlags">GSignalFlags</primary></indexterm><programlisting>typedef enum
{
  G_SIGNAL_RUN_FIRST	= 1 &lt;&lt; 0,
  G_SIGNAL_RUN_LAST	= 1 &lt;&lt; 1,
  G_SIGNAL_RUN_CLEANUP	= 1 &lt;&lt; 2,
  G_SIGNAL_NO_RECURSE	= 1 &lt;&lt; 3,
  G_SIGNAL_DETAILED	= 1 &lt;&lt; 4,
  G_SIGNAL_ACTION	= 1 &lt;&lt; 5,
  G_SIGNAL_NO_HOOKS	= 1 &lt;&lt; 6
} GSignalFlags;
</programlisting>
<para>
The signal flags are used to specify a signal's behaviour, the overall
signal description outlines how especially the RUN flags control the
stages of a signal emission.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="G-SIGNAL-RUN-FIRST--CAPS" role="constant">
<term><literal>G_SIGNAL_RUN_FIRST</literal></term>
<listitem><simpara> Invoke the object method handler in the first emission stage.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-SIGNAL-RUN-LAST--CAPS" role="constant">
<term><literal>G_SIGNAL_RUN_LAST</literal></term>
<listitem><simpara> Invoke the object method handler in the third emission stage.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-SIGNAL-RUN-CLEANUP--CAPS" role="constant">
<term><literal>G_SIGNAL_RUN_CLEANUP</literal></term>
<listitem><simpara> Invoke the object method handler in the last emission stage.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-SIGNAL-NO-RECURSE--CAPS" role="constant">
<term><literal>G_SIGNAL_NO_RECURSE</literal></term>
<listitem><simpara> Signals being emitted for an object while currently being in
 emission for this very object will not be emitted recursively,
 but instead cause the first emission to be restarted.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-SIGNAL-DETAILED--CAPS" role="constant">
<term><literal>G_SIGNAL_DETAILED</literal></term>
<listitem><simpara> This signal supports "::detail" appendices to the signal name
 upon handler connections and emissions.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-SIGNAL-ACTION--CAPS" role="constant">
<term><literal>G_SIGNAL_ACTION</literal></term>
<listitem><simpara> Action signals are signals that may freely be emitted on alive
 objects from user code via <link linkend="g-signal-emit"><function>g_signal_emit()</function></link> and friends, without
 the need of being embedded into extra code that performs pre or
 post emission adjustments on the object. They can also be thought
 of as object methods which can be called generically by 
 third-party code.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-SIGNAL-NO-HOOKS--CAPS" role="constant">
<term><literal>G_SIGNAL_NO_HOOKS</literal></term>
<listitem><simpara> No emissions hooks are supported for this signal.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GSignalMatchType" role="enum">
<title>enum GSignalMatchType</title>
<indexterm zone="GSignalMatchType"><primary sortas="SignalMatchType">GSignalMatchType</primary></indexterm><programlisting>typedef enum
{
  G_SIGNAL_MATCH_ID	   = 1 &lt;&lt; 0,
  G_SIGNAL_MATCH_DETAIL	   = 1 &lt;&lt; 1,
  G_SIGNAL_MATCH_CLOSURE   = 1 &lt;&lt; 2,
  G_SIGNAL_MATCH_FUNC	   = 1 &lt;&lt; 3,
  G_SIGNAL_MATCH_DATA	   = 1 &lt;&lt; 4,
  G_SIGNAL_MATCH_UNBLOCKED = 1 &lt;&lt; 5
} GSignalMatchType;
</programlisting>
<para>
The match types specify what <link linkend="g-signal-handlers-block-matched"><function>g_signal_handlers_block_matched()</function></link>,
<link linkend="g-signal-handlers-unblock-matched"><function>g_signal_handlers_unblock_matched()</function></link> and <link linkend="g-signal-handlers-disconnect-matched"><function>g_signal_handlers_disconnect_matched()</function></link>
match signals by.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="G-SIGNAL-MATCH-ID--CAPS" role="constant">
<term><literal>G_SIGNAL_MATCH_ID</literal></term>
<listitem><simpara> The signal id must be equal.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-SIGNAL-MATCH-DETAIL--CAPS" role="constant">
<term><literal>G_SIGNAL_MATCH_DETAIL</literal></term>
<listitem><simpara> The signal detail be equal.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-SIGNAL-MATCH-CLOSURE--CAPS" role="constant">
<term><literal>G_SIGNAL_MATCH_CLOSURE</literal></term>
<listitem><simpara> The closure must be the same.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-SIGNAL-MATCH-FUNC--CAPS" role="constant">
<term><literal>G_SIGNAL_MATCH_FUNC</literal></term>
<listitem><simpara> The C closure callback must be the same.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-SIGNAL-MATCH-DATA--CAPS" role="constant">
<term><literal>G_SIGNAL_MATCH_DATA</literal></term>
<listitem><simpara> The closure data must be the same.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-SIGNAL-MATCH-UNBLOCKED--CAPS" role="constant">
<term><literal>G_SIGNAL_MATCH_UNBLOCKED</literal></term>
<listitem><simpara> Only unblocked signals may matched.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GSignalQuery" role="struct">
<title>GSignalQuery</title>
<indexterm zone="GSignalQuery"><primary sortas="SignalQuery">GSignalQuery</primary></indexterm><programlisting>typedef struct {
  guint		signal_id;
  const gchar  *signal_name;
  GType		itype;
  GSignalFlags	signal_flags;
  GType		return_type; /* mangled with G_SIGNAL_TYPE_STATIC_SCOPE flag */
  guint		n_params;
  const GType  *param_types; /* mangled with G_SIGNAL_TYPE_STATIC_SCOPE flag */
} GSignalQuery;
</programlisting>
<para>
A structure holding in-depth information for a specific signal. It is
filled in by the <link linkend="g-signal-query"><function>g_signal_query()</function></link> function.</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="guint">guint</link>&#160;<structfield>signal_id</structfield>;</term>
<listitem><simpara> The signal id of the signal being queried, or 0 if the
 signal to be queried was unknown.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term>const&#160;<link linkend="gchar">gchar</link>&#160;*<structfield>signal_name</structfield>;</term>
<listitem><simpara> The signal name.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GType">GType</link>&#160;<structfield>itype</structfield>;</term>
<listitem><simpara> The interface/instance type that this signal can be emitted for.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GSignalFlags">GSignalFlags</link>&#160;<structfield>signal_flags</structfield>;</term>
<listitem><simpara> The signal flags as passed in to <link linkend="g-signal-new"><function>g_signal_new()</function></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GType">GType</link>&#160;<structfield>return_type</structfield>;</term>
<listitem><simpara> The return type for user callbacks.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="guint">guint</link>&#160;<structfield>n_params</structfield>;</term>
<listitem><simpara> The number of parameters that user callbacks take.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term>const&#160;<link linkend="GType">GType</link>&#160;*<structfield>param_types</structfield>;</term>
<listitem><simpara> The individual parameter types for user callbacks, note that the
 effective callback signature is:
 <programlisting>
 @return_type callback (<link linkend="gpointer">gpointer</link>     data1,
 [<link linkend="param-types">param_types</link> param_names,]
 <link linkend="gpointer">gpointer</link>     data2);
 </programlisting>
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="G-SIGNAL-TYPE-STATIC-SCOPE--CAPS" role="macro">
<title>G_SIGNAL_TYPE_STATIC_SCOPE</title>
<indexterm zone="G-SIGNAL-TYPE-STATIC-SCOPE--CAPS"><primary sortas="SIGNAL_TYPE_STATIC_SCOPE">G_SIGNAL_TYPE_STATIC_SCOPE</primary></indexterm><programlisting>#define	G_SIGNAL_TYPE_STATIC_SCOPE (G_TYPE_FLAG_RESERVED_ID_BIT)
</programlisting>
<para>
This macro flags signal argument types for which the signal system may 
assume that instances thereof remain persistent across all signal emissions
they are used in. This is only useful for non ref-counted, value-copy types.
</para>
<para>
To flag a signal argument in this way, add 
<literal>| G_SIGNAL_TYPE_STATIC_SCOPE</literal> to the corresponding argument
of <link linkend="g-signal-new"><function>g_signal_new()</function></link>.
<informalexample><programlisting>
g_signal_new ("size_request",
  G_TYPE_FROM_CLASS (gobject_class),
	 G_SIGNAL_RUN_FIRST,
	 G_STRUCT_OFFSET (GtkWidgetClass, size_request),
	 NULL, NULL,
	 _gtk_marshal_VOID__BOXED,
	 G_TYPE_NONE, 1,
	 GTK_TYPE_REQUISITION | G_SIGNAL_TYPE_STATIC_SCOPE);
</programlisting></informalexample></para>
<para>
</para></refsect2>
<refsect2 id="G-SIGNAL-MATCH-MASK--CAPS" role="macro">
<title>G_SIGNAL_MATCH_MASK</title>
<indexterm zone="G-SIGNAL-MATCH-MASK--CAPS"><primary sortas="SIGNAL_MATCH_MASK">G_SIGNAL_MATCH_MASK</primary></indexterm><programlisting>#define G_SIGNAL_MATCH_MASK  0x3f
</programlisting>
<para>
A mask for all <link linkend="GSignalMatchType"><type>GSignalMatchType</type></link> bits.</para>
<para>
</para></refsect2>
<refsect2 id="G-SIGNAL-FLAGS-MASK--CAPS" role="macro">
<title>G_SIGNAL_FLAGS_MASK</title>
<indexterm zone="G-SIGNAL-FLAGS-MASK--CAPS"><primary sortas="SIGNAL_FLAGS_MASK">G_SIGNAL_FLAGS_MASK</primary></indexterm><programlisting>#define G_SIGNAL_FLAGS_MASK  0x7f
</programlisting>
<para>
A mask for all <link linkend="GSignalFlags"><type>GSignalFlags</type></link> bits.</para>
<para>
</para></refsect2>
<refsect2 id="g-signal-new" role="function">
<title>g_signal_new ()</title>
<indexterm zone="g-signal-new"><primary sortas="signal_new">g_signal_new</primary></indexterm><programlisting><link linkend="guint">guint</link>               g_signal_new                        (const <link linkend="gchar">gchar</link> *signal_name,
                                                         <link linkend="GType">GType</link> itype,
                                                         <link linkend="GSignalFlags">GSignalFlags</link> signal_flags,
                                                         <link linkend="guint">guint</link> class_offset,
                                                         <link linkend="GSignalAccumulator">GSignalAccumulator</link> accumulator,
                                                         <link linkend="gpointer">gpointer</link> accu_data,
                                                         <link linkend="GSignalCMarshaller">GSignalCMarshaller</link> c_marshaller,
                                                         <link linkend="GType">GType</link> return_type,
                                                         <link linkend="guint">guint</link> n_params,
                                                         ...);</programlisting>
<para>
Creates a new signal. (This is usually done in the class initializer.)
</para>
<para>
A signal name consists of segments consisting of ASCII letters and
digits, separated by either the '-' or '_' character. The first
character of a signal name must be a letter. Names which violate these
rules lead to undefined behaviour of the GSignal system.
</para>
<para>
When registering a signal and looking up a signal, either separator can
be used, but they cannot be mixed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>signal_name</parameter>&#160;:</term>
<listitem><simpara> the name for the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>itype</parameter>&#160;:</term>
<listitem><simpara> the type this signal pertains to. It will also pertain to
 types which are derived from this type.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_flags</parameter>&#160;:</term>
<listitem><simpara> a combination of <link linkend="GSignalFlags"><type>GSignalFlags</type></link> specifying detail of when
 the default handler is to be invoked. You should at least specify
 <link linkend="G-SIGNAL-RUN-FIRST--CAPS"><literal>G_SIGNAL_RUN_FIRST</literal></link> or <link linkend="G-SIGNAL-RUN-LAST--CAPS"><literal>G_SIGNAL_RUN_LAST</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>class_offset</parameter>&#160;:</term>
<listitem><simpara> The offset of the function pointer in the class structure
 for this type. Used to invoke a class method generically. Pass 0 to
 not associate a class method with this signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>accumulator</parameter>&#160;:</term>
<listitem><simpara> the accumulator for this signal; may be <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>accu_data</parameter>&#160;:</term>
<listitem><simpara> user data for the <parameter>accumulator</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>c_marshaller</parameter>&#160;:</term>
<listitem><simpara> the function to translate arrays of parameter values to
 signal emissions into C language callback invocations.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_type</parameter>&#160;:</term>
<listitem><simpara> the type of return value, or <link linkend="G-TYPE-NONE--CAPS"><type>G_TYPE_NONE</type></link> for a signal
 without a return value.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_params</parameter>&#160;:</term>
<listitem><simpara> the number of parameter types to follow.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara> a list of types, one for each parameter.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the signal id
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-newv" role="function">
<title>g_signal_newv ()</title>
<indexterm zone="g-signal-newv"><primary sortas="signal_newv">g_signal_newv</primary></indexterm><programlisting><link linkend="guint">guint</link>               g_signal_newv                       (const <link linkend="gchar">gchar</link> *signal_name,
                                                         <link linkend="GType">GType</link> itype,
                                                         <link linkend="GSignalFlags">GSignalFlags</link> signal_flags,
                                                         <link linkend="GClosure">GClosure</link> *class_closure,
                                                         <link linkend="GSignalAccumulator">GSignalAccumulator</link> accumulator,
                                                         <link linkend="gpointer">gpointer</link> accu_data,
                                                         <link linkend="GSignalCMarshaller">GSignalCMarshaller</link> c_marshaller,
                                                         <link linkend="GType">GType</link> return_type,
                                                         <link linkend="guint">guint</link> n_params,
                                                         <link linkend="GType">GType</link> *param_types);</programlisting>
<para>
Creates a new signal. (This is usually done in the class initializer.)
</para>
<para>
See <link linkend="g-signal-new"><function>g_signal_new()</function></link> for details on allowed signal names.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>signal_name</parameter>&#160;:</term>
<listitem><simpara> the name for the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>itype</parameter>&#160;:</term>
<listitem><simpara> the type this signal pertains to. It will also pertain to
    types which are derived from this type
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_flags</parameter>&#160;:</term>
<listitem><simpara> a combination of <link linkend="GSignalFlags"><type>GSignalFlags</type></link> specifying detail of when
    the default handler is to be invoked. You should at least specify
    <link linkend="G-SIGNAL-RUN-FIRST--CAPS"><literal>G_SIGNAL_RUN_FIRST</literal></link> or <link linkend="G-SIGNAL-RUN-LAST--CAPS"><literal>G_SIGNAL_RUN_LAST</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>class_closure</parameter>&#160;:</term>
<listitem><simpara> The closure to invoke on signal emission; may be <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>accumulator</parameter>&#160;:</term>
<listitem><simpara> the accumulator for this signal; may be <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>accu_data</parameter>&#160;:</term>
<listitem><simpara> user data for the <parameter>accumulator</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>c_marshaller</parameter>&#160;:</term>
<listitem><simpara> the function to translate arrays of parameter values to
    signal emissions into C language callback invocations
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_type</parameter>&#160;:</term>
<listitem><simpara> the type of return value, or <link linkend="G-TYPE-NONE--CAPS"><type>G_TYPE_NONE</type></link> for a signal
    without a return value
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_params</parameter>&#160;:</term>
<listitem><simpara> the length of <parameter>param_types</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_types</parameter>&#160;:</term>
<listitem><simpara> an array of types, one for each parameter
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the signal id
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-new-valist" role="function">
<title>g_signal_new_valist ()</title>
<indexterm zone="g-signal-new-valist"><primary sortas="signal_new_valist">g_signal_new_valist</primary></indexterm><programlisting><link linkend="guint">guint</link>               g_signal_new_valist                 (const <link linkend="gchar">gchar</link> *signal_name,
                                                         <link linkend="GType">GType</link> itype,
                                                         <link linkend="GSignalFlags">GSignalFlags</link> signal_flags,
                                                         <link linkend="GClosure">GClosure</link> *class_closure,
                                                         <link linkend="GSignalAccumulator">GSignalAccumulator</link> accumulator,
                                                         <link linkend="gpointer">gpointer</link> accu_data,
                                                         <link linkend="GSignalCMarshaller">GSignalCMarshaller</link> c_marshaller,
                                                         <link linkend="GType">GType</link> return_type,
                                                         <link linkend="guint">guint</link> n_params,
                                                         <link linkend="va-list">va_list</link> args);</programlisting>
<para>
Creates a new signal. (This is usually done in the class initializer.)
</para>
<para>
See <link linkend="g-signal-new"><function>g_signal_new()</function></link> for details on allowed signal names.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>signal_name</parameter>&#160;:</term>
<listitem><simpara> the name for the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>itype</parameter>&#160;:</term>
<listitem><simpara> the type this signal pertains to. It will also pertain to
 types which are derived from this type.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_flags</parameter>&#160;:</term>
<listitem><simpara> a combination of <link linkend="GSignalFlags"><type>GSignalFlags</type></link> specifying detail of when
 the default handler is to be invoked. You should at least specify
 <link linkend="G-SIGNAL-RUN-FIRST--CAPS"><literal>G_SIGNAL_RUN_FIRST</literal></link> or <link linkend="G-SIGNAL-RUN-LAST--CAPS"><literal>G_SIGNAL_RUN_LAST</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>class_closure</parameter>&#160;:</term>
<listitem><simpara> The closure to invoke on signal emission; may be <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>accumulator</parameter>&#160;:</term>
<listitem><simpara> the accumulator for this signal; may be <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>accu_data</parameter>&#160;:</term>
<listitem><simpara> user data for the <parameter>accumulator</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>c_marshaller</parameter>&#160;:</term>
<listitem><simpara> the function to translate arrays of parameter values to
 signal emissions into C language callback invocations.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_type</parameter>&#160;:</term>
<listitem><simpara> the type of return value, or <link linkend="G-TYPE-NONE--CAPS"><type>G_TYPE_NONE</type></link> for a signal
 without a return value.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_params</parameter>&#160;:</term>
<listitem><simpara> the number of parameter types in <parameter>args</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>args</parameter>&#160;:</term>
<listitem><simpara> va_list of <link linkend="GType"><type>GType</type></link>, one for each parameter.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the signal id
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-query" role="function">
<title>g_signal_query ()</title>
<indexterm zone="g-signal-query"><primary sortas="signal_query">g_signal_query</primary></indexterm><programlisting><link linkend="void">void</link>                g_signal_query                      (<link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GSignalQuery">GSignalQuery</link> *query);</programlisting>
<para>
Queries the signal system for in-depth information about a
specific signal. This function will fill in a user-provided
structure to hold signal-specific information. If an invalid
signal id is passed in, the <parameter>signal_id</parameter> member of the <link linkend="GSignalQuery"><type>GSignalQuery</type></link>
is 0. All members filled into the <link linkend="GSignalQuery"><type>GSignalQuery</type></link> structure should
be considered constant and have to be left untouched.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>signal_id</parameter>&#160;:</term>
<listitem><simpara> The signal id of the signal to query information for.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>query</parameter>&#160;:</term>
<listitem><simpara> A user provided structure that is filled in with constant
 values upon success.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-lookup" role="function">
<title>g_signal_lookup ()</title>
<indexterm zone="g-signal-lookup"><primary sortas="signal_lookup">g_signal_lookup</primary></indexterm><programlisting><link linkend="guint">guint</link>               g_signal_lookup                     (const <link linkend="gchar">gchar</link> *name,
                                                         <link linkend="GType">GType</link> itype);</programlisting>
<para>
Given the name of the signal and the type of object it connects to, gets
the signal's identifying integer. Emitting the signal by number is
somewhat faster than using the name each time.
</para>
<para>
Also tries the ancestors of the given type.
</para>
<para>
See <link linkend="g-signal-new"><function>g_signal_new()</function></link> for details on allowed signal names.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> the signal's name.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>itype</parameter>&#160;:</term>
<listitem><simpara> the type that the signal operates on.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the signal's identifying number, or 0 if no signal was found.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-name" role="function">
<title>g_signal_name ()</title>
<indexterm zone="g-signal-name"><primary sortas="signal_name">g_signal_name</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link>*        g_signal_name                       (<link linkend="guint">guint</link> signal_id);</programlisting>
<para>
Given the signal's identifier, finds its name.
</para>
<para>
Two different signals may have the same name, if they have differing types.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>signal_id</parameter>&#160;:</term>
<listitem><simpara> the signal's identifying number.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the signal name, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the signal number was invalid.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-list-ids" role="function">
<title>g_signal_list_ids ()</title>
<indexterm zone="g-signal-list-ids"><primary sortas="signal_list_ids">g_signal_list_ids</primary></indexterm><programlisting><link linkend="guint">guint</link>*              g_signal_list_ids                   (<link linkend="GType">GType</link> itype,
                                                         <link linkend="guint">guint</link> *n_ids);</programlisting>
<para>
Lists the signals by id that a certain instance or interface type
created. Further information about the signals can be acquired through
<link linkend="g-signal-query"><function>g_signal_query()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>itype</parameter>&#160;:</term>
<listitem><simpara> Instance or interface type.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_ids</parameter>&#160;:</term>
<listitem><simpara> Location to store the number of signal ids for <parameter>itype</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> Newly allocated array of signal IDs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-emit" role="function">
<title>g_signal_emit ()</title>
<indexterm zone="g-signal-emit"><primary sortas="signal_emit">g_signal_emit</primary></indexterm><programlisting><link linkend="void">void</link>                g_signal_emit                       (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         ...);</programlisting>
<para>
Emits a signal.
</para>
<para>
Note that <link linkend="g-signal-emit"><function>g_signal_emit()</function></link> resets the return value to the default
if no handlers are connected, in contrast to <link linkend="g-signal-emitv"><function>g_signal_emitv()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> the instance the signal is being emitted on.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_id</parameter>&#160;:</term>
<listitem><simpara> the signal id
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detail</parameter>&#160;:</term>
<listitem><simpara> the detail
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara> parameters to be passed to the signal, followed by a
 location for the return value. If the return type of the signal
 is <link linkend="G-TYPE-NONE--CAPS"><type>G_TYPE_NONE</type></link>, the return value location can be omitted.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-emit-by-name" role="function">
<title>g_signal_emit_by_name ()</title>
<indexterm zone="g-signal-emit-by-name"><primary sortas="signal_emit_by_name">g_signal_emit_by_name</primary></indexterm><programlisting><link linkend="void">void</link>                g_signal_emit_by_name               (<link linkend="gpointer">gpointer</link> instance,
                                                         const <link linkend="gchar">gchar</link> *detailed_signal,
                                                         ...);</programlisting>
<para>
Emits a signal.
</para>
<para>
Note that <link linkend="g-signal-emit-by-name"><function>g_signal_emit_by_name()</function></link> resets the return value to the default
if no handlers are connected, in contrast to <link linkend="g-signal-emitv"><function>g_signal_emitv()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> the instance the signal is being emitted on.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detailed_signal</parameter>&#160;:</term>
<listitem><simpara> a string of the form "signal-name::detail".
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara> parameters to be passed to the signal, followed by a
 location for the return value. If the return type of the signal
 is <link linkend="G-TYPE-NONE--CAPS"><type>G_TYPE_NONE</type></link>, the return value location can be omitted.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-emitv" role="function">
<title>g_signal_emitv ()</title>
<indexterm zone="g-signal-emitv"><primary sortas="signal_emitv">g_signal_emitv</primary></indexterm><programlisting><link linkend="void">void</link>                g_signal_emitv                      (const <link linkend="GValue">GValue</link> *instance_and_params,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="GValue">GValue</link> *return_value);</programlisting>
<para>
Emits a signal.
</para>
<para>
Note that <link linkend="g-signal-emitv"><function>g_signal_emitv()</function></link> doesn't change <parameter>return_value</parameter> if no handlers are
connected, in contrast to <link linkend="g-signal-emit"><function>g_signal_emit()</function></link> and <link linkend="g-signal-emit-valist"><function>g_signal_emit_valist()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance_and_params</parameter>&#160;:</term>
<listitem><simpara> argument list for the signal emission. The first
 element in the array is a <link linkend="GValue"><type>GValue</type></link> for the instance the signal is
 being emitted on. The rest are any arguments to be passed to the
 signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_id</parameter>&#160;:</term>
<listitem><simpara> the signal id
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detail</parameter>&#160;:</term>
<listitem><simpara> the detail
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> Location to store the return value of the signal emission.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-emit-valist" role="function">
<title>g_signal_emit_valist ()</title>
<indexterm zone="g-signal-emit-valist"><primary sortas="signal_emit_valist">g_signal_emit_valist</primary></indexterm><programlisting><link linkend="void">void</link>                g_signal_emit_valist                (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="va-list">va_list</link> var_args);</programlisting>
<para>
Emits a signal.
</para>
<para>
Note that <link linkend="g-signal-emit-valist"><function>g_signal_emit_valist()</function></link> resets the return value to the default
if no handlers are connected, in contrast to <link linkend="g-signal-emitv"><function>g_signal_emitv()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> the instance the signal is being emitted on.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_id</parameter>&#160;:</term>
<listitem><simpara> the signal id
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detail</parameter>&#160;:</term>
<listitem><simpara> the detail
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>var_args</parameter>&#160;:</term>
<listitem><simpara> a list of parameters to be passed to the signal, followed by a
 location for the return value. If the return type of the signal
 is <link linkend="G-TYPE-NONE--CAPS"><type>G_TYPE_NONE</type></link>, the return value location can be omitted.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-connect" role="macro">
<title>g_signal_connect()</title>
<indexterm zone="g-signal-connect"><primary sortas="signal_connect">g_signal_connect</primary></indexterm><programlisting>#define             g_signal_connect(instance, detailed_signal, c_handler, data)</programlisting>
<para>
Connects a <link linkend="GCallback"><type>GCallback</type></link> function to a signal for a particular object.
</para>
<para>
The handler will be called before the default handler of the signal.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> the instance to connect to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detailed_signal</parameter>&#160;:</term>
<listitem><simpara> a string of the form "signal-name::detail".
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>c_handler</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GCallback"><type>GCallback</type></link> to connect.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> data to pass to <parameter>c_handler</parameter> calls.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-connect-after" role="macro">
<title>g_signal_connect_after()</title>
<indexterm zone="g-signal-connect-after"><primary sortas="signal_connect_after">g_signal_connect_after</primary></indexterm><programlisting>#define             g_signal_connect_after(instance, detailed_signal, c_handler, data)</programlisting>
<para>
Connects a <link linkend="GCallback"><type>GCallback</type></link> function to a signal for a particular object.
</para>
<para>
The handler will be called after the default handler of the signal.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> the instance to connect to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detailed_signal</parameter>&#160;:</term>
<listitem><simpara> a string of the form "signal-name::detail".
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>c_handler</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GCallback"><type>GCallback</type></link> to connect.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> data to pass to <parameter>c_handler</parameter> calls.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-connect-swapped" role="macro">
<title>g_signal_connect_swapped()</title>
<indexterm zone="g-signal-connect-swapped"><primary sortas="signal_connect_swapped">g_signal_connect_swapped</primary></indexterm><programlisting>#define             g_signal_connect_swapped(instance, detailed_signal, c_handler, data)</programlisting>
<para>
Connects a <link linkend="GCallback"><type>GCallback</type></link> function to a signal for a particular object.
</para>
<para>
The instance on which the signal is emitted and <parameter>data</parameter> will be swapped when 
calling the handler.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> the instance to connect to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detailed_signal</parameter>&#160;:</term>
<listitem><simpara> a string of the form "signal-name::detail".
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>c_handler</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GCallback"><type>GCallback</type></link> to connect.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> data to pass to <parameter>c_handler</parameter> calls.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-connect-object" role="function">
<title>g_signal_connect_object ()</title>
<indexterm zone="g-signal-connect-object"><primary sortas="signal_connect_object">g_signal_connect_object</primary></indexterm><programlisting><link linkend="gulong">gulong</link>              g_signal_connect_object             (<link linkend="gpointer">gpointer</link> instance,
                                                         const <link linkend="gchar">gchar</link> *detailed_signal,
                                                         <link linkend="GCallback">GCallback</link> c_handler,
                                                         <link linkend="gpointer">gpointer</link> gobject,
                                                         <link linkend="GConnectFlags">GConnectFlags</link> connect_flags);</programlisting>
<para>
This is similar to <link linkend="g-signal-connect-data"><function>g_signal_connect_data()</function></link>, but uses a closure which
ensures that the <parameter>gobject</parameter> stays alive during the call to <parameter>c_handler</parameter>
by temporarily adding a reference count to <parameter>gobject</parameter>.
</para>
<para>
Note that there is a bug in GObject that makes this function
much less useful than it might seem otherwise. Once <parameter>gobject</parameter> is
disposed, the callback will no longer be called, but, the signal
handler is <emphasis>not</emphasis> currently disconnected. If the
<parameter>instance</parameter> is itself being freed at the same time than this doesn't
matter, since the signal will automatically be removed, but
if <parameter>instance</parameter> persists, then the signal handler will leak. You
should not remove the signal yourself because in a future versions of
GObject, the handler <emphasis>will</emphasis> automatically
be disconnected.
</para>
<para>
It's possible to work around this problem in a way that will
continue to work with future versions of GObject by checking
that the signal handler is still connected before disconnected it:
<informalexample><programlisting>
 if (g_signal_handler_is_connected (instance, id))
   g_signal_handler_disconnect (instance, id);
</programlisting></informalexample></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> the instance to connect to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detailed_signal</parameter>&#160;:</term>
<listitem><simpara> a string of the form "signal-name::detail".
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>c_handler</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GCallback"><type>GCallback</type></link> to connect.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>gobject</parameter>&#160;:</term>
<listitem><simpara> the object to pass as data to <parameter>c_handler</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>connect_flags</parameter>&#160;:</term>
<listitem><simpara> a combination of <link linkend="GConnnectFlags"><type>GConnnectFlags</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the handler id.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GConnectFlags" role="enum">
<title>enum GConnectFlags</title>
<indexterm zone="GConnectFlags"><primary sortas="ConnectFlags">GConnectFlags</primary></indexterm><programlisting>typedef enum
{
  G_CONNECT_AFTER	= 1 &lt;&lt; 0,
  G_CONNECT_SWAPPED	= 1 &lt;&lt; 1
} GConnectFlags;
</programlisting>
<para>
The connection flags are used to specify the behaviour of a signal's 
connection.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="G-CONNECT-AFTER--CAPS" role="constant">
<term><literal>G_CONNECT_AFTER</literal></term>
<listitem><simpara> whether the handler should be called before or after the 
 default handler of the signal.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-CONNECT-SWAPPED--CAPS" role="constant">
<term><literal>G_CONNECT_SWAPPED</literal></term>
<listitem><simpara> whether the instance and data should be swapped when
 calling the handler.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-connect-data" role="function">
<title>g_signal_connect_data ()</title>
<indexterm zone="g-signal-connect-data"><primary sortas="signal_connect_data">g_signal_connect_data</primary></indexterm><programlisting><link linkend="gulong">gulong</link>              g_signal_connect_data               (<link linkend="gpointer">gpointer</link> instance,
                                                         const <link linkend="gchar">gchar</link> *detailed_signal,
                                                         <link linkend="GCallback">GCallback</link> c_handler,
                                                         <link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> destroy_data,
                                                         <link linkend="GConnectFlags">GConnectFlags</link> connect_flags);</programlisting>
<para>
Connects a <link linkend="GCallback"><type>GCallback</type></link> function to a signal for a particular object. Similar
to <link linkend="g-signal-connect"><function>g_signal_connect()</function></link>, but allows to provide a <link linkend="GClosureNotify"><type>GClosureNotify</type></link> for the data
which will be called when the signal handler is disconnected and no longer
used. Specify <parameter>connect_flags</parameter> if you need <literal>...<link linkend="after"><function>_after()</function></link></literal> or
<literal>...<link linkend="swapped"><function>_swapped()</function></link></literal> variants of this function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> the instance to connect to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detailed_signal</parameter>&#160;:</term>
<listitem><simpara> a string of the form "signal-name::detail".
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>c_handler</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GCallback"><type>GCallback</type></link> to connect.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> data to pass to <parameter>c_handler</parameter> calls.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>destroy_data</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GClosureNotify"><type>GClosureNotify</type></link> for <parameter>data</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>connect_flags</parameter>&#160;:</term>
<listitem><simpara> a combination of <link linkend="GConnectFlags"><type>GConnectFlags</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the handler id
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-connect-closure" role="function">
<title>g_signal_connect_closure ()</title>
<indexterm zone="g-signal-connect-closure"><primary sortas="signal_connect_closure">g_signal_connect_closure</primary></indexterm><programlisting><link linkend="gulong">gulong</link>              g_signal_connect_closure            (<link linkend="gpointer">gpointer</link> instance,
                                                         const <link linkend="gchar">gchar</link> *detailed_signal,
                                                         <link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gboolean">gboolean</link> after);</programlisting>
<para>
Connects a closure to a signal for a particular object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> the instance to connect to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detailed_signal</parameter>&#160;:</term>
<listitem><simpara> a string of the form "signal-name::detail".
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the closure to connect.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>after</parameter>&#160;:</term>
<listitem><simpara> whether the handler should be called before or after the
 default handler of the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the handler id
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-connect-closure-by-id" role="function">
<title>g_signal_connect_closure_by_id ()</title>
<indexterm zone="g-signal-connect-closure-by-id"><primary sortas="signal_connect_closure_by_id">g_signal_connect_closure_by_id</primary></indexterm><programlisting><link linkend="gulong">gulong</link>              g_signal_connect_closure_by_id      (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gboolean">gboolean</link> after);</programlisting>
<para>
Connects a closure to a signal for a particular object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> the instance to connect to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_id</parameter>&#160;:</term>
<listitem><simpara> the id of the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detail</parameter>&#160;:</term>
<listitem><simpara> the detail.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the closure to connect.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>after</parameter>&#160;:</term>
<listitem><simpara> whether the handler should be called before or after the
 default handler of the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the handler id
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-handler-block" role="function">
<title>g_signal_handler_block ()</title>
<indexterm zone="g-signal-handler-block"><primary sortas="signal_handler_block">g_signal_handler_block</primary></indexterm><programlisting><link linkend="void">void</link>                g_signal_handler_block              (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="gulong">gulong</link> handler_id);</programlisting>
<para>
Blocks a handler of an instance so it will not be called during any
signal emissions unless it is unblocked again. Thus "blocking" a
signal handler means to temporarily deactive it, a signal handler
has to be unblocked exactly the same amount of times it has been
blocked before to become active again.
</para>
<para>
The <parameter>handler_id</parameter> has to be a valid signal handler id, connected to a
signal of <parameter>instance</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> The instance to block the signal handler of.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>handler_id</parameter>&#160;:</term>
<listitem><simpara> Handler id of the handler to be blocked.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-handler-unblock" role="function">
<title>g_signal_handler_unblock ()</title>
<indexterm zone="g-signal-handler-unblock"><primary sortas="signal_handler_unblock">g_signal_handler_unblock</primary></indexterm><programlisting><link linkend="void">void</link>                g_signal_handler_unblock            (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="gulong">gulong</link> handler_id);</programlisting>
<para>
Undoes the effect of a previous <link linkend="g-signal-handler-block"><function>g_signal_handler_block()</function></link> call.  A
blocked handler is skipped during signal emissions and will not be
invoked, unblocking it (for exactly the amount of times it has been
blocked before) reverts its "blocked" state, so the handler will be
recognized by the signal system and is called upon future or
currently ongoing signal emissions (since the order in which
handlers are called during signal emissions is deterministic,
whether the unblocked handler in question is called as part of a
currently ongoing emission depends on how far that emission has
proceeded yet).
</para>
<para>
The <parameter>handler_id</parameter> has to be a valid id of a signal handler that is
connected to a signal of <parameter>instance</parameter> and is currently blocked.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> The instance to unblock the signal handler of.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>handler_id</parameter>&#160;:</term>
<listitem><simpara> Handler id of the handler to be unblocked.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-handler-disconnect" role="function">
<title>g_signal_handler_disconnect ()</title>
<indexterm zone="g-signal-handler-disconnect"><primary sortas="signal_handler_disconnect">g_signal_handler_disconnect</primary></indexterm><programlisting><link linkend="void">void</link>                g_signal_handler_disconnect         (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="gulong">gulong</link> handler_id);</programlisting>
<para>
Disconnects a handler from an instance so it will not be called during
any future or currently ongoing emissions of the signal it has been
connected to. The <parameter>handler_id</parameter> becomes invalid and may be reused.
</para>
<para>
The <parameter>handler_id</parameter> has to be a valid signal handler id, connected to a
signal of <parameter>instance</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> The instance to remove the signal handler from.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>handler_id</parameter>&#160;:</term>
<listitem><simpara> Handler id of the handler to be disconnected.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-handler-find" role="function">
<title>g_signal_handler_find ()</title>
<indexterm zone="g-signal-handler-find"><primary sortas="signal_handler_find">g_signal_handler_find</primary></indexterm><programlisting><link linkend="gulong">gulong</link>              g_signal_handler_find               (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="GSignalMatchType">GSignalMatchType</link> mask,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> func,
                                                         <link linkend="gpointer">gpointer</link> data);</programlisting>
<para>
Finds the first signal handler that matches certain selection criteria.
The criteria mask is passed as an OR-ed combination of <link linkend="GSignalMatchType"><type>GSignalMatchType</type></link>
flags, and the criteria values are passed as arguments.
The match <parameter>mask</parameter> has to be non-0 for successful matches.
If no handler was found, 0 is returned.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> The instance owning the signal handler to be found.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mask</parameter>&#160;:</term>
<listitem><simpara> Mask indicating which of <parameter>signal_id</parameter>, <parameter>detail</parameter>, <parameter>closure</parameter>, <parameter>func</parameter>
 and/or <parameter>data</parameter> the handler has to match.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_id</parameter>&#160;:</term>
<listitem><simpara> Signal the handler has to be connected to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detail</parameter>&#160;:</term>
<listitem><simpara> Signal detail the handler has to be connected to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> The closure the handler will invoke.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>func</parameter>&#160;:</term>
<listitem><simpara> The C closure callback of the handler (useless for non-C closures).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> The closure data of the handler's closure.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> A valid non-0 signal handler id for a successful match.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-handlers-block-matched" role="function">
<title>g_signal_handlers_block_matched ()</title>
<indexterm zone="g-signal-handlers-block-matched"><primary sortas="signal_handlers_block_matched">g_signal_handlers_block_matched</primary></indexterm><programlisting><link linkend="guint">guint</link>               g_signal_handlers_block_matched     (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="GSignalMatchType">GSignalMatchType</link> mask,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> func,
                                                         <link linkend="gpointer">gpointer</link> data);</programlisting>
<para>
Blocks all handlers on an instance that match a certain selection criteria.
The criteria mask is passed as an OR-ed combination of <link linkend="GSignalMatchType"><type>GSignalMatchType</type></link>
flags, and the criteria values are passed as arguments.
Passing at least one of the <link linkend="G-SIGNAL-MATCH-CLOSURE--CAPS"><literal>G_SIGNAL_MATCH_CLOSURE</literal></link>, <link linkend="G-SIGNAL-MATCH-FUNC--CAPS"><literal>G_SIGNAL_MATCH_FUNC</literal></link>
or <link linkend="G-SIGNAL-MATCH-DATA--CAPS"><literal>G_SIGNAL_MATCH_DATA</literal></link> match flags is required for successful matches.
If no handlers were found, 0 is returned, the number of blocked handlers
otherwise.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> The instance to block handlers from.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mask</parameter>&#160;:</term>
<listitem><simpara> Mask indicating which of <parameter>signal_id</parameter>, <parameter>detail</parameter>, <parameter>closure</parameter>, <parameter>func</parameter>
 and/or <parameter>data</parameter> the handlers have to match.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_id</parameter>&#160;:</term>
<listitem><simpara> Signal the handlers have to be connected to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detail</parameter>&#160;:</term>
<listitem><simpara> Signal detail the handlers have to be connected to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> The closure the handlers will invoke.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>func</parameter>&#160;:</term>
<listitem><simpara> The C closure callback of the handlers (useless for non-C closures).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> The closure data of the handlers' closures.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The number of handlers that matched.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-handlers-unblock-matched" role="function">
<title>g_signal_handlers_unblock_matched ()</title>
<indexterm zone="g-signal-handlers-unblock-matched"><primary sortas="signal_handlers_unblock_matched">g_signal_handlers_unblock_matched</primary></indexterm><programlisting><link linkend="guint">guint</link>               g_signal_handlers_unblock_matched   (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="GSignalMatchType">GSignalMatchType</link> mask,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> func,
                                                         <link linkend="gpointer">gpointer</link> data);</programlisting>
<para>
Unblocks all handlers on an instance that match a certain selection
criteria. The criteria mask is passed as an OR-ed combination of
<link linkend="GSignalMatchType"><type>GSignalMatchType</type></link> flags, and the criteria values are passed as arguments.
Passing at least one of the <link linkend="G-SIGNAL-MATCH-CLOSURE--CAPS"><literal>G_SIGNAL_MATCH_CLOSURE</literal></link>, <link linkend="G-SIGNAL-MATCH-FUNC--CAPS"><literal>G_SIGNAL_MATCH_FUNC</literal></link>
or <link linkend="G-SIGNAL-MATCH-DATA--CAPS"><literal>G_SIGNAL_MATCH_DATA</literal></link> match flags is required for successful matches.
If no handlers were found, 0 is returned, the number of unblocked handlers
otherwise. The match criteria should not apply to any handlers that are
not currently blocked.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> The instance to unblock handlers from.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mask</parameter>&#160;:</term>
<listitem><simpara> Mask indicating which of <parameter>signal_id</parameter>, <parameter>detail</parameter>, <parameter>closure</parameter>, <parameter>func</parameter>
 and/or <parameter>data</parameter> the handlers have to match.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_id</parameter>&#160;:</term>
<listitem><simpara> Signal the handlers have to be connected to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detail</parameter>&#160;:</term>
<listitem><simpara> Signal detail the handlers have to be connected to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> The closure the handlers will invoke.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>func</parameter>&#160;:</term>
<listitem><simpara> The C closure callback of the handlers (useless for non-C closures).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> The closure data of the handlers' closures.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The number of handlers that matched.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-handlers-disconnect-matched" role="function">
<title>g_signal_handlers_disconnect_matched ()</title>
<indexterm zone="g-signal-handlers-disconnect-matched"><primary sortas="signal_handlers_disconnect_matched">g_signal_handlers_disconnect_matched</primary></indexterm><programlisting><link linkend="guint">guint</link>               g_signal_handlers_disconnect_matched
                                                        (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="GSignalMatchType">GSignalMatchType</link> mask,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> func,
                                                         <link linkend="gpointer">gpointer</link> data);</programlisting>
<para>
Disconnects all handlers on an instance that match a certain
selection criteria. The criteria mask is passed as an OR-ed
combination of <link linkend="GSignalMatchType"><type>GSignalMatchType</type></link> flags, and the criteria values are
passed as arguments.  Passing at least one of the
<link linkend="G-SIGNAL-MATCH-CLOSURE--CAPS"><literal>G_SIGNAL_MATCH_CLOSURE</literal></link>, <link linkend="G-SIGNAL-MATCH-FUNC--CAPS"><literal>G_SIGNAL_MATCH_FUNC</literal></link> or
<link linkend="G-SIGNAL-MATCH-DATA--CAPS"><literal>G_SIGNAL_MATCH_DATA</literal></link> match flags is required for successful
matches.  If no handlers were found, 0 is returned, the number of
disconnected handlers otherwise.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> The instance to remove handlers from.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mask</parameter>&#160;:</term>
<listitem><simpara> Mask indicating which of <parameter>signal_id</parameter>, <parameter>detail</parameter>, <parameter>closure</parameter>, <parameter>func</parameter>
 and/or <parameter>data</parameter> the handlers have to match.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_id</parameter>&#160;:</term>
<listitem><simpara> Signal the handlers have to be connected to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detail</parameter>&#160;:</term>
<listitem><simpara> Signal detail the handlers have to be connected to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> The closure the handlers will invoke.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>func</parameter>&#160;:</term>
<listitem><simpara> The C closure callback of the handlers (useless for non-C closures).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> The closure data of the handlers' closures.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The number of handlers that matched.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-handler-is-connected" role="function">
<title>g_signal_handler_is_connected ()</title>
<indexterm zone="g-signal-handler-is-connected"><primary sortas="signal_handler_is_connected">g_signal_handler_is_connected</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_signal_handler_is_connected       (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="gulong">gulong</link> handler_id);</programlisting>
<para>
Returns whether <parameter>handler_id</parameter> is the id of a handler connected to <parameter>instance</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> The instance where a signal handler is sought.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>handler_id</parameter>&#160;:</term>
<listitem><simpara> the handler id.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> whether <parameter>handler_id</parameter> identifies a handler connected to <parameter>instance</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-handlers-block-by-func" role="macro">
<title>g_signal_handlers_block_by_func()</title>
<indexterm zone="g-signal-handlers-block-by-func"><primary sortas="signal_handlers_block_by_func">g_signal_handlers_block_by_func</primary></indexterm><programlisting>#define             g_signal_handlers_block_by_func(instance, func, data)</programlisting>
<para>
Blocks all handlers on an instance that match <parameter>func</parameter> and <parameter>data</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> The instance to block handlers from.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>func</parameter>&#160;:</term>
<listitem><simpara> The C closure callback of the handlers (useless for non-C closures).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> The closure data of the handlers' closures.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-handlers-unblock-by-func" role="macro">
<title>g_signal_handlers_unblock_by_func()</title>
<indexterm zone="g-signal-handlers-unblock-by-func"><primary sortas="signal_handlers_unblock_by_func">g_signal_handlers_unblock_by_func</primary></indexterm><programlisting>#define             g_signal_handlers_unblock_by_func(instance, func, data)</programlisting>
<para>
Unblocks all handlers on an instance that match <parameter>func</parameter> and <parameter>data</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> The instance to unblock handlers from.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>func</parameter>&#160;:</term>
<listitem><simpara> The C closure callback of the handlers (useless for non-C closures).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> The closure data of the handlers' closures.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-handlers-disconnect-by-func" role="macro">
<title>g_signal_handlers_disconnect_by_func()</title>
<indexterm zone="g-signal-handlers-disconnect-by-func"><primary sortas="signal_handlers_disconnect_by_func">g_signal_handlers_disconnect_by_func</primary></indexterm><programlisting>#define             g_signal_handlers_disconnect_by_func(instance, func, data)</programlisting>
<para>
Disconnects all handlers on an instance that match <parameter>func</parameter> and <parameter>data</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> The instance to remove handlers from.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>func</parameter>&#160;:</term>
<listitem><simpara> The C closure callback of the handlers (useless for non-C closures).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> The closure data of the handlers' closures.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-has-handler-pending" role="function">
<title>g_signal_has_handler_pending ()</title>
<indexterm zone="g-signal-has-handler-pending"><primary sortas="signal_has_handler_pending">g_signal_has_handler_pending</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_signal_has_handler_pending        (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="gboolean">gboolean</link> may_be_blocked);</programlisting>
<para>
Returns whether there are any handlers connected to <parameter>instance</parameter> for the
given signal id and detail.
</para>
<para>
One example of when you might use this is when the arguments to the
signal are difficult to compute. A class implementor may opt to not
emit the signal if no one is attached anyway, thus saving the cost
of building the arguments.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> the object whose signal handlers are sought.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_id</parameter>&#160;:</term>
<listitem><simpara> the signal id.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detail</parameter>&#160;:</term>
<listitem><simpara> the detail.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>may_be_blocked</parameter>&#160;:</term>
<listitem><simpara> whether blocked handlers should count as match.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if a handler is connected to the signal, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>
         otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-stop-emission" role="function">
<title>g_signal_stop_emission ()</title>
<indexterm zone="g-signal-stop-emission"><primary sortas="signal_stop_emission">g_signal_stop_emission</primary></indexterm><programlisting><link linkend="void">void</link>                g_signal_stop_emission              (<link linkend="gpointer">gpointer</link> instance,
                                                         <link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail);</programlisting>
<para>
Stops a signal's current emission.
</para>
<para>
This will prevent the default method from running, if the signal was
<link linkend="G-SIGNAL-RUN-LAST--CAPS"><literal>G_SIGNAL_RUN_LAST</literal></link> and you connected normally (i.e. without the "after"
flag).
</para>
<para>
Prints a warning if used on a signal which isn't being emitted.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> the object whose signal handlers you wish to stop.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_id</parameter>&#160;:</term>
<listitem><simpara> the signal identifier, as returned by <link linkend="g-signal-lookup"><function>g_signal_lookup()</function></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detail</parameter>&#160;:</term>
<listitem><simpara> the detail which the signal was emitted with.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-stop-emission-by-name" role="function">
<title>g_signal_stop_emission_by_name ()</title>
<indexterm zone="g-signal-stop-emission-by-name"><primary sortas="signal_stop_emission_by_name">g_signal_stop_emission_by_name</primary></indexterm><programlisting><link linkend="void">void</link>                g_signal_stop_emission_by_name      (<link linkend="gpointer">gpointer</link> instance,
                                                         const <link linkend="gchar">gchar</link> *detailed_signal);</programlisting>
<para>
Stops a signal's current emission.
</para>
<para>
This is just like <link linkend="g-signal-stop-emission"><function>g_signal_stop_emission()</function></link> except it will look up the
signal id for you.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> the object whose signal handlers you wish to stop.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detailed_signal</parameter>&#160;:</term>
<listitem><simpara> a string of the form "signal-name::detail".
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-override-class-closure" role="function">
<title>g_signal_override_class_closure ()</title>
<indexterm zone="g-signal-override-class-closure"><primary sortas="signal_override_class_closure">g_signal_override_class_closure</primary></indexterm><programlisting><link linkend="void">void</link>                g_signal_override_class_closure     (<link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GType">GType</link> instance_type,
                                                         <link linkend="GClosure">GClosure</link> *class_closure);</programlisting>
<para>
Overrides the class closure (i.e. the default handler) for the given signal
for emissions on instances of <parameter>instance_type</parameter>. <parameter>instance_type</parameter> must be derived
from the type to which the signal belongs.
</para>
<para>
See <link linkend="g-signal-chain-from-overridden"><function>g_signal_chain_from_overridden()</function></link> and
<link linkend="g-signal-chain-from-overridden-handler"><function>g_signal_chain_from_overridden_handler()</function></link> for how to chain up to the
parent class closure from inside the overridden one.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>signal_id</parameter>&#160;:</term>
<listitem><simpara> the signal id
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>instance_type</parameter>&#160;:</term>
<listitem><simpara> the instance type on which to override the class closure
 for the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>class_closure</parameter>&#160;:</term>
<listitem><simpara> the closure.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-chain-from-overridden" role="function">
<title>g_signal_chain_from_overridden ()</title>
<indexterm zone="g-signal-chain-from-overridden"><primary sortas="signal_chain_from_overridden">g_signal_chain_from_overridden</primary></indexterm><programlisting><link linkend="void">void</link>                g_signal_chain_from_overridden      (const <link linkend="GValue">GValue</link> *instance_and_params,
                                                         <link linkend="GValue">GValue</link> *return_value);</programlisting>
<para>
Calls the original class closure of a signal. This function should only
be called from an overridden class closure; see
<link linkend="g-signal-override-class-closure"><function>g_signal_override_class_closure()</function></link> and
<link linkend="g-signal-override-class-handler"><function>g_signal_override_class_handler()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance_and_params</parameter>&#160;:</term>
<listitem><simpara> the argument list of the signal emission. The first
 element in the array is a <link linkend="GValue"><type>GValue</type></link> for the instance the signal is being
 emitted on. The rest are any arguments to be passed to the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> Location for the return value.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-new-class-handler" role="function" condition="since:2.18">
<title>g_signal_new_class_handler ()</title>
<indexterm zone="g-signal-new-class-handler" role="2.18"><primary sortas="signal_new_class_handler">g_signal_new_class_handler</primary></indexterm><programlisting><link linkend="guint">guint</link>               g_signal_new_class_handler          (const <link linkend="gchar">gchar</link> *signal_name,
                                                         <link linkend="GType">GType</link> itype,
                                                         <link linkend="GSignalFlags">GSignalFlags</link> signal_flags,
                                                         <link linkend="GCallback">GCallback</link> class_handler,
                                                         <link linkend="GSignalAccumulator">GSignalAccumulator</link> accumulator,
                                                         <link linkend="gpointer">gpointer</link> accu_data,
                                                         <link linkend="GSignalCMarshaller">GSignalCMarshaller</link> c_marshaller,
                                                         <link linkend="GType">GType</link> return_type,
                                                         <link linkend="guint">guint</link> n_params,
                                                         ...);</programlisting>
<para>
Creates a new signal. (This is usually done in the class initializer.)
</para>
<para>
This is a variant of <link linkend="g-signal-new"><function>g_signal_new()</function></link> that takes a C callback instead
off a class offset for the signal's class handler. This function
doesn't need a function pointer exposed in the class structure of
an object definition, instead the function pointer is passed
directly and can be overriden by derived classes with
<link linkend="g-signal-override-class-closure"><function>g_signal_override_class_closure()</function></link> or
<link linkend="g-signal-override-class-handler"><function>g_signal_override_class_handler()</function></link>and chained to with
<link linkend="g-signal-chain-from-overridden"><function>g_signal_chain_from_overridden()</function></link> or
<link linkend="g-signal-chain-from-overridden-handler"><function>g_signal_chain_from_overridden_handler()</function></link>.
</para>
<para>
See <link linkend="g-signal-new"><function>g_signal_new()</function></link> for information about signal names.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>signal_name</parameter>&#160;:</term>
<listitem><simpara> the name for the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>itype</parameter>&#160;:</term>
<listitem><simpara> the type this signal pertains to. It will also pertain to
 types which are derived from this type.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_flags</parameter>&#160;:</term>
<listitem><simpara> a combination of <link linkend="GSignalFlags"><type>GSignalFlags</type></link> specifying detail of when
 the default handler is to be invoked. You should at least specify
 <link linkend="G-SIGNAL-RUN-FIRST--CAPS"><literal>G_SIGNAL_RUN_FIRST</literal></link> or <link linkend="G-SIGNAL-RUN-LAST--CAPS"><literal>G_SIGNAL_RUN_LAST</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>class_handler</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GCallback"><type>GCallback</type></link> which acts as class implementation of
 this signal. Used to invoke a class method generically. Pass <link linkend="NULL--CAPS"><literal>NULL</literal></link> to
 not associate a class method with this signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>accumulator</parameter>&#160;:</term>
<listitem><simpara> the accumulator for this signal; may be <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>accu_data</parameter>&#160;:</term>
<listitem><simpara> user data for the <parameter>accumulator</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>c_marshaller</parameter>&#160;:</term>
<listitem><simpara> the function to translate arrays of parameter values to
 signal emissions into C language callback invocations.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_type</parameter>&#160;:</term>
<listitem><simpara> the type of return value, or <link linkend="G-TYPE-NONE--CAPS"><type>G_TYPE_NONE</type></link> for a signal
 without a return value.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_params</parameter>&#160;:</term>
<listitem><simpara> the number of parameter types to follow.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara> a list of types, one for each parameter.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the signal id

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.18</para></refsect2>
<refsect2 id="g-signal-override-class-handler" role="function" condition="since:2.18">
<title>g_signal_override_class_handler ()</title>
<indexterm zone="g-signal-override-class-handler" role="2.18"><primary sortas="signal_override_class_handler">g_signal_override_class_handler</primary></indexterm><programlisting><link linkend="void">void</link>                g_signal_override_class_handler     (const <link linkend="gchar">gchar</link> *signal_name,
                                                         <link linkend="GType">GType</link> instance_type,
                                                         <link linkend="GCallback">GCallback</link> class_handler);</programlisting>
<para>
Overrides the class closure (i.e. the default handler) for the
given signal for emissions on instances of <parameter>instance_type</parameter> with
callabck <parameter>class_handler</parameter>. <parameter>instance_type</parameter> must be derived from the
type to which the signal belongs.
</para>
<para>
See <link linkend="g-signal-chain-from-overridden"><function>g_signal_chain_from_overridden()</function></link> and
<link linkend="g-signal-chain-from-overridden-handler"><function>g_signal_chain_from_overridden_handler()</function></link> for how to chain up to the
parent class closure from inside the overridden one.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>signal_name</parameter>&#160;:</term>
<listitem><simpara> the name for the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>instance_type</parameter>&#160;:</term>
<listitem><simpara> the instance type on which to override the class handler
 for the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>class_handler</parameter>&#160;:</term>
<listitem><simpara> the handler.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.18</para></refsect2>
<refsect2 id="g-signal-chain-from-overridden-handler" role="function" condition="since:2.18">
<title>g_signal_chain_from_overridden_handler ()</title>
<indexterm zone="g-signal-chain-from-overridden-handler" role="2.18"><primary sortas="signal_chain_from_overridden_handler">g_signal_chain_from_overridden_handler</primary></indexterm><programlisting><link linkend="void">void</link>                g_signal_chain_from_overridden_handler
                                                        (<link linkend="gpointer">gpointer</link> instance,
                                                         ...);</programlisting>
<para>
Calls the original class closure of a signal. This function should
only be called from an overridden class closure; see
<link linkend="g-signal-override-class-closure"><function>g_signal_override_class_closure()</function></link> and
<link linkend="g-signal-override-class-handler"><function>g_signal_override_class_handler()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> the instance the signal is being emitted on.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara> parameters to be passed to the parent class closure, followed by a
 location for the return value. If the return type of the signal
 is <link linkend="G-TYPE-NONE--CAPS"><type>G_TYPE_NONE</type></link>, the return value location can be omitted.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.18</para></refsect2>
<refsect2 id="g-signal-add-emission-hook" role="function">
<title>g_signal_add_emission_hook ()</title>
<indexterm zone="g-signal-add-emission-hook"><primary sortas="signal_add_emission_hook">g_signal_add_emission_hook</primary></indexterm><programlisting><link linkend="gulong">gulong</link>              g_signal_add_emission_hook          (<link linkend="guint">guint</link> signal_id,
                                                         <link linkend="GQuark">GQuark</link> detail,
                                                         <link linkend="GSignalEmissionHook">GSignalEmissionHook</link> hook_func,
                                                         <link linkend="gpointer">gpointer</link> hook_data,
                                                         <link linkend="GDestroyNotify">GDestroyNotify</link> data_destroy);</programlisting>
<para>
Adds an emission hook for a signal, which will get called for any emission
of that signal, independent of the instance. This is possible only
for signals which don't have <link linkend="G-SIGNAL-NO-HOOKS--CAPS"><type>G_SIGNAL_NO_HOOKS</type></link> flag set.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>signal_id</parameter>&#160;:</term>
<listitem><simpara> the signal identifier, as returned by <link linkend="g-signal-lookup"><function>g_signal_lookup()</function></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detail</parameter>&#160;:</term>
<listitem><simpara> the detail on which to call the hook.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>hook_func</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GSignalEmissionHook"><type>GSignalEmissionHook</type></link> function.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>hook_data</parameter>&#160;:</term>
<listitem><simpara> user data for <parameter>hook_func</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data_destroy</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GDestroyNotify"><type>GDestroyNotify</type></link> for <parameter>hook_data</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the hook id, for later use with <link linkend="g-signal-remove-emission-hook"><function>g_signal_remove_emission_hook()</function></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-remove-emission-hook" role="function">
<title>g_signal_remove_emission_hook ()</title>
<indexterm zone="g-signal-remove-emission-hook"><primary sortas="signal_remove_emission_hook">g_signal_remove_emission_hook</primary></indexterm><programlisting><link linkend="void">void</link>                g_signal_remove_emission_hook       (<link linkend="guint">guint</link> signal_id,
                                                         <link linkend="gulong">gulong</link> hook_id);</programlisting>
<para>
Deletes an emission hook.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>signal_id</parameter>&#160;:</term>
<listitem><simpara> the id of the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>hook_id</parameter>&#160;:</term>
<listitem><simpara> the id of the emission hook, as returned by
 <link linkend="g-signal-add-emission-hook"><function>g_signal_add_emission_hook()</function></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-parse-name" role="function">
<title>g_signal_parse_name ()</title>
<indexterm zone="g-signal-parse-name"><primary sortas="signal_parse_name">g_signal_parse_name</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_signal_parse_name                 (const <link linkend="gchar">gchar</link> *detailed_signal,
                                                         <link linkend="GType">GType</link> itype,
                                                         <link linkend="guint">guint</link> *signal_id_p,
                                                         <link linkend="GQuark">GQuark</link> *detail_p,
                                                         <link linkend="gboolean">gboolean</link> force_detail_quark);</programlisting>
<para>
Internal function to parse a signal name into its <parameter>signal_id</parameter>
and <parameter>detail</parameter> quark.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>detailed_signal</parameter>&#160;:</term>
<listitem><simpara> a string of the form "signal-name::detail".
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>itype</parameter>&#160;:</term>
<listitem><simpara> The interface/instance type that introduced "signal-name".
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_id_p</parameter>&#160;:</term>
<listitem><simpara> Location to store the signal id.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>detail_p</parameter>&#160;:</term>
<listitem><simpara> Location to store the detail quark.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>force_detail_quark</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> forces creation of a <link linkend="GQuark"><type>GQuark</type></link> for the detail.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> Whether the signal name could successfully be parsed and <parameter>signal_id_p</parameter> and <parameter>detail_p</parameter> contain valid return values.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-get-invocation-hint" role="function">
<title>g_signal_get_invocation_hint ()</title>
<indexterm zone="g-signal-get-invocation-hint"><primary sortas="signal_get_invocation_hint">g_signal_get_invocation_hint</primary></indexterm><programlisting><link linkend="GSignalInvocationHint">GSignalInvocationHint</link>* g_signal_get_invocation_hint     (<link linkend="gpointer">gpointer</link> instance);</programlisting>
<para>
Returns the invocation hint of the innermost signal emission of instance.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>instance</parameter>&#160;:</term>
<listitem><simpara> the instance to query
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the invocation hint of the innermost signal emission.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-type-cclosure-new" role="function">
<title>g_signal_type_cclosure_new ()</title>
<indexterm zone="g-signal-type-cclosure-new"><primary sortas="signal_type_cclosure_new">g_signal_type_cclosure_new</primary></indexterm><programlisting><link linkend="GClosure">GClosure</link>*           g_signal_type_cclosure_new          (<link linkend="GType">GType</link> itype,
                                                         <link linkend="guint">guint</link> struct_offset);</programlisting>
<para>
Creates a new closure which invokes the function found at the offset
<parameter>struct_offset</parameter> in the class structure of the interface or classed type
identified by <parameter>itype</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>itype</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GType"><type>GType</type></link> identifier of an interface or classed type
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>struct_offset</parameter>&#160;:</term>
<listitem><simpara> the offset of the member function of <parameter>itype</parameter>'s class
 structure which is to be invoked by the new closure
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="GCClosure"><type>GCClosure</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-signal-accumulator-true-handled" role="function" condition="since:2.4">
<title>g_signal_accumulator_true_handled ()</title>
<indexterm zone="g-signal-accumulator-true-handled" role="2.4"><primary sortas="signal_accumulator_true_handled">g_signal_accumulator_true_handled</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_signal_accumulator_true_handled   (<link linkend="GSignalInvocationHint">GSignalInvocationHint</link> *ihint,
                                                         <link linkend="GValue">GValue</link> *return_accu,
                                                         const <link linkend="GValue">GValue</link> *handler_return,
                                                         <link linkend="gpointer">gpointer</link> dummy);</programlisting>
<para>
A predefined <link linkend="GSignalAccumulator"><type>GSignalAccumulator</type></link> for signals that return a
boolean values. The behavior that this accumulator gives is
that a return of <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> stops the signal emission: no further
callbacks will be invoked, while a return of <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> allows
the emission to coninue. The idea here is that a <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> return
indicates that the callback <emphasis>handled</emphasis> the signal,
and no further handling is needed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>ihint</parameter>&#160;:</term>
<listitem><simpara> standard <link linkend="GSignalAccumulator"><type>GSignalAccumulator</type></link> parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_accu</parameter>&#160;:</term>
<listitem><simpara> standard <link linkend="GSignalAccumulator"><type>GSignalAccumulator</type></link> parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>handler_return</parameter>&#160;:</term>
<listitem><simpara> standard <link linkend="GSignalAccumulator"><type>GSignalAccumulator</type></link> parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dummy</parameter>&#160;:</term>
<listitem><simpara> standard <link linkend="GSignalAccumulator"><type>GSignalAccumulator</type></link> parameter
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> standard <link linkend="GSignalAccumulator"><type>GSignalAccumulator</type></link> result
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>

</refsect1>




</refentry>
