Imported Upstream version 1.49.1
[platform/upstream/gobject-introspection.git] / docs / reference / html / gi-GIEnumInfo.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>GIEnumInfo: GObject Introspection Reference Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="index.html" title="GObject Introspection Reference Manual">
8 <link rel="up" href="ch01.html" title="GIRepository">
9 <link rel="prev" href="gi-GIRegisteredTypeInfo.html" title="GIRegisteredTypeInfo">
10 <link rel="next" href="gi-GIStructInfo.html" title="GIStructInfo">
11 <meta name="generator" content="GTK-Doc V1.25.1 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
16 <td width="100%" align="left" class="shortcuts">
17 <a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
18                   <a href="#gi-GIEnumInfo.description" class="shortcut">Description</a></span>
19 </td>
20 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
21 <td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
22 <td><a accesskey="p" href="gi-GIRegisteredTypeInfo.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
23 <td><a accesskey="n" href="gi-GIStructInfo.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
24 </tr></table>
25 <div class="refentry">
26 <a name="gi-GIEnumInfo"></a><div class="titlepage"></div>
27 <div class="refnamediv"><table width="100%"><tr>
28 <td valign="top">
29 <h2><span class="refentrytitle"><a name="gi-GIEnumInfo.top_of_page"></a>GIEnumInfo</span></h2>
30 <p>GIEnumInfo — Structs representing an enumeration and its values</p>
31 </td>
32 <td class="gallery_image" valign="top" align="right"></td>
33 </tr></table></div>
34 <div class="refsect1">
35 <a name="gi-GIEnumInfo.functions"></a><h2>Functions</h2>
36 <div class="informaltable"><table class="informaltable" width="100%" border="0">
37 <colgroup>
38 <col width="150px" class="functions_return">
39 <col class="functions_name">
40 </colgroup>
41 <tbody>
42 <tr>
43 <td class="define_keyword">#define</td>
44 <td class="function_name">
45 <a class="link" href="gi-GIEnumInfo.html#GI-IS-ENUM-INFO:CAPS" title="GI_IS_ENUM_INFO()">GI_IS_ENUM_INFO</a><span class="c_punctuation">()</span>
46 </td>
47 </tr>
48 <tr>
49 <td class="define_keyword">#define</td>
50 <td class="function_name">
51 <a class="link" href="gi-GIEnumInfo.html#GI-IS-VALUE-INFO:CAPS" title="GI_IS_VALUE_INFO()">GI_IS_VALUE_INFO</a><span class="c_punctuation">()</span>
52 </td>
53 </tr>
54 <tr>
55 <td class="function_type">
56 <span class="returnvalue">gint</span>
57 </td>
58 <td class="function_name">
59 <a class="link" href="gi-GIEnumInfo.html#g-enum-info-get-n-values" title="g_enum_info_get_n_values ()">g_enum_info_get_n_values</a> <span class="c_punctuation">()</span>
60 </td>
61 </tr>
62 <tr>
63 <td class="function_type">
64 <a class="link" href="gi-GIValueInfo.html#GIValueInfo" title="GIValueInfo"><span class="returnvalue">GIValueInfo</span></a> *
65 </td>
66 <td class="function_name">
67 <a class="link" href="gi-GIEnumInfo.html#g-enum-info-get-value" title="g_enum_info_get_value ()">g_enum_info_get_value</a> <span class="c_punctuation">()</span>
68 </td>
69 </tr>
70 <tr>
71 <td class="function_type">
72 <span class="returnvalue">gint</span>
73 </td>
74 <td class="function_name">
75 <a class="link" href="gi-GIEnumInfo.html#g-enum-info-get-n-methods" title="g_enum_info_get_n_methods ()">g_enum_info_get_n_methods</a> <span class="c_punctuation">()</span>
76 </td>
77 </tr>
78 <tr>
79 <td class="function_type">
80 <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="returnvalue">GIFunctionInfo</span></a> *
81 </td>
82 <td class="function_name">
83 <a class="link" href="gi-GIEnumInfo.html#g-enum-info-get-method" title="g_enum_info_get_method ()">g_enum_info_get_method</a> <span class="c_punctuation">()</span>
84 </td>
85 </tr>
86 <tr>
87 <td class="function_type">
88 <a class="link" href="gi-common-types.html#GITypeTag" title="enum GITypeTag"><span class="returnvalue">GITypeTag</span></a>
89 </td>
90 <td class="function_name">
91 <a class="link" href="gi-GIEnumInfo.html#g-enum-info-get-storage-type" title="g_enum_info_get_storage_type ()">g_enum_info_get_storage_type</a> <span class="c_punctuation">()</span>
92 </td>
93 </tr>
94 <tr>
95 <td class="function_type">const <span class="returnvalue">gchar</span> *
96 </td>
97 <td class="function_name">
98 <a class="link" href="gi-GIEnumInfo.html#g-enum-info-get-error-domain" title="g_enum_info_get_error_domain ()">g_enum_info_get_error_domain</a> <span class="c_punctuation">()</span>
99 </td>
100 </tr>
101 <tr>
102 <td class="function_type">
103 <span class="returnvalue">gint64</span>
104 </td>
105 <td class="function_name">
106 <a class="link" href="gi-GIEnumInfo.html#g-value-info-get-value" title="g_value_info_get_value ()">g_value_info_get_value</a> <span class="c_punctuation">()</span>
107 </td>
108 </tr>
109 </tbody>
110 </table></div>
111 </div>
112 <div class="refsect1">
113 <a name="gi-GIEnumInfo.other"></a><h2>Types and Values</h2>
114 <div class="informaltable"><table class="informaltable" width="100%" border="0">
115 <colgroup>
116 <col width="150px" class="name">
117 <col class="description">
118 </colgroup>
119 <tbody><tr>
120 <td class="typedef_keyword">typedef</td>
121 <td class="function_name"><a class="link" href="gi-GIEnumInfo.html#GIEnumInfo" title="GIEnumInfo">GIEnumInfo</a></td>
122 </tr></tbody>
123 </table></div>
124 </div>
125 <div class="refsect1">
126 <a name="gi-GIEnumInfo.description"></a><h2>Description</h2>
127 <p>A GIEnumInfo represents an enumeration and a GIValueInfo struct represents a value
128 of an enumeration. The GIEnumInfo contains a set of values and a type
129 The GIValueInfo is fetched by calling <a class="link" href="gi-GIEnumInfo.html#g-enum-info-get-value" title="g_enum_info_get_value ()"><code class="function">g_enum_info_get_value()</code></a> on a <a class="link" href="gi-GIEnumInfo.html#GIEnumInfo" title="GIEnumInfo"><span class="type">GIEnumInfo</span></a>.</p>
130 <div class="refsect1">
131 <a name="gi-gienuminfo.struct-hierarchy"></a><h2>Struct hierarchy</h2>
132 <pre class="synopsis">
133   <a class="link" href="gi-GIBaseInfo.html" title="GIBaseInfo">GIBaseInfo</a>
134    +----<a class="link" href="gi-GIRegisteredTypeInfo.html" title="GIRegisteredTypeInfo">GIRegisteredTypeInfo</a>
135          +----GIEnumInfo
136 </pre>
137 </div>
138 </div>
139 <div class="refsect1">
140 <a name="gi-GIEnumInfo.functions_details"></a><h2>Functions</h2>
141 <div class="refsect2">
142 <a name="GI-IS-ENUM-INFO:CAPS"></a><h3>GI_IS_ENUM_INFO()</h3>
143 <pre class="programlisting">#define             GI_IS_ENUM_INFO(info)</pre>
144 <p>Checks if <em class="parameter"><code>info</code></em>
145  is a <a class="link" href="gi-GIEnumInfo.html#GIEnumInfo" title="GIEnumInfo"><span class="type">GIEnumInfo</span></a>.</p>
146 <div class="refsect3">
147 <a name="GI-IS-ENUM-INFO.parameters"></a><h4>Parameters</h4>
148 <div class="informaltable"><table class="informaltable" width="100%" border="0">
149 <colgroup>
150 <col width="150px" class="parameters_name">
151 <col class="parameters_description">
152 <col width="200px" class="parameters_annotations">
153 </colgroup>
154 <tbody><tr>
155 <td class="parameter_name"><p>info</p></td>
156 <td class="parameter_description"><p>an info structure</p></td>
157 <td class="parameter_annotations"> </td>
158 </tr></tbody>
159 </table></div>
160 </div>
161 </div>
162 <hr>
163 <div class="refsect2">
164 <a name="GI-IS-VALUE-INFO:CAPS"></a><h3>GI_IS_VALUE_INFO()</h3>
165 <pre class="programlisting">#define             GI_IS_VALUE_INFO(info)</pre>
166 <p>Checks if <em class="parameter"><code>info</code></em>
167  is a <a class="link" href="gi-GIValueInfo.html#GIValueInfo" title="GIValueInfo"><span class="type">GIValueInfo</span></a>.</p>
168 <div class="refsect3">
169 <a name="GI-IS-VALUE-INFO.parameters"></a><h4>Parameters</h4>
170 <div class="informaltable"><table class="informaltable" width="100%" border="0">
171 <colgroup>
172 <col width="150px" class="parameters_name">
173 <col class="parameters_description">
174 <col width="200px" class="parameters_annotations">
175 </colgroup>
176 <tbody><tr>
177 <td class="parameter_name"><p>info</p></td>
178 <td class="parameter_description"><p>an info structure</p></td>
179 <td class="parameter_annotations"> </td>
180 </tr></tbody>
181 </table></div>
182 </div>
183 </div>
184 <hr>
185 <div class="refsect2">
186 <a name="g-enum-info-get-n-values"></a><h3>g_enum_info_get_n_values ()</h3>
187 <pre class="programlisting"><span class="returnvalue">gint</span>
188 g_enum_info_get_n_values (<em class="parameter"><code><a class="link" href="gi-GIEnumInfo.html#GIEnumInfo" title="GIEnumInfo"><span class="type">GIEnumInfo</span></a> *info</code></em>);</pre>
189 <p>Obtain the number of values this enumeration contains.</p>
190 <div class="refsect3">
191 <a name="g-enum-info-get-n-values.parameters"></a><h4>Parameters</h4>
192 <div class="informaltable"><table class="informaltable" width="100%" border="0">
193 <colgroup>
194 <col width="150px" class="parameters_name">
195 <col class="parameters_description">
196 <col width="200px" class="parameters_annotations">
197 </colgroup>
198 <tbody><tr>
199 <td class="parameter_name"><p>info</p></td>
200 <td class="parameter_description"><p>a <a class="link" href="gi-GIEnumInfo.html#GIEnumInfo" title="GIEnumInfo"><span class="type">GIEnumInfo</span></a></p></td>
201 <td class="parameter_annotations"> </td>
202 </tr></tbody>
203 </table></div>
204 </div>
205 <div class="refsect3">
206 <a name="g-enum-info-get-n-values.returns"></a><h4>Returns</h4>
207 <p> the number of enumeration values</p>
208 </div>
209 </div>
210 <hr>
211 <div class="refsect2">
212 <a name="g-enum-info-get-value"></a><h3>g_enum_info_get_value ()</h3>
213 <pre class="programlisting"><a class="link" href="gi-GIValueInfo.html#GIValueInfo" title="GIValueInfo"><span class="returnvalue">GIValueInfo</span></a> *
214 g_enum_info_get_value (<em class="parameter"><code><a class="link" href="gi-GIEnumInfo.html#GIEnumInfo" title="GIEnumInfo"><span class="type">GIEnumInfo</span></a> *info</code></em>,
215                        <em class="parameter"><code><span class="type">gint</span> n</code></em>);</pre>
216 <p>Obtain a value for this enumeration.</p>
217 <div class="refsect3">
218 <a name="g-enum-info-get-value.parameters"></a><h4>Parameters</h4>
219 <div class="informaltable"><table class="informaltable" width="100%" border="0">
220 <colgroup>
221 <col width="150px" class="parameters_name">
222 <col class="parameters_description">
223 <col width="200px" class="parameters_annotations">
224 </colgroup>
225 <tbody>
226 <tr>
227 <td class="parameter_name"><p>info</p></td>
228 <td class="parameter_description"><p>a <a class="link" href="gi-GIEnumInfo.html#GIEnumInfo" title="GIEnumInfo"><span class="type">GIEnumInfo</span></a></p></td>
229 <td class="parameter_annotations"> </td>
230 </tr>
231 <tr>
232 <td class="parameter_name"><p>n</p></td>
233 <td class="parameter_description"><p>index of value to fetch</p></td>
234 <td class="parameter_annotations"> </td>
235 </tr>
236 </tbody>
237 </table></div>
238 </div>
239 <div class="refsect3">
240 <a name="g-enum-info-get-value.returns"></a><h4>Returns</h4>
241 <p> the enumeration value or <code class="literal">NULL</code> if type tag is wrong,
242 free the struct with <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. </p>
243 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
244 </div>
245 </div>
246 <hr>
247 <div class="refsect2">
248 <a name="g-enum-info-get-n-methods"></a><h3>g_enum_info_get_n_methods ()</h3>
249 <pre class="programlisting"><span class="returnvalue">gint</span>
250 g_enum_info_get_n_methods (<em class="parameter"><code><a class="link" href="gi-GIEnumInfo.html#GIEnumInfo" title="GIEnumInfo"><span class="type">GIEnumInfo</span></a> *info</code></em>);</pre>
251 <p>Obtain the number of methods that this enum type has.</p>
252 <div class="refsect3">
253 <a name="g-enum-info-get-n-methods.parameters"></a><h4>Parameters</h4>
254 <div class="informaltable"><table class="informaltable" width="100%" border="0">
255 <colgroup>
256 <col width="150px" class="parameters_name">
257 <col class="parameters_description">
258 <col width="200px" class="parameters_annotations">
259 </colgroup>
260 <tbody><tr>
261 <td class="parameter_name"><p>info</p></td>
262 <td class="parameter_description"><p>a <a class="link" href="gi-GIEnumInfo.html#GIEnumInfo" title="GIEnumInfo"><span class="type">GIEnumInfo</span></a></p></td>
263 <td class="parameter_annotations"> </td>
264 </tr></tbody>
265 </table></div>
266 </div>
267 <div class="refsect3">
268 <a name="g-enum-info-get-n-methods.returns"></a><h4>Returns</h4>
269 <p> number of methods</p>
270 </div>
271 <p class="since">Since: <a class="link" href="api-index-1-29-17.html#api-index-1.29.17">1.29.17</a></p>
272 </div>
273 <hr>
274 <div class="refsect2">
275 <a name="g-enum-info-get-method"></a><h3>g_enum_info_get_method ()</h3>
276 <pre class="programlisting"><a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="returnvalue">GIFunctionInfo</span></a> *
277 g_enum_info_get_method (<em class="parameter"><code><a class="link" href="gi-GIEnumInfo.html#GIEnumInfo" title="GIEnumInfo"><span class="type">GIEnumInfo</span></a> *info</code></em>,
278                         <em class="parameter"><code><span class="type">gint</span> n</code></em>);</pre>
279 <p>Obtain an enum type method at index <em class="parameter"><code>n</code></em>
280 .</p>
281 <div class="refsect3">
282 <a name="g-enum-info-get-method.parameters"></a><h4>Parameters</h4>
283 <div class="informaltable"><table class="informaltable" width="100%" border="0">
284 <colgroup>
285 <col width="150px" class="parameters_name">
286 <col class="parameters_description">
287 <col width="200px" class="parameters_annotations">
288 </colgroup>
289 <tbody>
290 <tr>
291 <td class="parameter_name"><p>info</p></td>
292 <td class="parameter_description"><p>a <a class="link" href="gi-GIEnumInfo.html#GIEnumInfo" title="GIEnumInfo"><span class="type">GIEnumInfo</span></a></p></td>
293 <td class="parameter_annotations"> </td>
294 </tr>
295 <tr>
296 <td class="parameter_name"><p>n</p></td>
297 <td class="parameter_description"><p>index of method to get</p></td>
298 <td class="parameter_annotations"> </td>
299 </tr>
300 </tbody>
301 </table></div>
302 </div>
303 <div class="refsect3">
304 <a name="g-enum-info-get-method.returns"></a><h4>Returns</h4>
305 <p> the <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a>. Free the struct by calling
306 <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. </p>
307 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
308 </div>
309 <p class="since">Since: <a class="link" href="api-index-1-29-17.html#api-index-1.29.17">1.29.17</a></p>
310 </div>
311 <hr>
312 <div class="refsect2">
313 <a name="g-enum-info-get-storage-type"></a><h3>g_enum_info_get_storage_type ()</h3>
314 <pre class="programlisting"><a class="link" href="gi-common-types.html#GITypeTag" title="enum GITypeTag"><span class="returnvalue">GITypeTag</span></a>
315 g_enum_info_get_storage_type (<em class="parameter"><code><a class="link" href="gi-GIEnumInfo.html#GIEnumInfo" title="GIEnumInfo"><span class="type">GIEnumInfo</span></a> *info</code></em>);</pre>
316 <p>Obtain the tag of the type used for the enum in the C ABI. This will
317 will be a signed or unsigned integral type.</p>
318 <p>Note that in the current implementation the width of the type is
319 computed correctly, but the signed or unsigned nature of the type
320 may not match the sign of the type used by the C compiler.</p>
321 <div class="refsect3">
322 <a name="g-enum-info-get-storage-type.parameters"></a><h4>Parameters</h4>
323 <div class="informaltable"><table class="informaltable" width="100%" border="0">
324 <colgroup>
325 <col width="150px" class="parameters_name">
326 <col class="parameters_description">
327 <col width="200px" class="parameters_annotations">
328 </colgroup>
329 <tbody><tr>
330 <td class="parameter_name"><p>info</p></td>
331 <td class="parameter_description"><p>a <a class="link" href="gi-GIEnumInfo.html#GIEnumInfo" title="GIEnumInfo"><span class="type">GIEnumInfo</span></a></p></td>
332 <td class="parameter_annotations"> </td>
333 </tr></tbody>
334 </table></div>
335 </div>
336 <div class="refsect3">
337 <a name="g-enum-info-get-storage-type.returns"></a><h4>Returns</h4>
338 <p> the storage type for the enumeration</p>
339 </div>
340 </div>
341 <hr>
342 <div class="refsect2">
343 <a name="g-enum-info-get-error-domain"></a><h3>g_enum_info_get_error_domain ()</h3>
344 <pre class="programlisting">const <span class="returnvalue">gchar</span> *
345 g_enum_info_get_error_domain (<em class="parameter"><code><a class="link" href="gi-GIEnumInfo.html#GIEnumInfo" title="GIEnumInfo"><span class="type">GIEnumInfo</span></a> *info</code></em>);</pre>
346 <p>Obtain the string form of the quark for the error domain associated with
347 this enum, if any.</p>
348 <div class="refsect3">
349 <a name="g-enum-info-get-error-domain.parameters"></a><h4>Parameters</h4>
350 <div class="informaltable"><table class="informaltable" width="100%" border="0">
351 <colgroup>
352 <col width="150px" class="parameters_name">
353 <col class="parameters_description">
354 <col width="200px" class="parameters_annotations">
355 </colgroup>
356 <tbody><tr>
357 <td class="parameter_name"><p>info</p></td>
358 <td class="parameter_description"><p>a <a class="link" href="gi-GIEnumInfo.html#GIEnumInfo" title="GIEnumInfo"><span class="type">GIEnumInfo</span></a></p></td>
359 <td class="parameter_annotations"> </td>
360 </tr></tbody>
361 </table></div>
362 </div>
363 <div class="refsect3">
364 <a name="g-enum-info-get-error-domain.returns"></a><h4>Returns</h4>
365 <p> the string form of the error domain associated
366 with this enum, or <code class="literal">NULL</code>. </p>
367 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
368 </div>
369 <p class="since">Since: <a class="link" href="api-index-1-29-17.html#api-index-1.29.17">1.29.17</a></p>
370 </div>
371 <hr>
372 <div class="refsect2">
373 <a name="g-value-info-get-value"></a><h3>g_value_info_get_value ()</h3>
374 <pre class="programlisting"><span class="returnvalue">gint64</span>
375 g_value_info_get_value (<em class="parameter"><code><a class="link" href="gi-GIValueInfo.html#GIValueInfo" title="GIValueInfo"><span class="type">GIValueInfo</span></a> *info</code></em>);</pre>
376 <p>Obtain the enumeration value of the <a class="link" href="gi-GIValueInfo.html#GIValueInfo" title="GIValueInfo"><span class="type">GIValueInfo</span></a>.</p>
377 <div class="refsect3">
378 <a name="g-value-info-get-value.parameters"></a><h4>Parameters</h4>
379 <div class="informaltable"><table class="informaltable" width="100%" border="0">
380 <colgroup>
381 <col width="150px" class="parameters_name">
382 <col class="parameters_description">
383 <col width="200px" class="parameters_annotations">
384 </colgroup>
385 <tbody><tr>
386 <td class="parameter_name"><p>info</p></td>
387 <td class="parameter_description"><p>a <a class="link" href="gi-GIValueInfo.html#GIValueInfo" title="GIValueInfo"><span class="type">GIValueInfo</span></a></p></td>
388 <td class="parameter_annotations"> </td>
389 </tr></tbody>
390 </table></div>
391 </div>
392 <div class="refsect3">
393 <a name="g-value-info-get-value.returns"></a><h4>Returns</h4>
394 <p> the enumeration value. This will always be representable
395 as a 32-bit signed or unsigned value. The use of gint64 as the
396 return type is to allow both.</p>
397 </div>
398 </div>
399 </div>
400 <div class="refsect1">
401 <a name="gi-GIEnumInfo.other_details"></a><h2>Types and Values</h2>
402 <div class="refsect2">
403 <a name="GIEnumInfo"></a><h3>GIEnumInfo</h3>
404 <pre class="programlisting">typedef GIBaseInfo GIEnumInfo;
405 </pre>
406 <p>Represents an enum or a flag.</p>
407 </div>
408 </div>
409 </div>
410 <div class="footer">
411 <hr>Generated by GTK-Doc V1.25.1</div>
412 </body>
413 </html>