Initial commit
[platform/upstream/glib2.0.git] / docs / reference / gobject / html / gobject-Closures.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>Closures</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7 <link rel="home" href="index.html" title="GObject Reference Manual">
8 <link rel="up" href="rn01.html" title="API Reference">
9 <link rel="prev" href="gobject-Signals.html" title="Signals">
10 <link rel="next" href="gobject-Value-arrays.html" title="Value arrays">
11 <meta name="generator" content="GTK-Doc V1.13 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 <link rel="preface" href="pr01.html" title="Introduction">
14 <link rel="part" href="pt01.html" title="Part I. Concepts">
15 <link rel="chapter" href="chapter-intro.html" title="Background">
16 <link rel="chapter" href="chapter-gtype.html" title="The GLib Dynamic Type System">
17 <link rel="chapter" href="chapter-gobject.html" title="The GObject base class">
18 <link rel="chapter" href="chapter-signal.html" title="The GObject messaging system">
19 <link rel="reference" href="rn01.html" title="API Reference">
20 <link rel="reference" href="rn02.html" title="Tools Reference">
21 <link rel="part" href="pt02.html" title="Part IV. Tutorial">
22 <link rel="chapter" href="howto-gobject.html" title="How to define and implement a new GObject">
23 <link rel="chapter" href="howto-interface.html" title="How to define and implement interfaces">
24 <link rel="chapter" href="howto-signals.html" title="How to create and use signals">
25 <link rel="part" href="pt03.html" title="Part V. Related Tools">
26 <link rel="chapter" href="tools-vala.html" title="Vala">
27 <link rel="chapter" href="tools-gob.html" title="GObject builder">
28 <link rel="chapter" href="tools-ginspector.html" title="Graphical inspection of GObjects">
29 <link rel="chapter" href="tools-refdb.html" title="Debugging reference count problems">
30 <link rel="chapter" href="tools-gtkdoc.html" title="Writing API docs">
31 <link rel="index" href="api-index-full.html" title="Index">
32 <link rel="index" href="api-index-deprecated.html" title="Index of deprecated symbols">
33 <link rel="index" href="api-index-2-2.html" title="Index of new symbols in 2.2">
34 <link rel="index" href="api-index-2-4.html" title="Index of new symbols in 2.4">
35 <link rel="index" href="api-index-2-6.html" title="Index of new symbols in 2.6">
36 <link rel="index" href="api-index-2-8.html" title="Index of new symbols in 2.8">
37 <link rel="index" href="api-index-2-10.html" title="Index of new symbols in 2.10">
38 <link rel="index" href="api-index-2-12.html" title="Index of new symbols in 2.12">
39 <link rel="index" href="api-index-2-14.html" title="Index of new symbols in 2.14">
40 <link rel="index" href="api-index-2-18.html" title="Index of new symbols in 2.18">
41 <link rel="index" href="api-index-2-22.html" title="Index of new symbols in 2.22">
42 <link rel="index" href="api-index-2-24.html" title="Index of new symbols in 2.24">
43 </head>
44 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
45 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
46 <tr valign="middle">
47 <td><a accesskey="p" href="gobject-Signals.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
48 <td><a accesskey="u" href="rn01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
49 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
50 <th width="100%" align="center">GObject Reference Manual</th>
51 <td><a accesskey="n" href="gobject-Value-arrays.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
52 </tr>
53 <tr><td colspan="5" class="shortcuts">
54 <a href="#gobject-Closures.synopsis" class="shortcut">Top</a>
55                    | 
56                   <a href="#gobject-Closures.description" class="shortcut">Description</a>
57 </td></tr>
58 </table>
59 <div class="refentry" title="Closures">
60 <a name="gobject-Closures"></a><div class="titlepage"></div>
61 <div class="refnamediv"><table width="100%"><tr>
62 <td valign="top">
63 <h2><span class="refentrytitle"><a name="gobject-Closures.top_of_page"></a>Closures</span></h2>
64 <p>Closures — Functions as first-class objects</p>
65 </td>
66 <td valign="top" align="right"></td>
67 </tr></table></div>
68 <div class="refsynopsisdiv" title="Synopsis">
69 <a name="gobject-Closures.synopsis"></a><h2>Synopsis</h2>
70 <pre class="synopsis">
71 #include &lt;glib-object.h&gt;
72
73 #define             <a class="link" href="gobject-Closures.html#G-CLOSURE-NEEDS-MARSHAL:CAPS" title="G_CLOSURE_NEEDS_MARSHAL()">G_CLOSURE_NEEDS_MARSHAL</a>             (closure)
74 #define             <a class="link" href="gobject-Closures.html#G-CLOSURE-N-NOTIFIERS:CAPS" title="G_CLOSURE_N_NOTIFIERS()">G_CLOSURE_N_NOTIFIERS</a>               (cl)
75 #define             <a class="link" href="gobject-Closures.html#G-CCLOSURE-SWAP-DATA:CAPS" title="G_CCLOSURE_SWAP_DATA()">G_CCLOSURE_SWAP_DATA</a>                (cclosure)
76 #define             <a class="link" href="gobject-Closures.html#G-CALLBACK:CAPS" title="G_CALLBACK()">G_CALLBACK</a>                          (f)
77 <span class="returnvalue">void</span>                (<a class="link" href="gobject-Closures.html#GCallback" title="GCallback ()">*GCallback</a>)                        (void);
78                     <a class="link" href="gobject-Closures.html#GClosure" title="GClosure">GClosure</a>;
79 #define             <a class="link" href="gobject-Closures.html#G-TYPE-CLOSURE:CAPS" title="G_TYPE_CLOSURE">G_TYPE_CLOSURE</a>
80                     <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure">GCClosure</a>;
81 <span class="returnvalue">void</span>                (<a class="link" href="gobject-Closures.html#GClosureMarshal" title="GClosureMarshal ()">*GClosureMarshal</a>)                  (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
82                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
83                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
84                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
85                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
86                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
87 <span class="returnvalue">void</span>                (<a class="link" href="gobject-Closures.html#GClosureNotify" title="GClosureNotify ()">*GClosureNotify</a>)                   (<a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> data,
88                                                          <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure);
89 <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a>*           <a class="link" href="gobject-Closures.html#g-cclosure-new" title="g_cclosure_new ()">g_cclosure_new</a>                      (<a class="link" href="gobject-Closures.html#GCallback" title="GCallback ()"><span class="returnvalue">GCallback</span></a> callback_func,
90                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> user_data,
91                                                          <a class="link" href="gobject-Closures.html#GClosureNotify" title="GClosureNotify ()"><span class="returnvalue">GClosureNotify</span></a> destroy_data);
92 <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a>*           <a class="link" href="gobject-Closures.html#g-cclosure-new-swap" title="g_cclosure_new_swap ()">g_cclosure_new_swap</a>                 (<a class="link" href="gobject-Closures.html#GCallback" title="GCallback ()"><span class="returnvalue">GCallback</span></a> callback_func,
93                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> user_data,
94                                                          <a class="link" href="gobject-Closures.html#GClosureNotify" title="GClosureNotify ()"><span class="returnvalue">GClosureNotify</span></a> destroy_data);
95 <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a>*           <a class="link" href="gobject-Closures.html#g-cclosure-new-object" title="g_cclosure_new_object ()">g_cclosure_new_object</a>               (<a class="link" href="gobject-Closures.html#GCallback" title="GCallback ()"><span class="returnvalue">GCallback</span></a> callback_func,
96                                                          <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="returnvalue">GObject</span></a> *object);
97 <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a>*           <a class="link" href="gobject-Closures.html#g-cclosure-new-object-swap" title="g_cclosure_new_object_swap ()">g_cclosure_new_object_swap</a>          (<a class="link" href="gobject-Closures.html#GCallback" title="GCallback ()"><span class="returnvalue">GCallback</span></a> callback_func,
98                                                          <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="returnvalue">GObject</span></a> *object);
99 <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a>*           <a class="link" href="gobject-Closures.html#g-closure-new-object" title="g_closure_new_object ()">g_closure_new_object</a>                (<a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> sizeof_closure,
100                                                          <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="returnvalue">GObject</span></a> *object);
101 <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a>*           <a class="link" href="gobject-Closures.html#g-closure-ref" title="g_closure_ref ()">g_closure_ref</a>                       (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure);
102 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-closure-sink" title="g_closure_sink ()">g_closure_sink</a>                      (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure);
103 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-closure-unref" title="g_closure_unref ()">g_closure_unref</a>                     (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure);
104 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()">g_closure_invoke</a>                    (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
105                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
106                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
107                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
108                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint);
109 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-closure-invalidate" title="g_closure_invalidate ()">g_closure_invalidate</a>                (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure);
110 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-closure-add-finalize-notifier" title="g_closure_add_finalize_notifier ()">g_closure_add_finalize_notifier</a>     (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
111                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> notify_data,
112                                                          <a class="link" href="gobject-Closures.html#GClosureNotify" title="GClosureNotify ()"><span class="returnvalue">GClosureNotify</span></a> notify_func);
113 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-closure-add-invalidate-notifier" title="g_closure_add_invalidate_notifier ()">g_closure_add_invalidate_notifier</a>   (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
114                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> notify_data,
115                                                          <a class="link" href="gobject-Closures.html#GClosureNotify" title="GClosureNotify ()"><span class="returnvalue">GClosureNotify</span></a> notify_func);
116 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-closure-remove-finalize-notifier" title="g_closure_remove_finalize_notifier ()">g_closure_remove_finalize_notifier</a>  (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
117                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> notify_data,
118                                                          <a class="link" href="gobject-Closures.html#GClosureNotify" title="GClosureNotify ()"><span class="returnvalue">GClosureNotify</span></a> notify_func);
119 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-closure-remove-invalidate-notifier" title="g_closure_remove_invalidate_notifier ()">g_closure_remove_invalidate_notifier</a>
120                                                         (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
121                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> notify_data,
122                                                          <a class="link" href="gobject-Closures.html#GClosureNotify" title="GClosureNotify ()"><span class="returnvalue">GClosureNotify</span></a> notify_func);
123 <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a>*           <a class="link" href="gobject-Closures.html#g-closure-new-simple" title="g_closure_new_simple ()">g_closure_new_simple</a>                (<a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> sizeof_closure,
124                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> data);
125 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-closure-set-marshal" title="g_closure_set_marshal ()">g_closure_set_marshal</a>               (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
126                                                          <a class="link" href="gobject-Closures.html#GClosureMarshal" title="GClosureMarshal ()"><span class="returnvalue">GClosureMarshal</span></a> marshal);
127 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-closure-add-marshal-guards" title="g_closure_add_marshal_guards ()">g_closure_add_marshal_guards</a>        (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
128                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> pre_marshal_data,
129                                                          <a class="link" href="gobject-Closures.html#GClosureNotify" title="GClosureNotify ()"><span class="returnvalue">GClosureNotify</span></a> pre_marshal_notify,
130                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> post_marshal_data,
131                                                          <a class="link" href="gobject-Closures.html#GClosureNotify" title="GClosureNotify ()"><span class="returnvalue">GClosureNotify</span></a> post_marshal_notify);
132 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-closure-set-meta-marshal" title="g_closure_set_meta_marshal ()">g_closure_set_meta_marshal</a>          (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
133                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data,
134                                                          <a class="link" href="gobject-Closures.html#GClosureMarshal" title="GClosureMarshal ()"><span class="returnvalue">GClosureMarshal</span></a> meta_marshal);
135 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-source-set-closure" title="g_source_set_closure ()">g_source_set_closure</a>                (<a href="./../glib/glib/glib-The-Main-Event-Loop.html#GSource"><span class="returnvalue">GSource</span></a> *source,
136                                                          <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure);
137 #define             <a class="link" href="gobject-Closures.html#G-TYPE-IO-CHANNEL:CAPS" title="G_TYPE_IO_CHANNEL">G_TYPE_IO_CHANNEL</a>
138 #define             <a class="link" href="gobject-Closures.html#G-TYPE-IO-CONDITION:CAPS" title="G_TYPE_IO_CONDITION">G_TYPE_IO_CONDITION</a>
139
140 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--VOID" title="g_cclosure_marshal_VOID__VOID ()">g_cclosure_marshal_VOID__VOID</a>       (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
141                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
142                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
143                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
144                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
145                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
146 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--BOOLEAN" title="g_cclosure_marshal_VOID__BOOLEAN ()">g_cclosure_marshal_VOID__BOOLEAN</a>    (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
147                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
148                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
149                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
150                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
151                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
152 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--CHAR" title="g_cclosure_marshal_VOID__CHAR ()">g_cclosure_marshal_VOID__CHAR</a>       (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
153                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
154                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
155                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
156                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
157                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
158 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--UCHAR" title="g_cclosure_marshal_VOID__UCHAR ()">g_cclosure_marshal_VOID__UCHAR</a>      (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
159                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
160                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
161                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
162                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
163                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
164 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--INT" title="g_cclosure_marshal_VOID__INT ()">g_cclosure_marshal_VOID__INT</a>        (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
165                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
166                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
167                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
168                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
169                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
170 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--UINT" title="g_cclosure_marshal_VOID__UINT ()">g_cclosure_marshal_VOID__UINT</a>       (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
171                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
172                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
173                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
174                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
175                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
176 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--LONG" title="g_cclosure_marshal_VOID__LONG ()">g_cclosure_marshal_VOID__LONG</a>       (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
177                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
178                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
179                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
180                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
181                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
182 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--ULONG" title="g_cclosure_marshal_VOID__ULONG ()">g_cclosure_marshal_VOID__ULONG</a>      (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
183                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
184                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
185                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
186                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
187                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
188 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--ENUM" title="g_cclosure_marshal_VOID__ENUM ()">g_cclosure_marshal_VOID__ENUM</a>       (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
189                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
190                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
191                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
192                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
193                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
194 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--FLAGS" title="g_cclosure_marshal_VOID__FLAGS ()">g_cclosure_marshal_VOID__FLAGS</a>      (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
195                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
196                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
197                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
198                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
199                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
200 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--FLOAT" title="g_cclosure_marshal_VOID__FLOAT ()">g_cclosure_marshal_VOID__FLOAT</a>      (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
201                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
202                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
203                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
204                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
205                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
206 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--DOUBLE" title="g_cclosure_marshal_VOID__DOUBLE ()">g_cclosure_marshal_VOID__DOUBLE</a>     (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
207                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
208                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
209                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
210                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
211                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
212 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--STRING" title="g_cclosure_marshal_VOID__STRING ()">g_cclosure_marshal_VOID__STRING</a>     (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
213                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
214                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
215                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
216                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
217                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
218 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--PARAM" title="g_cclosure_marshal_VOID__PARAM ()">g_cclosure_marshal_VOID__PARAM</a>      (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
219                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
220                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
221                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
222                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
223                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
224 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--BOXED" title="g_cclosure_marshal_VOID__BOXED ()">g_cclosure_marshal_VOID__BOXED</a>      (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
225                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
226                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
227                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
228                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
229                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
230 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--POINTER" title="g_cclosure_marshal_VOID__POINTER ()">g_cclosure_marshal_VOID__POINTER</a>    (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
231                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
232                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
233                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
234                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
235                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
236 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--OBJECT" title="g_cclosure_marshal_VOID__OBJECT ()">g_cclosure_marshal_VOID__OBJECT</a>     (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
237                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
238                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
239                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
240                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
241                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
242 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-STRING--OBJECT-POINTER" title="g_cclosure_marshal_STRING__OBJECT_POINTER ()">g_cclosure_marshal_STRING__OBJECT_POINTER</a>
243                                                         (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
244                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
245                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
246                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
247                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
248                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
249 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-VOID--UINT-POINTER" title="g_cclosure_marshal_VOID__UINT_POINTER ()">g_cclosure_marshal_VOID__UINT_POINTER</a>
250                                                         (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
251                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
252                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
253                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
254                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
255                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
256 <span class="returnvalue">void</span>                <a class="link" href="gobject-Closures.html#g-cclosure-marshal-BOOLEAN--FLAGS" title="g_cclosure_marshal_BOOLEAN__FLAGS ()">g_cclosure_marshal_BOOLEAN__FLAGS</a>   (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
257                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
258                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
259                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
260                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
261                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);
262 #define             <a class="link" href="gobject-Closures.html#g-cclosure-marshal-BOOL--FLAGS" title="g_cclosure_marshal_BOOL__FLAGS">g_cclosure_marshal_BOOL__FLAGS</a>
263 </pre>
264 </div>
265 <div class="refsect1" title="Description">
266 <a name="gobject-Closures.description"></a><h2>Description</h2>
267 <p>
268 A <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> represents a callback supplied by the programmer. It
269 will generally comprise a function of some kind and a marshaller
270 used to call it. It is the reponsibility of the marshaller to
271 convert the arguments for the invocation from <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a>s into
272 a suitable form, perform the callback on the converted arguments,
273 and transform the return value back into a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a>.
274 </p>
275 <p>
276 In the case of C programs, a closure usually just holds a pointer
277 to a function and maybe a data argument, and the marshaller
278 converts between <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> and native C types. The GObject
279 library provides the <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> type for this purpose. Bindings for
280 other languages need marshallers which convert between <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a>s and suitable representations in the runtime of the language in
281 order to use functions written in that languages as callbacks.
282 </p>
283 <p>
284 Within GObject, closures play an important role in the
285 implementation of signals. When a signal is registered, the
286 <em class="parameter"><code>c_marshaller</code></em> argument to <a class="link" href="gobject-Signals.html#g-signal-new" title="g_signal_new ()"><code class="function">g_signal_new()</code></a> specifies the default C
287 marshaller for any closure which is connected to this
288 signal. GObject provides a number of C marshallers for this
289 purpose, see the g_cclosure_marshal_*() functions. Additional C
290 marshallers can be generated with the <a href="glib-genmarshal.html">glib-genmarshal</a> utility.  Closures
291 can be explicitly connected to signals with
292 <a class="link" href="gobject-Signals.html#g-signal-connect-closure" title="g_signal_connect_closure ()"><code class="function">g_signal_connect_closure()</code></a>, but it usually more convenient to let
293 GObject create a closure automatically by using one of the
294 g_signal_connect_*() functions which take a callback function/user
295 data pair.
296 </p>
297 <p>
298 Using closures has a number of important advantages over a simple
299 callback function/data pointer combination:
300 </p>
301 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
302 <li class="listitem"><p>
303 Closures allow the callee to get the types of the callback parameters,
304 which means that language bindings don't have to write individual glue
305 for each callback type.
306 </p></li>
307 <li class="listitem"><p>
308 The reference counting of <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> makes it easy to handle reentrancy
309 right; if a callback is removed while it is being invoked, the closure
310 and its parameters won't be freed until the invocation finishes.
311 </p></li>
312 <li class="listitem"><p>
313 <a class="link" href="gobject-Closures.html#g-closure-invalidate" title="g_closure_invalidate ()"><code class="function">g_closure_invalidate()</code></a> and invalidation notifiers allow callbacks to be
314 automatically removed when the objects they point to go away.
315 </p></li>
316 </ul></div>
317 </div>
318 <div class="refsect1" title="Details">
319 <a name="gobject-Closures.details"></a><h2>Details</h2>
320 <div class="refsect2" title="G_CLOSURE_NEEDS_MARSHAL()">
321 <a name="G-CLOSURE-NEEDS-MARSHAL:CAPS"></a><h3>G_CLOSURE_NEEDS_MARSHAL()</h3>
322 <pre class="programlisting">#define G_CLOSURE_NEEDS_MARSHAL(closure) (((GClosure*) (closure))-&gt;marshal == NULL)
323 </pre>
324 <p>
325 Check if the closure still needs a marshaller. See <a class="link" href="gobject-Closures.html#g-closure-set-marshal" title="g_closure_set_marshal ()"><code class="function">g_closure_set_marshal()</code></a>.</p>
326 <div class="variablelist"><table border="0">
327 <col align="left" valign="top">
328 <tbody>
329 <tr>
330 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
331 <td> a <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>
332 </td>
333 </tr>
334 <tr>
335 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
336 <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if a <a class="link" href="gobject-Closures.html#GClosureMarshal" title="GClosureMarshal ()"><span class="type">GClosureMarshal</span></a> marshaller has not yet been set on 
337 <em class="parameter"><code>closure</code></em>.
338 </td>
339 </tr>
340 </tbody>
341 </table></div>
342 </div>
343 <hr>
344 <div class="refsect2" title="G_CLOSURE_N_NOTIFIERS()">
345 <a name="G-CLOSURE-N-NOTIFIERS:CAPS"></a><h3>G_CLOSURE_N_NOTIFIERS()</h3>
346 <pre class="programlisting">#define             G_CLOSURE_N_NOTIFIERS(cl)</pre>
347 <p>
348 Get the total number of notifiers connected with the closure <em class="parameter"><code>cl</code></em>. 
349 The count includes the meta marshaller, the finalize and invalidate notifiers 
350 and the marshal guards. Note that each guard counts as two notifiers. 
351 See <a class="link" href="gobject-Closures.html#g-closure-set-meta-marshal" title="g_closure_set_meta_marshal ()"><code class="function">g_closure_set_meta_marshal()</code></a>, <a class="link" href="gobject-Closures.html#g-closure-add-finalize-notifier" title="g_closure_add_finalize_notifier ()"><code class="function">g_closure_add_finalize_notifier()</code></a>,
352 <a class="link" href="gobject-Closures.html#g-closure-add-invalidate-notifier" title="g_closure_add_invalidate_notifier ()"><code class="function">g_closure_add_invalidate_notifier()</code></a> and <a class="link" href="gobject-Closures.html#g-closure-add-marshal-guards" title="g_closure_add_marshal_guards ()"><code class="function">g_closure_add_marshal_guards()</code></a>.</p>
353 <div class="variablelist"><table border="0">
354 <col align="left" valign="top">
355 <tbody>
356 <tr>
357 <td><p><span class="term"><em class="parameter"><code>cl</code></em> :</span></p></td>
358 <td> a <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>
359 </td>
360 </tr>
361 <tr>
362 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
363 <td> number of notifiers
364 </td>
365 </tr>
366 </tbody>
367 </table></div>
368 </div>
369 <hr>
370 <div class="refsect2" title="G_CCLOSURE_SWAP_DATA()">
371 <a name="G-CCLOSURE-SWAP-DATA:CAPS"></a><h3>G_CCLOSURE_SWAP_DATA()</h3>
372 <pre class="programlisting">#define G_CCLOSURE_SWAP_DATA(cclosure)      (((GClosure*) (cclosure))-&gt;derivative_flag)
373 </pre>
374 <p>
375 Checks whether the user data of the <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> should be passed as the
376 first parameter to the callback. See <a class="link" href="gobject-Closures.html#g-cclosure-new-swap" title="g_cclosure_new_swap ()"><code class="function">g_cclosure_new_swap()</code></a>.</p>
377 <div class="variablelist"><table border="0">
378 <col align="left" valign="top">
379 <tbody>
380 <tr>
381 <td><p><span class="term"><em class="parameter"><code>cclosure</code></em> :</span></p></td>
382 <td> a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a>
383 </td>
384 </tr>
385 <tr>
386 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
387 <td> <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if data has to be swapped.
388 </td>
389 </tr>
390 </tbody>
391 </table></div>
392 </div>
393 <hr>
394 <div class="refsect2" title="G_CALLBACK()">
395 <a name="G-CALLBACK:CAPS"></a><h3>G_CALLBACK()</h3>
396 <pre class="programlisting">#define G_CALLBACK(f)                       ((GCallback) (f))
397 </pre>
398 <p>
399 Cast a function pointer to a <a class="link" href="gobject-Closures.html#GCallback" title="GCallback ()"><span class="type">GCallback</span></a>.</p>
400 <div class="variablelist"><table border="0">
401 <col align="left" valign="top">
402 <tbody><tr>
403 <td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td>
404 <td> a function pointer.
405 </td>
406 </tr></tbody>
407 </table></div>
408 </div>
409 <hr>
410 <div class="refsect2" title="GCallback ()">
411 <a name="GCallback"></a><h3>GCallback ()</h3>
412 <pre class="programlisting"><span class="returnvalue">void</span>                (*GCallback)                        (void);</pre>
413 <p>
414 The type used for callback functions in structure definitions and function 
415 signatures. This doesn't mean that all callback functions must take no 
416 parameters and return void. The required signature of a callback function 
417 is determined by the context in which is used (e.g. the signal to which it 
418 is connected). Use <a class="link" href="gobject-Closures.html#G-CALLBACK:CAPS" title="G_CALLBACK()"><code class="function">G_CALLBACK()</code></a> to cast the callback function to a <a class="link" href="gobject-Closures.html#GCallback" title="GCallback ()"><span class="type">GCallback</span></a>.</p>
419 </div>
420 <hr>
421 <div class="refsect2" title="GClosure">
422 <a name="GClosure"></a><h3>GClosure</h3>
423 <pre class="programlisting">typedef struct {
424   volatile              guint    in_marshal : 1;
425   volatile              guint    is_invalid : 1;
426 } GClosure;
427 </pre>
428 <p>
429 A <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> represents a callback supplied by the programmer.</p>
430 <div class="variablelist"><table border="0">
431 <col align="left" valign="top">
432 <tbody>
433 <tr>
434 <td><p><span class="term">volatile               <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="GClosure.in-marshal"></a>in_marshal</code></em> : 1;</span></p></td>
435 <td> Indicates whether the closure is currently being invoked with 
436  <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
437 </td>
438 </tr>
439 <tr>
440 <td><p><span class="term">volatile               <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="GClosure.is-invalid"></a>is_invalid</code></em> : 1;</span></p></td>
441 <td> Indicates whether the closure has been invalidated by 
442  <a class="link" href="gobject-Closures.html#g-closure-invalidate" title="g_closure_invalidate ()"><code class="function">g_closure_invalidate()</code></a>
443 </td>
444 </tr>
445 </tbody>
446 </table></div>
447 </div>
448 <hr>
449 <div class="refsect2" title="G_TYPE_CLOSURE">
450 <a name="G-TYPE-CLOSURE:CAPS"></a><h3>G_TYPE_CLOSURE</h3>
451 <pre class="programlisting">#define G_TYPE_CLOSURE             (g_closure_get_type ())
452 </pre>
453 <p>
454 The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> for <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>.</p>
455 </div>
456 <hr>
457 <div class="refsect2" title="GCClosure">
458 <a name="GCClosure"></a><h3>GCClosure</h3>
459 <pre class="programlisting">typedef struct {
460   GClosure closure;
461   gpointer callback;
462 } GCClosure;
463 </pre>
464 <p>
465 A <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> is a specialization of <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> for C function callbacks.</p>
466 <div class="variablelist"><table border="0">
467 <col align="left" valign="top">
468 <tbody>
469 <tr>
470 <td><p><span class="term"><a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> <em class="structfield"><code><a name="GCClosure.closure"></a>closure</code></em>;</span></p></td>
471 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>
472 </td>
473 </tr>
474 <tr>
475 <td><p><span class="term"><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> <em class="structfield"><code><a name="GCClosure.callback"></a>callback</code></em>;</span></p></td>
476 <td> the callback function
477 </td>
478 </tr>
479 </tbody>
480 </table></div>
481 </div>
482 <hr>
483 <div class="refsect2" title="GClosureMarshal ()">
484 <a name="GClosureMarshal"></a><h3>GClosureMarshal ()</h3>
485 <pre class="programlisting"><span class="returnvalue">void</span>                (*GClosureMarshal)                  (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
486                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
487                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
488                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
489                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
490                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
491 <p>
492 The type used for marshaller functions.</p>
493 <div class="variablelist"><table border="0">
494 <col align="left" valign="top">
495 <tbody>
496 <tr>
497 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
498 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
499 </td>
500 </tr>
501 <tr>
502 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
503 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> to store the return value. May be <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the
504  callback of <em class="parameter"><code>closure</code></em> doesn't return a value.
505 </td>
506 </tr>
507 <tr>
508 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
509 <td> the length of the <em class="parameter"><code>param_values</code></em> array
510 </td>
511 </tr>
512 <tr>
513 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
514 <td> an array of <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a>s holding the arguments on
515  which to invoke the callback of <em class="parameter"><code>closure</code></em>
516 </td>
517 </tr>
518 <tr>
519 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
520 <td> the invocation hint given as the last argument
521  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
522 </td>
523 </tr>
524 <tr>
525 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
526 <td> additional data specified when registering the marshaller,
527  see <a class="link" href="gobject-Closures.html#g-closure-set-marshal" title="g_closure_set_marshal ()"><code class="function">g_closure_set_marshal()</code></a> and <a class="link" href="gobject-Closures.html#g-closure-set-meta-marshal" title="g_closure_set_meta_marshal ()"><code class="function">g_closure_set_meta_marshal()</code></a>
528 </td>
529 </tr>
530 </tbody>
531 </table></div>
532 </div>
533 <hr>
534 <div class="refsect2" title="GClosureNotify ()">
535 <a name="GClosureNotify"></a><h3>GClosureNotify ()</h3>
536 <pre class="programlisting"><span class="returnvalue">void</span>                (*GClosureNotify)                   (<a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> data,
537                                                          <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure);</pre>
538 <p>
539 The type used for the various notification callbacks which can be registered
540 on closures.</p>
541 <div class="variablelist"><table border="0">
542 <col align="left" valign="top">
543 <tbody>
544 <tr>
545 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
546 <td> data specified when registering the notification callback
547 </td>
548 </tr>
549 <tr>
550 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
551 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> on which the notification is emitted
552 </td>
553 </tr>
554 </tbody>
555 </table></div>
556 </div>
557 <hr>
558 <div class="refsect2" title="g_cclosure_new ()">
559 <a name="g-cclosure-new"></a><h3>g_cclosure_new ()</h3>
560 <pre class="programlisting"><a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a>*           g_cclosure_new                      (<a class="link" href="gobject-Closures.html#GCallback" title="GCallback ()"><span class="returnvalue">GCallback</span></a> callback_func,
561                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> user_data,
562                                                          <a class="link" href="gobject-Closures.html#GClosureNotify" title="GClosureNotify ()"><span class="returnvalue">GClosureNotify</span></a> destroy_data);</pre>
563 <p>
564 Creates a new closure which invokes <em class="parameter"><code>callback_func</code></em> with <em class="parameter"><code>user_data</code></em> as
565 the last parameter.</p>
566 <div class="variablelist"><table border="0">
567 <col align="left" valign="top">
568 <tbody>
569 <tr>
570 <td><p><span class="term"><em class="parameter"><code>callback_func</code></em> :</span></p></td>
571 <td> the function to invoke
572 </td>
573 </tr>
574 <tr>
575 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
576 <td> user data to pass to <em class="parameter"><code>callback_func</code></em>
577 </td>
578 </tr>
579 <tr>
580 <td><p><span class="term"><em class="parameter"><code>destroy_data</code></em> :</span></p></td>
581 <td> destroy notify to be called when <em class="parameter"><code>user_data</code></em> is no longer used
582 </td>
583 </tr>
584 <tr>
585 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
586 <td> a new <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a>
587 </td>
588 </tr>
589 </tbody>
590 </table></div>
591 </div>
592 <hr>
593 <div class="refsect2" title="g_cclosure_new_swap ()">
594 <a name="g-cclosure-new-swap"></a><h3>g_cclosure_new_swap ()</h3>
595 <pre class="programlisting"><a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a>*           g_cclosure_new_swap                 (<a class="link" href="gobject-Closures.html#GCallback" title="GCallback ()"><span class="returnvalue">GCallback</span></a> callback_func,
596                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> user_data,
597                                                          <a class="link" href="gobject-Closures.html#GClosureNotify" title="GClosureNotify ()"><span class="returnvalue">GClosureNotify</span></a> destroy_data);</pre>
598 <p>
599 Creates a new closure which invokes <em class="parameter"><code>callback_func</code></em> with <em class="parameter"><code>user_data</code></em> as
600 the first parameter.</p>
601 <div class="variablelist"><table border="0">
602 <col align="left" valign="top">
603 <tbody>
604 <tr>
605 <td><p><span class="term"><em class="parameter"><code>callback_func</code></em> :</span></p></td>
606 <td> the function to invoke
607 </td>
608 </tr>
609 <tr>
610 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
611 <td> user data to pass to <em class="parameter"><code>callback_func</code></em>
612 </td>
613 </tr>
614 <tr>
615 <td><p><span class="term"><em class="parameter"><code>destroy_data</code></em> :</span></p></td>
616 <td> destroy notify to be called when <em class="parameter"><code>user_data</code></em> is no longer used
617 </td>
618 </tr>
619 <tr>
620 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
621 <td> a new <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a>
622 </td>
623 </tr>
624 </tbody>
625 </table></div>
626 </div>
627 <hr>
628 <div class="refsect2" title="g_cclosure_new_object ()">
629 <a name="g-cclosure-new-object"></a><h3>g_cclosure_new_object ()</h3>
630 <pre class="programlisting"><a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a>*           g_cclosure_new_object               (<a class="link" href="gobject-Closures.html#GCallback" title="GCallback ()"><span class="returnvalue">GCallback</span></a> callback_func,
631                                                          <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="returnvalue">GObject</span></a> *object);</pre>
632 <p>
633 A variant of <a class="link" href="gobject-Closures.html#g-cclosure-new" title="g_cclosure_new ()"><code class="function">g_cclosure_new()</code></a> which uses <em class="parameter"><code>object</code></em> as <em class="parameter"><code>user_data</code></em> and
634 calls <a class="link" href="gobject-The-Base-Object-Type.html#g-object-watch-closure" title="g_object_watch_closure ()"><code class="function">g_object_watch_closure()</code></a> on <em class="parameter"><code>object</code></em> and the created
635 closure. This function is useful when you have a callback closely
636 associated with a <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>, and want the callback to no longer run
637 after the object is is freed.</p>
638 <div class="variablelist"><table border="0">
639 <col align="left" valign="top">
640 <tbody>
641 <tr>
642 <td><p><span class="term"><em class="parameter"><code>callback_func</code></em> :</span></p></td>
643 <td> the function to invoke
644 </td>
645 </tr>
646 <tr>
647 <td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
648 <td> a <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> pointer to pass to <em class="parameter"><code>callback_func</code></em>
649 </td>
650 </tr>
651 <tr>
652 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
653 <td> a new <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a>
654 </td>
655 </tr>
656 </tbody>
657 </table></div>
658 </div>
659 <hr>
660 <div class="refsect2" title="g_cclosure_new_object_swap ()">
661 <a name="g-cclosure-new-object-swap"></a><h3>g_cclosure_new_object_swap ()</h3>
662 <pre class="programlisting"><a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a>*           g_cclosure_new_object_swap          (<a class="link" href="gobject-Closures.html#GCallback" title="GCallback ()"><span class="returnvalue">GCallback</span></a> callback_func,
663                                                          <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="returnvalue">GObject</span></a> *object);</pre>
664 <p>
665 A variant of <a class="link" href="gobject-Closures.html#g-cclosure-new-swap" title="g_cclosure_new_swap ()"><code class="function">g_cclosure_new_swap()</code></a> which uses <em class="parameter"><code>object</code></em> as <em class="parameter"><code>user_data</code></em>
666 and calls <a class="link" href="gobject-The-Base-Object-Type.html#g-object-watch-closure" title="g_object_watch_closure ()"><code class="function">g_object_watch_closure()</code></a> on <em class="parameter"><code>object</code></em> and the created
667 closure. This function is useful when you have a callback closely
668 associated with a <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>, and want the callback to no longer run
669 after the object is is freed.</p>
670 <div class="variablelist"><table border="0">
671 <col align="left" valign="top">
672 <tbody>
673 <tr>
674 <td><p><span class="term"><em class="parameter"><code>callback_func</code></em> :</span></p></td>
675 <td> the function to invoke
676 </td>
677 </tr>
678 <tr>
679 <td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
680 <td> a <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> pointer to pass to <em class="parameter"><code>callback_func</code></em>
681 </td>
682 </tr>
683 <tr>
684 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
685 <td> a new <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a>
686 </td>
687 </tr>
688 </tbody>
689 </table></div>
690 </div>
691 <hr>
692 <div class="refsect2" title="g_closure_new_object ()">
693 <a name="g-closure-new-object"></a><h3>g_closure_new_object ()</h3>
694 <pre class="programlisting"><a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a>*           g_closure_new_object                (<a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> sizeof_closure,
695                                                          <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="returnvalue">GObject</span></a> *object);</pre>
696 <p>
697 A variant of <a class="link" href="gobject-Closures.html#g-closure-new-simple" title="g_closure_new_simple ()"><code class="function">g_closure_new_simple()</code></a> which stores <em class="parameter"><code>object</code></em> in the
698 <em class="parameter"><code>data</code></em> field of the closure and calls <a class="link" href="gobject-The-Base-Object-Type.html#g-object-watch-closure" title="g_object_watch_closure ()"><code class="function">g_object_watch_closure()</code></a> on
699 <em class="parameter"><code>object</code></em> and the created closure. This function is mainly useful
700 when implementing new types of closures.</p>
701 <div class="variablelist"><table border="0">
702 <col align="left" valign="top">
703 <tbody>
704 <tr>
705 <td><p><span class="term"><em class="parameter"><code>sizeof_closure</code></em> :</span></p></td>
706 <td> the size of the structure to allocate, must be at least
707  <code class="literal">sizeof (GClosure)</code>
708 </td>
709 </tr>
710 <tr>
711 <td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
712 <td> a <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> pointer to store in the <em class="parameter"><code>data</code></em> field of the newly
713  allocated <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>
714 </td>
715 </tr>
716 <tr>
717 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
718 <td> a newly allocated <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>
719 </td>
720 </tr>
721 </tbody>
722 </table></div>
723 </div>
724 <hr>
725 <div class="refsect2" title="g_closure_ref ()">
726 <a name="g-closure-ref"></a><h3>g_closure_ref ()</h3>
727 <pre class="programlisting"><a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a>*           g_closure_ref                       (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure);</pre>
728 <p>
729 Increments the reference count on a closure to force it staying
730 alive while the caller holds a pointer to it.</p>
731 <div class="variablelist"><table border="0">
732 <col align="left" valign="top">
733 <tbody>
734 <tr>
735 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
736 <td> <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to increment the reference count on
737 </td>
738 </tr>
739 <tr>
740 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
741 <td> The <em class="parameter"><code>closure</code></em> passed in, for convenience
742 </td>
743 </tr>
744 </tbody>
745 </table></div>
746 </div>
747 <hr>
748 <div class="refsect2" title="g_closure_sink ()">
749 <a name="g-closure-sink"></a><h3>g_closure_sink ()</h3>
750 <pre class="programlisting"><span class="returnvalue">void</span>                g_closure_sink                      (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure);</pre>
751 <p>
752 Takes over the initial ownership of a closure.  Each closure is
753 initially created in a <em class="firstterm">floating</em> state, which
754 means that the initial reference count is not owned by any caller.
755 <a class="link" href="gobject-Closures.html#g-closure-sink" title="g_closure_sink ()"><code class="function">g_closure_sink()</code></a> checks to see if the object is still floating, and
756 if so, unsets the floating state and decreases the reference
757 count. If the closure is not floating, <a class="link" href="gobject-Closures.html#g-closure-sink" title="g_closure_sink ()"><code class="function">g_closure_sink()</code></a> does
758 nothing. The reason for the existance of the floating state is to
759 prevent cumbersome code sequences like:
760 </p>
761 <div class="informalexample"><pre class="programlisting">
762 closure = g_cclosure_new (cb_func, cb_data);
763 g_source_set_closure (source, closure);
764 g_closure_unref (closure); // XXX GObject doesn't really need this
765 </pre></div>
766 <p>
767 Because <a class="link" href="gobject-Closures.html#g-source-set-closure" title="g_source_set_closure ()"><code class="function">g_source_set_closure()</code></a> (and similar functions) take ownership of the
768 initial reference count, if it is unowned, we instead can write:
769 </p>
770 <div class="informalexample"><pre class="programlisting">
771 g_source_set_closure (source, g_cclosure_new (cb_func, cb_data));
772 </pre></div>
773 <p>
774 </p>
775 <p>
776 Generally, this function is used together with <a class="link" href="gobject-Closures.html#g-closure-ref" title="g_closure_ref ()"><code class="function">g_closure_ref()</code></a>. Ane example
777 of storing a closure for later notification looks like:
778 </p>
779 <div class="informalexample"><pre class="programlisting">
780 static GClosure *notify_closure = NULL;
781 void
782 foo_notify_set_closure (GClosure *closure)
783 {
784   if (notify_closure)
785     g_closure_unref (notify_closure);
786   notify_closure = closure;
787   if (notify_closure)
788     {
789       g_closure_ref (notify_closure);
790       g_closure_sink (notify_closure);
791     }
792 }
793 </pre></div>
794 <p>
795 </p>
796 <p>
797 Because <a class="link" href="gobject-Closures.html#g-closure-sink" title="g_closure_sink ()"><code class="function">g_closure_sink()</code></a> may decrement the reference count of a closure
798 (if it hasn't been called on <em class="parameter"><code>closure</code></em> yet) just like <a class="link" href="gobject-Closures.html#g-closure-unref" title="g_closure_unref ()"><code class="function">g_closure_unref()</code></a>,
799 <a class="link" href="gobject-Closures.html#g-closure-ref" title="g_closure_ref ()"><code class="function">g_closure_ref()</code></a> should be called prior to this function.</p>
800 <div class="variablelist"><table border="0">
801 <col align="left" valign="top">
802 <tbody><tr>
803 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
804 <td> <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to decrement the initial reference count on, if it's
805           still being held
806 </td>
807 </tr></tbody>
808 </table></div>
809 </div>
810 <hr>
811 <div class="refsect2" title="g_closure_unref ()">
812 <a name="g-closure-unref"></a><h3>g_closure_unref ()</h3>
813 <pre class="programlisting"><span class="returnvalue">void</span>                g_closure_unref                     (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure);</pre>
814 <p>
815 Decrements the reference count of a closure after it was previously
816 incremented by the same caller. If no other callers are using the
817 closure, then the closure will be destroyed and freed.</p>
818 <div class="variablelist"><table border="0">
819 <col align="left" valign="top">
820 <tbody><tr>
821 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
822 <td> <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to decrement the reference count on
823 </td>
824 </tr></tbody>
825 </table></div>
826 </div>
827 <hr>
828 <div class="refsect2" title="g_closure_invoke ()">
829 <a name="g-closure-invoke"></a><h3>g_closure_invoke ()</h3>
830 <pre class="programlisting"><span class="returnvalue">void</span>                g_closure_invoke                    (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
831                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
832                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
833                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
834                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint);</pre>
835 <p>
836 Invokes the closure, i.e. executes the callback represented by the <em class="parameter"><code>closure</code></em>.</p>
837 <div class="variablelist"><table border="0">
838 <col align="left" valign="top">
839 <tbody>
840 <tr>
841 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
842 <td> a <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>
843 </td>
844 </tr>
845 <tr>
846 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
847 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> to store the return value. May be <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the
848                callback of <em class="parameter"><code>closure</code></em> doesn't return a value.
849 </td>
850 </tr>
851 <tr>
852 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
853 <td> the length of the <em class="parameter"><code>param_values</code></em> array
854 </td>
855 </tr>
856 <tr>
857 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
858 <td> an array of <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a>s holding the arguments on
859                which to invoke the callback of <em class="parameter"><code>closure</code></em>
860 </td>
861 </tr>
862 <tr>
863 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
864 <td> a context-dependent invocation hint
865 </td>
866 </tr>
867 </tbody>
868 </table></div>
869 </div>
870 <hr>
871 <div class="refsect2" title="g_closure_invalidate ()">
872 <a name="g-closure-invalidate"></a><h3>g_closure_invalidate ()</h3>
873 <pre class="programlisting"><span class="returnvalue">void</span>                g_closure_invalidate                (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure);</pre>
874 <p>
875 Sets a flag on the closure to indicate that its calling
876 environment has become invalid, and thus causes any future
877 invocations of <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a> on this <em class="parameter"><code>closure</code></em> to be
878 ignored. Also, invalidation notifiers installed on the closure will
879 be called at this point. Note that unless you are holding a
880 reference to the closure yourself, the invalidation notifiers may
881 unref the closure and cause it to be destroyed, so if you need to
882 access the closure after calling <a class="link" href="gobject-Closures.html#g-closure-invalidate" title="g_closure_invalidate ()"><code class="function">g_closure_invalidate()</code></a>, make sure
883 that you've previously called <a class="link" href="gobject-Closures.html#g-closure-ref" title="g_closure_ref ()"><code class="function">g_closure_ref()</code></a>.
884 </p>
885 <p>
886 Note that <a class="link" href="gobject-Closures.html#g-closure-invalidate" title="g_closure_invalidate ()"><code class="function">g_closure_invalidate()</code></a> will also be called when the
887 reference count of a closure drops to zero (unless it has already
888 been invalidated before).</p>
889 <div class="variablelist"><table border="0">
890 <col align="left" valign="top">
891 <tbody><tr>
892 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
893 <td> GClosure to invalidate
894 </td>
895 </tr></tbody>
896 </table></div>
897 </div>
898 <hr>
899 <div class="refsect2" title="g_closure_add_finalize_notifier ()">
900 <a name="g-closure-add-finalize-notifier"></a><h3>g_closure_add_finalize_notifier ()</h3>
901 <pre class="programlisting"><span class="returnvalue">void</span>                g_closure_add_finalize_notifier     (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
902                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> notify_data,
903                                                          <a class="link" href="gobject-Closures.html#GClosureNotify" title="GClosureNotify ()"><span class="returnvalue">GClosureNotify</span></a> notify_func);</pre>
904 <p>
905 Registers a finalization notifier which will be called when the
906 reference count of <em class="parameter"><code>closure</code></em> goes down to 0. Multiple finalization
907 notifiers on a single closure are invoked in unspecified order. If
908 a single call to <a class="link" href="gobject-Closures.html#g-closure-unref" title="g_closure_unref ()"><code class="function">g_closure_unref()</code></a> results in the closure being
909 both invalidated and finalized, then the invalidate notifiers will
910 be run before the finalize notifiers.</p>
911 <div class="variablelist"><table border="0">
912 <col align="left" valign="top">
913 <tbody>
914 <tr>
915 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
916 <td> a <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>
917 </td>
918 </tr>
919 <tr>
920 <td><p><span class="term"><em class="parameter"><code>notify_data</code></em> :</span></p></td>
921 <td> data to pass to <em class="parameter"><code>notify_func</code></em>
922 </td>
923 </tr>
924 <tr>
925 <td><p><span class="term"><em class="parameter"><code>notify_func</code></em> :</span></p></td>
926 <td> the callback function to register
927 </td>
928 </tr>
929 </tbody>
930 </table></div>
931 </div>
932 <hr>
933 <div class="refsect2" title="g_closure_add_invalidate_notifier ()">
934 <a name="g-closure-add-invalidate-notifier"></a><h3>g_closure_add_invalidate_notifier ()</h3>
935 <pre class="programlisting"><span class="returnvalue">void</span>                g_closure_add_invalidate_notifier   (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
936                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> notify_data,
937                                                          <a class="link" href="gobject-Closures.html#GClosureNotify" title="GClosureNotify ()"><span class="returnvalue">GClosureNotify</span></a> notify_func);</pre>
938 <p>
939 Registers an invalidation notifier which will be called when the
940 <em class="parameter"><code>closure</code></em> is invalidated with <a class="link" href="gobject-Closures.html#g-closure-invalidate" title="g_closure_invalidate ()"><code class="function">g_closure_invalidate()</code></a>. Invalidation
941 notifiers are invoked before finalization notifiers, in an
942 unspecified order.</p>
943 <div class="variablelist"><table border="0">
944 <col align="left" valign="top">
945 <tbody>
946 <tr>
947 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
948 <td> a <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>
949 </td>
950 </tr>
951 <tr>
952 <td><p><span class="term"><em class="parameter"><code>notify_data</code></em> :</span></p></td>
953 <td> data to pass to <em class="parameter"><code>notify_func</code></em>
954 </td>
955 </tr>
956 <tr>
957 <td><p><span class="term"><em class="parameter"><code>notify_func</code></em> :</span></p></td>
958 <td> the callback function to register
959 </td>
960 </tr>
961 </tbody>
962 </table></div>
963 </div>
964 <hr>
965 <div class="refsect2" title="g_closure_remove_finalize_notifier ()">
966 <a name="g-closure-remove-finalize-notifier"></a><h3>g_closure_remove_finalize_notifier ()</h3>
967 <pre class="programlisting"><span class="returnvalue">void</span>                g_closure_remove_finalize_notifier  (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
968                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> notify_data,
969                                                          <a class="link" href="gobject-Closures.html#GClosureNotify" title="GClosureNotify ()"><span class="returnvalue">GClosureNotify</span></a> notify_func);</pre>
970 <p>
971 Removes a finalization notifier.
972 </p>
973 <p>
974 Notice that notifiers are automatically removed after they are run.</p>
975 <div class="variablelist"><table border="0">
976 <col align="left" valign="top">
977 <tbody>
978 <tr>
979 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
980 <td> a <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>
981 </td>
982 </tr>
983 <tr>
984 <td><p><span class="term"><em class="parameter"><code>notify_data</code></em> :</span></p></td>
985 <td> data which was passed to <a class="link" href="gobject-Closures.html#g-closure-add-finalize-notifier" title="g_closure_add_finalize_notifier ()"><code class="function">g_closure_add_finalize_notifier()</code></a>
986  when registering <em class="parameter"><code>notify_func</code></em>
987 </td>
988 </tr>
989 <tr>
990 <td><p><span class="term"><em class="parameter"><code>notify_func</code></em> :</span></p></td>
991 <td> the callback function to remove
992 </td>
993 </tr>
994 </tbody>
995 </table></div>
996 </div>
997 <hr>
998 <div class="refsect2" title="g_closure_remove_invalidate_notifier ()">
999 <a name="g-closure-remove-invalidate-notifier"></a><h3>g_closure_remove_invalidate_notifier ()</h3>
1000 <pre class="programlisting"><span class="returnvalue">void</span>                g_closure_remove_invalidate_notifier
1001                                                         (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1002                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> notify_data,
1003                                                          <a class="link" href="gobject-Closures.html#GClosureNotify" title="GClosureNotify ()"><span class="returnvalue">GClosureNotify</span></a> notify_func);</pre>
1004 <p>
1005 Removes an invalidation notifier.
1006 </p>
1007 <p>
1008 Notice that notifiers are automatically removed after they are run.</p>
1009 <div class="variablelist"><table border="0">
1010 <col align="left" valign="top">
1011 <tbody>
1012 <tr>
1013 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1014 <td> a <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>
1015 </td>
1016 </tr>
1017 <tr>
1018 <td><p><span class="term"><em class="parameter"><code>notify_data</code></em> :</span></p></td>
1019 <td> data which was passed to <a class="link" href="gobject-Closures.html#g-closure-add-invalidate-notifier" title="g_closure_add_invalidate_notifier ()"><code class="function">g_closure_add_invalidate_notifier()</code></a>
1020               when registering <em class="parameter"><code>notify_func</code></em>
1021 </td>
1022 </tr>
1023 <tr>
1024 <td><p><span class="term"><em class="parameter"><code>notify_func</code></em> :</span></p></td>
1025 <td> the callback function to remove
1026 </td>
1027 </tr>
1028 </tbody>
1029 </table></div>
1030 </div>
1031 <hr>
1032 <div class="refsect2" title="g_closure_new_simple ()">
1033 <a name="g-closure-new-simple"></a><h3>g_closure_new_simple ()</h3>
1034 <pre class="programlisting"><a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a>*           g_closure_new_simple                (<a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> sizeof_closure,
1035                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> data);</pre>
1036 <p>
1037 Allocates a struct of the given size and initializes the initial
1038 part as a <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>. This function is mainly useful when
1039 implementing new types of closures.
1040 </p>
1041 <p>
1042 </p>
1043 <div class="informalexample"><pre class="programlisting">
1044 typedef struct _MyClosure MyClosure;
1045 struct _MyClosure
1046 {
1047   GClosure closure;
1048   // extra data goes here
1049 };
1050
1051 static void
1052 my_closure_finalize (gpointer  notify_data,
1053                      GClosure *closure)
1054 {
1055   MyClosure *my_closure = (MyClosure *)closure;
1056
1057   // free extra data here
1058 }
1059
1060 MyClosure *my_closure_new (gpointer data)
1061 {
1062   GClosure *closure;
1063   MyClosure *my_closure;
1064
1065   closure = g_closure_new_simple (sizeof (MyClosure), data);
1066   my_closure = (MyClosure *) closure;
1067
1068   // initialize extra data here
1069
1070   g_closure_add_finalize_notifier (closure, notify_data,
1071                                    my_closure_finalize);
1072   return my_closure;
1073 }
1074 </pre></div>
1075 <div class="variablelist"><table border="0">
1076 <col align="left" valign="top">
1077 <tbody>
1078 <tr>
1079 <td><p><span class="term"><em class="parameter"><code>sizeof_closure</code></em> :</span></p></td>
1080 <td> the size of the structure to allocate, must be at least
1081                  <code class="literal">sizeof (GClosure)</code>
1082 </td>
1083 </tr>
1084 <tr>
1085 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
1086 <td> data to store in the <em class="parameter"><code>data</code></em> field of the newly allocated <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>
1087 </td>
1088 </tr>
1089 <tr>
1090 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1091 <td> a newly allocated <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>
1092 </td>
1093 </tr>
1094 </tbody>
1095 </table></div>
1096 </div>
1097 <hr>
1098 <div class="refsect2" title="g_closure_set_marshal ()">
1099 <a name="g-closure-set-marshal"></a><h3>g_closure_set_marshal ()</h3>
1100 <pre class="programlisting"><span class="returnvalue">void</span>                g_closure_set_marshal               (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1101                                                          <a class="link" href="gobject-Closures.html#GClosureMarshal" title="GClosureMarshal ()"><span class="returnvalue">GClosureMarshal</span></a> marshal);</pre>
1102 <p>
1103 Sets the marshaller of <em class="parameter"><code>closure</code></em>. The <code class="literal">marshal_data</code>
1104 of <em class="parameter"><code>marshal</code></em> provides a way for a meta marshaller to provide additional
1105 information to the marshaller. (See <a class="link" href="gobject-Closures.html#g-closure-set-meta-marshal" title="g_closure_set_meta_marshal ()"><code class="function">g_closure_set_meta_marshal()</code></a>.) For
1106 GObject's C predefined marshallers (the g_cclosure_marshal_*()
1107 functions), what it provides is a callback function to use instead of
1108 <em class="parameter"><code>closure-&gt;callback</code></em>.</p>
1109 <div class="variablelist"><table border="0">
1110 <col align="left" valign="top">
1111 <tbody>
1112 <tr>
1113 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1114 <td> a <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>
1115 </td>
1116 </tr>
1117 <tr>
1118 <td><p><span class="term"><em class="parameter"><code>marshal</code></em> :</span></p></td>
1119 <td> a <a class="link" href="gobject-Closures.html#GClosureMarshal" title="GClosureMarshal ()"><span class="type">GClosureMarshal</span></a> function
1120 </td>
1121 </tr>
1122 </tbody>
1123 </table></div>
1124 </div>
1125 <hr>
1126 <div class="refsect2" title="g_closure_add_marshal_guards ()">
1127 <a name="g-closure-add-marshal-guards"></a><h3>g_closure_add_marshal_guards ()</h3>
1128 <pre class="programlisting"><span class="returnvalue">void</span>                g_closure_add_marshal_guards        (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1129                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> pre_marshal_data,
1130                                                          <a class="link" href="gobject-Closures.html#GClosureNotify" title="GClosureNotify ()"><span class="returnvalue">GClosureNotify</span></a> pre_marshal_notify,
1131                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> post_marshal_data,
1132                                                          <a class="link" href="gobject-Closures.html#GClosureNotify" title="GClosureNotify ()"><span class="returnvalue">GClosureNotify</span></a> post_marshal_notify);</pre>
1133 <p>
1134 Adds a pair of notifiers which get invoked before and after the
1135 closure callback, respectively. This is typically used to protect
1136 the extra arguments for the duration of the callback. See
1137 <a class="link" href="gobject-The-Base-Object-Type.html#g-object-watch-closure" title="g_object_watch_closure ()"><code class="function">g_object_watch_closure()</code></a> for an example of marshal guards.</p>
1138 <div class="variablelist"><table border="0">
1139 <col align="left" valign="top">
1140 <tbody>
1141 <tr>
1142 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1143 <td> a <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>
1144 </td>
1145 </tr>
1146 <tr>
1147 <td><p><span class="term"><em class="parameter"><code>pre_marshal_data</code></em> :</span></p></td>
1148 <td> data to pass to <em class="parameter"><code>pre_marshal_notify</code></em>
1149 </td>
1150 </tr>
1151 <tr>
1152 <td><p><span class="term"><em class="parameter"><code>pre_marshal_notify</code></em> :</span></p></td>
1153 <td> a function to call before the closure callback
1154 </td>
1155 </tr>
1156 <tr>
1157 <td><p><span class="term"><em class="parameter"><code>post_marshal_data</code></em> :</span></p></td>
1158 <td> data to pass to <em class="parameter"><code>post_marshal_notify</code></em>
1159 </td>
1160 </tr>
1161 <tr>
1162 <td><p><span class="term"><em class="parameter"><code>post_marshal_notify</code></em> :</span></p></td>
1163 <td> a function to call after the closure callback
1164 </td>
1165 </tr>
1166 </tbody>
1167 </table></div>
1168 </div>
1169 <hr>
1170 <div class="refsect2" title="g_closure_set_meta_marshal ()">
1171 <a name="g-closure-set-meta-marshal"></a><h3>g_closure_set_meta_marshal ()</h3>
1172 <pre class="programlisting"><span class="returnvalue">void</span>                g_closure_set_meta_marshal          (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1173                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data,
1174                                                          <a class="link" href="gobject-Closures.html#GClosureMarshal" title="GClosureMarshal ()"><span class="returnvalue">GClosureMarshal</span></a> meta_marshal);</pre>
1175 <p>
1176 Sets the meta marshaller of <em class="parameter"><code>closure</code></em>.  A meta marshaller wraps
1177 <em class="parameter"><code>closure-&gt;marshal</code></em> and modifies the way it is called in some
1178 fashion. The most common use of this facility is for C callbacks.
1179 The same marshallers (generated by <a href="glib-genmarshal.html">glib-genmarshal</a>) are used
1180 everywhere, but the way that we get the callback function
1181 differs. In most cases we want to use <em class="parameter"><code>closure-&gt;callback</code></em>, but in
1182 other cases we want to use some different technique to retrieve the
1183 callback function.
1184 </p>
1185 <p>
1186 For example, class closures for signals (see
1187 <a class="link" href="gobject-Signals.html#g-signal-type-cclosure-new" title="g_signal_type_cclosure_new ()"><code class="function">g_signal_type_cclosure_new()</code></a>) retrieve the callback function from a
1188 fixed offset in the class structure.  The meta marshaller retrieves
1189 the right callback and passes it to the marshaller as the
1190 <em class="parameter"><code>marshal_data</code></em> argument.</p>
1191 <div class="variablelist"><table border="0">
1192 <col align="left" valign="top">
1193 <tbody>
1194 <tr>
1195 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1196 <td> a <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>
1197 </td>
1198 </tr>
1199 <tr>
1200 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
1201 <td> context-dependent data to pass to <em class="parameter"><code>meta_marshal</code></em>
1202 </td>
1203 </tr>
1204 <tr>
1205 <td><p><span class="term"><em class="parameter"><code>meta_marshal</code></em> :</span></p></td>
1206 <td> a <a class="link" href="gobject-Closures.html#GClosureMarshal" title="GClosureMarshal ()"><span class="type">GClosureMarshal</span></a> function
1207 </td>
1208 </tr>
1209 </tbody>
1210 </table></div>
1211 </div>
1212 <hr>
1213 <div class="refsect2" title="g_source_set_closure ()">
1214 <a name="g-source-set-closure"></a><h3>g_source_set_closure ()</h3>
1215 <pre class="programlisting"><span class="returnvalue">void</span>                g_source_set_closure                (<a href="./../glib/glib/glib-The-Main-Event-Loop.html#GSource"><span class="returnvalue">GSource</span></a> *source,
1216                                                          <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure);</pre>
1217 <p>
1218 Set the callback for a source as a <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>.
1219 </p>
1220 <p>
1221 If the source is not one of the standard GLib types, the <em class="parameter"><code>closure_callback</code></em>
1222 and <em class="parameter"><code>closure_marshal</code></em> fields of the <a href="./../glib/glib/glib-The-Main-Event-Loop.html#GSourceFuncs"><span class="type">GSourceFuncs</span></a> structure must have been
1223 filled in with pointers to appropriate functions.</p>
1224 <div class="variablelist"><table border="0">
1225 <col align="left" valign="top">
1226 <tbody>
1227 <tr>
1228 <td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
1229 <td> the source
1230 </td>
1231 </tr>
1232 <tr>
1233 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1234 <td> a <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a>
1235 </td>
1236 </tr>
1237 </tbody>
1238 </table></div>
1239 </div>
1240 <hr>
1241 <div class="refsect2" title="G_TYPE_IO_CHANNEL">
1242 <a name="G-TYPE-IO-CHANNEL:CAPS"></a><h3>G_TYPE_IO_CHANNEL</h3>
1243 <pre class="programlisting">#define G_TYPE_IO_CHANNEL (g_io_channel_get_type ())
1244 </pre>
1245 <p>
1246 The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> for <a href="./../glib/glib/glib-IO-Channels.html#GIOChannel"><span class="type">GIOChannel</span></a>.</p>
1247 </div>
1248 <hr>
1249 <div class="refsect2" title="G_TYPE_IO_CONDITION">
1250 <a name="G-TYPE-IO-CONDITION:CAPS"></a><h3>G_TYPE_IO_CONDITION</h3>
1251 <pre class="programlisting">#define G_TYPE_IO_CONDITION (g_io_condition_get_type ())
1252 </pre>
1253 <p>
1254 The <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> for <a href="./../glib/glib/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a>.</p>
1255 </div>
1256 <hr>
1257 <div class="refsect2" title="g_cclosure_marshal_VOID__VOID ()">
1258 <a name="g-cclosure-marshal-VOID--VOID"></a><h3>g_cclosure_marshal_VOID__VOID ()</h3>
1259 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__VOID       (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1260                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
1261                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
1262                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
1263                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
1264                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
1265 <p>
1266 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
1267 <code class="literal">void (*callback) (gpointer instance, gpointer user_data)</code>.</p>
1268 <div class="variablelist"><table border="0">
1269 <col align="left" valign="top">
1270 <tbody>
1271 <tr>
1272 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1273 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
1274 </td>
1275 </tr>
1276 <tr>
1277 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
1278 <td> ignored
1279 </td>
1280 </tr>
1281 <tr>
1282 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
1283 <td> 1
1284 </td>
1285 </tr>
1286 <tr>
1287 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
1288 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding only the instance
1289 </td>
1290 </tr>
1291 <tr>
1292 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
1293 <td> the invocation hint given as the last argument
1294  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
1295 </td>
1296 </tr>
1297 <tr>
1298 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
1299 <td> additional data specified when registering the marshaller
1300 </td>
1301 </tr>
1302 </tbody>
1303 </table></div>
1304 </div>
1305 <hr>
1306 <div class="refsect2" title="g_cclosure_marshal_VOID__BOOLEAN ()">
1307 <a name="g-cclosure-marshal-VOID--BOOLEAN"></a><h3>g_cclosure_marshal_VOID__BOOLEAN ()</h3>
1308 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__BOOLEAN    (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1309                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
1310                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
1311                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
1312                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
1313                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
1314 <p>
1315 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
1316 <code class="literal">void (*callback) (gpointer instance, gboolean arg1, gpointer user_data)</code>.</p>
1317 <div class="variablelist"><table border="0">
1318 <col align="left" valign="top">
1319 <tbody>
1320 <tr>
1321 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1322 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
1323 </td>
1324 </tr>
1325 <tr>
1326 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
1327 <td> ignored
1328 </td>
1329 </tr>
1330 <tr>
1331 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
1332 <td> 2
1333 </td>
1334 </tr>
1335 <tr>
1336 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
1337 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding the instance and the <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> parameter
1338 </td>
1339 </tr>
1340 <tr>
1341 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
1342 <td> the invocation hint given as the last argument
1343  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
1344 </td>
1345 </tr>
1346 <tr>
1347 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
1348 <td> additional data specified when registering the marshaller
1349 </td>
1350 </tr>
1351 </tbody>
1352 </table></div>
1353 </div>
1354 <hr>
1355 <div class="refsect2" title="g_cclosure_marshal_VOID__CHAR ()">
1356 <a name="g-cclosure-marshal-VOID--CHAR"></a><h3>g_cclosure_marshal_VOID__CHAR ()</h3>
1357 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__CHAR       (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1358                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
1359                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
1360                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
1361                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
1362                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
1363 <p>
1364 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
1365 <code class="literal">void (*callback) (gpointer instance, gchar arg1, gpointer user_data)</code>.</p>
1366 <div class="variablelist"><table border="0">
1367 <col align="left" valign="top">
1368 <tbody>
1369 <tr>
1370 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1371 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
1372 </td>
1373 </tr>
1374 <tr>
1375 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
1376 <td> ignored
1377 </td>
1378 </tr>
1379 <tr>
1380 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
1381 <td> 2
1382 </td>
1383 </tr>
1384 <tr>
1385 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
1386 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding the instance and the <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> parameter
1387 </td>
1388 </tr>
1389 <tr>
1390 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
1391 <td> the invocation hint given as the last argument
1392  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
1393 </td>
1394 </tr>
1395 <tr>
1396 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
1397 <td> additional data specified when registering the marshaller
1398 </td>
1399 </tr>
1400 </tbody>
1401 </table></div>
1402 </div>
1403 <hr>
1404 <div class="refsect2" title="g_cclosure_marshal_VOID__UCHAR ()">
1405 <a name="g-cclosure-marshal-VOID--UCHAR"></a><h3>g_cclosure_marshal_VOID__UCHAR ()</h3>
1406 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__UCHAR      (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1407                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
1408                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
1409                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
1410                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
1411                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
1412 <p>
1413 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
1414 <code class="literal">void (*callback) (gpointer instance, guchar arg1, gpointer user_data)</code>.</p>
1415 <div class="variablelist"><table border="0">
1416 <col align="left" valign="top">
1417 <tbody>
1418 <tr>
1419 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1420 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
1421 </td>
1422 </tr>
1423 <tr>
1424 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
1425 <td> ignored
1426 </td>
1427 </tr>
1428 <tr>
1429 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
1430 <td> 2
1431 </td>
1432 </tr>
1433 <tr>
1434 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
1435 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding the instance and the <a href="./../glib/glib/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> parameter
1436 </td>
1437 </tr>
1438 <tr>
1439 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
1440 <td> the invocation hint given as the last argument
1441  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
1442 </td>
1443 </tr>
1444 <tr>
1445 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
1446 <td> additional data specified when registering the marshaller
1447 </td>
1448 </tr>
1449 </tbody>
1450 </table></div>
1451 </div>
1452 <hr>
1453 <div class="refsect2" title="g_cclosure_marshal_VOID__INT ()">
1454 <a name="g-cclosure-marshal-VOID--INT"></a><h3>g_cclosure_marshal_VOID__INT ()</h3>
1455 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__INT        (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1456                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
1457                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
1458                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
1459                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
1460                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
1461 <p>
1462 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
1463 <code class="literal">void (*callback) (gpointer instance, gint arg1, gpointer user_data)</code>.</p>
1464 <div class="variablelist"><table border="0">
1465 <col align="left" valign="top">
1466 <tbody>
1467 <tr>
1468 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1469 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
1470 </td>
1471 </tr>
1472 <tr>
1473 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
1474 <td> ignored
1475 </td>
1476 </tr>
1477 <tr>
1478 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
1479 <td> 2
1480 </td>
1481 </tr>
1482 <tr>
1483 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
1484 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding the instance and the <a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> parameter
1485 </td>
1486 </tr>
1487 <tr>
1488 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
1489 <td> the invocation hint given as the last argument
1490  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
1491 </td>
1492 </tr>
1493 <tr>
1494 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
1495 <td> additional data specified when registering the marshaller
1496 </td>
1497 </tr>
1498 </tbody>
1499 </table></div>
1500 </div>
1501 <hr>
1502 <div class="refsect2" title="g_cclosure_marshal_VOID__UINT ()">
1503 <a name="g-cclosure-marshal-VOID--UINT"></a><h3>g_cclosure_marshal_VOID__UINT ()</h3>
1504 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__UINT       (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1505                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
1506                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
1507                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
1508                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
1509                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
1510 <p>
1511 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
1512 <code class="literal">void (*callback) (gpointer instance, guint arg1, gpointer user_data)</code>.</p>
1513 <div class="variablelist"><table border="0">
1514 <col align="left" valign="top">
1515 <tbody>
1516 <tr>
1517 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1518 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
1519 </td>
1520 </tr>
1521 <tr>
1522 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
1523 <td> ignored
1524 </td>
1525 </tr>
1526 <tr>
1527 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
1528 <td> 2
1529 </td>
1530 </tr>
1531 <tr>
1532 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
1533 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding the instance and the <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> parameter
1534 </td>
1535 </tr>
1536 <tr>
1537 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
1538 <td> the invocation hint given as the last argument
1539  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
1540 </td>
1541 </tr>
1542 <tr>
1543 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
1544 <td> additional data specified when registering the marshaller
1545 </td>
1546 </tr>
1547 </tbody>
1548 </table></div>
1549 </div>
1550 <hr>
1551 <div class="refsect2" title="g_cclosure_marshal_VOID__LONG ()">
1552 <a name="g-cclosure-marshal-VOID--LONG"></a><h3>g_cclosure_marshal_VOID__LONG ()</h3>
1553 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__LONG       (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1554                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
1555                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
1556                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
1557                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
1558                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
1559 <p>
1560 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
1561 <code class="literal">void (*callback) (gpointer instance, glong arg1, gpointer user_data)</code>.</p>
1562 <div class="variablelist"><table border="0">
1563 <col align="left" valign="top">
1564 <tbody>
1565 <tr>
1566 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1567 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
1568 </td>
1569 </tr>
1570 <tr>
1571 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
1572 <td> ignored
1573 </td>
1574 </tr>
1575 <tr>
1576 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
1577 <td> 2
1578 </td>
1579 </tr>
1580 <tr>
1581 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
1582 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding the instance and the <a href="./../glib/glib/glib-Basic-Types.html#glong"><span class="type">glong</span></a> parameter
1583 </td>
1584 </tr>
1585 <tr>
1586 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
1587 <td> the invocation hint given as the last argument
1588  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
1589 </td>
1590 </tr>
1591 <tr>
1592 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
1593 <td> additional data specified when registering the marshaller
1594 </td>
1595 </tr>
1596 </tbody>
1597 </table></div>
1598 </div>
1599 <hr>
1600 <div class="refsect2" title="g_cclosure_marshal_VOID__ULONG ()">
1601 <a name="g-cclosure-marshal-VOID--ULONG"></a><h3>g_cclosure_marshal_VOID__ULONG ()</h3>
1602 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__ULONG      (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1603                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
1604                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
1605                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
1606                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
1607                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
1608 <p>
1609 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
1610 <code class="literal">void (*callback) (gpointer instance, gulong arg1, gpointer user_data)</code>.</p>
1611 <div class="variablelist"><table border="0">
1612 <col align="left" valign="top">
1613 <tbody>
1614 <tr>
1615 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1616 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
1617 </td>
1618 </tr>
1619 <tr>
1620 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
1621 <td> ignored
1622 </td>
1623 </tr>
1624 <tr>
1625 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
1626 <td> 2
1627 </td>
1628 </tr>
1629 <tr>
1630 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
1631 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding the instance and the <a href="./../glib/glib/glib-Basic-Types.html#gulong"><span class="type">gulong</span></a> parameter
1632 </td>
1633 </tr>
1634 <tr>
1635 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
1636 <td> the invocation hint given as the last argument
1637  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
1638 </td>
1639 </tr>
1640 <tr>
1641 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
1642 <td> additional data specified when registering the marshaller
1643 </td>
1644 </tr>
1645 </tbody>
1646 </table></div>
1647 </div>
1648 <hr>
1649 <div class="refsect2" title="g_cclosure_marshal_VOID__ENUM ()">
1650 <a name="g-cclosure-marshal-VOID--ENUM"></a><h3>g_cclosure_marshal_VOID__ENUM ()</h3>
1651 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__ENUM       (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1652                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
1653                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
1654                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
1655                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
1656                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
1657 <p>
1658 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
1659 <code class="literal">void (*callback) (gpointer instance, gint arg1, gpointer user_data)</code> where the <a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> parameter denotes an enumeration type..</p>
1660 <div class="variablelist"><table border="0">
1661 <col align="left" valign="top">
1662 <tbody>
1663 <tr>
1664 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1665 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
1666 </td>
1667 </tr>
1668 <tr>
1669 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
1670 <td> ignored
1671 </td>
1672 </tr>
1673 <tr>
1674 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
1675 <td> 2
1676 </td>
1677 </tr>
1678 <tr>
1679 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
1680 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding the instance and the enumeration parameter
1681 </td>
1682 </tr>
1683 <tr>
1684 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
1685 <td> the invocation hint given as the last argument
1686  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
1687 </td>
1688 </tr>
1689 <tr>
1690 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
1691 <td> additional data specified when registering the marshaller
1692 </td>
1693 </tr>
1694 </tbody>
1695 </table></div>
1696 </div>
1697 <hr>
1698 <div class="refsect2" title="g_cclosure_marshal_VOID__FLAGS ()">
1699 <a name="g-cclosure-marshal-VOID--FLAGS"></a><h3>g_cclosure_marshal_VOID__FLAGS ()</h3>
1700 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__FLAGS      (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1701                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
1702                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
1703                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
1704                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
1705                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
1706 <p>
1707 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
1708 <code class="literal">void (*callback) (gpointer instance, gint arg1, gpointer user_data)</code> where the <a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> parameter denotes a flags type.</p>
1709 <div class="variablelist"><table border="0">
1710 <col align="left" valign="top">
1711 <tbody>
1712 <tr>
1713 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1714 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
1715 </td>
1716 </tr>
1717 <tr>
1718 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
1719 <td> ignored
1720 </td>
1721 </tr>
1722 <tr>
1723 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
1724 <td> 2
1725 </td>
1726 </tr>
1727 <tr>
1728 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
1729 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding the instance and the flags parameter
1730 </td>
1731 </tr>
1732 <tr>
1733 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
1734 <td> the invocation hint given as the last argument
1735  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
1736 </td>
1737 </tr>
1738 <tr>
1739 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
1740 <td> additional data specified when registering the marshaller
1741 </td>
1742 </tr>
1743 </tbody>
1744 </table></div>
1745 </div>
1746 <hr>
1747 <div class="refsect2" title="g_cclosure_marshal_VOID__FLOAT ()">
1748 <a name="g-cclosure-marshal-VOID--FLOAT"></a><h3>g_cclosure_marshal_VOID__FLOAT ()</h3>
1749 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__FLOAT      (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1750                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
1751                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
1752                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
1753                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
1754                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
1755 <p>
1756 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
1757 <code class="literal">void (*callback) (gpointer instance, gfloat arg1, gpointer user_data)</code>.</p>
1758 <div class="variablelist"><table border="0">
1759 <col align="left" valign="top">
1760 <tbody>
1761 <tr>
1762 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1763 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
1764 </td>
1765 </tr>
1766 <tr>
1767 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
1768 <td> ignored
1769 </td>
1770 </tr>
1771 <tr>
1772 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
1773 <td> 2
1774 </td>
1775 </tr>
1776 <tr>
1777 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
1778 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding the instance and the <a href="./../glib/glib/glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a> parameter
1779 </td>
1780 </tr>
1781 <tr>
1782 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
1783 <td> the invocation hint given as the last argument
1784  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
1785 </td>
1786 </tr>
1787 <tr>
1788 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
1789 <td> additional data specified when registering the marshaller
1790 </td>
1791 </tr>
1792 </tbody>
1793 </table></div>
1794 </div>
1795 <hr>
1796 <div class="refsect2" title="g_cclosure_marshal_VOID__DOUBLE ()">
1797 <a name="g-cclosure-marshal-VOID--DOUBLE"></a><h3>g_cclosure_marshal_VOID__DOUBLE ()</h3>
1798 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__DOUBLE     (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1799                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
1800                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
1801                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
1802                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
1803                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
1804 <p>
1805 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
1806 <code class="literal">void (*callback) (gpointer instance, gdouble arg1, gpointer user_data)</code>.</p>
1807 <div class="variablelist"><table border="0">
1808 <col align="left" valign="top">
1809 <tbody>
1810 <tr>
1811 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1812 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
1813 </td>
1814 </tr>
1815 <tr>
1816 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
1817 <td> ignored
1818 </td>
1819 </tr>
1820 <tr>
1821 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
1822 <td> 2
1823 </td>
1824 </tr>
1825 <tr>
1826 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
1827 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding the instance and the <a href="./../glib/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> parameter
1828 </td>
1829 </tr>
1830 <tr>
1831 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
1832 <td> the invocation hint given as the last argument
1833  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
1834 </td>
1835 </tr>
1836 <tr>
1837 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
1838 <td> additional data specified when registering the marshaller
1839 </td>
1840 </tr>
1841 </tbody>
1842 </table></div>
1843 </div>
1844 <hr>
1845 <div class="refsect2" title="g_cclosure_marshal_VOID__STRING ()">
1846 <a name="g-cclosure-marshal-VOID--STRING"></a><h3>g_cclosure_marshal_VOID__STRING ()</h3>
1847 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__STRING     (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1848                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
1849                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
1850                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
1851                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
1852                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
1853 <p>
1854 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
1855 <code class="literal">void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data)</code>.</p>
1856 <div class="variablelist"><table border="0">
1857 <col align="left" valign="top">
1858 <tbody>
1859 <tr>
1860 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1861 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
1862 </td>
1863 </tr>
1864 <tr>
1865 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
1866 <td> ignored
1867 </td>
1868 </tr>
1869 <tr>
1870 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
1871 <td> 2
1872 </td>
1873 </tr>
1874 <tr>
1875 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
1876 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding the instance and the <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* parameter
1877 </td>
1878 </tr>
1879 <tr>
1880 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
1881 <td> the invocation hint given as the last argument
1882  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
1883 </td>
1884 </tr>
1885 <tr>
1886 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
1887 <td> additional data specified when registering the marshaller
1888 </td>
1889 </tr>
1890 </tbody>
1891 </table></div>
1892 </div>
1893 <hr>
1894 <div class="refsect2" title="g_cclosure_marshal_VOID__PARAM ()">
1895 <a name="g-cclosure-marshal-VOID--PARAM"></a><h3>g_cclosure_marshal_VOID__PARAM ()</h3>
1896 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__PARAM      (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1897                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
1898                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
1899                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
1900                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
1901                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
1902 <p>
1903 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
1904 <code class="literal">void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data)</code>.</p>
1905 <div class="variablelist"><table border="0">
1906 <col align="left" valign="top">
1907 <tbody>
1908 <tr>
1909 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1910 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
1911 </td>
1912 </tr>
1913 <tr>
1914 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
1915 <td> ignored
1916 </td>
1917 </tr>
1918 <tr>
1919 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
1920 <td> 2
1921 </td>
1922 </tr>
1923 <tr>
1924 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
1925 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding the instance and the <a class="link" href="gobject-GParamSpec.html#GParamSpec" title="GParamSpec"><span class="type">GParamSpec</span></a>* parameter
1926 </td>
1927 </tr>
1928 <tr>
1929 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
1930 <td> the invocation hint given as the last argument
1931  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
1932 </td>
1933 </tr>
1934 <tr>
1935 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
1936 <td> additional data specified when registering the marshaller
1937 </td>
1938 </tr>
1939 </tbody>
1940 </table></div>
1941 </div>
1942 <hr>
1943 <div class="refsect2" title="g_cclosure_marshal_VOID__BOXED ()">
1944 <a name="g-cclosure-marshal-VOID--BOXED"></a><h3>g_cclosure_marshal_VOID__BOXED ()</h3>
1945 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__BOXED      (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1946                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
1947                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
1948                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
1949                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
1950                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
1951 <p>
1952 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
1953 <code class="literal">void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data)</code>.</p>
1954 <div class="variablelist"><table border="0">
1955 <col align="left" valign="top">
1956 <tbody>
1957 <tr>
1958 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
1959 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
1960 </td>
1961 </tr>
1962 <tr>
1963 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
1964 <td> ignored
1965 </td>
1966 </tr>
1967 <tr>
1968 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
1969 <td> 2
1970 </td>
1971 </tr>
1972 <tr>
1973 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
1974 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding the instance and the <span class="type">GBoxed</span>* parameter
1975 </td>
1976 </tr>
1977 <tr>
1978 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
1979 <td> the invocation hint given as the last argument
1980  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
1981 </td>
1982 </tr>
1983 <tr>
1984 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
1985 <td> additional data specified when registering the marshaller
1986 </td>
1987 </tr>
1988 </tbody>
1989 </table></div>
1990 </div>
1991 <hr>
1992 <div class="refsect2" title="g_cclosure_marshal_VOID__POINTER ()">
1993 <a name="g-cclosure-marshal-VOID--POINTER"></a><h3>g_cclosure_marshal_VOID__POINTER ()</h3>
1994 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__POINTER    (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
1995                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
1996                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
1997                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
1998                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
1999                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
2000 <p>
2001 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
2002 <code class="literal">void (*callback) (gpointer instance, gpointer arg1, gpointer user_data)</code>.</p>
2003 <div class="variablelist"><table border="0">
2004 <col align="left" valign="top">
2005 <tbody>
2006 <tr>
2007 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
2008 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
2009 </td>
2010 </tr>
2011 <tr>
2012 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
2013 <td> ignored
2014 </td>
2015 </tr>
2016 <tr>
2017 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
2018 <td> 2
2019 </td>
2020 </tr>
2021 <tr>
2022 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
2023 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding the instance and the <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> parameter
2024 </td>
2025 </tr>
2026 <tr>
2027 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
2028 <td> the invocation hint given as the last argument
2029  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
2030 </td>
2031 </tr>
2032 <tr>
2033 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
2034 <td> additional data specified when registering the marshaller
2035 </td>
2036 </tr>
2037 </tbody>
2038 </table></div>
2039 </div>
2040 <hr>
2041 <div class="refsect2" title="g_cclosure_marshal_VOID__OBJECT ()">
2042 <a name="g-cclosure-marshal-VOID--OBJECT"></a><h3>g_cclosure_marshal_VOID__OBJECT ()</h3>
2043 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__OBJECT     (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
2044                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
2045                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
2046                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
2047                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
2048                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
2049 <p>
2050 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
2051 <code class="literal">void (*callback) (gpointer instance, GOBject *arg1, gpointer user_data)</code>.</p>
2052 <div class="variablelist"><table border="0">
2053 <col align="left" valign="top">
2054 <tbody>
2055 <tr>
2056 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
2057 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
2058 </td>
2059 </tr>
2060 <tr>
2061 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
2062 <td> ignored
2063 </td>
2064 </tr>
2065 <tr>
2066 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
2067 <td> 2
2068 </td>
2069 </tr>
2070 <tr>
2071 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
2072 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding the instance and the <a class="link" href="gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>* parameter
2073 </td>
2074 </tr>
2075 <tr>
2076 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
2077 <td> the invocation hint given as the last argument
2078  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
2079 </td>
2080 </tr>
2081 <tr>
2082 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
2083 <td> additional data specified when registering the marshaller
2084 </td>
2085 </tr>
2086 </tbody>
2087 </table></div>
2088 </div>
2089 <hr>
2090 <div class="refsect2" title="g_cclosure_marshal_STRING__OBJECT_POINTER ()">
2091 <a name="g-cclosure-marshal-STRING--OBJECT-POINTER"></a><h3>g_cclosure_marshal_STRING__OBJECT_POINTER ()</h3>
2092 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_STRING__OBJECT_POINTER
2093                                                         (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
2094                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
2095                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
2096                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
2097                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
2098                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
2099 <p>
2100 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
2101 <code class="literal">gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data)</code>.</p>
2102 <div class="variablelist"><table border="0">
2103 <col align="left" valign="top">
2104 <tbody>
2105 <tr>
2106 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
2107 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
2108 </td>
2109 </tr>
2110 <tr>
2111 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
2112 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a>, which can store the returned string
2113 </td>
2114 </tr>
2115 <tr>
2116 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
2117 <td> 3
2118 </td>
2119 </tr>
2120 <tr>
2121 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
2122 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding instance, arg1 and arg2
2123 </td>
2124 </tr>
2125 <tr>
2126 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
2127 <td> the invocation hint given as the last argument
2128  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
2129 </td>
2130 </tr>
2131 <tr>
2132 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
2133 <td> additional data specified when registering the marshaller
2134 </td>
2135 </tr>
2136 </tbody>
2137 </table></div>
2138 </div>
2139 <hr>
2140 <div class="refsect2" title="g_cclosure_marshal_VOID__UINT_POINTER ()">
2141 <a name="g-cclosure-marshal-VOID--UINT-POINTER"></a><h3>g_cclosure_marshal_VOID__UINT_POINTER ()</h3>
2142 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_VOID__UINT_POINTER
2143                                                         (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
2144                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
2145                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
2146                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
2147                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
2148                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
2149 <p>
2150 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
2151 <code class="literal">void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data)</code>.</p>
2152 <div class="variablelist"><table border="0">
2153 <col align="left" valign="top">
2154 <tbody>
2155 <tr>
2156 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
2157 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
2158 </td>
2159 </tr>
2160 <tr>
2161 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
2162 <td> ignored
2163 </td>
2164 </tr>
2165 <tr>
2166 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
2167 <td> 3
2168 </td>
2169 </tr>
2170 <tr>
2171 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
2172 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding instance, arg1 and arg2
2173 </td>
2174 </tr>
2175 <tr>
2176 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
2177 <td> the invocation hint given as the last argument
2178  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
2179 </td>
2180 </tr>
2181 <tr>
2182 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
2183 <td> additional data specified when registering the marshaller
2184 </td>
2185 </tr>
2186 </tbody>
2187 </table></div>
2188 </div>
2189 <hr>
2190 <div class="refsect2" title="g_cclosure_marshal_BOOLEAN__FLAGS ()">
2191 <a name="g-cclosure-marshal-BOOLEAN--FLAGS"></a><h3>g_cclosure_marshal_BOOLEAN__FLAGS ()</h3>
2192 <pre class="programlisting"><span class="returnvalue">void</span>                g_cclosure_marshal_BOOLEAN__FLAGS   (<a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="returnvalue">GClosure</span></a> *closure,
2193                                                          <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *return_value,
2194                                                          <a href="./../glib/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> n_param_values,
2195                                                          const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="returnvalue">GValue</span></a> *param_values,
2196                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> invocation_hint,
2197                                                          <a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> marshal_data);</pre>
2198 <p>
2199 A marshaller for a <a class="link" href="gobject-Closures.html#GCClosure" title="GCClosure"><span class="type">GCClosure</span></a> with a callback of type
2200 <code class="literal">gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data)</code> where the <a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> parameter
2201 denotes a flags type.</p>
2202 <div class="variablelist"><table border="0">
2203 <col align="left" valign="top">
2204 <tbody>
2205 <tr>
2206 <td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
2207 <td> the <a class="link" href="gobject-Closures.html#GClosure" title="GClosure"><span class="type">GClosure</span></a> to which the marshaller belongs
2208 </td>
2209 </tr>
2210 <tr>
2211 <td><p><span class="term"><em class="parameter"><code>return_value</code></em> :</span></p></td>
2212 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> which can store the returned <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>
2213 </td>
2214 </tr>
2215 <tr>
2216 <td><p><span class="term"><em class="parameter"><code>n_param_values</code></em> :</span></p></td>
2217 <td> 2
2218 </td>
2219 </tr>
2220 <tr>
2221 <td><p><span class="term"><em class="parameter"><code>param_values</code></em> :</span></p></td>
2222 <td> a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> array holding instance and arg1
2223 </td>
2224 </tr>
2225 <tr>
2226 <td><p><span class="term"><em class="parameter"><code>invocation_hint</code></em> :</span></p></td>
2227 <td> the invocation hint given as the last argument
2228  to <a class="link" href="gobject-Closures.html#g-closure-invoke" title="g_closure_invoke ()"><code class="function">g_closure_invoke()</code></a>
2229 </td>
2230 </tr>
2231 <tr>
2232 <td><p><span class="term"><em class="parameter"><code>marshal_data</code></em> :</span></p></td>
2233 <td> additional data specified when registering the marshaller
2234 </td>
2235 </tr>
2236 </tbody>
2237 </table></div>
2238 </div>
2239 <hr>
2240 <div class="refsect2" title="g_cclosure_marshal_BOOL__FLAGS">
2241 <a name="g-cclosure-marshal-BOOL--FLAGS"></a><h3>g_cclosure_marshal_BOOL__FLAGS</h3>
2242 <pre class="programlisting">#define             g_cclosure_marshal_BOOL__FLAGS</pre>
2243 <p>
2244 Another name for <a class="link" href="gobject-Closures.html#g-cclosure-marshal-BOOLEAN--FLAGS" title="g_cclosure_marshal_BOOLEAN__FLAGS ()"><code class="function">g_cclosure_marshal_BOOLEAN__FLAGS()</code></a>.</p>
2245 </div>
2246 </div>
2247 </div>
2248 <div class="footer">
2249 <hr>
2250           Generated by GTK-Doc V1.13</div>
2251 </body>
2252 </html>