|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/21585/root/usr/share/gtk-doc/html/libgnome/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>gnome-program</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="GNOME Library Reference Manual">
<link rel="up" href="libgnome.html#id2740192" title="Initializing applications and starting programs">
<link rel="prev" href="libgnome.html" title="GNOME Library (libgnome)">
<link rel="next" href="libgnome-gnome-init.html" title="gnome-init">
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="libgnome.html" title="GNOME Library (libgnome)">
</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="2">
<tr valign="middle">
<td><a accesskey="p" href="libgnome.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="libgnome.html#id2740192"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GNOME Library Reference Manual</th>
<td><a accesskey="n" href="libgnome-gnome-init.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2776405" class="shortcut">Top</a>
 | 
<a href="#id2785922" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="libgnome-gnome-program"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2776405"></a><span class="refentrytitle">gnome-program</span>
</h2>
<p>gnome-program — Initialize and retrieve information about a GNOME application.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
#include <libgnome/libgnome.h>
enum <a href="libgnome-gnome-program.html#GnomeFileDomain">GnomeFileDomain</a>;
<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a>;
<a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a>;
<a href="libgnome-gnome-program.html#GnomeModuleRequirement">GnomeModuleRequirement</a>;
void (<a href="libgnome-gnome-program.html#GnomeModuleInitHook">*GnomeModuleInitHook</a>) (const <a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a> *mod_info);
void (<a href="libgnome-gnome-program.html#GnomeModuleClassInitHook">*GnomeModuleClassInitHook</a>) (GnomeProgramClass *klass,
const <a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a> *mod_info);
void (<a href="libgnome-gnome-program.html#GnomeModuleHook">*GnomeModuleHook</a>) (<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a> *program,
<a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a> *mod_info);
<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a>* <a href="libgnome-gnome-program.html#gnome-program-init">gnome_program_init</a> (const char *app_id,
const char *app_version,
const <a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a> *module_info,
int argc,
char **argv,
const char *first_property_name,
...);
<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a>* <a href="libgnome-gnome-program.html#gnome-program-initv">gnome_program_initv</a> (<a
href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"
>GType</a> type,
const char *app_id,
const char *app_version,
const <a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a> *module_info,
int argc,
char **argv,
const char *first_property_name,
va_list args);
<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a>* <a href="libgnome-gnome-program.html#gnome-program-get">gnome_program_get</a> (void);
const char* <a href="libgnome-gnome-program.html#gnome-program-get-human-readable-name">gnome_program_get_human_readable_name</a>
(<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a> *program);
const char* <a href="libgnome-gnome-program.html#gnome-program-get-app-id">gnome_program_get_app_id</a> (<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a> *program);
const char* <a href="libgnome-gnome-program.html#gnome-program-get-app-version">gnome_program_get_app_version</a> (<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a> *program);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a>* <a href="libgnome-gnome-program.html#gnome-program-locate-file">gnome_program_locate_file</a> (<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a> *program,
<a href="libgnome-gnome-program.html#GnomeFileDomain">GnomeFileDomain</a> domain,
const <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *file_name,
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a> only_if_exists,
<a
href="/usr/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html#GSList"
>GSList</a> **ret_locations);
void <a href="libgnome-gnome-program.html#gnome-program-module-register">gnome_program_module_register</a> (const <a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a> *module_info);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="libgnome-gnome-program.html#gnome-program-module-registered">gnome_program_module_registered</a> (const <a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a> *module_info);
const <a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a>* <a href="libgnome-gnome-program.html#gnome-program-module-load">gnome_program_module_load</a>
(const char *mod_name);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a> <a href="libgnome-gnome-program.html#gnome-program-install-property">gnome_program_install_property</a> (GnomeProgramClass *pclass,
<a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObjectGetPropertyFunc"
>GObjectGetPropertyFunc</a> get_fn,
<a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObjectSetPropertyFunc"
>GObjectSetPropertyFunc</a> set_fn,
<a
href="/usr/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"
>GParamSpec</a> *pspec);
poptContext <a href="libgnome-gnome-program.html#gnome-program-preinit">gnome_program_preinit</a> (<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a> *program,
const char *app_id,
const char *app_version,
int argc,
char **argv);
void <a href="libgnome-gnome-program.html#gnome-program-parse-args">gnome_program_parse_args</a> (<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a> *program);
void <a href="libgnome-gnome-program.html#gnome-program-postinit">gnome_program_postinit</a> (<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a> *program);
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-POPT-TABLE:CAPS">GNOME_PARAM_POPT_TABLE</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-POPT-FLAGS:CAPS">GNOME_PARAM_POPT_FLAGS</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-POPT-CONTEXT:CAPS">GNOME_PARAM_POPT_CONTEXT</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-GOPTION-CONTEXT:CAPS">GNOME_PARAM_GOPTION_CONTEXT</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-CREATE-DIRECTORIES:CAPS">GNOME_PARAM_CREATE_DIRECTORIES</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-ENABLE-SOUND:CAPS">GNOME_PARAM_ENABLE_SOUND</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-ESPEAKER:CAPS">GNOME_PARAM_ESPEAKER</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-APP-ID:CAPS">GNOME_PARAM_APP_ID</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-APP-VERSION:CAPS">GNOME_PARAM_APP_VERSION</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-GNOME-PREFIX:CAPS">GNOME_PARAM_GNOME_PREFIX</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-GNOME-SYSCONFDIR:CAPS">GNOME_PARAM_GNOME_SYSCONFDIR</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-GNOME-DATADIR:CAPS">GNOME_PARAM_GNOME_DATADIR</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-GNOME-LIBDIR:CAPS">GNOME_PARAM_GNOME_LIBDIR</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-APP-PREFIX:CAPS">GNOME_PARAM_APP_PREFIX</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-APP-SYSCONFDIR:CAPS">GNOME_PARAM_APP_SYSCONFDIR</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-APP-DATADIR:CAPS">GNOME_PARAM_APP_DATADIR</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-APP-LIBDIR:CAPS">GNOME_PARAM_APP_LIBDIR</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-HUMAN-READABLE-NAME:CAPS">GNOME_PARAM_HUMAN_READABLE_NAME</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-GNOME-PATH:CAPS">GNOME_PARAM_GNOME_PATH</a>
#define <a href="libgnome-gnome-program.html#GNOME-PARAM-NONE:CAPS">GNOME_PARAM_NONE</a>
#define <a href="libgnome-gnome-program.html#GNOME-PROGRAM-STANDARD-PROPERTIES:CAPS">GNOME_PROGRAM_STANDARD_PROPERTIES</a>
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2785922"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2785936"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2785946"></a><h3>
<a name="GnomeFileDomain"></a>enum GnomeFileDomain</h3>
<a class="indexterm" name="id2785959"></a><pre class="programlisting">typedef enum {
GNOME_FILE_DOMAIN_UNKNOWN = 0,
/* Gnome installed files */
GNOME_FILE_DOMAIN_LIBDIR,
GNOME_FILE_DOMAIN_DATADIR,
GNOME_FILE_DOMAIN_SOUND,
GNOME_FILE_DOMAIN_PIXMAP,
GNOME_FILE_DOMAIN_CONFIG,
GNOME_FILE_DOMAIN_HELP,
/* Application files */
GNOME_FILE_DOMAIN_APP_LIBDIR,
GNOME_FILE_DOMAIN_APP_DATADIR,
GNOME_FILE_DOMAIN_APP_SOUND,
GNOME_FILE_DOMAIN_APP_PIXMAP,
GNOME_FILE_DOMAIN_APP_CONFIG,
GNOME_FILE_DOMAIN_APP_HELP
} GnomeFileDomain;
</pre>
<p>
Many of the files that a GNOME application needs to access will be installed in
standard locations. For example, GNOME help files will be in one location,
while help files specific to the current application might be in another
location.
</p>
<p>
The different types of files are given in this enum. User applications make use
of the <em class="structfield"><code>GNOME_FILE_DOMAIN_APP_*</code></em> types, which specify
locations relative to <a href="libgnome-gnome-program.html#GNOME-PARAM-APP-DATADIR:CAPS"><span class="type">GNOME_PARAM_APP_DATADIR</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a name="GNOME-FILE-DOMAIN-UNKNOWN:CAPS"></a><code class="literal">GNOME_FILE_DOMAIN_UNKNOWN</code></span></td>
<td>An unknown file domain (should never be used).
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GNOME-FILE-DOMAIN-LIBDIR:CAPS"></a><code class="literal">GNOME_FILE_DOMAIN_LIBDIR</code></span></td>
<td>Libraries in the main GNOME installation.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GNOME-FILE-DOMAIN-DATADIR:CAPS"></a><code class="literal">GNOME_FILE_DOMAIN_DATADIR</code></span></td>
<td>Data files in the main GNOME installation.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GNOME-FILE-DOMAIN-SOUND:CAPS"></a><code class="literal">GNOME_FILE_DOMAIN_SOUND</code></span></td>
<td>Sound files in the main GNOME installation.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GNOME-FILE-DOMAIN-PIXMAP:CAPS"></a><code class="literal">GNOME_FILE_DOMAIN_PIXMAP</code></span></td>
<td>Pixmap files in the main GNOME installation.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GNOME-FILE-DOMAIN-CONFIG:CAPS"></a><code class="literal">GNOME_FILE_DOMAIN_CONFIG</code></span></td>
<td>Config files in the main GNOME installation.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GNOME-FILE-DOMAIN-HELP:CAPS"></a><code class="literal">GNOME_FILE_DOMAIN_HELP</code></span></td>
<td>Help files in the main GNOME installation.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GNOME-FILE-DOMAIN-APP-LIBDIR:CAPS"></a><code class="literal">GNOME_FILE_DOMAIN_APP_LIBDIR</code></span></td>
<td>Application specific libraries.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GNOME-FILE-DOMAIN-APP-DATADIR:CAPS"></a><code class="literal">GNOME_FILE_DOMAIN_APP_DATADIR</code></span></td>
<td>Application specific data files.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GNOME-FILE-DOMAIN-APP-SOUND:CAPS"></a><code class="literal">GNOME_FILE_DOMAIN_APP_SOUND</code></span></td>
<td>Application specific sound files.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GNOME-FILE-DOMAIN-APP-PIXMAP:CAPS"></a><code class="literal">GNOME_FILE_DOMAIN_APP_PIXMAP</code></span></td>
<td>Application specific pixmap files.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GNOME-FILE-DOMAIN-APP-CONFIG:CAPS"></a><code class="literal">GNOME_FILE_DOMAIN_APP_CONFIG</code></span></td>
<td>Application specific config files.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GNOME-FILE-DOMAIN-APP-HELP:CAPS"></a><code class="literal">GNOME_FILE_DOMAIN_APP_HELP</code></span></td>
<td>Application specific help files.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2786306"></a><h3>
<a name="GnomeProgram"></a>GnomeProgram</h3>
<a class="indexterm" name="id2786319"></a><pre class="programlisting">typedef struct {
GObject object;
GnomeProgramPrivate *_priv;
} GnomeProgram;
</pre>
<p>
A structure containing information about the current application. Initialised
during a call to <a href="libgnome-gnome-program.html#gnome-program-init"><code class="function">gnome_program_init()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"
>GObject</a> <em class="structfield"><code>object</code></em>;</span></td>
<td>A <a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"
><span class="type">GObject</span></a> containing the parameters and their values which were set
dring initialisation.
</td>
</tr>
<tr>
<td>
<span class="term">GnomeProgramPrivate *<em class="structfield"><code>_priv</code></em>;</span></td>
<td>Private data about the program instance.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2786403"></a><h3>
<a name="GnomeModuleInfo"></a>GnomeModuleInfo</h3>
<a class="indexterm" name="id2786420"></a><pre class="programlisting">typedef struct {
const char *name;
const char *version;
const char *description;
GnomeModuleRequirement *requirements; /* last element has NULL version */
GnomeModuleHook instance_init;
GnomeModuleHook pre_args_parse, post_args_parse;
#ifdef GNOME_DISABLE_DEPRECATED
struct poptOption *_options;
#else
struct poptOption *options;
#endif
GnomeModuleInitHook init_pass;
GnomeModuleClassInitHook class_init;
const char *opt_prefix;
GnomeModuleGetGOptionGroupFunc get_goption_group_func;
} GnomeModuleInfo;
</pre>
<p>
A structure containing information about a module. This contains descriptive
information about the module, as well as how to initialise it and what its
dependencies are (chained via the <em class="parameter"><code>requirements</code></em> parameter).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term">const char *<em class="structfield"><code>name</code></em>;</span></td>
<td>The module name.
</td>
</tr>
<tr>
<td>
<span class="term">const char *<em class="structfield"><code>version</code></em>;</span></td>
<td>The module's version string.
</td>
</tr>
<tr>
<td>
<span class="term">const char *<em class="structfield"><code>description</code></em>;</span></td>
<td>A string describing the module (can be <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a>).
</td>
</tr>
<tr>
<td>
<span class="term"><a href="libgnome-gnome-program.html#GnomeModuleRequirement">GnomeModuleRequirement</a> *<em class="structfield"><code>requirements</code></em>;</span></td>
<td>A pointer to an array of modules that are required by this
module. The last module in the array should have its required_version field set
to <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><a href="libgnome-gnome-program.html#GnomeModuleHook">GnomeModuleHook</a> <em class="structfield"><code>instance_init</code></em>;</span></td>
<td>A function to call to initialise an instance of this module
(can be <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a>).
</td>
</tr>
<tr>
<td>
<span class="term"><a href="libgnome-gnome-program.html#GnomeModuleHook">GnomeModuleHook</a> <em class="structfield"><code>pre_args_parse</code></em>;</span></td>
<td>A function to call before parsing the arguments for this
module (can be <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a>).
</td>
</tr>
<tr>
<td>
<span class="term"><a href="libgnome-gnome-program.html#GnomeModuleHook">GnomeModuleHook</a> <em class="structfield"><code>post_args_parse</code></em>;</span></td>
<td>A function to call after parsing the arguments for this
module (can be <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a>).
</td>
</tr>
<tr>
<td>
<span class="term"><a href="libgnome-gnome-program.html#GnomeModuleClassInitHook">GnomeModuleClassInitHook</a> <em class="structfield"><code>class_init</code></em>;</span></td>
<td>A function to call to initialise this module prior to creating any
instances (can be <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a>).
</td>
</tr>
<tr>
<td>
<span class="term">const char *<em class="structfield"><code>opt_prefix</code></em>;</span></td>
<td>Unused.
</td>
</tr>
<tr>
<td>
<span class="term">GnomeModuleGetGOptionGroupFunc <em class="structfield"><code>get_goption_group_func</code></em>;</span></td>
<td>A function which must return a non-<a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a> <a
href="/usr/share/gtk-doc/html/glib/glib-Commandline-option-parser.html#GOptionGroup"
><span class="type">GOptionGroup</span></a>,
which will be added to the <a href="libgnome-gnome-program.html#GnomeProgram"><span class="type">GnomeProgram</span></a> s <a
href="/usr/share/gtk-doc/html/glib/glib-Commandline-option-parser.html#GOptionContext"
><span class="type">GOptionContext</span></a> during
#<a href="libgnome-gnome-program.html#gnome-program-init"><code class="function">gnome_program_init()</code></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2786787"></a><h3>
<a name="GnomeModuleRequirement"></a>GnomeModuleRequirement</h3>
<a class="indexterm" name="id2786799"></a><pre class="programlisting">typedef struct {
const char *required_version;
const GnomeModuleInfo *module_info;
} GnomeModuleRequirement;
</pre>
<p>
A structure which allows a module to specify the minimum required versions of
modules it depends upon.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term">const char *<em class="structfield"><code>required_version</code></em>;</span></td>
<td>The version required by the parent module.
</td>
</tr>
<tr>
<td>
<span class="term">const <a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a> *<em class="structfield"><code>module_info</code></em>;</span></td>
<td>A <a href="libgnome-gnome-program.html#GnomeModuleInfo"><span class="type">GnomeModuleInfo</span></a> structure detailing the required module.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2786875"></a><h3>
<a name="GnomeModuleInitHook"></a>GnomeModuleInitHook ()</h3>
<a class="indexterm" name="id2786888"></a><pre class="programlisting">void (*GnomeModuleInitHook) (const <a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a> *mod_info);</pre>
<p>
A function that will be called to allow a module to do any pre-initialisation
it might need to do prior to having arguments parsed by the controlling parent
module (the parent will do the argument parsing for all modules in the
hierarchy).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>mod_info</code></em> :</span></td>
<td>The current module.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2786939"></a><h3>
<a name="GnomeModuleClassInitHook"></a>GnomeModuleClassInitHook ()</h3>
<a class="indexterm" name="id2786952"></a><pre class="programlisting">void (*GnomeModuleClassInitHook) (GnomeProgramClass *klass,
const <a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a> *mod_info);</pre>
<p>
A function called to perform any class specific setup that is required by each
module.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>klass</code></em> :</span></td>
<td>The class of the parent module (which could be this module's class).
This will usually be <span class="type">GnomeProgramClass</span>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>mod_info</code></em> :</span></td>
<td>The current module.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2787032"></a><h3>
<a name="GnomeModuleHook"></a>GnomeModuleHook ()</h3>
<a class="indexterm" name="id2787044"></a><pre class="programlisting">void (*GnomeModuleHook) (<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a> *program,
<a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a> *mod_info);</pre>
<p>
A function that is called to perform some intialisation in a module (which
could be either the main init function or the pre or post argument parsing
phase).
</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>The <a href="libgnome-gnome-program.html#GnomeProgram"><span class="type">GnomeProgram</span></a> instance which is being initialised.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>mod_info</code></em> :</span></td>
<td>The current module's <a href="libgnome-gnome-program.html#GnomeModuleInfo"><span class="type">GnomeModuleInfo</span></a> structure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2787133"></a><h3>
<a name="gnome-program-init"></a>gnome_program_init ()</h3>
<a class="indexterm" name="id2787146"></a><pre class="programlisting"><a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a>* gnome_program_init (const char *app_id,
const char *app_version,
const <a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a> *module_info,
int argc,
char **argv,
const char *first_property_name,
...);</pre>
<p>
Initialises the current GNOME libraries for use by the application.</p>
<p>
Every GNOME application will need to call this function (or
<a href="libgnome-gnome-program.html#gnome-program-initv"><code class="function">gnome_program_initv()</code></a>) early in its lifetime to initialize the various GNOME
libraries in a consistent fashion. This function is very flexible in allowing
the user to specify which modules should be initialised and any special
paramter values that should be passed to these modules (along with processing
commandline options).
</p>
<p>
It loads the specified <em class="parameter"><code>module_info</code></em>, which is normally <a href="libgnome-gnome-init.html#LIBGNOME-MODULE:CAPS"><span class="type">LIBGNOME_MODULE</span></a> or
<a
href="/usr/share/gtk-doc/html/libgnomeui/libgnomeui-gnome-ui-init.html#LIBGNOMEUI-MODULE:CAPS"
><span class="type">LIBGNOMEUI_MODULE</span></a> and pulls in all the dependencies. Programs that are not
running in setuid or setgid mode will also load modules specified in the
<em class="parameter"><code>--load-modules</code></em> and also in the <em class="parameter"><code>GNOME_MODULES</code></em> environment variable.
</p>
<p>
After setting up the module loading, this function then calls (in order)
<a href="libgnome-gnome-program.html#gnome-program-preinit"><code class="function">gnome_program_preinit()</code></a>, <a href="libgnome-gnome-program.html#gnome-program-parse-args"><code class="function">gnome_program_parse_args()</code></a> and
<a href="libgnome-gnome-program.html#gnome-program-postinit"><code class="function">gnome_program_postinit()</code></a>.
</p>
<p>The following example shows how one might initialise a typical program
using a goption table that is defined elsewhere.
</p>
<div class="example">
<a name="id2787327"></a><p class="title"><b>Example 1. Initializing a GNOME application (deprecated, using popt)</b></p>
<pre class="programlisting">
int main(int argc, char **argv) {
GnomeProgram *my_app;
GOptionContext *option_context;
/* We assume PACKAGE and VERSION are set to the program name and version
* number respectively. Also, assume that 'options' is a global array of
* poptOptions.
*/
option_context = g_option_context_new (PACKAGE);
g_option_context_add_main_entries (option_context, options, NULL);
my_app = gnome_program_init(PACKAGE, VERSION, LIBGNOMEUI_MODULE,
argc, argv,
GNOME_PARAM_GOPTION_CONTEXT, option_context,
GNOME_PARAM_NONE);
/* Now process any extra args, etc ... */
}
</pre>
</div>
<p>
Even though many applications still use popt for command-line option parsing,
it has been deprecated in Gnome-2.14 and its use is discouraged for
newly-written code. GNOME applications should aim to use the new
<span class="type">GOption</span> API. Here an example that shows how one might initialize a typical
program using a GOptionEntry table (see the GLib documentation for a more
elaborate example of an option entry table):
</p>
<div class="example">
<a name="id2787369"></a><p class="title"><b>Example 2. Initializing a GNOME application (new, using GOption)</b></p>
<pre class="programlisting">
int main(int argc, char **argv) {
gchar **remaining_args = NULL;
GOptionEntry option_entries[] = {
/* ... your application's command line options go here ... */
/* last but not least a special option that collects filenames */
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY,
&remaining_args,
"Special option that collects any remaining arguments for us" },
{ NULL }
};
GOptionContext *option_context;
GnomeProgram *my_app;
option_context = g_option_context_new ("my-app");
/* if you are using any libraries that have command line options
* of their own and provide a GOptionGroup with them, you can
* add them here as well using <a
href="/usr/share/gtk-doc/html/glib/glib-Commandline-option-parser.html#g-option-context-add-group"
><code class="function">g_option_context_add_group()</code></a>
*/
/* now add our own application's command-line options. If you
* are using gettext for translations, you should be using
* GETTEXT_PACKAGE here instead of NULL
*/
g_option_context_add_main_entries (option_context, option_entries, NULL);
/* We assume PACKAGE and VERSION are set to the program name and version
* number respectively. Also, assume that 'option_entries' is a global
* array of GOptionEntry structures.
*/
my_app = gnome_program_init(PACKAGE, VERSION,
LIBGNOMEUI_MODULE, argc, argv,
GNOME_PARAM_GOPTION_CONTEXT, option_context,
GNOME_PARAM_NONE);
/* parse remaining command-line arguments that are not
* options (e.g. filenames or URIs or whatever), if any
*/
if (remaining_args != NULL) {
gint i, num_args;
num_args = g_strv_length (remaining_args);
for (i = 0; i < num_args; ++i) {
/* process remaining_args[i] here */
}
g_strfreev (remaining_args);
remaining_args = NULL;
}
</pre>
</div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<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>module_info</code></em> :</span></td>
<td> The module to init with this program.
</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 <em class="parameter"><code>argv</code></em>.
</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"><em class="parameter"><code>first_property_name</code></em> :</span></td>
<td> The first item in a <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a>-terminated list of attribute
name and value pairs (so this will be an attribute name or <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a>).
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>...</code></em> :</span></td>
<td> The continuation of a <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a>-terminated list of attribute name/value
pairs.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> A <a href="libgnome-gnome-program.html#GnomeProgram"><span class="type">GnomeProgram</span></a> instance representing the current application.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2787602"></a><h3>
<a name="gnome-program-initv"></a>gnome_program_initv ()</h3>
<a class="indexterm" name="id2787614"></a><pre class="programlisting"><a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a>* gnome_program_initv (<a
href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType"
>GType</a> type,
const char *app_id,
const char *app_version,
const <a href="libgnome-gnome-program.html#GnomeModuleInfo">GnomeModuleInfo</a> *module_info,
int argc,
char **argv,
const char *first_property_name,
va_list args);</pre>
<p>
Provides a non-varargs form of <a href="libgnome-gnome-program.html#gnome-program-init"><code class="function">gnome_program_init()</code></a>. Users will rarely need
to call this function directly.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>type</code></em> :</span></td>
<td> The type of application to be initialized (usually
<span class="type">GNOME_TYPE_PROGRAM</span>).
</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>module_info</code></em> :</span></td>
<td> The modules to init with the application.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>argc</code></em> :</span></td>
<td> The number of command line arguments contained in <em class="parameter"><code>argv</code></em>.
</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"><em class="parameter"><code>first_property_name</code></em> :</span></td>
<td> The first item in a <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a>-terminated list of attribute
name/value.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>args</code></em> :</span></td>
<td> The remaining elements in the <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a> terminated list (of which
<em class="parameter"><code>first_property_name</code></em> is the first element).
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> A <a href="libgnome-gnome-program.html#GnomeProgram"><span class="type">GnomeProgram</span></a> instance representing the current application.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2787893"></a><h3>
<a name="gnome-program-get"></a>gnome_program_get ()</h3>
<a class="indexterm" name="id2787906"></a><pre class="programlisting"><a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a>* gnome_program_get (void);</pre>
<p>
Retrieves an object that stored information about the application's state.
Other functions assume this will always return a <a href="libgnome-gnome-program.html#GnomeProgram"><span class="type">GnomeProgram</span></a> object which
(if not <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a>) has already been initialized.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> The application's <a href="libgnome-gnome-program.html#GnomeProgram"><span class="type">GnomeProgram</span></a> instance, or <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a> if it does not
exist.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2787986"></a><h3>
<a name="gnome-program-get-human-readable-name"></a>gnome_program_get_human_readable_name ()</h3>
<a class="indexterm" name="id2788000"></a><pre class="programlisting">const char* gnome_program_get_human_readable_name
(<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a> *program);</pre>
<p>
This function returns a pointer to a static string that the
application has provided as a human readable name. The app
should provide the name with the <a href="libgnome-gnome-program.html#GNOME-PARAM-HUMAN-READABLE-NAME:CAPS"><span class="type">GNOME_PARAM_HUMAN_READABLE_NAME</span></a>
init argument. Returns <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a> if no name was set.</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> The application object
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> Application human-readable name string.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2788086"></a><h3>
<a name="gnome-program-get-app-id"></a>gnome_program_get_app_id ()</h3>
<a class="indexterm" name="id2788099"></a><pre class="programlisting">const char* gnome_program_get_app_id (<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a> *program);</pre>
<p>
This function returns a pointer to a static string that the
application has provided as an identifier. This is not meant as a
human-readable identifier so much as a unique identifier for
programs and libraries.</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> The program object
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> Application ID string.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2788165"></a><h3>
<a name="gnome-program-get-app-version"></a>gnome_program_get_app_version ()</h3>
<a class="indexterm" name="id2788178"></a><pre class="programlisting">const char* gnome_program_get_app_version (<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a> *program);</pre>
<p>
This function returns a pointer to a static string that the
application has provided as a version number. This is not meant as a
human-readable identifier so much as a unique identifier for
programs and libraries.</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> 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"><a
href="/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 <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *file_name,
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a> only_if_exists,
<a
href="/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 <a
href="/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> for
the APP specific prefixes (during the initialization part of the
application).
</p>
<p>
The <em class="parameter"><code>ret_locations</code></em> list and its contents should be freed by the caller, as
should 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 <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a> (in which case the current
application 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 <a
href="/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
<a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a>) or <a
href="/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 the
GNOME library framework. The memory pointed to by <em class="parameter"><code>module_info</code></em> must be
valid during the whole application initialization process, and the module
described by <em class="parameter"><code>module_info</code></em> must only use the <em class="parameter"><code>module_info</code></em> pointer to
register 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"><a
href="/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 <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a> if the
module 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"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a> gnome_program_install_property (GnomeProgramClass *pclass,
<a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObjectGetPropertyFunc"
>GObjectGetPropertyFunc</a> get_fn,
<a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObjectSetPropertyFunc"
>GObjectSetPropertyFunc</a> set_fn,
<a
href="/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 the
functions to set and retrieve these properties.
</p>
<p>
Normal applications will never need to call this function, it is mostly for
use 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 that
needs to be done prior to command line argument parsing. The poptContext
returned 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>
<td> A poptContext representing the argument parsing state,
or <a
href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"
><code class="literal">NULL</code></a> if using GOption argument parsing.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789144"></a><h3>
<a name="gnome-program-parse-args"></a>gnome_program_parse_args ()</h3>
<a class="indexterm" name="id2789157"></a><pre class="programlisting">void gnome_program_parse_args (<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a> *program);</pre>
<p>
Parses the command line arguments for the application</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></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789208"></a><h3>
<a name="gnome-program-postinit"></a>gnome_program_postinit ()</h3>
<a class="indexterm" name="id2789221"></a><pre class="programlisting">void gnome_program_postinit (<a href="libgnome-gnome-program.html#GnomeProgram">GnomeProgram</a> *program);</pre>
<p>
Called after <a href="libgnome-gnome-program.html#gnome-program-parse-args"><code class="function">gnome_program_parse_args()</code></a>, this function
takes care of post-parse initialization and cleanup</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></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789284"></a><h3>
<a name="GNOME-PARAM-POPT-TABLE:CAPS"></a>GNOME_PARAM_POPT_TABLE</h3>
<a class="indexterm" name="id2789299"></a><pre class="programlisting">#define GNOME_PARAM_POPT_TABLE "popt-table"
</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">GNOME_PARAM_POPT_TABLE</code> is deprecated and should not be used in newly-written code. 2.14. Use GOption argument parsing instead,
with <a href="libgnome-gnome-program.html#GNOME-PARAM-GOPTION-CONTEXT:CAPS"><span class="type">GNOME_PARAM_GOPTION_CONTEXT</span></a>.</p>
</div>
<p>
This parameter contains the table of options to be passed to popt (write on
init only). Mutually exclusive with using <a href="libgnome-gnome-program.html#GNOME-PARAM-GOPTION-CONTEXT:CAPS"><span class="type">GNOME_PARAM_GOPTION_CONTEXT</span></a>
parameter.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789349"></a><h3>
<a name="GNOME-PARAM-POPT-FLAGS:CAPS"></a>GNOME_PARAM_POPT_FLAGS</h3>
<a class="indexterm" name="id2789365"></a><pre class="programlisting">#define GNOME_PARAM_POPT_FLAGS "popt-flags"
</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">GNOME_PARAM_POPT_FLAGS</code> is deprecated and should not be used in newly-written code. 2.14. Use GOption argument parsing instead.</p>
</div>
<p>
This parameter contains the flags to use for popt (write on init only).
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789395"></a><h3>
<a name="GNOME-PARAM-POPT-CONTEXT:CAPS"></a>GNOME_PARAM_POPT_CONTEXT</h3>
<a class="indexterm" name="id2789411"></a><pre class="programlisting">#define GNOME_PARAM_POPT_CONTEXT "popt-context"
</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">GNOME_PARAM_POPT_CONTEXT</code> is deprecated and should not be used in newly-written code. 2.14. Use GOption argument parsing instead.</p>
</div>
<p>
This parameter contains the context pointer that <a href="libgnome-gnome-program.html#GnomeProgram"><span class="type">GnomeProgram</span></a> is using for
popt parsing (readable).
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789450"></a><h3>
<a name="GNOME-PARAM-GOPTION-CONTEXT:CAPS"></a>GNOME_PARAM_GOPTION_CONTEXT</h3>
<a class="indexterm" name="id2789466"></a><pre class="programlisting">#define GNOME_PARAM_GOPTION_CONTEXT "goption-context"
</pre>
<p>
This parameter contains the GOptionContext pointer that <a href="libgnome-gnome-program.html#GnomeProgram"><span class="type">GnomeProgram</span></a> is using for
GOption parsing (write on init only). The <a href="libgnome-gnome-program.html#GnomeProgram"><span class="type">GnomeProgram</span></a> will assume ownership of the
passed <a
href="/usr/share/gtk-doc/html/glib/glib-Commandline-option-parser.html#GOptionContext"
><span class="type">GOptionContext</span></a>.
Mutually exclusive with using the <a href="libgnome-gnome-program.html#GNOME-PARAM-POPT-TABLE:CAPS"><span class="type">GNOME_PARAM_POPT_TABLE</span></a> parameter.
</p>
<p>Since 2.14
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789524"></a><h3>
<a name="GNOME-PARAM-CREATE-DIRECTORIES:CAPS"></a>GNOME_PARAM_CREATE_DIRECTORIES</h3>
<a class="indexterm" name="id2789536"></a><pre class="programlisting">#define GNOME_PARAM_CREATE_DIRECTORIES "create-directories"
</pre>
<p>
This parameter contains <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the standard GNOME directories should be
created on startup.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789564"></a><h3>
<a name="GNOME-PARAM-ENABLE-SOUND:CAPS"></a>GNOME_PARAM_ENABLE_SOUND</h3>
<a class="indexterm" name="id2789578"></a><pre class="programlisting">#define GNOME_PARAM_ENABLE_SOUND "enable-sound"
</pre>
<p>
This parameter determines whether or not to enable sound on startup.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789595"></a><h3>
<a name="GNOME-PARAM-ESPEAKER:CAPS"></a>GNOME_PARAM_ESPEAKER</h3>
<a class="indexterm" name="id2789608"></a><pre class="programlisting">#define GNOME_PARAM_ESPEAKER "espeaker"
</pre>
<p>
This parameter describes how to connect to esd.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789625"></a><h3>
<a name="GNOME-PARAM-APP-ID:CAPS"></a>GNOME_PARAM_APP_ID</h3>
<a class="indexterm" name="id2789638"></a><pre class="programlisting">#define GNOME_PARAM_APP_ID "app-id"
</pre>
<p>
This parameter contains the ID string to use for the application (readable).
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789655"></a><h3>
<a name="GNOME-PARAM-APP-VERSION:CAPS"></a>GNOME_PARAM_APP_VERSION</h3>
<a class="indexterm" name="id2789668"></a><pre class="programlisting">#define GNOME_PARAM_APP_VERSION "app-version"
</pre>
<p>
This parameter contains the application version (readable).
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789685"></a><h3>
<a name="GNOME-PARAM-GNOME-PREFIX:CAPS"></a>GNOME_PARAM_GNOME_PREFIX</h3>
<a class="indexterm" name="id2789698"></a><pre class="programlisting">#define GNOME_PARAM_GNOME_PREFIX "gnome-prefix"
</pre>
<p>
This parameter contains the prefix where the main GNOME system is installed
(readable, writable on init only).
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789716"></a><h3>
<a name="GNOME-PARAM-GNOME-SYSCONFDIR:CAPS"></a>GNOME_PARAM_GNOME_SYSCONFDIR</h3>
<a class="indexterm" name="id2789728"></a><pre class="programlisting">#define GNOME_PARAM_GNOME_SYSCONFDIR "gnome-sysconfdir"
</pre>
<p>
This parameter contains the prefix where the GNOME configuration files
are installed (readable, writable on init only).
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789746"></a><h3>
<a name="GNOME-PARAM-GNOME-DATADIR:CAPS"></a>GNOME_PARAM_GNOME_DATADIR</h3>
<a class="indexterm" name="id2789760"></a><pre class="programlisting">#define GNOME_PARAM_GNOME_DATADIR "gnome-datadir"
</pre>
<p>
This parameter contains the prefix where the GNOME data files are installed
(readable, writable on init only).
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789778"></a><h3>
<a name="GNOME-PARAM-GNOME-LIBDIR:CAPS"></a>GNOME_PARAM_GNOME_LIBDIR</h3>
<a class="indexterm" name="id2789791"></a><pre class="programlisting">#define GNOME_PARAM_GNOME_LIBDIR "gnome-libdir"
</pre>
<p>
This parameter contains the prefix where the GNOME library files are installed
(readable, writable on init only).
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789809"></a><h3>
<a name="GNOME-PARAM-APP-PREFIX:CAPS"></a>GNOME_PARAM_APP_PREFIX</h3>
<a class="indexterm" name="id2789822"></a><pre class="programlisting">#define GNOME_PARAM_APP_PREFIX "app-prefix"
</pre>
<p>
This parameter contains the prefix where this application was installed
(read / write).
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789839"></a><h3>
<a name="GNOME-PARAM-APP-SYSCONFDIR:CAPS"></a>GNOME_PARAM_APP_SYSCONFDIR</h3>
<a class="indexterm" name="id2789852"></a><pre class="programlisting">#define GNOME_PARAM_APP_SYSCONFDIR "app-sysconfdir"
</pre>
<p>
This parameter contains the prefix where this application's configuration files
are installed (read / write).
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789870"></a><h3>
<a name="GNOME-PARAM-APP-DATADIR:CAPS"></a>GNOME_PARAM_APP_DATADIR</h3>
<a class="indexterm" name="id2789883"></a><pre class="programlisting">#define GNOME_PARAM_APP_DATADIR "app-datadir"
</pre>
<p>
This parameter contains the prefix where this application's data files are
installed (read / write).
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789901"></a><h3>
<a name="GNOME-PARAM-APP-LIBDIR:CAPS"></a>GNOME_PARAM_APP_LIBDIR</h3>
<a class="indexterm" name="id2789914"></a><pre class="programlisting">#define GNOME_PARAM_APP_LIBDIR "app-libdir"
</pre>
<p>
This parameter contains the prefix where this application's library files are
installed (read / write).
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789932"></a><h3>
<a name="GNOME-PARAM-HUMAN-READABLE-NAME:CAPS"></a>GNOME_PARAM_HUMAN_READABLE_NAME</h3>
<a class="indexterm" name="id2789946"></a><pre class="programlisting">#define GNOME_PARAM_HUMAN_READABLE_NAME "human-readable-name"
</pre>
<p>
This parameter contains the human readable name of the application (readable).
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789963"></a><h3>
<a name="GNOME-PARAM-GNOME-PATH:CAPS"></a>GNOME_PARAM_GNOME_PATH</h3>
<a class="indexterm" name="id2789976"></a><pre class="programlisting">#define GNOME_PARAM_GNOME_PATH "gnome-path"
</pre>
<p>
This parameter contains the path in which to look for installed files (taken
from the GNOME2_PATH environment variable).
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2789994"></a><h3>
<a name="GNOME-PARAM-NONE:CAPS"></a>GNOME_PARAM_NONE</h3>
<a class="indexterm" name="id2790007"></a><pre class="programlisting">#define GNOME_PARAM_NONE NULL
</pre>
<p>
Used to terminate a list of parameters and their values.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2790024"></a><h3>
<a name="GNOME-PROGRAM-STANDARD-PROPERTIES:CAPS"></a>GNOME_PROGRAM_STANDARD_PROPERTIES</h3>
<a class="indexterm" name="id2790037"></a><pre class="programlisting">#define GNOME_PROGRAM_STANDARD_PROPERTIES</pre>
<p>
When PREFIX, SYSCONFDIR, DATADIR and LIBDIR are defined during the build
process, this macro can be used to assign these values to
<a href="libgnome-gnome-program.html#GNOME-PARAM-APP-PREFIX:CAPS"><span class="type">GNOME_PARAM_APP_PREFIX</span></a>, <a href="libgnome-gnome-program.html#GNOME-PARAM-APP-SYSCONFDIR:CAPS"><span class="type">GNOME_PARAM_APP_SYSCONFDIR</span></a>, <a href="libgnome-gnome-program.html#GNOME-PARAM-APP-DATADIR:CAPS"><span class="type">GNOME_PARAM_APP_DATADIR</span></a>
and <a href="libgnome-gnome-program.html#GNOME-PARAM-APP-LIBDIR:CAPS"><span class="type">GNOME_PARAM_APP_LIBDIR</span></a> respectively so that the GNOME libraries
automatically know where to fetch application specific data from. </p>
<p>
Every respectable GNOME application should set these variables and use
GNOME_PROGRAM_STANDARD_PROPERTIES in the call to <a href="libgnome-gnome-program.html#gnome-program-init"><code class="function">gnome_program_init()</code></a>.
</p>
</div>
</div>
</div>
</body>
</html>