36
36
<td valign="top" align="right"></td>
37
37
</tr></table></div>
38
<div class="refsynopsisdiv" title="Synopsis">
38
<div class="refsynopsisdiv">
39
39
<a name="gi-GICallableInfo.synopsis"></a><h2>Synopsis</h2>
40
<pre class="synopsis">typedef <a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo">GICallableInfo</a>;
41
<a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="returnvalue">GITypeInfo</span></a> * <a class="link" href="gi-GICallableInfo.html#g-callable-info-get-return-type" title="g_callable_info_get_return_type ()">g_callable_info_get_return_type</a> (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>);
40
<pre class="synopsis">#define <a class="link" href="gi-GICallableInfo.html#GI-IS-CALLABLE-INFO:CAPS" title="GI_IS_CALLABLE_INFO()">GI_IS_CALLABLE_INFO</a> (info)
41
typedef <a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo">GICallableInfo</a>;
42
<a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="returnvalue">GITypeInfo</span></a> * <a class="link" href="gi-GICallableInfo.html#g-callable-info-get-return-type" title="g_callable_info_get_return_type ()">g_callable_info_get_return_type</a> (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>);
42
43
<a class="link" href="gi-GIArgInfo.html#GITransfer" title="enum GITransfer"><span class="returnvalue">GITransfer</span></a> <a class="link" href="gi-GICallableInfo.html#g-callable-info-get-caller-owns" title="g_callable_info_get_caller_owns ()">g_callable_info_get_caller_owns</a> (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>);
43
44
<span class="returnvalue">gboolean</span> <a class="link" href="gi-GICallableInfo.html#g-callable-info-may-return-null" title="g_callable_info_may_return_null ()">g_callable_info_may_return_null</a> (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>);
45
const <span class="returnvalue">gchar</span> * <a class="link" href="gi-GICallableInfo.html#g-callable-info-get-return-attribute" title="g_callable_info_get_return_attribute ()">g_callable_info_get_return_attribute</a>
46
(<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>,
47
<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>);
48
<span class="returnvalue">gboolean</span> <a class="link" href="gi-GICallableInfo.html#g-callable-info-iterate-return-attributes" title="g_callable_info_iterate_return_attributes ()">g_callable_info_iterate_return_attributes</a>
49
(<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>,
50
<em class="parameter"><code><a class="link" href="gi-GIBaseInfo.html#GIAttributeIter" title="GIAttributeIter"><span class="type">GIAttributeIter</span></a> *iterator</code></em>,
51
<em class="parameter"><code><span class="type">char</span> **name</code></em>,
52
<em class="parameter"><code><span class="type">char</span> **value</code></em>);
44
53
<span class="returnvalue">gint</span> <a class="link" href="gi-GICallableInfo.html#g-callable-info-get-n-args" title="g_callable_info_get_n_args ()">g_callable_info_get_n_args</a> (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>);
45
<a class="link" href="gi-GIArgInfo.html#GIArgInfo" title="GIArgInfo"><span class="returnvalue">GIArgInfo</span></a> * <a class="link" href="gi-GICallableInfo.html#g-callable-info-get-arg" title="g_callable_info_get_arg ()">g_callable_info_get_arg</a> (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>,
54
<a class="link" href="gi-GIArgInfo.html#GIArgInfo" title="GIArgInfo"><span class="returnvalue">GIArgInfo</span></a> * <a class="link" href="gi-GICallableInfo.html#g-callable-info-get-arg" title="g_callable_info_get_arg ()">g_callable_info_get_arg</a> (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>,
46
55
<em class="parameter"><code><span class="type">gint</span> n</code></em>);
47
56
<span class="returnvalue">void</span> <a class="link" href="gi-GICallableInfo.html#g-callable-info-load-arg" title="g_callable_info_load_arg ()">g_callable_info_load_arg</a> (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>,
48
57
<em class="parameter"><code><span class="type">gint</span> n</code></em>,
51
60
<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *type</code></em>);
54
<div class="refsect1" title="Description">
63
<div class="refsect1">
55
64
<a name="gi-GICallableInfo.description"></a><h2>Description</h2>
57
66
GICallableInfo represents an entity which is callable.
58
67
Currently a function (<a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a>), virtual function,
59
(<span class="type">GIVirtualFunc</span>) or callback (<a class="link" href="gi-girepository.html#GICallbackInfo" title="GICallbackInfo"><span class="type">GICallbackInfo</span></a>).
68
(<a class="link" href="gi-GIVFuncInfo.html#GIVFuncInfo" title="GIVFuncInfo"><span class="type">GIVFuncInfo</span></a>) or callback (<a class="link" href="gi-girepository.html#GICallbackInfo" title="GICallbackInfo"><span class="type">GICallbackInfo</span></a>).
62
71
A callable has a list of arguments (<a class="link" href="gi-GIArgInfo.html#GIArgInfo" title="GIArgInfo"><span class="type">GIArgInfo</span></a>), a return type,
63
72
direction and a flag which decides if it returns null.
66
<div class="refsect1" title="Details">
76
<div class="refsect1">
77
<a name="gi-gicallableinfo.struct-hierarchy"></a><h2>Struct hierarchy</h2>
78
<pre class="synopsis">
79
<a class="link" href="gi-GIBaseInfo.html" title="GIBaseInfo">GIBaseInfo</a>
81
+----<a class="link" href="gi-GIFunctionInfo.html" title="GIFunctionInfo">GIFunctionInfo</a>
82
+----<a class="link" href="gi-GISignalInfo.html" title="GISignalInfo">GISignalInfo</a>
83
+----<a class="link" href="gi-GIVFuncInfo.html" title="GIVFuncInfo">GIVFuncInfo</a>
89
<div class="refsect1">
67
90
<a name="gi-GICallableInfo.details"></a><h2>Details</h2>
68
<div class="refsect2" title="GICallableInfo">
91
<div class="refsect2">
92
<a name="GI-IS-CALLABLE-INFO:CAPS"></a><h3>GI_IS_CALLABLE_INFO()</h3>
93
<pre class="programlisting">#define GI_IS_CALLABLE_INFO(info)</pre>
98
<div class="refsect2">
69
99
<a name="GICallableInfo"></a><h3>GICallableInfo</h3>
70
100
<pre class="programlisting">typedef GIBaseInfo GICallableInfo;
73
103
Represents a callable, either <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a>, <a class="link" href="gi-girepository.html#GICallbackInfo" title="GICallbackInfo"><span class="type">GICallbackInfo</span></a> or
74
<a class="link" href="gi-givfuncinfo.html#GIVFuncInfo" title="GIVFuncInfo"><span class="type">GIVFuncInfo</span></a>.
104
<a class="link" href="gi-GIVFuncInfo.html#GIVFuncInfo" title="GIVFuncInfo"><span class="type">GIVFuncInfo</span></a>.
78
<div class="refsect2" title="g_callable_info_get_return_type ()">
108
<div class="refsect2">
79
109
<a name="g-callable-info-get-return-type"></a><h3>g_callable_info_get_return_type ()</h3>
80
<pre class="programlisting"><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="returnvalue">GITypeInfo</span></a> * g_callable_info_get_return_type (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>);</pre>
110
<pre class="programlisting"><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="returnvalue">GITypeInfo</span></a> * g_callable_info_get_return_type (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>);</pre>
82
112
Obtain the return type of a callable item as a <a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a>.
93
123
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
94
<td> the <a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a>. Free the struct by calling
95
<a class="link" href="gi-GIBaseInfo.html#g-base-info-unref" title="g_base_info_unref ()"><code class="function">g_base_info_unref()</code></a> when done.. <acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>. </td>
124
<td>the <a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a>. Free the struct by calling
125
<a class="link" href="gi-GIBaseInfo.html#g-base-info-unref" title="g_base_info_unref ()"><code class="function">g_base_info_unref()</code></a> when done. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
101
<div class="refsect2" title="g_callable_info_get_caller_owns ()">
132
<div class="refsect2">
102
133
<a name="g-callable-info-get-caller-owns"></a><h3>g_callable_info_get_caller_owns ()</h3>
103
134
<pre class="programlisting"><a class="link" href="gi-GIArgInfo.html#GITransfer" title="enum GITransfer"><span class="returnvalue">GITransfer</span></a> g_callable_info_get_caller_owns (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>);</pre>
117
148
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
118
<td> <code class="literal">TRUE</code> if the caller owns the return value, <code class="literal">FALSE</code> otherwise.
150
<code class="literal">TRUE</code> if the caller owns the return value, <code class="literal">FALSE</code> otherwise.</td>
125
<div class="refsect2" title="g_callable_info_may_return_null ()">
156
<div class="refsect2">
126
157
<a name="g-callable-info-may-return-null"></a><h3>g_callable_info_may_return_null ()</h3>
127
158
<pre class="programlisting"><span class="returnvalue">gboolean</span> g_callable_info_may_return_null (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>);</pre>
140
171
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
141
<td> <code class="literal">TRUE</code> if callable could return <code class="literal">NULL</code>
148
<div class="refsect2" title="g_callable_info_get_n_args ()">
173
<code class="literal">TRUE</code> if callable could return <code class="literal">NULL</code>
180
<div class="refsect2">
181
<a name="g-callable-info-get-return-attribute"></a><h3>g_callable_info_get_return_attribute ()</h3>
182
<pre class="programlisting">const <span class="returnvalue">gchar</span> * g_callable_info_get_return_attribute
183
(<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>,
184
<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>);</pre>
186
Retrieve an arbitrary attribute associated with the return value.
188
<div class="variablelist"><table border="0">
189
<col align="left" valign="top">
192
<td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
193
<td>a <a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a>
197
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
198
<td>a freeform string naming an attribute</td>
201
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
202
<td>The value of the attribute, or <code class="literal">NULL</code> if no such attribute exists</td>
208
<div class="refsect2">
209
<a name="g-callable-info-iterate-return-attributes"></a><h3>g_callable_info_iterate_return_attributes ()</h3>
210
<pre class="programlisting"><span class="returnvalue">gboolean</span> g_callable_info_iterate_return_attributes
211
(<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>,
212
<em class="parameter"><code><a class="link" href="gi-GIBaseInfo.html#GIAttributeIter" title="GIAttributeIter"><span class="type">GIAttributeIter</span></a> *iterator</code></em>,
213
<em class="parameter"><code><span class="type">char</span> **name</code></em>,
214
<em class="parameter"><code><span class="type">char</span> **value</code></em>);</pre>
216
Iterate over all attributes associated with the return value. The
217
iterator structure is typically stack allocated, and must have its
218
first member initialized to <code class="literal">NULL</code>.
221
Both the <em class="parameter"><code>name</code></em> and <em class="parameter"><code>value</code></em> should be treated as constants
222
and must not be freed.
225
See <a class="link" href="gi-GIBaseInfo.html#g-base-info-iterate-attributes" title="g_base_info_iterate_attributes ()"><code class="function">g_base_info_iterate_attributes()</code></a> for an example of how to use a
228
<div class="variablelist"><table border="0">
229
<col align="left" valign="top">
232
<td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
233
<td>a <a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a>
237
<td><p><span class="term"><em class="parameter"><code>iterator</code></em> :</span></p></td>
238
<td>a <a class="link" href="gi-GIBaseInfo.html#GIAttributeIter" title="GIAttributeIter"><span class="type">GIAttributeIter</span></a> structure, must be initialized; see below</td>
241
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
242
<td>Returned name, must not be freed. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
246
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
247
<td>Returned name, must not be freed. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
251
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
253
<code class="literal">TRUE</code> if there are more attributes</td>
259
<div class="refsect2">
149
260
<a name="g-callable-info-get-n-args"></a><h3>g_callable_info_get_n_args ()</h3>
150
261
<pre class="programlisting"><span class="returnvalue">gint</span> g_callable_info_get_n_args (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>);</pre>
163
274
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
164
<td> The number of arguments this callable expects.
275
<td>The number of arguments this callable expects.</td>
171
<div class="refsect2" title="g_callable_info_get_arg ()">
281
<div class="refsect2">
172
282
<a name="g-callable-info-get-arg"></a><h3>g_callable_info_get_arg ()</h3>
173
<pre class="programlisting"><a class="link" href="gi-GIArgInfo.html#GIArgInfo" title="GIArgInfo"><span class="returnvalue">GIArgInfo</span></a> * g_callable_info_get_arg (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>,
283
<pre class="programlisting"><a class="link" href="gi-GIArgInfo.html#GIArgInfo" title="GIArgInfo"><span class="returnvalue">GIArgInfo</span></a> * g_callable_info_get_arg (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>,
174
284
<em class="parameter"><code><span class="type">gint</span> n</code></em>);</pre>
176
286
Obtain information about a particular argument of this callable.
187
297
<td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td>
188
<td>the argument index to fetch
298
<td>the argument index to fetch</td>
192
301
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
193
<td> the <a class="link" href="gi-GIArgInfo.html#GIArgInfo" title="GIArgInfo"><span class="type">GIArgInfo</span></a>. Free it with
194
<a class="link" href="gi-GIBaseInfo.html#g-base-info-unref" title="g_base_info_unref ()"><code class="function">g_base_info_unref()</code></a> when done.. <acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>. </td>
302
<td>the <a class="link" href="gi-GIArgInfo.html#GIArgInfo" title="GIArgInfo"><span class="type">GIArgInfo</span></a>. Free it with
303
<a class="link" href="gi-GIBaseInfo.html#g-base-info-unref" title="g_base_info_unref ()"><code class="function">g_base_info_unref()</code></a> when done. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
200
<div class="refsect2" title="g_callable_info_load_arg ()">
310
<div class="refsect2">
201
311
<a name="g-callable-info-load-arg"></a><h3>g_callable_info_load_arg ()</h3>
202
312
<pre class="programlisting"><span class="returnvalue">void</span> g_callable_info_load_arg (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>,
203
313
<em class="parameter"><code><span class="type">gint</span> n</code></em>,
222
332
<td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td>
223
<td>the argument index to fetch
333
<td>the argument index to fetch</td>
227
336
<td><p><span class="term"><em class="parameter"><code>arg</code></em> :</span></p></td>
228
<td> Initialize with argument number <em class="parameter"><code>n</code></em>. <acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym> caller-allocates. </td>
337
<td>Initialize with argument number <em class="parameter"><code>n</code></em>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym> caller-allocates]</span>
234
<div class="refsect2" title="g_callable_info_load_return_type ()">
344
<div class="refsect2">
235
345
<a name="g-callable-info-load-return-type"></a><h3>g_callable_info_load_return_type ()</h3>
236
346
<pre class="programlisting"><span class="returnvalue">void</span> g_callable_info_load_return_type (<em class="parameter"><code><a class="link" href="gi-GICallableInfo.html#GICallableInfo" title="GICallableInfo"><span class="type">GICallableInfo</span></a> *info</code></em>,
237
347
<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *type</code></em>);</pre>