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

<refnamediv>
<refname>Closures</refname>
<refpurpose>Functions as first-class objects</refpurpose>
</refnamediv>

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

<synopsis>

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

#define             <link linkend="G-CLOSURE-NEEDS-MARSHAL--CAPS">G_CLOSURE_NEEDS_MARSHAL</link>             (closure)
#define             <link linkend="G-CLOSURE-N-NOTIFIERS--CAPS">G_CLOSURE_N_NOTIFIERS</link>               (cl)
#define             <link linkend="G-CCLOSURE-SWAP-DATA--CAPS">G_CCLOSURE_SWAP_DATA</link>                (cclosure)
#define             <link linkend="G-CALLBACK--CAPS">G_CALLBACK</link>                          (f)
<link linkend="void">void</link>                (<link linkend="GCallback">*GCallback</link>)                        (void);
                    <link linkend="GClosure">GClosure</link>;
#define             <link linkend="G-TYPE-CLOSURE--CAPS">G_TYPE_CLOSURE</link>
                    <link linkend="GCClosure">GCClosure</link>;
<link linkend="void">void</link>                (<link linkend="GClosureMarshal">*GClosureMarshal</link>)                  (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                (<link linkend="GClosureNotify">*GClosureNotify</link>)                   (<link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GClosure">GClosure</link> *closure);
<link linkend="GClosure">GClosure</link>*           <link linkend="g-cclosure-new">g_cclosure_new</link>                      (<link linkend="GCallback">GCallback</link> callback_func,
                                                         <link linkend="gpointer">gpointer</link> user_data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> destroy_data);
<link linkend="GClosure">GClosure</link>*           <link linkend="g-cclosure-new-swap">g_cclosure_new_swap</link>                 (<link linkend="GCallback">GCallback</link> callback_func,
                                                         <link linkend="gpointer">gpointer</link> user_data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> destroy_data);
<link linkend="GClosure">GClosure</link>*           <link linkend="g-cclosure-new-object">g_cclosure_new_object</link>               (<link linkend="GCallback">GCallback</link> callback_func,
                                                         <link linkend="GObject">GObject</link> *object);
<link linkend="GClosure">GClosure</link>*           <link linkend="g-cclosure-new-object-swap">g_cclosure_new_object_swap</link>          (<link linkend="GCallback">GCallback</link> callback_func,
                                                         <link linkend="GObject">GObject</link> *object);
<link linkend="GClosure">GClosure</link>*           <link linkend="g-closure-new-object">g_closure_new_object</link>                (<link linkend="guint">guint</link> sizeof_closure,
                                                         <link linkend="GObject">GObject</link> *object);
<link linkend="GClosure">GClosure</link>*           <link linkend="g-closure-ref">g_closure_ref</link>                       (<link linkend="GClosure">GClosure</link> *closure);
<link linkend="void">void</link>                <link linkend="g-closure-sink">g_closure_sink</link>                      (<link linkend="GClosure">GClosure</link> *closure);
<link linkend="void">void</link>                <link linkend="g-closure-unref">g_closure_unref</link>                     (<link linkend="GClosure">GClosure</link> *closure);
<link linkend="void">void</link>                <link linkend="g-closure-invoke">g_closure_invoke</link>                    (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint);
<link linkend="void">void</link>                <link linkend="g-closure-invalidate">g_closure_invalidate</link>                (<link linkend="GClosure">GClosure</link> *closure);
<link linkend="void">void</link>                <link linkend="g-closure-add-finalize-notifier">g_closure_add_finalize_notifier</link>     (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> notify_data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> notify_func);
<link linkend="void">void</link>                <link linkend="g-closure-add-invalidate-notifier">g_closure_add_invalidate_notifier</link>   (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> notify_data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> notify_func);
<link linkend="void">void</link>                <link linkend="g-closure-remove-finalize-notifier">g_closure_remove_finalize_notifier</link>  (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> notify_data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> notify_func);
<link linkend="void">void</link>                <link linkend="g-closure-remove-invalidate-notifier">g_closure_remove_invalidate_notifier</link>
                                                        (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> notify_data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> notify_func);
<link linkend="GClosure">GClosure</link>*           <link linkend="g-closure-new-simple">g_closure_new_simple</link>                (<link linkend="guint">guint</link> sizeof_closure,
                                                         <link linkend="gpointer">gpointer</link> data);
<link linkend="void">void</link>                <link linkend="g-closure-set-marshal">g_closure_set_marshal</link>               (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GClosureMarshal">GClosureMarshal</link> marshal);
<link linkend="void">void</link>                <link linkend="g-closure-add-marshal-guards">g_closure_add_marshal_guards</link>        (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> pre_marshal_data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> pre_marshal_notify,
                                                         <link linkend="gpointer">gpointer</link> post_marshal_data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> post_marshal_notify);
<link linkend="void">void</link>                <link linkend="g-closure-set-meta-marshal">g_closure_set_meta_marshal</link>          (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> marshal_data,
                                                         <link linkend="GClosureMarshal">GClosureMarshal</link> meta_marshal);
<link linkend="void">void</link>                <link linkend="g-source-set-closure">g_source_set_closure</link>                (<link linkend="GSource">GSource</link> *source,
                                                         <link linkend="GClosure">GClosure</link> *closure);
#define             <link linkend="G-TYPE-IO-CHANNEL--CAPS">G_TYPE_IO_CHANNEL</link>
#define             <link linkend="G-TYPE-IO-CONDITION--CAPS">G_TYPE_IO_CONDITION</link>

<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--VOID">g_cclosure_marshal_VOID__VOID</link>       (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--BOOLEAN">g_cclosure_marshal_VOID__BOOLEAN</link>    (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--CHAR">g_cclosure_marshal_VOID__CHAR</link>       (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--UCHAR">g_cclosure_marshal_VOID__UCHAR</link>      (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--INT">g_cclosure_marshal_VOID__INT</link>        (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--UINT">g_cclosure_marshal_VOID__UINT</link>       (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--LONG">g_cclosure_marshal_VOID__LONG</link>       (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--ULONG">g_cclosure_marshal_VOID__ULONG</link>      (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--ENUM">g_cclosure_marshal_VOID__ENUM</link>       (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--FLAGS">g_cclosure_marshal_VOID__FLAGS</link>      (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--FLOAT">g_cclosure_marshal_VOID__FLOAT</link>      (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--DOUBLE">g_cclosure_marshal_VOID__DOUBLE</link>     (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--STRING">g_cclosure_marshal_VOID__STRING</link>     (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--PARAM">g_cclosure_marshal_VOID__PARAM</link>      (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--BOXED">g_cclosure_marshal_VOID__BOXED</link>      (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--POINTER">g_cclosure_marshal_VOID__POINTER</link>    (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--OBJECT">g_cclosure_marshal_VOID__OBJECT</link>     (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-STRING--OBJECT-POINTER">g_cclosure_marshal_STRING__OBJECT_POINTER</link>
                                                        (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-VOID--UINT-POINTER">g_cclosure_marshal_VOID__UINT_POINTER</link>
                                                        (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
<link linkend="void">void</link>                <link linkend="g-cclosure-marshal-BOOLEAN--FLAGS">g_cclosure_marshal_BOOLEAN__FLAGS</link>   (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);
#define             <link linkend="g-cclosure-marshal-BOOL--FLAGS">g_cclosure_marshal_BOOL__FLAGS</link>
</synopsis>
</refsynopsisdiv>









<refsect1 id="gobject-Closures.description" role="desc">
<title role="desc.title">Description</title>
<para>
A <link linkend="GClosure"><type>GClosure</type></link> represents a callback supplied by the programmer. It
will generally comprise a function of some kind and a marshaller
used to call it. It is the reponsibility of the marshaller to
convert the arguments for the invocation from <link linkend="GValue"><type>GValue</type></link><!-- -->s into
a suitable form, perform the callback on the converted arguments,
and transform the return value back into a <link linkend="GValue"><type>GValue</type></link>.
</para>
<para>
In the case of C programs, a closure usually just holds a pointer
to a function and maybe a data argument, and the marshaller
converts between <link linkend="GValue"><type>GValue</type></link><!-- --> and native C types. The GObject
library provides the <link linkend="GCClosure"><type>GCClosure</type></link> type for this purpose. Bindings for
other languages need marshallers which convert between <link linkend="GValue"><type>GValue</type></link><!--
-->s and suitable representations in the runtime of the language in
order to use functions written in that languages as callbacks.
</para>
<para>
Within GObject, closures play an important role in the
implementation of signals. When a signal is registered, the
<parameter>c_marshaller</parameter> argument to <link linkend="g-signal-new"><function>g_signal_new()</function></link> specifies the default C
marshaller for any closure which is connected to this
signal. GObject provides a number of C marshallers for this
purpose, see the g_cclosure_marshal_*() functions. Additional C
marshallers can be generated with the <link
linkend="glib-genmarshal">glib-genmarshal</link> utility.  Closures
can be explicitly connected to signals with
<link linkend="g-signal-connect-closure"><function>g_signal_connect_closure()</function></link>, but it usually more convenient to let
GObject create a closure automatically by using one of the
g_signal_connect_*() functions which take a callback function/user
data pair.
</para>
<para>
Using closures has a number of important advantages over a simple
callback function/data pointer combination:
<itemizedlist>
<listitem><para>
Closures allow the callee to get the types of the callback parameters,
which means that language bindings don't have to write individual glue
for each callback type.
</para></listitem>
<listitem><para>
The reference counting of <link linkend="GClosure"><type>GClosure</type></link> makes it easy to handle reentrancy
right; if a callback is removed while it is being invoked, the closure
and its parameters won't be freed until the invocation finishes.
</para></listitem>
<listitem><para>
<link linkend="g-closure-invalidate"><function>g_closure_invalidate()</function></link> and invalidation notifiers allow callbacks to be
automatically removed when the objects they point to go away.
</para></listitem>
</itemizedlist></para>
<para>
</para>
</refsect1>

<refsect1 id="gobject-Closures.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="G-CLOSURE-NEEDS-MARSHAL--CAPS" role="macro">
<title>G_CLOSURE_NEEDS_MARSHAL()</title>
<indexterm zone="G-CLOSURE-NEEDS-MARSHAL--CAPS"><primary sortas="CLOSURE_NEEDS_MARSHAL">G_CLOSURE_NEEDS_MARSHAL</primary></indexterm><programlisting>#define	G_CLOSURE_NEEDS_MARSHAL(closure) (((GClosure*) (closure))-&gt;marshal == NULL)
</programlisting>
<para>
Check if the closure still needs a marshaller. See <link linkend="g-closure-set-marshal"><function>g_closure_set_marshal()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GClosure"><type>GClosure</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-CLOSURE-N-NOTIFIERS--CAPS" role="macro">
<title>G_CLOSURE_N_NOTIFIERS()</title>
<indexterm zone="G-CLOSURE-N-NOTIFIERS--CAPS"><primary sortas="CLOSURE_N_NOTIFIERS">G_CLOSURE_N_NOTIFIERS</primary></indexterm><programlisting>#define             G_CLOSURE_N_NOTIFIERS(cl)</programlisting>
<para>
Get the total number of notifiers connected with the closure <parameter>cl</parameter>. 
The count includes the meta marshaller, the finalize and invalidate notifiers 
and the marshal guards. Note that each guard counts as two notifiers. 
See <link linkend="g-closure-set-meta-marshal"><function>g_closure_set_meta_marshal()</function></link>, <link linkend="g-closure-add-finalize-notifier"><function>g_closure_add_finalize_notifier()</function></link>,
<link linkend="g-closure-add-invalidate-notifier"><function>g_closure_add_invalidate_notifier()</function></link> and <link linkend="g-closure-add-marshal-guards"><function>g_closure_add_marshal_guards()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>cl</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GClosure"><type>GClosure</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-CCLOSURE-SWAP-DATA--CAPS" role="macro">
<title>G_CCLOSURE_SWAP_DATA()</title>
<indexterm zone="G-CCLOSURE-SWAP-DATA--CAPS"><primary sortas="CCLOSURE_SWAP_DATA">G_CCLOSURE_SWAP_DATA</primary></indexterm><programlisting>#define	G_CCLOSURE_SWAP_DATA(cclosure)	 (((GClosure*) (cclosure))-&gt;derivative_flag)
</programlisting>
<para>
Checks whether the user data of the <link linkend="GCClosure"><type>GCClosure</type></link> should be passed as the
first parameter to the callback. See <link linkend="g-cclosure-new-swap"><function>g_cclosure_new_swap()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>cclosure</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GCClosure"><type>GCClosure</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-CALLBACK--CAPS" role="macro">
<title>G_CALLBACK()</title>
<indexterm zone="G-CALLBACK--CAPS"><primary sortas="CALLBACK">G_CALLBACK</primary></indexterm><programlisting>#define	G_CALLBACK(f)			 ((GCallback) (f))
</programlisting>
<para>
Cast a function pointer to a <link linkend="GCallback"><type>GCallback</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>f</parameter>&#160;:</term>
<listitem><simpara> a function pointer.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GCallback" role="function">
<title>GCallback ()</title>
<indexterm zone="GCallback"><primary sortas="Callback">GCallback</primary></indexterm><programlisting><link linkend="void">void</link>                (*GCallback)                        (void);</programlisting>
<para>
The type used for callback functions in structure definitions and function 
signatures. This doesn't mean that all callback functions must take no 
parameters and return void. The required signature of a callback function 
is determined by the context in which is used (e.g. the signal to which it 
is connected). Use <link linkend="G-CALLBACK--CAPS"><function>G_CALLBACK()</function></link> to cast the callback function to a <link linkend="GCallback"><type>GCallback</type></link>.</para>
<para>
</para></refsect2>
<refsect2 id="GClosure" role="struct">
<title>GClosure</title>
<indexterm zone="GClosure"><primary sortas="Closure">GClosure</primary></indexterm><programlisting>typedef struct {
  volatile       	guint	 in_marshal : 1;
  volatile       	guint	 is_invalid : 1;
} GClosure;
</programlisting>
<para>
A <link linkend="GClosure"><type>GClosure</type></link> represents a callback supplied by the programmer.</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term>volatile&#160;&#160;&#160;&#160;&#160;&#160;&#160;	<link linkend="guint">guint</link>&#160;<structfield>in_marshal</structfield>&#160;:&#160;1;</term>
<listitem><simpara> Indicates whether the closure is currently being invoked with 
 <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem>
</varlistentry>
<varlistentry>
<term>volatile&#160;&#160;&#160;&#160;&#160;&#160;&#160;	<link linkend="guint">guint</link>&#160;<structfield>is_invalid</structfield>&#160;:&#160;1;</term>
<listitem><simpara> Indicates whether the closure has been invalidated by 
 <link linkend="g-closure-invalidate"><function>g_closure_invalidate()</function></link>
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="G-TYPE-CLOSURE--CAPS" role="macro">
<title>G_TYPE_CLOSURE</title>
<indexterm zone="G-TYPE-CLOSURE--CAPS"><primary sortas="TYPE_CLOSURE">G_TYPE_CLOSURE</primary></indexterm><programlisting>#define	G_TYPE_CLOSURE		(g_closure_get_type ())
</programlisting>
<para>
The <link linkend="GType"><type>GType</type></link> for <link linkend="GClosure"><type>GClosure</type></link>.</para>
<para>
</para></refsect2>
<refsect2 id="GCClosure" role="struct">
<title>GCClosure</title>
<indexterm zone="GCClosure"><primary sortas="CClosure">GCClosure</primary></indexterm><programlisting>typedef struct {
  GClosure	closure;
  gpointer	callback;
} GCClosure;
</programlisting>
<para>
A <link linkend="GCClosure"><type>GCClosure</type></link> is a specialization of <link linkend="GClosure"><type>GClosure</type></link> for C function callbacks.</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="GClosure">GClosure</link>&#160;<structfield>closure</structfield>;</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link>
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="gpointer">gpointer</link>&#160;<structfield>callback</structfield>;</term>
<listitem><simpara> the callback function
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GClosureMarshal" role="function">
<title>GClosureMarshal ()</title>
<indexterm zone="GClosureMarshal"><primary sortas="ClosureMarshal">GClosureMarshal</primary></indexterm><programlisting><link linkend="void">void</link>                (*GClosureMarshal)                  (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
The type used for marshaller functions.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> to store the return value. May be <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the
 callback of <parameter>closure</parameter> doesn't return a value.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> the length of the <parameter>param_values</parameter> array
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> an array of <link linkend="GValue"><type>GValue</type></link><!-- -->s holding the arguments on
 which to invoke the callback of <parameter>closure</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller,
 see <link linkend="g-closure-set-marshal"><function>g_closure_set_marshal()</function></link> and <link linkend="g-closure-set-meta-marshal"><function>g_closure_set_meta_marshal()</function></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GClosureNotify" role="function">
<title>GClosureNotify ()</title>
<indexterm zone="GClosureNotify"><primary sortas="ClosureNotify">GClosureNotify</primary></indexterm><programlisting><link linkend="void">void</link>                (*GClosureNotify)                   (<link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GClosure">GClosure</link> *closure);</programlisting>
<para>
The type used for the various notification callbacks which can be registered
on closures.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> data specified when registering the notification callback
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> on which the notification is emitted
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-new" role="function">
<title>g_cclosure_new ()</title>
<indexterm zone="g-cclosure-new"><primary sortas="cclosure_new">g_cclosure_new</primary></indexterm><programlisting><link linkend="GClosure">GClosure</link>*           g_cclosure_new                      (<link linkend="GCallback">GCallback</link> callback_func,
                                                         <link linkend="gpointer">gpointer</link> user_data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> destroy_data);</programlisting>
<para>
Creates a new closure which invokes <parameter>callback_func</parameter> with <parameter>user_data</parameter> as
the last parameter.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>callback_func</parameter>&#160;:</term>
<listitem><simpara> the function to invoke
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> user data to pass to <parameter>callback_func</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>destroy_data</parameter>&#160;:</term>
<listitem><simpara> destroy notify to be called when <parameter>user_data</parameter> is no longer used
</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-cclosure-new-swap" role="function">
<title>g_cclosure_new_swap ()</title>
<indexterm zone="g-cclosure-new-swap"><primary sortas="cclosure_new_swap">g_cclosure_new_swap</primary></indexterm><programlisting><link linkend="GClosure">GClosure</link>*           g_cclosure_new_swap                 (<link linkend="GCallback">GCallback</link> callback_func,
                                                         <link linkend="gpointer">gpointer</link> user_data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> destroy_data);</programlisting>
<para>
Creates a new closure which invokes <parameter>callback_func</parameter> with <parameter>user_data</parameter> as
the first parameter.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>callback_func</parameter>&#160;:</term>
<listitem><simpara> the function to invoke
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> user data to pass to <parameter>callback_func</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>destroy_data</parameter>&#160;:</term>
<listitem><simpara> destroy notify to be called when <parameter>user_data</parameter> is no longer used
</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-cclosure-new-object" role="function">
<title>g_cclosure_new_object ()</title>
<indexterm zone="g-cclosure-new-object"><primary sortas="cclosure_new_object">g_cclosure_new_object</primary></indexterm><programlisting><link linkend="GClosure">GClosure</link>*           g_cclosure_new_object               (<link linkend="GCallback">GCallback</link> callback_func,
                                                         <link linkend="GObject">GObject</link> *object);</programlisting>
<para>
A variant of <link linkend="g-cclosure-new"><function>g_cclosure_new()</function></link> which uses <parameter>object</parameter> as <parameter>user_data</parameter> and
calls <link linkend="g-object-watch-closure"><function>g_object_watch_closure()</function></link> on <parameter>object</parameter> and the created
closure. This function is useful when you have a callback closely
associated with a <link linkend="GObject"><type>GObject</type></link>, and want the callback to no longer run
after the object is is freed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>callback_func</parameter>&#160;:</term>
<listitem><simpara> the function to invoke
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link> pointer to pass to <parameter>callback_func</parameter>
</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-cclosure-new-object-swap" role="function">
<title>g_cclosure_new_object_swap ()</title>
<indexterm zone="g-cclosure-new-object-swap"><primary sortas="cclosure_new_object_swap">g_cclosure_new_object_swap</primary></indexterm><programlisting><link linkend="GClosure">GClosure</link>*           g_cclosure_new_object_swap          (<link linkend="GCallback">GCallback</link> callback_func,
                                                         <link linkend="GObject">GObject</link> *object);</programlisting>
<para>
A variant of <link linkend="g-cclosure-new-swap"><function>g_cclosure_new_swap()</function></link> which uses <parameter>object</parameter> as <parameter>user_data</parameter>
and calls <link linkend="g-object-watch-closure"><function>g_object_watch_closure()</function></link> on <parameter>object</parameter> and the created
closure. This function is useful when you have a callback closely
associated with a <link linkend="GObject"><type>GObject</type></link>, and want the callback to no longer run
after the object is is freed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>callback_func</parameter>&#160;:</term>
<listitem><simpara> the function to invoke
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link> pointer to pass to <parameter>callback_func</parameter>
</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-closure-new-object" role="function">
<title>g_closure_new_object ()</title>
<indexterm zone="g-closure-new-object"><primary sortas="closure_new_object">g_closure_new_object</primary></indexterm><programlisting><link linkend="GClosure">GClosure</link>*           g_closure_new_object                (<link linkend="guint">guint</link> sizeof_closure,
                                                         <link linkend="GObject">GObject</link> *object);</programlisting>
<para>
A variant of <link linkend="g-closure-new-simple"><function>g_closure_new_simple()</function></link> which stores <parameter>object</parameter> in the
<parameter>data</parameter> field of the closure and calls <link linkend="g-object-watch-closure"><function>g_object_watch_closure()</function></link> on
<parameter>object</parameter> and the created closure. This function is mainly useful
when implementing new types of closures.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sizeof_closure</parameter>&#160;:</term>
<listitem><simpara> the size of the structure to allocate, must be at least
 <literal>sizeof (GClosure)</literal>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link> pointer to store in the <parameter>data</parameter> field of the newly
 allocated <link linkend="GClosure"><type>GClosure</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a newly allocated <link linkend="GClosure"><type>GClosure</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-closure-ref" role="function">
<title>g_closure_ref ()</title>
<indexterm zone="g-closure-ref"><primary sortas="closure_ref">g_closure_ref</primary></indexterm><programlisting><link linkend="GClosure">GClosure</link>*           g_closure_ref                       (<link linkend="GClosure">GClosure</link> *closure);</programlisting>
<para>
Increments the reference count on a closure to force it staying
alive while the caller holds a pointer to it.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GClosure"><type>GClosure</type></link> to increment the reference count on
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The <parameter>closure</parameter> passed in, for convenience
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-closure-sink" role="function">
<title>g_closure_sink ()</title>
<indexterm zone="g-closure-sink"><primary sortas="closure_sink">g_closure_sink</primary></indexterm><programlisting><link linkend="void">void</link>                g_closure_sink                      (<link linkend="GClosure">GClosure</link> *closure);</programlisting>
<para>
Takes over the initial ownership of a closure.  Each closure is
initially created in a <firstterm>floating</firstterm> state, which
means that the initial reference count is not owned by any caller.
<link linkend="g-closure-sink"><function>g_closure_sink()</function></link> checks to see if the object is still floating, and
if so, unsets the floating state and decreases the reference
count. If the closure is not floating, <link linkend="g-closure-sink"><function>g_closure_sink()</function></link> does
nothing. The reason for the existance of the floating state is to
prevent cumbersome code sequences like:
<informalexample><programlisting>
closure = g_cclosure_new (cb_func, cb_data);
g_source_set_closure (source, closure);
g_closure_unref (closure); // XXX GObject doesn't really need this
</programlisting></informalexample>
Because <link linkend="g-source-set-closure"><function>g_source_set_closure()</function></link> (and similar functions) take ownership of the
initial reference count, if it is unowned, we instead can write:
<informalexample><programlisting>
g_source_set_closure (source, g_cclosure_new (cb_func, cb_data));
</programlisting></informalexample>
</para>
<para>
Generally, this function is used together with <link linkend="g-closure-ref"><function>g_closure_ref()</function></link>. Ane example
of storing a closure for later notification looks like:
<informalexample><programlisting>
static GClosure *notify_closure = NULL;
void
foo_notify_set_closure (GClosure *closure)
{
  if (notify_closure)
    g_closure_unref (notify_closure);
  notify_closure = closure;
  if (notify_closure)
    {
      g_closure_ref (notify_closure);
      g_closure_sink (notify_closure);
    }
}
</programlisting></informalexample>
</para>
<para>
Because <link linkend="g-closure-sink"><function>g_closure_sink()</function></link> may decrement the reference count of a closure
(if it hasn't been called on <parameter>closure</parameter> yet) just like <link linkend="g-closure-unref"><function>g_closure_unref()</function></link>,
<link linkend="g-closure-ref"><function>g_closure_ref()</function></link> should be called prior to this function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GClosure"><type>GClosure</type></link> to decrement the initial reference count on, if it's
          still being held
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-closure-unref" role="function">
<title>g_closure_unref ()</title>
<indexterm zone="g-closure-unref"><primary sortas="closure_unref">g_closure_unref</primary></indexterm><programlisting><link linkend="void">void</link>                g_closure_unref                     (<link linkend="GClosure">GClosure</link> *closure);</programlisting>
<para>
Decrements the reference count of a closure after it was previously
incremented by the same caller. If no other callers are using the
closure, then the closure will be destroyed and freed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GClosure"><type>GClosure</type></link> to decrement the reference count on
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-closure-invoke" role="function">
<title>g_closure_invoke ()</title>
<indexterm zone="g-closure-invoke"><primary sortas="closure_invoke">g_closure_invoke</primary></indexterm><programlisting><link linkend="void">void</link>                g_closure_invoke                    (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint);</programlisting>
<para>
Invokes the closure, i.e. executes the callback represented by the <parameter>closure</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GClosure"><type>GClosure</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> to store the return value. May be <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the
               callback of <parameter>closure</parameter> doesn't return a value.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> the length of the <parameter>param_values</parameter> array
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> an array of <link linkend="GValue"><type>GValue</type></link><!-- -->s holding the arguments on
               which to invoke the callback of <parameter>closure</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> a context-dependent invocation hint
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-closure-invalidate" role="function">
<title>g_closure_invalidate ()</title>
<indexterm zone="g-closure-invalidate"><primary sortas="closure_invalidate">g_closure_invalidate</primary></indexterm><programlisting><link linkend="void">void</link>                g_closure_invalidate                (<link linkend="GClosure">GClosure</link> *closure);</programlisting>
<para>
Sets a flag on the closure to indicate that its calling
environment has become invalid, and thus causes any future
invocations of <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link> on this <parameter>closure</parameter> to be
ignored. Also, invalidation notifiers installed on the closure will
be called at this point. Note that unless you are holding a
reference to the closure yourself, the invalidation notifiers may
unref the closure and cause it to be destroyed, so if you need to
access the closure after calling <link linkend="g-closure-invalidate"><function>g_closure_invalidate()</function></link>, make sure
that you've previously called <link linkend="g-closure-ref"><function>g_closure_ref()</function></link>.
</para>
<para>
Note that <link linkend="g-closure-invalidate"><function>g_closure_invalidate()</function></link> will also be called when the
reference count of a closure drops to zero (unless it has already
been invalidated before).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> GClosure to invalidate
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-closure-add-finalize-notifier" role="function">
<title>g_closure_add_finalize_notifier ()</title>
<indexterm zone="g-closure-add-finalize-notifier"><primary sortas="closure_add_finalize_notifier">g_closure_add_finalize_notifier</primary></indexterm><programlisting><link linkend="void">void</link>                g_closure_add_finalize_notifier     (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> notify_data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> notify_func);</programlisting>
<para>
Registers a finalization notifier which will be called when the
reference count of <parameter>closure</parameter> goes down to 0. Multiple finalization
notifiers on a single closure are invoked in unspecified order. If
a single call to <link linkend="g-closure-unref"><function>g_closure_unref()</function></link> results in the closure being
both invalidated and finalized, then the invalidate notifiers will
be run before the finalize notifiers.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GClosure"><type>GClosure</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>notify_data</parameter>&#160;:</term>
<listitem><simpara> data to pass to <parameter>notify_func</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>notify_func</parameter>&#160;:</term>
<listitem><simpara> the callback function to register
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-closure-add-invalidate-notifier" role="function">
<title>g_closure_add_invalidate_notifier ()</title>
<indexterm zone="g-closure-add-invalidate-notifier"><primary sortas="closure_add_invalidate_notifier">g_closure_add_invalidate_notifier</primary></indexterm><programlisting><link linkend="void">void</link>                g_closure_add_invalidate_notifier   (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> notify_data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> notify_func);</programlisting>
<para>
Registers an invalidation notifier which will be called when the
<parameter>closure</parameter> is invalidated with <link linkend="g-closure-invalidate"><function>g_closure_invalidate()</function></link>. Invalidation
notifiers are invoked before finalization notifiers, in an
unspecified order.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GClosure"><type>GClosure</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>notify_data</parameter>&#160;:</term>
<listitem><simpara> data to pass to <parameter>notify_func</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>notify_func</parameter>&#160;:</term>
<listitem><simpara> the callback function to register
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-closure-remove-finalize-notifier" role="function">
<title>g_closure_remove_finalize_notifier ()</title>
<indexterm zone="g-closure-remove-finalize-notifier"><primary sortas="closure_remove_finalize_notifier">g_closure_remove_finalize_notifier</primary></indexterm><programlisting><link linkend="void">void</link>                g_closure_remove_finalize_notifier  (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> notify_data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> notify_func);</programlisting>
<para>
Removes a finalization notifier.
</para>
<para>
Notice that notifiers are automatically removed after they are run.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GClosure"><type>GClosure</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>notify_data</parameter>&#160;:</term>
<listitem><simpara> data which was passed to <link linkend="g-closure-add-finalize-notifier"><function>g_closure_add_finalize_notifier()</function></link>
 when registering <parameter>notify_func</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>notify_func</parameter>&#160;:</term>
<listitem><simpara> the callback function to remove
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-closure-remove-invalidate-notifier" role="function">
<title>g_closure_remove_invalidate_notifier ()</title>
<indexterm zone="g-closure-remove-invalidate-notifier"><primary sortas="closure_remove_invalidate_notifier">g_closure_remove_invalidate_notifier</primary></indexterm><programlisting><link linkend="void">void</link>                g_closure_remove_invalidate_notifier
                                                        (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> notify_data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> notify_func);</programlisting>
<para>
Removes an invalidation notifier.
</para>
<para>
Notice that notifiers are automatically removed after they are run.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GClosure"><type>GClosure</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>notify_data</parameter>&#160;:</term>
<listitem><simpara> data which was passed to <link linkend="g-closure-add-invalidate-notifier"><function>g_closure_add_invalidate_notifier()</function></link>
              when registering <parameter>notify_func</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>notify_func</parameter>&#160;:</term>
<listitem><simpara> the callback function to remove
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-closure-new-simple" role="function">
<title>g_closure_new_simple ()</title>
<indexterm zone="g-closure-new-simple"><primary sortas="closure_new_simple">g_closure_new_simple</primary></indexterm><programlisting><link linkend="GClosure">GClosure</link>*           g_closure_new_simple                (<link linkend="guint">guint</link> sizeof_closure,
                                                         <link linkend="gpointer">gpointer</link> data);</programlisting>
<para>
Allocates a struct of the given size and initializes the initial
part as a <link linkend="GClosure"><type>GClosure</type></link>. This function is mainly useful when
implementing new types of closures.
</para>
<para>
<informalexample><programlisting>
typedef struct _MyClosure MyClosure;
struct _MyClosure
{
  GClosure closure;
  // extra data goes here
};

static void
my_closure_finalize (gpointer  notify_data,
                     GClosure *closure)
{
  MyClosure *my_closure = (MyClosure *)closure;

  // free extra data here
}

MyClosure *my_closure_new (gpointer data)
{
  GClosure *closure;
  MyClosure *my_closure;

  closure = g_closure_new_simple (sizeof (MyClosure), data);
  my_closure = (MyClosure *) closure;

  // initialize extra data here

  g_closure_add_finalize_notifier (closure, notify_data,
                                   my_closure_finalize);
  return my_closure;
}
</programlisting></informalexample></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sizeof_closure</parameter>&#160;:</term>
<listitem><simpara> the size of the structure to allocate, must be at least
                 <literal>sizeof (GClosure)</literal>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> data to store in the <parameter>data</parameter> field of the newly allocated <link linkend="GClosure"><type>GClosure</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a newly allocated <link linkend="GClosure"><type>GClosure</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-closure-set-marshal" role="function">
<title>g_closure_set_marshal ()</title>
<indexterm zone="g-closure-set-marshal"><primary sortas="closure_set_marshal">g_closure_set_marshal</primary></indexterm><programlisting><link linkend="void">void</link>                g_closure_set_marshal               (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GClosureMarshal">GClosureMarshal</link> marshal);</programlisting>
<para>
Sets the marshaller of <parameter>closure</parameter>. The <literal>marshal_data</literal>
of <parameter>marshal</parameter> provides a way for a meta marshaller to provide additional
information to the marshaller. (See <link linkend="g-closure-set-meta-marshal"><function>g_closure_set_meta_marshal()</function></link>.) For
GObject's C predefined marshallers (the g_cclosure_marshal_*()
functions), what it provides is a callback function to use instead of
<parameter>closure->callback</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GClosure"><type>GClosure</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GClosureMarshal"><type>GClosureMarshal</type></link> function
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-closure-add-marshal-guards" role="function">
<title>g_closure_add_marshal_guards ()</title>
<indexterm zone="g-closure-add-marshal-guards"><primary sortas="closure_add_marshal_guards">g_closure_add_marshal_guards</primary></indexterm><programlisting><link linkend="void">void</link>                g_closure_add_marshal_guards        (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> pre_marshal_data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> pre_marshal_notify,
                                                         <link linkend="gpointer">gpointer</link> post_marshal_data,
                                                         <link linkend="GClosureNotify">GClosureNotify</link> post_marshal_notify);</programlisting>
<para>
Adds a pair of notifiers which get invoked before and after the
closure callback, respectively. This is typically used to protect
the extra arguments for the duration of the callback. See
<link linkend="g-object-watch-closure"><function>g_object_watch_closure()</function></link> for an example of marshal guards.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GClosure"><type>GClosure</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pre_marshal_data</parameter>&#160;:</term>
<listitem><simpara> data to pass to <parameter>pre_marshal_notify</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pre_marshal_notify</parameter>&#160;:</term>
<listitem><simpara> a function to call before the closure callback
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>post_marshal_data</parameter>&#160;:</term>
<listitem><simpara> data to pass to <parameter>post_marshal_notify</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>post_marshal_notify</parameter>&#160;:</term>
<listitem><simpara> a function to call after the closure callback
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-closure-set-meta-marshal" role="function">
<title>g_closure_set_meta_marshal ()</title>
<indexterm zone="g-closure-set-meta-marshal"><primary sortas="closure_set_meta_marshal">g_closure_set_meta_marshal</primary></indexterm><programlisting><link linkend="void">void</link>                g_closure_set_meta_marshal          (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="gpointer">gpointer</link> marshal_data,
                                                         <link linkend="GClosureMarshal">GClosureMarshal</link> meta_marshal);</programlisting>
<para>
Sets the meta marshaller of <parameter>closure</parameter>.  A meta marshaller wraps
<parameter>closure->marshal</parameter> and modifies the way it is called in some
fashion. The most common use of this facility is for C callbacks.
The same marshallers (generated by <link
linkend="glib-genmarshal">glib-genmarshal</link>) are used
everywhere, but the way that we get the callback function
differs. In most cases we want to use <parameter>closure->callback</parameter>, but in
other cases we want to use some different technique to retrieve the
callback function.
</para>
<para>
For example, class closures for signals (see
<link linkend="g-signal-type-cclosure-new"><function>g_signal_type_cclosure_new()</function></link>) retrieve the callback function from a
fixed offset in the class structure.  The meta marshaller retrieves
the right callback and passes it to the marshaller as the
<parameter>marshal_data</parameter> argument.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GClosure"><type>GClosure</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> context-dependent data to pass to <parameter>meta_marshal</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>meta_marshal</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GClosureMarshal"><type>GClosureMarshal</type></link> function
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-source-set-closure" role="function">
<title>g_source_set_closure ()</title>
<indexterm zone="g-source-set-closure"><primary sortas="source_set_closure">g_source_set_closure</primary></indexterm><programlisting><link linkend="void">void</link>                g_source_set_closure                (<link linkend="GSource">GSource</link> *source,
                                                         <link linkend="GClosure">GClosure</link> *closure);</programlisting>
<para>
Set the callback for a source as a <link linkend="GClosure"><type>GClosure</type></link>.
</para>
<para>
If the source is not one of the standard GLib types, the <parameter>closure_callback</parameter>
and <parameter>closure_marshal</parameter> fields of the <link linkend="GSourceFuncs"><type>GSourceFuncs</type></link> structure must have been
filled in with pointers to appropriate functions.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>source</parameter>&#160;:</term>
<listitem><simpara> the source
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GClosure"><type>GClosure</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-TYPE-IO-CHANNEL--CAPS" role="macro">
<title>G_TYPE_IO_CHANNEL</title>
<indexterm zone="G-TYPE-IO-CHANNEL--CAPS"><primary sortas="TYPE_IO_CHANNEL">G_TYPE_IO_CHANNEL</primary></indexterm><programlisting>#define G_TYPE_IO_CHANNEL (g_io_channel_get_type ())
</programlisting>
<para>
The <link linkend="GType"><type>GType</type></link> for <link linkend="GIOChannel"><type>GIOChannel</type></link>.</para>
<para>
</para></refsect2>
<refsect2 id="G-TYPE-IO-CONDITION--CAPS" role="macro">
<title>G_TYPE_IO_CONDITION</title>
<indexterm zone="G-TYPE-IO-CONDITION--CAPS"><primary sortas="TYPE_IO_CONDITION">G_TYPE_IO_CONDITION</primary></indexterm><programlisting>#define G_TYPE_IO_CONDITION (g_io_condition_get_type ())
</programlisting>
<para>
The <link linkend="GType"><type>GType</type></link> for <link linkend="GIOCondition"><type>GIOCondition</type></link>.</para>
<para>
</para></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--VOID" role="function">
<title>g_cclosure_marshal_VOID__VOID ()</title>
<indexterm zone="g-cclosure-marshal-VOID--VOID"><primary sortas="cclosure_marshal_VOID__VOID">g_cclosure_marshal_VOID__VOID</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__VOID       (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, gpointer user_data)</literal>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 1
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding only the instance
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--BOOLEAN" role="function">
<title>g_cclosure_marshal_VOID__BOOLEAN ()</title>
<indexterm zone="g-cclosure-marshal-VOID--BOOLEAN"><primary sortas="cclosure_marshal_VOID__BOOLEAN">g_cclosure_marshal_VOID__BOOLEAN</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__BOOLEAN    (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, gboolean arg1, gpointer user_data)</literal>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding the instance and the <link linkend="gboolean"><type>gboolean</type></link> parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--CHAR" role="function">
<title>g_cclosure_marshal_VOID__CHAR ()</title>
<indexterm zone="g-cclosure-marshal-VOID--CHAR"><primary sortas="cclosure_marshal_VOID__CHAR">g_cclosure_marshal_VOID__CHAR</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__CHAR       (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, gchar arg1, gpointer user_data)</literal>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding the instance and the <link linkend="gchar"><type>gchar</type></link> parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--UCHAR" role="function">
<title>g_cclosure_marshal_VOID__UCHAR ()</title>
<indexterm zone="g-cclosure-marshal-VOID--UCHAR"><primary sortas="cclosure_marshal_VOID__UCHAR">g_cclosure_marshal_VOID__UCHAR</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__UCHAR      (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, guchar arg1, gpointer user_data)</literal>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding the instance and the <link linkend="guchar"><type>guchar</type></link> parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--INT" role="function">
<title>g_cclosure_marshal_VOID__INT ()</title>
<indexterm zone="g-cclosure-marshal-VOID--INT"><primary sortas="cclosure_marshal_VOID__INT">g_cclosure_marshal_VOID__INT</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__INT        (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding the instance and the <link linkend="gint"><type>gint</type></link> parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--UINT" role="function">
<title>g_cclosure_marshal_VOID__UINT ()</title>
<indexterm zone="g-cclosure-marshal-VOID--UINT"><primary sortas="cclosure_marshal_VOID__UINT">g_cclosure_marshal_VOID__UINT</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__UINT       (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, guint arg1, gpointer user_data)</literal>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding the instance and the <link linkend="guint"><type>guint</type></link> parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--LONG" role="function">
<title>g_cclosure_marshal_VOID__LONG ()</title>
<indexterm zone="g-cclosure-marshal-VOID--LONG"><primary sortas="cclosure_marshal_VOID__LONG">g_cclosure_marshal_VOID__LONG</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__LONG       (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, glong arg1, gpointer user_data)</literal>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding the instance and the <link linkend="glong"><type>glong</type></link> parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--ULONG" role="function">
<title>g_cclosure_marshal_VOID__ULONG ()</title>
<indexterm zone="g-cclosure-marshal-VOID--ULONG"><primary sortas="cclosure_marshal_VOID__ULONG">g_cclosure_marshal_VOID__ULONG</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__ULONG      (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, gulong arg1, gpointer user_data)</literal>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding the instance and the <link linkend="gulong"><type>gulong</type></link> parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--ENUM" role="function">
<title>g_cclosure_marshal_VOID__ENUM ()</title>
<indexterm zone="g-cclosure-marshal-VOID--ENUM"><primary sortas="cclosure_marshal_VOID__ENUM">g_cclosure_marshal_VOID__ENUM</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__ENUM       (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the <link linkend="gint"><type>gint</type></link> parameter denotes an enumeration type..</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding the instance and the enumeration parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--FLAGS" role="function">
<title>g_cclosure_marshal_VOID__FLAGS ()</title>
<indexterm zone="g-cclosure-marshal-VOID--FLAGS"><primary sortas="cclosure_marshal_VOID__FLAGS">g_cclosure_marshal_VOID__FLAGS</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__FLAGS      (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the <link linkend="gint"><type>gint</type></link> parameter denotes a flags type.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding the instance and the flags parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--FLOAT" role="function">
<title>g_cclosure_marshal_VOID__FLOAT ()</title>
<indexterm zone="g-cclosure-marshal-VOID--FLOAT"><primary sortas="cclosure_marshal_VOID__FLOAT">g_cclosure_marshal_VOID__FLOAT</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__FLOAT      (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, gfloat arg1, gpointer user_data)</literal>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding the instance and the <link linkend="gfloat"><type>gfloat</type></link> parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--DOUBLE" role="function">
<title>g_cclosure_marshal_VOID__DOUBLE ()</title>
<indexterm zone="g-cclosure-marshal-VOID--DOUBLE"><primary sortas="cclosure_marshal_VOID__DOUBLE">g_cclosure_marshal_VOID__DOUBLE</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__DOUBLE     (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, gdouble arg1, gpointer user_data)</literal>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding the instance and the <link linkend="gdouble"><type>gdouble</type></link> parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--STRING" role="function">
<title>g_cclosure_marshal_VOID__STRING ()</title>
<indexterm zone="g-cclosure-marshal-VOID--STRING"><primary sortas="cclosure_marshal_VOID__STRING">g_cclosure_marshal_VOID__STRING</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__STRING     (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data)</literal>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding the instance and the <link linkend="gchar"><type>gchar</type></link>* parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--PARAM" role="function">
<title>g_cclosure_marshal_VOID__PARAM ()</title>
<indexterm zone="g-cclosure-marshal-VOID--PARAM"><primary sortas="cclosure_marshal_VOID__PARAM">g_cclosure_marshal_VOID__PARAM</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__PARAM      (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data)</literal>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding the instance and the <link linkend="GParamSpec"><type>GParamSpec</type></link>* parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--BOXED" role="function">
<title>g_cclosure_marshal_VOID__BOXED ()</title>
<indexterm zone="g-cclosure-marshal-VOID--BOXED"><primary sortas="cclosure_marshal_VOID__BOXED">g_cclosure_marshal_VOID__BOXED</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__BOXED      (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data)</literal>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding the instance and the <link linkend="GBoxed"><type>GBoxed</type></link>* parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--POINTER" role="function">
<title>g_cclosure_marshal_VOID__POINTER ()</title>
<indexterm zone="g-cclosure-marshal-VOID--POINTER"><primary sortas="cclosure_marshal_VOID__POINTER">g_cclosure_marshal_VOID__POINTER</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__POINTER    (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, gpointer arg1, gpointer user_data)</literal>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding the instance and the <link linkend="gpointer"><type>gpointer</type></link> parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--OBJECT" role="function">
<title>g_cclosure_marshal_VOID__OBJECT ()</title>
<indexterm zone="g-cclosure-marshal-VOID--OBJECT"><primary sortas="cclosure_marshal_VOID__OBJECT">g_cclosure_marshal_VOID__OBJECT</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__OBJECT     (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, GOBject *arg1, gpointer user_data)</literal>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding the instance and the <link linkend="GObject"><type>GObject</type></link>* parameter
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-STRING--OBJECT-POINTER" role="function">
<title>g_cclosure_marshal_STRING__OBJECT_POINTER ()</title>
<indexterm zone="g-cclosure-marshal-STRING--OBJECT-POINTER"><primary sortas="cclosure_marshal_STRING__OBJECT_POINTER">g_cclosure_marshal_STRING__OBJECT_POINTER</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_STRING__OBJECT_POINTER
                                                        (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data)</literal>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link>, which can store the returned string
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 3
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding instance, arg1 and arg2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-VOID--UINT-POINTER" role="function">
<title>g_cclosure_marshal_VOID__UINT_POINTER ()</title>
<indexterm zone="g-cclosure-marshal-VOID--UINT-POINTER"><primary sortas="cclosure_marshal_VOID__UINT_POINTER">g_cclosure_marshal_VOID__UINT_POINTER</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_VOID__UINT_POINTER
                                                        (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data)</literal>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> ignored
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 3
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding instance, arg1 and arg2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-BOOLEAN--FLAGS" role="function">
<title>g_cclosure_marshal_BOOLEAN__FLAGS ()</title>
<indexterm zone="g-cclosure-marshal-BOOLEAN--FLAGS"><primary sortas="cclosure_marshal_BOOLEAN__FLAGS">g_cclosure_marshal_BOOLEAN__FLAGS</primary></indexterm><programlisting><link linkend="void">void</link>                g_cclosure_marshal_BOOLEAN__FLAGS   (<link linkend="GClosure">GClosure</link> *closure,
                                                         <link linkend="GValue">GValue</link> *return_value,
                                                         <link linkend="guint">guint</link> n_param_values,
                                                         const <link linkend="GValue">GValue</link> *param_values,
                                                         <link linkend="gpointer">gpointer</link> invocation_hint,
                                                         <link linkend="gpointer">gpointer</link> marshal_data);</programlisting>
<para>
A marshaller for a <link linkend="GCClosure"><type>GCClosure</type></link> with a callback of type
<literal>gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the <link linkend="gint"><type>gint</type></link> parameter
denotes a flags type.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GClosure"><type>GClosure</type></link> to which the marshaller belongs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>return_value</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> which can store the returned <link linkend="gboolean"><type>gboolean</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_param_values</parameter>&#160;:</term>
<listitem><simpara> 2
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_values</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> array holding instance and arg1
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>invocation_hint</parameter>&#160;:</term>
<listitem><simpara> the invocation hint given as the last argument
 to <link linkend="g-closure-invoke"><function>g_closure_invoke()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>marshal_data</parameter>&#160;:</term>
<listitem><simpara> additional data specified when registering the marshaller
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-cclosure-marshal-BOOL--FLAGS" role="macro">
<title>g_cclosure_marshal_BOOL__FLAGS</title>
<indexterm zone="g-cclosure-marshal-BOOL--FLAGS"><primary sortas="cclosure_marshal_BOOL__FLAGS">g_cclosure_marshal_BOOL__FLAGS</primary></indexterm><programlisting>#define             g_cclosure_marshal_BOOL__FLAGS</programlisting>
<para>
Another name for <link linkend="g-cclosure-marshal-BOOLEAN--FLAGS"><function>g_cclosure_marshal_BOOLEAN__FLAGS()</function></link>.</para>
<para>
</para></refsect2>

</refsect1>




</refentry>
