📄 libgnome-gnome-program.html
字号:
<td> The application object</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> Application version string.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2788244"></a><h3><a name="gnome-program-locate-file"></a>gnome_program_locate_file ()</h3><a class="indexterm" name="id2788257"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a>* gnome_program_locate_file (<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a> *program, <a href="libgnome-gnome-program.html#GnomeFileDomain">GnomeFileDomain</a> domain, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *file_name, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> only_if_exists, <ahref="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList">GSList</a> **ret_locations);</pre><p>This function finds a full path to the <em class="parameter"><code>file_name</code></em> located in the specified"domain". A domain is a name for a collection of related files.For example, common domains are "libdir", "pixmap", and "config".</p><p>If <em class="parameter"><code>ret_locations</code></em> is <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>, only one pathname is returned. Otherwise,alternative paths are returned in <em class="parameter"><code>ret_locations</code></em>.</p><p>User applications should store files in the GNOME_FILE_DOMAIN_APP_*domains. However you MUST set the correct attributes for <a href="libgnome-gnome-program.html#GnomeProgram"><span class="type">GnomeProgram</span></a> forthe APP specific prefixes (during the initialization part of theapplication).</p><p>The <em class="parameter"><code>ret_locations</code></em> list and its contents should be freed by the caller, asshould the returned string.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>program</code></em> :</span></td><td> A valid <a href="libgnome-gnome-program.html#GnomeProgram"><span class="type">GnomeProgram</span></a> object or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> (in which case the currentapplication is used).</td></tr><tr><td><span class="term"><em class="parameter"><code>domain</code></em> :</span></td><td> A <a href="libgnome-gnome-program.html#GnomeFileDomain"><span class="type">GnomeFileDomain</span></a>.</td></tr><tr><td><span class="term"><em class="parameter"><code>file_name</code></em> :</span></td><td> A file name or path inside the 'domain' to find.</td></tr><tr><td><span class="term"><em class="parameter"><code>only_if_exists</code></em> :</span></td><td> Only return a full pathname if the specified file actually exists</td></tr><tr><td><span class="term"><em class="parameter"><code>ret_locations</code></em> :</span></td><td> If this is not <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>, a list of all the possible locations of the file will be returned.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The full path to the file (if it exists or only_if_exists is <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>) or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2788529"></a><h3><a name="gnome-program-module-register"></a>gnome_program_module_register ()</h3><a class="indexterm" name="id2788542"></a><pre class="programlisting">void gnome_program_module_register (const <a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a> *module_info);</pre><p>This function is used to register a module to be initialized by theGNOME library framework. The memory pointed to by <em class="parameter"><code>module_info</code></em> must bevalid during the whole application initialization process, and the moduledescribed by <em class="parameter"><code>module_info</code></em> must only use the <em class="parameter"><code>module_info</code></em> pointer toregister itself.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>module_info</code></em> :</span></td><td> A pointer to a GnomeModuleInfo structure describing the module to be initialized</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2788616"></a><h3><a name="gnome-program-module-registered"></a>gnome_program_module_registered ()</h3><a class="indexterm" name="id2788630"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> gnome_program_module_registered (const <a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a> *module_info);</pre><p>This method checks to see whether a specific module has been initialized in the specified program.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>module_info</code></em> :</span></td><td> A pointer to a GnomeModuleInfo structure describing the module to be queried</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> A value indicating whether the specified module has been registered/initialized in the current program</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2788695"></a><h3><a name="gnome-program-module-load"></a>gnome_program_module_load ()</h3><a class="indexterm" name="id2788709"></a><pre class="programlisting">const <a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a>* gnome_program_module_load (const char *mod_name);</pre><p>Loads a shared library that contains a<a href="libgnome-gnome-program.html#GnomeModuleInfo"><span class="type">GnomeModuleInfo</span></a> dynamic_module_info structure.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>mod_name</code></em> :</span></td><td> module name</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The <a href="libgnome-gnome-program.html#GnomeModuleInfo"><span class="type">GnomeModuleInfo</span></a> structure that was loaded, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if themodule could not be loaded.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2788800"></a><h3><a name="gnome-program-install-property"></a>gnome_program_install_property ()</h3><a class="indexterm" name="id2788814"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint">guint</a> gnome_program_install_property (GnomeProgramClass *pclass, <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObjectGetPropertyFunc">GObjectGetPropertyFunc</a> get_fn, <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObjectSetPropertyFunc">GObjectSetPropertyFunc</a> set_fn, <ahref="/usr/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec">GParamSpec</a> *pspec);</pre><p>Install a collection of available properties, their default values and thefunctions to set and retrieve these properties.</p><p>Normal applications will never need to call this function, it is mostly foruse by other platform library authors.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>pclass</code></em> :</span></td><td> A <span class="type">GnomeProgramClass</span>.</td></tr><tr><td><span class="term"><em class="parameter"><code>get_fn</code></em> :</span></td><td> A function to get property values.</td></tr><tr><td><span class="term"><em class="parameter"><code>set_fn</code></em> :</span></td><td> A function to set property values.</td></tr><tr><td><span class="term"><em class="parameter"><code>pspec</code></em> :</span></td><td> A collection of properties.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The number of properties installed.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2788957"></a><h3><a name="gnome-program-preinit"></a>gnome_program_preinit ()</h3><a class="indexterm" name="id2788970"></a><pre class="programlisting">poptContext gnome_program_preinit (<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a> *program, const char *app_id, const char *app_version, int argc, char **argv);</pre><p>This function performs the portion of application initialization thatneeds to be done prior to command line argument parsing. The poptContextreturned can be used for <code class="function">getopt()</code>-style option processing.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>program</code></em> :</span></td><td> Application object</td></tr><tr><td><span class="term"><em class="parameter"><code>app_id</code></em> :</span></td><td> application ID string</td></tr><tr><td><span class="term"><em class="parameter"><code>app_version</code></em> :</span></td><td> application version string</td></tr><tr><td><span class="term"><em class="parameter"><code>argc</code></em> :</span></td><td> The number of commmand line arguments contained in 'argv'</td></tr><tr><td><span class="term"><em class="parameter"><code>argv</code></em> :</span></td><td> A string array of command line arguments</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -