/usr/share/gtk-doc/html/libfm/libfm-FmModule.html is in libfm-doc 1.2.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>FmModule: Libfm Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="Libfm Reference Manual">
<link rel="up" href="libfm-core.html" title="Libfm Core Reference.">
<link rel="prev" href="libfm-FmThumbnailer.html" title="FmThumbnailer">
<link rel="next" href="libfm-Common-Libfm-utilities..html" title="Common Libfm utilities.">
<meta name="generator" content="GTK-Doc V1.25 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#libfm-FmModule.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="libfm-core.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="libfm-FmThumbnailer.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="libfm-Common-Libfm-utilities..html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libfm-FmModule"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libfm-FmModule.top_of_page"></a>FmModule</span></h2>
<p>FmModule — Simple external modules handler.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libfm-FmModule.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libfm-FmModule.html#CHECK-MODULES:CAPS" title="CHECK_MODULES()">CHECK_MODULES</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libfm-FmModule.html#FM-DEFINE-MODULE:CAPS" title="FM_DEFINE_MODULE()">FM_DEFINE_MODULE</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libfm-FmModule.html#FM-MODULE-DEFINE-TYPE:CAPS" title="FM_MODULE_DEFINE_TYPE()">FM_MODULE_DEFINE_TYPE</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="libfm-FmModule.html#FmModuleInitCallback" title="FmModuleInitCallback ()">*FmModuleInitCallback</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="libfm-FmModule.html#fm-module-is-in-use" title="fm_module_is_in_use ()">fm_module_is_in_use</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libfm-FmModule.html#fm-module-register-type" title="fm_module_register_type ()">fm_module_register_type</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libfm-FmModule.html#fm-module-unregister-type" title="fm_module_unregister_type ()">fm_module_unregister_type</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="libfm-FmModule.html#fm-modules-add-directory" title="fm_modules_add_directory ()">fm_modules_add_directory</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libfm-FmModule.html#fm-modules-load" title="fm_modules_load ()">fm_modules_load</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libfm-FmModule.description"></a><h2>Description</h2>
<p><em class="parameter"><code>include</code></em>
: libfm/fm.h</p>
<p>This implementation allows applications to use external modules and
select which ones application wants to use (from none to all).</p>
<p>The naming scheme in examples below is strict. Replace "dummy" part in
them with your real name when you trying to use those examples. Those
strict example names are:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>FM_MODULE_dummy_VERSION</p></li>
<li class="listitem"><p>fm_module_init_dummy</p></li>
<li class="listitem"><p>fm_module_callback_dummy</p></li>
<li class="listitem"><p>fm_module_register_dummy</p></li>
</ul></div>
<p>To use modules application should make few things. Let say, there is
some FmDummyWidget which wants to use "dummy" type of modules. First
thing application should do is create a header file which all modules
of that type should include:</p>
<div class="example">
<a name="example-fm-dummy-h"></a><p class="title"><b>Example 1. Sample of fm-dummy.h</b></p>
<div class="example-contents">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="gtkdoc ppc">#include <libfm/fm.h></span>
<span class="gtkdoc ppc">#define FM_MODULE_dummy_VERSION 1</span>
<span class="gtkdoc kwc">typedef</span> <span class="gtkdoc kwb">struct</span> _FmDummyInit <span class="gtkdoc opt">{</span>
<span class="gtkdoc kwb">int</span> <span class="gtkdoc opt">(*</span>get_new<span class="gtkdoc opt">)(</span><span class="gtkdoc kwb">const char</span> <span class="gtkdoc opt">*</span>name<span class="gtkdoc opt">);</span>
<span class="gtkdoc opt">}</span> FmDummyInit<span class="gtkdoc opt">;</span>
<span class="gtkdoc kwc">extern</span> FmDummyInit fm_module_init_dummy<span class="gtkdoc opt">;</span></pre></td>
</tr>
</tbody>
</table>
</div>
</div>
<br class="example-break"><p>The FM_MODULE_dummy_VERSION is a number which should be increased each
time something in FmDummyInit structure is changed. The FmDummyInit
represents an interface to module. It is specific for said module type.
The fm_module_init_dummy usage see below.</p>
<p>Second thing application should do is to create implementation of the
module handling in your code:</p>
<div class="example">
<a name="example-fm-dummy-widget-c"></a><p class="title"><b>Example 2. Sample of fm-dummy-widget.c</b></p>
<div class="example-contents">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="gtkdoc ppc">#include</span> <span class="gtkdoc pps">"fm-dummy.h"</span><span class="gtkdoc ppc"></span>
<span class="function"><a href="libfm-FmModule.html#FM-MODULE-DEFINE-TYPE:CAPS">FM_MODULE_DEFINE_TYPE</a></span><span class="gtkdoc opt">(</span>dummy<span class="gtkdoc opt">,</span> FmDummyInit<span class="gtkdoc opt">,</span> <span class="number">1</span><span class="gtkdoc opt">)</span>
<span class="gtkdoc kwb">static</span> gboolean <span class="function">fm_module_callback_dummy</span><span class="gtkdoc opt">(</span><span class="gtkdoc kwb">const char</span> <span class="gtkdoc opt">*</span>name<span class="gtkdoc opt">,</span> gpointer init<span class="gtkdoc opt">,</span> <span class="gtkdoc kwb">int</span> ver<span class="gtkdoc opt">)</span>
<span class="gtkdoc opt">{</span>
<span class="comment">/* add module callbacks into own data list */</span>
<span class="gtkdoc opt">.......</span>
<span class="gtkdoc opt">}</span>
<span class="gtkdoc opt">.......</span>
<span class="gtkdoc opt">{</span>
FmDummyInit <span class="gtkdoc opt">*</span>module<span class="gtkdoc opt">;</span>
<span class="gtkdoc kwb">int</span> result <span class="gtkdoc opt">= -</span><span class="number">1</span><span class="gtkdoc opt">;</span>
<span class="function"><a href="libfm-FmModule.html#CHECK-MODULES:CAPS">CHECK_MODULES</a></span><span class="gtkdoc opt">();</span>
module <span class="gtkdoc opt">=</span> <span class="function">_find_module</span><span class="gtkdoc opt">(</span><span class="string">"test"</span><span class="gtkdoc opt">);</span>
<span class="keyword">if</span> <span class="gtkdoc opt">(</span>module<span class="gtkdoc opt">)</span>
result <span class="gtkdoc opt">=</span> module<span class="gtkdoc opt">-></span><span class="function">get_new</span><span class="gtkdoc opt">(</span><span class="string">"test sample"</span><span class="gtkdoc opt">);</span>
<span class="keyword">return</span> result<span class="gtkdoc opt">;</span>
<span class="gtkdoc opt">}</span></pre></td>
</tr>
</tbody>
</table>
</div>
</div>
<br class="example-break"><p>Third thing application should do is to register module type on the
application start, the same way as application calls <a class="link" href="libfm-Libfm.html#fm-init" title="fm_init ()"><code class="function">fm_init()</code></a> on the
start:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="function">fm_module_register_dummy</span><span class="gtkdoc opt">();</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p>
On application terminate it is adviced to unregister module type by
calling API <a class="link" href="libfm-FmModule.html#fm-module-unregister-type" title="fm_module_unregister_type ()"><code class="function">fm_module_unregister_type()</code></a> the same way as application
calls <a class="link" href="libfm-Libfm.html#fm-finalize" title="fm_finalize ()"><code class="function">fm_finalize()</code></a> on exit:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="function"><a href="libfm-FmModule.html#fm-module-unregister-type">fm_module_unregister_type</a></span><span class="gtkdoc opt">(</span><span class="string">"dummy"</span><span class="gtkdoc opt">);</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>The module itself will be easy to make. All you should do is to use
<a class="link" href="libfm-FmModule.html#FM-DEFINE-MODULE:CAPS" title="FM_DEFINE_MODULE()"><code class="function">FM_DEFINE_MODULE()</code></a> macro and implement callbacks for the module
interface (see the fm-dummy.h header example above):</p>
<div class="example">
<a name="example-fm-dummy-test-c"></a><p class="title"><b>Example 3. Sample of module dummy/test</b></p>
<div class="example-contents">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="gtkdoc ppc">#include</span> <span class="gtkdoc pps">"fm-dummy.h"</span><span class="gtkdoc ppc"></span>
<span class="function"><a href="libfm-FmModule.html#FM-DEFINE-MODULE:CAPS">FM_DEFINE_MODULE</a></span><span class="gtkdoc opt">(</span>dummy<span class="gtkdoc opt">,</span> test<span class="gtkdoc opt">)</span>
<span class="gtkdoc kwb">static int</span> <span class="function">fm_dummy_test_get_new</span><span class="gtkdoc opt">(</span><span class="gtkdoc kwb">const char</span> <span class="gtkdoc opt">*</span>name<span class="gtkdoc opt">)</span>
<span class="gtkdoc opt">{</span>
<span class="comment">/* implementation */</span>
<span class="gtkdoc opt">}</span>
FmDummyInit fm_module_init_dummy <span class="gtkdoc opt">= {</span>
fm_dummy_test_get_new<span class="gtkdoc opt">;</span>
<span class="gtkdoc opt">};</span></pre></td>
</tr>
</tbody>
</table>
</div>
</div>
<br class="example-break"><p>The fm_module_init_dummy should be exactly the same structure that is
defined in the header file above.</p>
<p>Note that modules are scanned and loaded only once per application
run for simplicity and reliability reasons (in fact, deletion of a
module that have some code running in another thread may lead to some
unpredictable problems). Therefore if you have any module changed you
have to restart the application before it see your change.</p>
</div>
<div class="refsect1">
<a name="libfm-FmModule.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="CHECK-MODULES:CAPS"></a><h3>CHECK_MODULES()</h3>
<pre class="programlisting">#define CHECK_MODULES(...) if(G_UNLIKELY(!fm_modules_loaded)) fm_modules_load()
</pre>
</div>
<hr>
<div class="refsect2">
<a name="FM-DEFINE-MODULE:CAPS"></a><h3>FM_DEFINE_MODULE()</h3>
<pre class="programlisting">#define FM_DEFINE_MODULE(_type_, _name_)</pre>
<p>Macro used in module definition. Module should have module specific
structure: if <em class="parameter"><code>type</code></em>
is vfs then it should be fm_module_init_vfs. See
specific header file for some `extern' definition.</p>
<div class="refsect3">
<a name="FM-DEFINE-MODULE.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>_type_</p></td>
<td class="parameter_description"><p>type of module (e.g. `vfs')</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>_name_</p></td>
<td class="parameter_description"><p>module type specific key (e.g. `menu')</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="FM-MODULE-DEFINE-TYPE:CAPS"></a><h3>FM_MODULE_DEFINE_TYPE()</h3>
<pre class="programlisting">#define FM_MODULE_DEFINE_TYPE(_type_, _struct_, _minver_)</pre>
<p>Macro used in module caller. Callback is ran when matched module is
found, it should return <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success.</p>
<div class="refsect3">
<a name="FM-MODULE-DEFINE-TYPE.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>_type_</p></td>
<td class="parameter_description"><p>type of module (e.g. `vfs')</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>_struct_</p></td>
<td class="parameter_description"><p>type of struct with module callbacks</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>_minver_</p></td>
<td class="parameter_description"><p>minimum version supported</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="FmModuleInitCallback"></a><h3>FmModuleInitCallback ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="c_punctuation">(</span>*FmModuleInitCallback<span class="c_punctuation">)</span> (<em class="parameter"><code>const <span class="type">char</span> *key</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> init_data</code></em>,
<em class="parameter"><code><span class="type">int</span> version</code></em>);</pre>
<p>This API is used to make callback from the modules loader to the
implementation which uses module so the implementation may do required
checks and add module to own list of supported data.
This callback will be done in default main context.</p>
<div class="refsect3">
<a name="FmModuleInitCallback.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>key</p></td>
<td class="parameter_description"><p>the module name as key value for the type</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>init_data</p></td>
<td class="parameter_description"><p>module type specific initialization data</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>version</p></td>
<td class="parameter_description"><p>version of loaded module</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="FmModuleInitCallback.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if module was accepted by implementation.</p>
</div>
<p class="since">Since: 1.2.0</p>
</div>
<hr>
<div class="refsect2">
<a name="fm-module-is-in-use"></a><h3>fm_module_is_in_use ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
fm_module_is_in_use (<em class="parameter"><code>const <span class="type">char</span> *type</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
<p>Checks if specified module is found and successfully loaded.</p>
<div class="refsect3">
<a name="fm-module-is-in-use.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>module type</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description"><p> module key. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="fm-module-is-in-use.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if module is in use.</p>
</div>
<p class="since">Since: 1.2.0</p>
</div>
<hr>
<div class="refsect2">
<a name="fm-module-register-type"></a><h3>fm_module_register_type ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
fm_module_register_type (<em class="parameter"><code>const <span class="type">char</span> *type</code></em>,
<em class="parameter"><code><span class="type">int</span> minver</code></em>,
<em class="parameter"><code><span class="type">int</span> maxver</code></em>,
<em class="parameter"><code><a class="link" href="libfm-FmModule.html#FmModuleInitCallback" title="FmModuleInitCallback ()"><span class="type">FmModuleInitCallback</span></a> cb</code></em>);</pre>
<p>Registers <em class="parameter"><code>type</code></em>
into the modules loader. The modules loader will call
<em class="parameter"><code>cb</code></em>
routine when module that supports the <em class="parameter"><code>type</code></em>
was found within the
libfm modules directory. The scanning for modules will be done after
some timeout after last call to <a class="link" href="libfm-FmModule.html#fm-module-register-type" title="fm_module_register_type ()"><code class="function">fm_module_register_type()</code></a> so this API
should be used at application start before any possible modules usage
may appear.</p>
<div class="refsect3">
<a name="fm-module-register-type.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>module type, unique for the application</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>minver</p></td>
<td class="parameter_description"><p>minimum supported module version</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>maxver</p></td>
<td class="parameter_description"><p>maximum supported module version</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>cb</p></td>
<td class="parameter_description"><p>the callback used to inform about found module</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 1.2.0</p>
</div>
<hr>
<div class="refsect2">
<a name="fm-module-unregister-type"></a><h3>fm_module_unregister_type ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
fm_module_unregister_type (<em class="parameter"><code>const <span class="type">char</span> *type</code></em>);</pre>
<p>Frees any resources that were allocated previously on the call to
<a class="link" href="libfm-FmModule.html#fm-module-register-type" title="fm_module_register_type ()"><code class="function">fm_module_register_type()</code></a> API, including code of the modules. After
this call any usage of data from callbacks will be invalid and the
most possibly lead to crash so it might be called only on finalizing
the application data.</p>
<div class="refsect3">
<a name="fm-module-unregister-type.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>module type, unique for the application</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: 1.2.0</p>
</div>
<hr>
<div class="refsect2">
<a name="fm-modules-add-directory"></a><h3>fm_modules_add_directory ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
fm_modules_add_directory (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>);</pre>
<p>Adds an application-specific directory <em class="parameter"><code>path</code></em>
to be used later for
scanning for modules. The <em class="parameter"><code>path</code></em>
should be absolute UNIX path.</p>
<div class="refsect3">
<a name="fm-modules-add-directory.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>path</p></td>
<td class="parameter_description"><p>absolute path to modules directory</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="fm-modules-add-directory.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>path</code></em>
was added successfully.</p>
</div>
<p class="since">Since: 1.2.0</p>
</div>
<hr>
<div class="refsect2">
<a name="fm-modules-load"></a><h3>fm_modules_load ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
fm_modules_load (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Forces scanning the libfm modules for existing modules. Any calls to
<a class="link" href="libfm-FmModule.html#fm-module-register-type" title="fm_module_register_type ()"><code class="function">fm_module_register_type()</code></a> after this will have no effect.</p>
<p class="since">Since: 1.2.0</p>
</div>
</div>
<div class="refsect1">
<a name="libfm-FmModule.other_details"></a><h2>Types and Values</h2>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.25</div>
</body>
</html>
|