Imported Upstream version 2.50.2
[platform/upstream/glib.git] / docs / reference / gio / html / gio-Extension-Points.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>Extension Points: GIO Reference Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="index.html" title="GIO Reference Manual">
8 <link rel="up" href="extending.html" title="Extending GIO">
9 <link rel="prev" href="GIOModule.html" title="GIOModule">
10 <link rel="next" href="tools.html" title="GIO Tools">
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="#gio-Extension-Points.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="extending.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
22 <td><a accesskey="p" href="GIOModule.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
23 <td><a accesskey="n" href="tools.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="gio-Extension-Points"></a><div class="titlepage"></div>
27 <div class="refnamediv"><table width="100%"><tr>
28 <td valign="top">
29 <h2><span class="refentrytitle"><a name="gio-Extension-Points.top_of_page"></a>Extension Points</span></h2>
30 <p>Extension Points — Extension Points</p>
31 </td>
32 <td class="gallery_image" valign="top" align="right"></td>
33 </tr></table></div>
34 <div class="refsect1">
35 <a name="gio-Extension-Points.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="function_type">const <span class="returnvalue">char</span> *
44 </td>
45 <td class="function_name">
46 <a class="link" href="gio-Extension-Points.html#g-io-extension-get-name" title="g_io_extension_get_name ()">g_io_extension_get_name</a> <span class="c_punctuation">()</span>
47 </td>
48 </tr>
49 <tr>
50 <td class="function_type">
51 <a href="../glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
52 </td>
53 <td class="function_name">
54 <a class="link" href="gio-Extension-Points.html#g-io-extension-get-priority" title="g_io_extension_get_priority ()">g_io_extension_get_priority</a> <span class="c_punctuation">()</span>
55 </td>
56 </tr>
57 <tr>
58 <td class="function_type">
59 <a href="../gobject-Type-Information.html#GType"><span class="returnvalue">GType</span></a>
60 </td>
61 <td class="function_name">
62 <a class="link" href="gio-Extension-Points.html#g-io-extension-get-type" title="g_io_extension_get_type ()">g_io_extension_get_type</a> <span class="c_punctuation">()</span>
63 </td>
64 </tr>
65 <tr>
66 <td class="function_type">
67 <a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension"><span class="returnvalue">GIOExtension</span></a> *
68 </td>
69 <td class="function_name">
70 <a class="link" href="gio-Extension-Points.html#g-io-extension-point-get-extension-by-name" title="g_io_extension_point_get_extension_by_name ()">g_io_extension_point_get_extension_by_name</a> <span class="c_punctuation">()</span>
71 </td>
72 </tr>
73 <tr>
74 <td class="function_type">
75 <a href="../glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *
76 </td>
77 <td class="function_name">
78 <a class="link" href="gio-Extension-Points.html#g-io-extension-point-get-extensions" title="g_io_extension_point_get_extensions ()">g_io_extension_point_get_extensions</a> <span class="c_punctuation">()</span>
79 </td>
80 </tr>
81 <tr>
82 <td class="function_type">
83 <a href="../gobject-Type-Information.html#GType"><span class="returnvalue">GType</span></a>
84 </td>
85 <td class="function_name">
86 <a class="link" href="gio-Extension-Points.html#g-io-extension-point-get-required-type" title="g_io_extension_point_get_required_type ()">g_io_extension_point_get_required_type</a> <span class="c_punctuation">()</span>
87 </td>
88 </tr>
89 <tr>
90 <td class="function_type">
91 <a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension"><span class="returnvalue">GIOExtension</span></a> *
92 </td>
93 <td class="function_name">
94 <a class="link" href="gio-Extension-Points.html#g-io-extension-point-implement" title="g_io_extension_point_implement ()">g_io_extension_point_implement</a> <span class="c_punctuation">()</span>
95 </td>
96 </tr>
97 <tr>
98 <td class="function_type">
99 <a class="link" href="gio-Extension-Points.html#GIOExtensionPoint" title="GIOExtensionPoint"><span class="returnvalue">GIOExtensionPoint</span></a> *
100 </td>
101 <td class="function_name">
102 <a class="link" href="gio-Extension-Points.html#g-io-extension-point-lookup" title="g_io_extension_point_lookup ()">g_io_extension_point_lookup</a> <span class="c_punctuation">()</span>
103 </td>
104 </tr>
105 <tr>
106 <td class="function_type">
107 <a class="link" href="gio-Extension-Points.html#GIOExtensionPoint" title="GIOExtensionPoint"><span class="returnvalue">GIOExtensionPoint</span></a> *
108 </td>
109 <td class="function_name">
110 <a class="link" href="gio-Extension-Points.html#g-io-extension-point-register" title="g_io_extension_point_register ()">g_io_extension_point_register</a> <span class="c_punctuation">()</span>
111 </td>
112 </tr>
113 <tr>
114 <td class="function_type">
115 <span class="returnvalue">void</span>
116 </td>
117 <td class="function_name">
118 <a class="link" href="gio-Extension-Points.html#g-io-extension-point-set-required-type" title="g_io_extension_point_set_required_type ()">g_io_extension_point_set_required_type</a> <span class="c_punctuation">()</span>
119 </td>
120 </tr>
121 <tr>
122 <td class="function_type">
123 <a href="../gobject-Type-Information.html#GTypeClass"><span class="returnvalue">GTypeClass</span></a> *
124 </td>
125 <td class="function_name">
126 <a class="link" href="gio-Extension-Points.html#g-io-extension-ref-class" title="g_io_extension_ref_class ()">g_io_extension_ref_class</a> <span class="c_punctuation">()</span>
127 </td>
128 </tr>
129 </tbody>
130 </table></div>
131 </div>
132 <div class="refsect1">
133 <a name="gio-Extension-Points.other"></a><h2>Types and Values</h2>
134 <div class="informaltable"><table class="informaltable" width="100%" border="0">
135 <colgroup>
136 <col width="150px" class="name">
137 <col class="description">
138 </colgroup>
139 <tbody>
140 <tr>
141 <td class="datatype_keyword"> </td>
142 <td class="function_name"><a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension">GIOExtension</a></td>
143 </tr>
144 <tr>
145 <td class="datatype_keyword"> </td>
146 <td class="function_name"><a class="link" href="gio-Extension-Points.html#GIOExtensionPoint" title="GIOExtensionPoint">GIOExtensionPoint</a></td>
147 </tr>
148 </tbody>
149 </table></div>
150 </div>
151 <div class="refsect1">
152 <a name="gio-Extension-Points.includes"></a><h2>Includes</h2>
153 <pre class="synopsis">#include &lt;gio.h&gt;
154 </pre>
155 </div>
156 <div class="refsect1">
157 <a name="gio-Extension-Points.description"></a><h2>Description</h2>
158 <p><a class="link" href="gio-Extension-Points.html#GIOExtensionPoint" title="GIOExtensionPoint"><span class="type">GIOExtensionPoint</span></a> provides a mechanism for modules to extend the
159 functionality of the library or application that loaded it in an 
160 organized fashion.  </p>
161 <p>An extension point is identified by a name, and it may optionally
162 require that any implementation must be of a certain type (or derived
163 thereof). Use <a class="link" href="gio-Extension-Points.html#g-io-extension-point-register" title="g_io_extension_point_register ()"><code class="function">g_io_extension_point_register()</code></a> to register an
164 extension point, and <a class="link" href="gio-Extension-Points.html#g-io-extension-point-set-required-type" title="g_io_extension_point_set_required_type ()"><code class="function">g_io_extension_point_set_required_type()</code></a> to
165 set a required type.</p>
166 <p>A module can implement an extension point by specifying the <a href="../gobject-Type-Information.html#GType"><span class="type">GType</span></a> 
167 that implements the functionality. Additionally, each implementation
168 of an extension point has a name, and a priority. Use
169 <a class="link" href="gio-Extension-Points.html#g-io-extension-point-implement" title="g_io_extension_point_implement ()"><code class="function">g_io_extension_point_implement()</code></a> to implement an extension point.</p>
170 <div class="informalexample">
171   <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
172     <tbody>
173       <tr>
174         <td class="listing_lines" align="right"><pre>1
175 2
176 3
177 4
178 5</pre></td>
179         <td class="listing_code"><pre class="programlisting">GIOExtensionPoint <span class="gtkdoc opt">*</span>ep<span class="gtkdoc opt">;</span>
180
181 <span class="gtkdoc slc">// Register an extension point</span>
182 ep <span class="gtkdoc opt">=</span> <span class="function"><a href="gio-Extension-Points.html#g-io-extension-point-register">g_io_extension_point_register</a></span> <span class="gtkdoc opt">(</span><span class="string">&quot;my-extension-point&quot;</span><span class="gtkdoc opt">);</span>
183 <span class="function"><a href="gio-Extension-Points.html#g-io-extension-point-set-required-type">g_io_extension_point_set_required_type</a></span> <span class="gtkdoc opt">(</span>ep<span class="gtkdoc opt">,</span> MY_TYPE_EXAMPLE<span class="gtkdoc opt">);</span></pre></td>
184       </tr>
185     </tbody>
186   </table>
187 </div>
188
189 <p></p>
190 <div class="informalexample">
191   <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
192     <tbody>
193       <tr>
194         <td class="listing_lines" align="right"><pre>1
195 2
196 3
197 4
198 5
199 6</pre></td>
200         <td class="listing_code"><pre class="programlisting"><span class="gtkdoc slc">// Implement an extension point</span>
201 <span class="function"><a href="../gobject-Type-Information.html#G-DEFINE-TYPE:CAPS">G_DEFINE_TYPE</a></span> <span class="gtkdoc opt">(</span>MyExampleImpl<span class="gtkdoc opt">,</span> my_example_impl<span class="gtkdoc opt">,</span> MY_TYPE_EXAMPLE<span class="gtkdoc opt">);</span>
202 <span class="function"><a href="gio-Extension-Points.html#g-io-extension-point-implement">g_io_extension_point_implement</a></span> <span class="gtkdoc opt">(</span><span class="string">&quot;my-extension-point&quot;</span><span class="gtkdoc opt">,</span>
203                                 <span class="function">my_example_impl_get_type</span> <span class="gtkdoc opt">(),</span>
204                                 <span class="string">&quot;my-example&quot;</span><span class="gtkdoc opt">,</span>
205                                 <span class="number">10</span><span class="gtkdoc opt">);</span></pre></td>
206       </tr>
207     </tbody>
208   </table>
209 </div>
210
211 <p></p>
212 <p> It is up to the code that registered the extension point how
213  it uses the implementations that have been associated with it.
214  Depending on the use case, it may use all implementations, or
215  only the one with the highest priority, or pick a specific
216  one by name.</p>
217 <p> To avoid opening all modules just to find out what extension
218  points they implement, GIO makes use of a caching mechanism,
219  see gio-querymodules.
220  You are expected to run this command after installing a
221  GIO module.</p>
222 <p> The <code class="literal">GIO_EXTRA_MODULES</code> environment variable can be used to
223  specify additional directories to automatically load modules
224  from. This environment variable has the same syntax as the
225  <code class="literal">PATH</code>. If two modules have the same base name in different
226  directories, then the latter one will be ignored. If additional
227  directories are specified GIO will load modules from the built-in
228  directory last.</p>
229 </div>
230 <div class="refsect1">
231 <a name="gio-Extension-Points.functions_details"></a><h2>Functions</h2>
232 <div class="refsect2">
233 <a name="g-io-extension-get-name"></a><h3>g_io_extension_get_name ()</h3>
234 <pre class="programlisting">const <span class="returnvalue">char</span> *
235 g_io_extension_get_name (<em class="parameter"><code><a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension"><span class="type">GIOExtension</span></a> *extension</code></em>);</pre>
236 <p>Gets the name under which <em class="parameter"><code>extension</code></em>
237  was registered.</p>
238 <p>Note that the same type may be registered as extension
239 for multiple extension points, under different names.</p>
240 <div class="refsect3">
241 <a name="g-io-extension-get-name.parameters"></a><h4>Parameters</h4>
242 <div class="informaltable"><table class="informaltable" width="100%" border="0">
243 <colgroup>
244 <col width="150px" class="parameters_name">
245 <col class="parameters_description">
246 <col width="200px" class="parameters_annotations">
247 </colgroup>
248 <tbody><tr>
249 <td class="parameter_name"><p>extension</p></td>
250 <td class="parameter_description"><p>a <a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension"><span class="type">GIOExtension</span></a></p></td>
251 <td class="parameter_annotations"> </td>
252 </tr></tbody>
253 </table></div>
254 </div>
255 <div class="refsect3">
256 <a name="g-io-extension-get-name.returns"></a><h4>Returns</h4>
257 <p> the name of <em class="parameter"><code>extension</code></em>
258 .</p>
259 </div>
260 </div>
261 <hr>
262 <div class="refsect2">
263 <a name="g-io-extension-get-priority"></a><h3>g_io_extension_get_priority ()</h3>
264 <pre class="programlisting"><a href="../glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
265 g_io_extension_get_priority (<em class="parameter"><code><a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension"><span class="type">GIOExtension</span></a> *extension</code></em>);</pre>
266 <p>Gets the priority with which <em class="parameter"><code>extension</code></em>
267  was registered.</p>
268 <div class="refsect3">
269 <a name="g-io-extension-get-priority.parameters"></a><h4>Parameters</h4>
270 <div class="informaltable"><table class="informaltable" width="100%" border="0">
271 <colgroup>
272 <col width="150px" class="parameters_name">
273 <col class="parameters_description">
274 <col width="200px" class="parameters_annotations">
275 </colgroup>
276 <tbody><tr>
277 <td class="parameter_name"><p>extension</p></td>
278 <td class="parameter_description"><p>a <a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension"><span class="type">GIOExtension</span></a></p></td>
279 <td class="parameter_annotations"> </td>
280 </tr></tbody>
281 </table></div>
282 </div>
283 <div class="refsect3">
284 <a name="g-io-extension-get-priority.returns"></a><h4>Returns</h4>
285 <p> the priority of <em class="parameter"><code>extension</code></em>
286 </p>
287 </div>
288 </div>
289 <hr>
290 <div class="refsect2">
291 <a name="g-io-extension-get-type"></a><h3>g_io_extension_get_type ()</h3>
292 <pre class="programlisting"><a href="../gobject-Type-Information.html#GType"><span class="returnvalue">GType</span></a>
293 g_io_extension_get_type (<em class="parameter"><code><a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension"><span class="type">GIOExtension</span></a> *extension</code></em>);</pre>
294 <p>Gets the type associated with <em class="parameter"><code>extension</code></em>
295 .</p>
296 <div class="refsect3">
297 <a name="g-io-extension-get-type.parameters"></a><h4>Parameters</h4>
298 <div class="informaltable"><table class="informaltable" width="100%" border="0">
299 <colgroup>
300 <col width="150px" class="parameters_name">
301 <col class="parameters_description">
302 <col width="200px" class="parameters_annotations">
303 </colgroup>
304 <tbody><tr>
305 <td class="parameter_name"><p>extension</p></td>
306 <td class="parameter_description"><p>a <a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension"><span class="type">GIOExtension</span></a></p></td>
307 <td class="parameter_annotations"> </td>
308 </tr></tbody>
309 </table></div>
310 </div>
311 <div class="refsect3">
312 <a name="g-io-extension-get-type.returns"></a><h4>Returns</h4>
313 <p> the type of <em class="parameter"><code>extension</code></em>
314 </p>
315 </div>
316 </div>
317 <hr>
318 <div class="refsect2">
319 <a name="g-io-extension-point-get-extension-by-name"></a><h3>g_io_extension_point_get_extension_by_name ()</h3>
320 <pre class="programlisting"><a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension"><span class="returnvalue">GIOExtension</span></a> *
321 g_io_extension_point_get_extension_by_name
322                                (<em class="parameter"><code><a class="link" href="gio-Extension-Points.html#GIOExtensionPoint" title="GIOExtensionPoint"><span class="type">GIOExtensionPoint</span></a> *extension_point</code></em>,
323                                 <em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
324 <p>Finds a <a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension"><span class="type">GIOExtension</span></a> for an extension point by name.</p>
325 <div class="refsect3">
326 <a name="g-io-extension-point-get-extension-by-name.parameters"></a><h4>Parameters</h4>
327 <div class="informaltable"><table class="informaltable" width="100%" border="0">
328 <colgroup>
329 <col width="150px" class="parameters_name">
330 <col class="parameters_description">
331 <col width="200px" class="parameters_annotations">
332 </colgroup>
333 <tbody>
334 <tr>
335 <td class="parameter_name"><p>extension_point</p></td>
336 <td class="parameter_description"><p>a <a class="link" href="gio-Extension-Points.html#GIOExtensionPoint" title="GIOExtensionPoint"><span class="type">GIOExtensionPoint</span></a></p></td>
337 <td class="parameter_annotations"> </td>
338 </tr>
339 <tr>
340 <td class="parameter_name"><p>name</p></td>
341 <td class="parameter_description"><p>the name of the extension to get</p></td>
342 <td class="parameter_annotations"> </td>
343 </tr>
344 </tbody>
345 </table></div>
346 </div>
347 <div class="refsect3">
348 <a name="g-io-extension-point-get-extension-by-name.returns"></a><h4>Returns</h4>
349 <p> the <a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension"><span class="type">GIOExtension</span></a> for <em class="parameter"><code>extension_point</code></em>
350 that has the
351 given name, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if there is no extension with that name. </p>
352 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
353 </div>
354 </div>
355 <hr>
356 <div class="refsect2">
357 <a name="g-io-extension-point-get-extensions"></a><h3>g_io_extension_point_get_extensions ()</h3>
358 <pre class="programlisting"><a href="../glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *
359 g_io_extension_point_get_extensions (<em class="parameter"><code><a class="link" href="gio-Extension-Points.html#GIOExtensionPoint" title="GIOExtensionPoint"><span class="type">GIOExtensionPoint</span></a> *extension_point</code></em>);</pre>
360 <p>Gets a list of all extensions that implement this extension point.
361 The list is sorted by priority, beginning with the highest priority.</p>
362 <div class="refsect3">
363 <a name="g-io-extension-point-get-extensions.parameters"></a><h4>Parameters</h4>
364 <div class="informaltable"><table class="informaltable" width="100%" border="0">
365 <colgroup>
366 <col width="150px" class="parameters_name">
367 <col class="parameters_description">
368 <col width="200px" class="parameters_annotations">
369 </colgroup>
370 <tbody><tr>
371 <td class="parameter_name"><p>extension_point</p></td>
372 <td class="parameter_description"><p>a <a class="link" href="gio-Extension-Points.html#GIOExtensionPoint" title="GIOExtensionPoint"><span class="type">GIOExtensionPoint</span></a></p></td>
373 <td class="parameter_annotations"> </td>
374 </tr></tbody>
375 </table></div>
376 </div>
377 <div class="refsect3">
378 <a name="g-io-extension-point-get-extensions.returns"></a><h4>Returns</h4>
379 <p> a <a href="../glib-Doubly-Linked-Lists.html#GList"><span class="type">GList</span></a> of
380 <a href="gio-Extension-Points.html#GIOExtension"><span class="type">GIOExtensions</span></a>. The list is owned by GIO and should not be
381 modified. </p>
382 <p><span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GIOExtension][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
383 </div>
384 </div>
385 <hr>
386 <div class="refsect2">
387 <a name="g-io-extension-point-get-required-type"></a><h3>g_io_extension_point_get_required_type ()</h3>
388 <pre class="programlisting"><a href="../gobject-Type-Information.html#GType"><span class="returnvalue">GType</span></a>
389 g_io_extension_point_get_required_type
390                                (<em class="parameter"><code><a class="link" href="gio-Extension-Points.html#GIOExtensionPoint" title="GIOExtensionPoint"><span class="type">GIOExtensionPoint</span></a> *extension_point</code></em>);</pre>
391 <p>Gets the required type for <em class="parameter"><code>extension_point</code></em>
392 .</p>
393 <div class="refsect3">
394 <a name="g-io-extension-point-get-required-type.parameters"></a><h4>Parameters</h4>
395 <div class="informaltable"><table class="informaltable" width="100%" border="0">
396 <colgroup>
397 <col width="150px" class="parameters_name">
398 <col class="parameters_description">
399 <col width="200px" class="parameters_annotations">
400 </colgroup>
401 <tbody><tr>
402 <td class="parameter_name"><p>extension_point</p></td>
403 <td class="parameter_description"><p>a <a class="link" href="gio-Extension-Points.html#GIOExtensionPoint" title="GIOExtensionPoint"><span class="type">GIOExtensionPoint</span></a></p></td>
404 <td class="parameter_annotations"> </td>
405 </tr></tbody>
406 </table></div>
407 </div>
408 <div class="refsect3">
409 <a name="g-io-extension-point-get-required-type.returns"></a><h4>Returns</h4>
410 <p> the <a href="../gobject-Type-Information.html#GType"><span class="type">GType</span></a> that all implementations must have,
411 or <a href="../gobject-Type-Information.html#G-TYPE-INVALID:CAPS"><span class="type">G_TYPE_INVALID</span></a> if the extension point has no required type</p>
412 </div>
413 </div>
414 <hr>
415 <div class="refsect2">
416 <a name="g-io-extension-point-implement"></a><h3>g_io_extension_point_implement ()</h3>
417 <pre class="programlisting"><a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension"><span class="returnvalue">GIOExtension</span></a> *
418 g_io_extension_point_implement (<em class="parameter"><code>const <span class="type">char</span> *extension_point_name</code></em>,
419                                 <em class="parameter"><code><a href="../gobject-Type-Information.html#GType"><span class="type">GType</span></a> type</code></em>,
420                                 <em class="parameter"><code>const <span class="type">char</span> *extension_name</code></em>,
421                                 <em class="parameter"><code><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> priority</code></em>);</pre>
422 <p>Registers <em class="parameter"><code>type</code></em>
423  as extension for the extension point with name
424 <em class="parameter"><code>extension_point_name</code></em>
425 . </p>
426 <p>If <em class="parameter"><code>type</code></em>
427  has already been registered as an extension for this 
428 extension point, the existing <a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension"><span class="type">GIOExtension</span></a> object is returned.</p>
429 <div class="refsect3">
430 <a name="g-io-extension-point-implement.parameters"></a><h4>Parameters</h4>
431 <div class="informaltable"><table class="informaltable" width="100%" border="0">
432 <colgroup>
433 <col width="150px" class="parameters_name">
434 <col class="parameters_description">
435 <col width="200px" class="parameters_annotations">
436 </colgroup>
437 <tbody>
438 <tr>
439 <td class="parameter_name"><p>extension_point_name</p></td>
440 <td class="parameter_description"><p>the name of the extension point</p></td>
441 <td class="parameter_annotations"> </td>
442 </tr>
443 <tr>
444 <td class="parameter_name"><p>type</p></td>
445 <td class="parameter_description"><p>the <a href="../gobject-Type-Information.html#GType"><span class="type">GType</span></a> to register as extension </p></td>
446 <td class="parameter_annotations"> </td>
447 </tr>
448 <tr>
449 <td class="parameter_name"><p>extension_name</p></td>
450 <td class="parameter_description"><p>the name for the extension</p></td>
451 <td class="parameter_annotations"> </td>
452 </tr>
453 <tr>
454 <td class="parameter_name"><p>priority</p></td>
455 <td class="parameter_description"><p>the priority for the extension</p></td>
456 <td class="parameter_annotations"> </td>
457 </tr>
458 </tbody>
459 </table></div>
460 </div>
461 <div class="refsect3">
462 <a name="g-io-extension-point-implement.returns"></a><h4>Returns</h4>
463 <p> a <a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension"><span class="type">GIOExtension</span></a> object for <a href="../gobject-Type-Information.html#GType"><span class="type">GType</span></a>. </p>
464 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
465 </div>
466 </div>
467 <hr>
468 <div class="refsect2">
469 <a name="g-io-extension-point-lookup"></a><h3>g_io_extension_point_lookup ()</h3>
470 <pre class="programlisting"><a class="link" href="gio-Extension-Points.html#GIOExtensionPoint" title="GIOExtensionPoint"><span class="returnvalue">GIOExtensionPoint</span></a> *
471 g_io_extension_point_lookup (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
472 <p>Looks up an existing extension point.</p>
473 <div class="refsect3">
474 <a name="g-io-extension-point-lookup.parameters"></a><h4>Parameters</h4>
475 <div class="informaltable"><table class="informaltable" width="100%" border="0">
476 <colgroup>
477 <col width="150px" class="parameters_name">
478 <col class="parameters_description">
479 <col width="200px" class="parameters_annotations">
480 </colgroup>
481 <tbody><tr>
482 <td class="parameter_name"><p>name</p></td>
483 <td class="parameter_description"><p>the name of the extension point</p></td>
484 <td class="parameter_annotations"> </td>
485 </tr></tbody>
486 </table></div>
487 </div>
488 <div class="refsect3">
489 <a name="g-io-extension-point-lookup.returns"></a><h4>Returns</h4>
490 <p> the <a class="link" href="gio-Extension-Points.html#GIOExtensionPoint" title="GIOExtensionPoint"><span class="type">GIOExtensionPoint</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if there
491 is no registered extension point with the given name. </p>
492 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
493 </div>
494 </div>
495 <hr>
496 <div class="refsect2">
497 <a name="g-io-extension-point-register"></a><h3>g_io_extension_point_register ()</h3>
498 <pre class="programlisting"><a class="link" href="gio-Extension-Points.html#GIOExtensionPoint" title="GIOExtensionPoint"><span class="returnvalue">GIOExtensionPoint</span></a> *
499 g_io_extension_point_register (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
500 <p>Registers an extension point.</p>
501 <div class="refsect3">
502 <a name="g-io-extension-point-register.parameters"></a><h4>Parameters</h4>
503 <div class="informaltable"><table class="informaltable" width="100%" border="0">
504 <colgroup>
505 <col width="150px" class="parameters_name">
506 <col class="parameters_description">
507 <col width="200px" class="parameters_annotations">
508 </colgroup>
509 <tbody><tr>
510 <td class="parameter_name"><p>name</p></td>
511 <td class="parameter_description"><p>The name of the extension point</p></td>
512 <td class="parameter_annotations"> </td>
513 </tr></tbody>
514 </table></div>
515 </div>
516 <div class="refsect3">
517 <a name="g-io-extension-point-register.returns"></a><h4>Returns</h4>
518 <p> the new <a class="link" href="gio-Extension-Points.html#GIOExtensionPoint" title="GIOExtensionPoint"><span class="type">GIOExtensionPoint</span></a>. This object is
519 owned by GIO and should not be freed. </p>
520 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
521 </div>
522 </div>
523 <hr>
524 <div class="refsect2">
525 <a name="g-io-extension-point-set-required-type"></a><h3>g_io_extension_point_set_required_type ()</h3>
526 <pre class="programlisting"><span class="returnvalue">void</span>
527 g_io_extension_point_set_required_type
528                                (<em class="parameter"><code><a class="link" href="gio-Extension-Points.html#GIOExtensionPoint" title="GIOExtensionPoint"><span class="type">GIOExtensionPoint</span></a> *extension_point</code></em>,
529                                 <em class="parameter"><code><a href="../gobject-Type-Information.html#GType"><span class="type">GType</span></a> type</code></em>);</pre>
530 <p>Sets the required type for <em class="parameter"><code>extension_point</code></em>
531  to <em class="parameter"><code>type</code></em>
532
533 All implementations must henceforth have this type.</p>
534 <div class="refsect3">
535 <a name="g-io-extension-point-set-required-type.parameters"></a><h4>Parameters</h4>
536 <div class="informaltable"><table class="informaltable" width="100%" border="0">
537 <colgroup>
538 <col width="150px" class="parameters_name">
539 <col class="parameters_description">
540 <col width="200px" class="parameters_annotations">
541 </colgroup>
542 <tbody>
543 <tr>
544 <td class="parameter_name"><p>extension_point</p></td>
545 <td class="parameter_description"><p>a <a class="link" href="gio-Extension-Points.html#GIOExtensionPoint" title="GIOExtensionPoint"><span class="type">GIOExtensionPoint</span></a></p></td>
546 <td class="parameter_annotations"> </td>
547 </tr>
548 <tr>
549 <td class="parameter_name"><p>type</p></td>
550 <td class="parameter_description"><p>the <a href="../gobject-Type-Information.html#GType"><span class="type">GType</span></a> to require</p></td>
551 <td class="parameter_annotations"> </td>
552 </tr>
553 </tbody>
554 </table></div>
555 </div>
556 </div>
557 <hr>
558 <div class="refsect2">
559 <a name="g-io-extension-ref-class"></a><h3>g_io_extension_ref_class ()</h3>
560 <pre class="programlisting"><a href="../gobject-Type-Information.html#GTypeClass"><span class="returnvalue">GTypeClass</span></a> *
561 g_io_extension_ref_class (<em class="parameter"><code><a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension"><span class="type">GIOExtension</span></a> *extension</code></em>);</pre>
562 <p>Gets a reference to the class for the type that is 
563 associated with <em class="parameter"><code>extension</code></em>
564 .</p>
565 <div class="refsect3">
566 <a name="g-io-extension-ref-class.parameters"></a><h4>Parameters</h4>
567 <div class="informaltable"><table class="informaltable" width="100%" border="0">
568 <colgroup>
569 <col width="150px" class="parameters_name">
570 <col class="parameters_description">
571 <col width="200px" class="parameters_annotations">
572 </colgroup>
573 <tbody><tr>
574 <td class="parameter_name"><p>extension</p></td>
575 <td class="parameter_description"><p>a <a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension"><span class="type">GIOExtension</span></a></p></td>
576 <td class="parameter_annotations"> </td>
577 </tr></tbody>
578 </table></div>
579 </div>
580 <div class="refsect3">
581 <a name="g-io-extension-ref-class.returns"></a><h4>Returns</h4>
582 <p> the <a href="../gobject-Type-Information.html#GTypeClass"><span class="type">GTypeClass</span></a> for the type of <em class="parameter"><code>extension</code></em>
583 . </p>
584 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
585 </div>
586 </div>
587 </div>
588 <div class="refsect1">
589 <a name="gio-Extension-Points.other_details"></a><h2>Types and Values</h2>
590 <div class="refsect2">
591 <a name="GIOExtension"></a><h3>GIOExtension</h3>
592 <pre class="programlisting">typedef struct _GIOExtension GIOExtension;</pre>
593 <p><a class="link" href="gio-Extension-Points.html#GIOExtension" title="GIOExtension"><span class="type">GIOExtension</span></a> is an opaque data structure and can only be accessed
594 using the following functions.</p>
595 </div>
596 <hr>
597 <div class="refsect2">
598 <a name="GIOExtensionPoint"></a><h3>GIOExtensionPoint</h3>
599 <pre class="programlisting">typedef struct _GIOExtensionPoint GIOExtensionPoint;</pre>
600 <p><a class="link" href="gio-Extension-Points.html#GIOExtensionPoint" title="GIOExtensionPoint"><span class="type">GIOExtensionPoint</span></a> is an opaque data structure and can only be accessed
601 using the following functions.</p>
602 </div>
603 </div>
604 <div class="refsect1">
605 <a name="gio-Extension-Points.see-also"></a><h2>See Also</h2>
606 <p>Extending GIO</p>
607 </div>
608 </div>
609 <div class="footer">
610 <hr>Generated by GTK-Doc V1.25.1</div>
611 </body>
612 </html>