diff options
author | Havoc Pennington <hp@src.gnome.org> | 1999-12-31 04:01:03 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 1999-12-31 04:01:03 +0000 |
commit | 42451a2f15b9e4eb527f77e7930eb167526afc2b (patch) | |
tree | 02f97c22f983fbd8758f227ae0d9237f92327d0b /doc | |
parent | e387b3e2f1e66baa8a14817c6f7a1c5dcb09f8eb (diff) | |
download | gconf-42451a2f15b9e4eb527f77e7930eb167526afc2b.tar.gz |
documentation
Diffstat (limited to 'doc')
-rw-r--r-- | doc/gconf/gconf.sgml | 299 |
1 files changed, 294 insertions, 5 deletions
diff --git a/doc/gconf/gconf.sgml b/doc/gconf/gconf.sgml index e07b3e52..fcebce84 100644 --- a/doc/gconf/gconf.sgml +++ b/doc/gconf/gconf.sgml @@ -98,7 +98,8 @@ ask to be notified when the value of a key changes. This allows settings to be applied to groups of applications, without restarting them and without - ugly hacks. + ugly hacks. It also allows a clean model-view + architecture for applications. </para> </listitem> <listitem> @@ -133,8 +134,9 @@ specification, originally developed for the Debian project. See <ulink url="http://www.debian.org/~wakkerma/config6" type="http">http://www.debian.org/~wakkerma/config6</ulink> for his - specification. Other sources of ideas include the Windows registry and - the ACAP specification. + specification. Other sources of ideas include the Windows registry, + the ACAP specification, and Emacs customize mode (try typing + <literal>M-x customize-browse</literal> in Emacs). </para> </sect1> @@ -315,7 +317,7 @@ </sect2> <!-- Schemas --> - <sect2> + <sect2 id="concepts-schemas"> <title>Schemas</title> <para> @@ -997,7 +999,7 @@ print_value(GConfValue* value) </chapter> <!-- gconftool --> - <chapter> + <chapter id="gconftool"> <title><application>gconftool</application> Utility Program</title> <para> @@ -1007,6 +1009,293 @@ print_value(GConfValue* value) </chapter> + <!-- Schema Files --> + <chapter> + <title>Schema Files</title> + + <para> + This chapter covers the mechanics of writing and installing the + GConf schema files. Schema files describe your configuration + data and provide default values for it. See <xref + linkend="concepts-schemas"> for an explanation of schemas. The + schema file is not understood by the GConf client library; + rather, <application>gconftool</application> (see <xref + linkend="gconftool">) knows how to parse it, and then uses the GConf + client library to install the information in the GConf database. + </para> + + <sect1> + <title>Schema File Format</title> + <para> + Here is a sample schema file for a hypothetical application, + <application>basic-gconf-app</application>, one of the + examples that comes with the GConf distribution. + <example> + <title>Sample schema file</title> + <programlisting> +<gconfschemafile> + <schemalist> + <schema> + <key>/schemas/apps/basic-gconf-app/fooandbar</key> + <applyto>/apps/basic-gconf-app/foo</applyto> + <applyto>/apps/basic-gconf-app/bar</applyto> + <owner>basic-gconf-app</owner> + <type>string</type> + <locale name="C"> + <default>Blah blah blurgh</default> + <short>short description in C locale</short> + <long>long description of foo and bar in C locale</long> + </locale> + <locale name="no"> + <default>some thing in norwegian</default> + <short>short description in Norway</short> + <long>Long description in Norway. long long long. this is a long sentence.</long> + </locale> + </schema> + <schema> + <key>/schemas/apps/basic-gconf-app/baz</key> + <applyto>/apps/basic-gconf-app/baz</applyto> + <owner>basic-gconf-app</owner> + <type>string</type> + <locale name="C"> + <default>Zzzzzzzzzz</default> + <short>short description in C locale</short> + <long>long description of baz in C locale</long> + </locale> + <locale name="no"> + <default>some thing in norwegian</default> + <short>short description in Norway</short> + <long>Long description in Norway. long long long. this is a long sentence.</long> + </locale> + </schema> + <schema> + <key>/schemas/apps/basic-gconf-app/blah</key> + <applyto>/apps/basic-gconf-app/blah</applyto> + <owner>basic-gconf-app</owner> + <type>string</type> + <locale name="C"> + <default>bllllllaaaaaaaaaaaaaaaaarrrrrrggggggghhhhh</default> + <short>short description in C locale</short> + <long>long description of blah in C locale</long> + </locale> + <locale name="no"> + <default>some thing in norwegian</default> + <short>short description in Norway</short> + <long>Long description in Norway. long long long. this is a long sentence.</long> + </locale> + </schema> + </schemalist> +</gconfschemafile> + </programlisting> + </example> + </para> + + <para> + The file format is straightforward. The root node must be + called <literal><gconfschemafile></literal>. This + element contains one or more <literal><schemalist></literal> + elements; I can't think of a reason to use multiple + <literal><schemalist></literal> elements, but you can if + you want, and <application>gconftool</application> will load + each one. The <literal><schemalist></literal> in turn + contains one or more <literal><schema></literal> + elements. Each of these describes a single schema. + </para> + + <warning> + <para> + <application>gconftool</application> is not very tolerant + about whitespace right now; in particular it won't strip + whitespace from around key names, type names, etc. This is + broken and will be fixed, just watch out for now. + </para> + </warning> + + <para> + Here are the fields of the <literal><schema></literal> + element: + +<informaltable pgwide=1 frame="none"> +<tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"> +<tbody> + +<row> +<entry><key></entry> +<entry>The key <emphasis>where the schema will be stored</emphasis>; + see <xref linkend="conventions"> for naming + conventions. There may be only one key per schema. +</entry> + +</row> + +<row> +<entry><applyto></entry> + +<entry>A key <emphasis>the schema will be applied to</emphasis>; that + is, this schema <emphasis>describes</emphasis> this + key. See <xref linkend="conventions"> for naming + conventions. There may be multiple <applyto> + elements.</entry> + +</row> + +<row> +<entry><owner></entry> + +<entry>Name of the application that uses this schema; may be the + command line name, or a human-readable name. However + you should use the same value for <owner> for + all schemas your app installs. The primary purpose + of this field is to enable sysadmins to locate the + keys belonging to a given application. + </entry> + +</row> + +<row> +<entry><type></entry> + +<entry>The type of values described by this schema. i.e. keys +the schema is applied to should store values of this type. +Allowed values are: <literal>string</literal>, <literal>int</literal>, +<literal>bool</literal>, <literal>float</literal>, + <literal>list</literal>, <literal>pair</literal> + </entry> + +</row> + +<row> +<entry><default></entry> + +<entry>The <literal><default></literal> element may +appear below <literal><schema></literal> (a default for all + locales, often suitable for numeric values), +<emphasis>OR</emphasis> below a <literal><locale></literal> +element, if the default should be localized. It simply contains the + default value for the keys the schema is applied to. + + </entry> + +</row> + + +<row> +<entry><locale></entry> + + <entry> + The <literal><locale></literal> element + contains locale-specific data, including the + human-readable short and long descriptions, + and optionally the default value + (<literal><default></literal> may also be + placed directly underneath the + <literal><schema></literal> element). + There should be one + <literal><locale></literal> element for each + locale, with a <literal>name</literal> attribute + specifying the locale name. + </entry> + +</row> + + +</tbody></tgroup></informaltable> + + A <literal><locale></literal> element can contain +a locale-specific <literal><default></literal>, and may also +contain short and long descriptions as follows: +<informaltable pgwide=1 frame="none"> +<tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"> +<tbody> + +<row> +<entry><short></entry> +<entry>A short description of the purpose of this key, around +40 characters long (about half a line). +</entry> + +</row> + +<row> +<entry><long></entry> +<entry>A long description of the configuration key, around a paragraph + or two. Should describe the possible values of the +key and their effect on the application. +</entry> + +</row> + +</tbody></tgroup></informaltable> + + </para> + + </sect1> + + <sect1> + <title>Installing Schemas</title> + + <para> + There are several things that need to happen at "<literal>make + install</literal>" time. + <itemizedlist mark="bullet"> + <listitem> + <para> + The schemas should be installed into a GConf + configuration source; either the default source, or a + source specified by the user with a + <filename>configure</filename> option called + <literal>--gconf-config-source</literal>. + </para> + </listitem> + <listitem> + <para> + The schema files should be installed to + <filename>$(sysconfdir)/gconf/schemas/</filename>, + making it easy for sysadmins to browse them or + bulk-reinstall them into a new configuration source. + </para> + </listitem> + </itemizedlist> + </para> + + <para> + FIXME give snippets of configure.in and Makefile.am + </para> + + </sect1> + + <sect1> + <title>Schema File DTD</title> + + <para> + There is no DTD right now, but I'd appreciate having one based + on the above description. If someone makes one I'll put it + here. + </para> + + <para> + <programlisting> + DTD DTD DTD DTD I am a DTD + </programlisting> + </sect1> + + </chapter> + + <!-- Checklist/Summary --> + <chapter> + <title>Checklist/Summary</title> + + <para> + This chapter summarizes the things to consider and actions to + take when adding GConf support to an application. + </para> + + <para> + + </para> + + </chapter> + <!-- GConf reference --> <chapter id="gconf-reference"> <title>GConf Reference Documentation</title> |