Update to version 2.33.1
[profile/ivi/glib2.git] / docs / reference / gio / html / gio-GSettingsSchema-GSettingsSchemaSource.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>GSettingsSchema, GSettingsSchemaSource</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GIO Reference Manual">
8 <link rel="up" href="settings.html" title="Settings">
9 <link rel="prev" href="GSettingsBackend.html" title="GSettingsBackend">
10 <link rel="next" href="resources.html" title="Resources">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
16 <tr valign="middle">
17 <td><a accesskey="p" href="GSettingsBackend.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="settings.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GIO Reference Manual</th>
21 <td><a accesskey="n" href="resources.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gio-GSettingsSchema-GSettingsSchemaSource.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#gio-GSettingsSchema-GSettingsSchemaSource.description" class="shortcut">Description</a>
27                    | 
28                   <a href="#gio-GSettingsSchema-GSettingsSchemaSource.object-hierarchy" class="shortcut">Object Hierarchy</a>
29 </td></tr>
30 </table>
31 <div class="refentry">
32 <a name="gio-GSettingsSchema-GSettingsSchemaSource"></a><div class="titlepage"></div>
33 <div class="refnamediv"><table width="100%"><tr>
34 <td valign="top">
35 <h2><span class="refentrytitle"><a name="gio-GSettingsSchema-GSettingsSchemaSource.top_of_page"></a>GSettingsSchema, GSettingsSchemaSource</span></h2>
36 <p>GSettingsSchema, GSettingsSchemaSource — introspecting and controlling the loading of
37                     <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> schemas</p>
38 </td>
39 <td valign="top" align="right"></td>
40 </tr></table></div>
41 <div class="refsynopsisdiv">
42 <a name="gio-GSettingsSchema-GSettingsSchemaSource.synopsis"></a><h2>Synopsis</h2>
43 <a name="GSettingsSchema"></a><pre class="synopsis">                    <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource">GSettingsSchemaSource</a>;
44 #define             <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#G-TYPE-SETTINGS-SCHEMA-SOURCE:CAPS" title="G_TYPE_SETTINGS_SCHEMA_SOURCE">G_TYPE_SETTINGS_SCHEMA_SOURCE</a>
45 <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="returnvalue">GSettingsSchemaSource</span></a> * <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#g-settings-schema-source-get-default" title="g_settings_schema_source_get_default ()">g_settings_schema_source_get_default</a>
46                                                         (<em class="parameter"><code><span class="type">void</span></code></em>);
47 <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="returnvalue">GSettingsSchemaSource</span></a> * <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#g-settings-schema-source-ref" title="g_settings_schema_source_ref ()">g_settings_schema_source_ref</a>    (<em class="parameter"><code><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="type">GSettingsSchemaSource</span></a> *source</code></em>);
48 <span class="returnvalue">void</span>                <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#g-settings-schema-source-unref" title="g_settings_schema_source_unref ()">g_settings_schema_source_unref</a>      (<em class="parameter"><code><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="type">GSettingsSchemaSource</span></a> *source</code></em>);
49
50 <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="returnvalue">GSettingsSchemaSource</span></a> * <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#g-settings-schema-source-new-from-directory" title="g_settings_schema_source_new_from_directory ()">g_settings_schema_source_new_from_directory</a>
51                                                         (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *directory</code></em>,
52                                                          <em class="parameter"><code><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="type">GSettingsSchemaSource</span></a> *parent</code></em>,
53                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> trusted</code></em>,
54                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
55
56 <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="returnvalue">GSettingsSchema</span></a> *   <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#g-settings-schema-source-lookup" title="g_settings_schema_source_lookup ()">g_settings_schema_source_lookup</a>     (<em class="parameter"><code><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="type">GSettingsSchemaSource</span></a> *source</code></em>,
57                                                          <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *schema_id</code></em>,
58                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> recursive</code></em>);
59
60                     <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema-struct" title="GSettingsSchema">GSettingsSchema</a>;
61 #define             <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#G-TYPE-SETTINGS-SCHEMA:CAPS" title="G_TYPE_SETTINGS_SCHEMA">G_TYPE_SETTINGS_SCHEMA</a>
62 <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="returnvalue">GSettingsSchema</span></a> *   <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#g-settings-schema-ref" title="g_settings_schema_ref ()">g_settings_schema_ref</a>               (<em class="parameter"><code><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a> *schema</code></em>);
63 <span class="returnvalue">void</span>                <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#g-settings-schema-unref" title="g_settings_schema_unref ()">g_settings_schema_unref</a>             (<em class="parameter"><code><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a> *schema</code></em>);
64
65 const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#g-settings-schema-get-id" title="g_settings_schema_get_id ()">g_settings_schema_get_id</a>            (<em class="parameter"><code><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a> *schema</code></em>);
66 const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#g-settings-schema-get-path" title="g_settings_schema_get_path ()">g_settings_schema_get_path</a>          (<em class="parameter"><code><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a> *schema</code></em>);
67 </pre>
68 </div>
69 <div class="refsect1">
70 <a name="gio-GSettingsSchema-GSettingsSchemaSource.object-hierarchy"></a><h2>Object Hierarchy</h2>
71 <pre class="synopsis">
72   GBoxed
73    +----GSettingsSchema
74 </pre>
75 </div>
76 <div class="refsect1">
77 <a name="gio-GSettingsSchema-GSettingsSchemaSource.description"></a><h2>Description</h2>
78 <p>
79 The <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="type">GSettingsSchemaSource</span></a> and <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a> APIs provide a
80 mechanism for advanced control over the loading of schemas and a
81 mechanism for introspecting their content.
82 </p>
83 <p>
84 Plugin loading systems that wish to provide plugins a way to access
85 settings face the problem of how to make the schemas for these
86 settings visible to GSettings.  Typically, a plugin will want to ship
87 the schema along with itself and it won't be installed into the
88 standard system directories for schemas.
89 </p>
90 <p>
91 <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="type">GSettingsSchemaSource</span></a> provides a mechanism for dealing with this by
92 allowing the creation of a new 'schema source' from which schemas can
93 be acquired.  This schema source can then become part of the metadata
94 associated with the plugin and queried whenever the plugin requires
95 access to some settings.
96 </p>
97 <p>
98 Consider the following example:
99 </p>
100 <p>
101 </p>
102 <div class="informalexample"><pre class="programlisting">
103 typedef struct
104 {
105    ...
106    GSettingsSchemaSource *schema_source;
107    ...
108 } Plugin;
109
110 Plugin *
111 initialise_plugin (const gchar *dir)
112 {
113   Plugin *plugin;
114
115   ...
116
117   plugin-&gt;schema_source =
118     g_settings_new_schema_source_from_directory (dir,
119       g_settings_schema_source_get_default (), FALSE, NULL);
120
121   ...
122
123   return plugin;
124 }
125
126 ...
127
128 GSettings *
129 plugin_get_settings (Plugin      *plugin,
130                      const gchar *schema_id)
131 {
132   GSettingsSchema *schema;
133
134   if (schema_id == NULL)
135     schema_id = plugin-&gt;identifier;
136
137   schema = g_settings_schema_source_lookup (plugin-&gt;schema_source,
138                                             schema_id, FALSE);
139
140   if (schema == NULL)
141     {
142       ... disable the plugin or abort, etc ...
143     }
144
145   return g_settings_new_full (schema, NULL, NULL);
146 }
147 </pre></div>
148 <p>
149 </p>
150 <p>
151 The code above shows how hooks should be added to the code that
152 initialises (or enables) the plugin to create the schema source and
153 how an API can be added to the plugin system to provide a convenient
154 way for the plugin to access its settings, using the schemas that it
155 ships.
156 </p>
157 <p>
158 From the standpoint of the plugin, it would need to ensure that it
159 ships a gschemas.compiled file as part of itself, and then simply do
160 the following:
161 </p>
162 <p>
163 </p>
164 <div class="informalexample"><pre class="programlisting">
165 {
166   GSettings *settings;
167   gint some_value;
168
169   settings = plugin_get_settings (self, NULL);
170   some_value = g_settings_get_int (settings, "some-value");
171   ...
172 }
173 </pre></div>
174 <p>
175 </p>
176 <p>
177 It's also possible that the plugin system expects the schema source
178 files (ie: .gschema.xml files) instead of a gschemas.compiled file.
179 In that case, the plugin loading system must compile the schemas for
180 itself before attempting to create the settings source.
181 </p>
182 </div>
183 <div class="refsect1">
184 <a name="gio-GSettingsSchema-GSettingsSchemaSource.details"></a><h2>Details</h2>
185 <div class="refsect2">
186 <a name="GSettingsSchemaSource"></a><h3>GSettingsSchemaSource</h3>
187 <pre class="programlisting">typedef struct _GSettingsSchemaSource GSettingsSchemaSource;</pre>
188 <p>
189 This is an opaque structure type.  You may not access it directly.
190 </p>
191 <p class="since">Since 2.32</p>
192 </div>
193 <hr>
194 <div class="refsect2">
195 <a name="G-TYPE-SETTINGS-SCHEMA-SOURCE:CAPS"></a><h3>G_TYPE_SETTINGS_SCHEMA_SOURCE</h3>
196 <pre class="programlisting">#define                 G_TYPE_SETTINGS_SCHEMA_SOURCE                   (g_settings_schema_source_get_type ())
197 </pre>
198 <p>
199 A boxed <a href="./../gobject/gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a> corresponding to <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="type">GSettingsSchemaSource</span></a>.
200 </p>
201 <p class="since">Since 2.32</p>
202 </div>
203 <hr>
204 <div class="refsect2">
205 <a name="g-settings-schema-source-get-default"></a><h3>g_settings_schema_source_get_default ()</h3>
206 <pre class="programlisting"><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="returnvalue">GSettingsSchemaSource</span></a> * g_settings_schema_source_get_default
207                                                         (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
208 <p>
209 Gets the default system schema source.
210 </p>
211 <p>
212 This function is not required for normal uses of <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> but it
213 may be useful to authors of plugin management systems or to those who
214 want to introspect the content of schemas.
215 </p>
216 <p>
217 If no schemas are installed, <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> will be returned.
218 </p>
219 <p>
220 The returned source may actually consist of multiple schema sources
221 from different directories, depending on which directories were given
222 in <code class="envar">XDG_DATA_DIRS</code> and
223 <code class="envar">GSETTINGS_SCHEMA_DIR</code>.  For this reason, all lookups
224 performed against the default source should probably be done
225 recursively.
226 </p>
227 <div class="variablelist"><table border="0">
228 <col align="left" valign="top">
229 <tbody><tr>
230 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
231 <td>the default schema source. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
232 </td>
233 </tr></tbody>
234 </table></div>
235 <p class="since">Since 2.32</p>
236 </div>
237 <hr>
238 <div class="refsect2">
239 <a name="g-settings-schema-source-ref"></a><h3>g_settings_schema_source_ref ()</h3>
240 <pre class="programlisting"><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="returnvalue">GSettingsSchemaSource</span></a> * g_settings_schema_source_ref    (<em class="parameter"><code><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="type">GSettingsSchemaSource</span></a> *source</code></em>);</pre>
241 <p>
242 Increase the reference count of <em class="parameter"><code>source</code></em>, returning a new reference.
243 </p>
244 <div class="variablelist"><table border="0">
245 <col align="left" valign="top">
246 <tbody>
247 <tr>
248 <td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
249 <td>a <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="type">GSettingsSchemaSource</span></a>
250 </td>
251 </tr>
252 <tr>
253 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
254 <td>a new reference to <em class="parameter"><code>source</code></em>
255 </td>
256 </tr>
257 </tbody>
258 </table></div>
259 <p class="since">Since 2.32</p>
260 </div>
261 <hr>
262 <div class="refsect2">
263 <a name="g-settings-schema-source-unref"></a><h3>g_settings_schema_source_unref ()</h3>
264 <pre class="programlisting"><span class="returnvalue">void</span>                g_settings_schema_source_unref      (<em class="parameter"><code><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="type">GSettingsSchemaSource</span></a> *source</code></em>);</pre>
265 <p>
266 Decrease the reference count of <em class="parameter"><code>source</code></em>, possibly freeing it.
267 </p>
268 <div class="variablelist"><table border="0">
269 <col align="left" valign="top">
270 <tbody><tr>
271 <td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
272 <td>a <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="type">GSettingsSchemaSource</span></a>
273 </td>
274 </tr></tbody>
275 </table></div>
276 <p class="since">Since 2.32</p>
277 </div>
278 <hr>
279 <div class="refsect2">
280 <a name="g-settings-schema-source-new-from-directory"></a><h3>g_settings_schema_source_new_from_directory ()</h3>
281 <pre class="programlisting"><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="returnvalue">GSettingsSchemaSource</span></a> * g_settings_schema_source_new_from_directory
282                                                         (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *directory</code></em>,
283                                                          <em class="parameter"><code><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="type">GSettingsSchemaSource</span></a> *parent</code></em>,
284                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> trusted</code></em>,
285                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
286 <p>
287 Attempts to create a new schema source corresponding to the contents
288 of the given directory.
289 </p>
290 <p>
291 This function is not required for normal uses of <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> but it
292 may be useful to authors of plugin management systems.
293 </p>
294 <p>
295 The directory should contain a file called
296 <code class="filename">gschemas.compiled</code> as produced by
297 <span class="command"><strong>glib-compile-schemas</strong></span>.
298 </p>
299 <p>
300 If <em class="parameter"><code>trusted</code></em> is <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> then <code class="filename">gschemas.compiled</code> is
301 trusted not to be corrupted.  This assumption has a performance
302 advantage, but can result in crashes or inconsistent behaviour in the
303 case of a corrupted file.  Generally, you should set <em class="parameter"><code>trusted</code></em> to
304 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> for files installed by the system and to <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> for files in
305 the home directory.
306 </p>
307 <p>
308 If <em class="parameter"><code>parent</code></em> is non-<a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then there are two effects.
309 </p>
310 <p>
311 First, if <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#g-settings-schema-source-lookup" title="g_settings_schema_source_lookup ()"><code class="function">g_settings_schema_source_lookup()</code></a> is called with the
312 <em class="parameter"><code>recursive</code></em> flag set to <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> and the schema can not be found in the
313 source, the lookup will recurse to the parent.
314 </p>
315 <p>
316 Second, any references to other schemas specified within this
317 source (ie: <code class="literal">child</code> or <code class="literal">extents</code>)
318 references may be resolved from the <em class="parameter"><code>parent</code></em>.
319 </p>
320 <p>
321 For this second reason, except in very unusual situations, the
322 <em class="parameter"><code>parent</code></em> should probably be given as the default schema source, as
323 returned by <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#g-settings-schema-source-get-default" title="g_settings_schema_source_get_default ()"><code class="function">g_settings_schema_source_get_default()</code></a>.
324 </p>
325 <div class="variablelist"><table border="0">
326 <col align="left" valign="top">
327 <tbody>
328 <tr>
329 <td><p><span class="term"><em class="parameter"><code>directory</code></em> :</span></p></td>
330 <td>the filename of a directory</td>
331 </tr>
332 <tr>
333 <td><p><span class="term"><em class="parameter"><code>parent</code></em> :</span></p></td>
334 <td>a <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="type">GSettingsSchemaSource</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
335 </td>
336 </tr>
337 <tr>
338 <td><p><span class="term"><em class="parameter"><code>trusted</code></em> :</span></p></td>
339 <td>
340 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, if the directory is trusted</td>
341 </tr>
342 <tr>
343 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
344 <td>a pointer to a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> pointer set to <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
345 </td>
346 </tr>
347 </tbody>
348 </table></div>
349 <p class="since">Since 2.32</p>
350 </div>
351 <hr>
352 <div class="refsect2">
353 <a name="g-settings-schema-source-lookup"></a><h3>g_settings_schema_source_lookup ()</h3>
354 <pre class="programlisting"><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="returnvalue">GSettingsSchema</span></a> *   g_settings_schema_source_lookup     (<em class="parameter"><code><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="type">GSettingsSchemaSource</span></a> *source</code></em>,
355                                                          <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *schema_id</code></em>,
356                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> recursive</code></em>);</pre>
357 <p>
358 Looks up a schema with the identifier <em class="parameter"><code>schema_id</code></em> in <em class="parameter"><code>source</code></em>.
359 </p>
360 <p>
361 This function is not required for normal uses of <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> but it
362 may be useful to authors of plugin management systems or to those who
363 want to introspect the content of schemas.
364 </p>
365 <p>
366 If the schema isn't found directly in <em class="parameter"><code>source</code></em> and <em class="parameter"><code>recursive</code></em> is <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>
367 then the parent sources will also be checked.
368 </p>
369 <p>
370 If the schema isn't found, <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned.
371 </p>
372 <div class="variablelist"><table border="0">
373 <col align="left" valign="top">
374 <tbody>
375 <tr>
376 <td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
377 <td>a <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchemaSource" title="GSettingsSchemaSource"><span class="type">GSettingsSchemaSource</span></a>
378 </td>
379 </tr>
380 <tr>
381 <td><p><span class="term"><em class="parameter"><code>schema_id</code></em> :</span></p></td>
382 <td>a schema ID</td>
383 </tr>
384 <tr>
385 <td><p><span class="term"><em class="parameter"><code>recursive</code></em> :</span></p></td>
386 <td>
387 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the lookup should be recursive</td>
388 </tr>
389 <tr>
390 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
391 <td>a new <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
392 </td>
393 </tr>
394 </tbody>
395 </table></div>
396 <p class="since">Since 2.32</p>
397 </div>
398 <hr>
399 <div class="refsect2">
400 <a name="GSettingsSchema-struct"></a><h3>GSettingsSchema</h3>
401 <pre class="programlisting">typedef struct _GSettingsSchema GSettingsSchema;</pre>
402 <p>
403 This is an opaque structure type.  You may not access it directly.
404 </p>
405 <p class="since">Since 2.32</p>
406 </div>
407 <hr>
408 <div class="refsect2">
409 <a name="G-TYPE-SETTINGS-SCHEMA:CAPS"></a><h3>G_TYPE_SETTINGS_SCHEMA</h3>
410 <pre class="programlisting">#define                 G_TYPE_SETTINGS_SCHEMA                          (g_settings_schema_get_type ())
411 </pre>
412 <p>
413 A boxed <a href="./../gobject/gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a> corresponding to <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a>.
414 </p>
415 <p class="since">Since 2.32</p>
416 </div>
417 <hr>
418 <div class="refsect2">
419 <a name="g-settings-schema-ref"></a><h3>g_settings_schema_ref ()</h3>
420 <pre class="programlisting"><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="returnvalue">GSettingsSchema</span></a> *   g_settings_schema_ref               (<em class="parameter"><code><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a> *schema</code></em>);</pre>
421 <p>
422 Increase the reference count of <em class="parameter"><code>schema</code></em>, returning a new reference.
423 </p>
424 <div class="variablelist"><table border="0">
425 <col align="left" valign="top">
426 <tbody>
427 <tr>
428 <td><p><span class="term"><em class="parameter"><code>schema</code></em> :</span></p></td>
429 <td>a <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a>
430 </td>
431 </tr>
432 <tr>
433 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
434 <td>a new reference to <em class="parameter"><code>schema</code></em>
435 </td>
436 </tr>
437 </tbody>
438 </table></div>
439 <p class="since">Since 2.32</p>
440 </div>
441 <hr>
442 <div class="refsect2">
443 <a name="g-settings-schema-unref"></a><h3>g_settings_schema_unref ()</h3>
444 <pre class="programlisting"><span class="returnvalue">void</span>                g_settings_schema_unref             (<em class="parameter"><code><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a> *schema</code></em>);</pre>
445 <p>
446 Decrease the reference count of <em class="parameter"><code>schema</code></em>, possibly freeing it.
447 </p>
448 <div class="variablelist"><table border="0">
449 <col align="left" valign="top">
450 <tbody><tr>
451 <td><p><span class="term"><em class="parameter"><code>schema</code></em> :</span></p></td>
452 <td>a <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a>
453 </td>
454 </tr></tbody>
455 </table></div>
456 <p class="since">Since 2.32</p>
457 </div>
458 <hr>
459 <div class="refsect2">
460 <a name="g-settings-schema-get-id"></a><h3>g_settings_schema_get_id ()</h3>
461 <pre class="programlisting">const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       g_settings_schema_get_id            (<em class="parameter"><code><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a> *schema</code></em>);</pre>
462 <p>
463 Get the ID of <em class="parameter"><code>schema</code></em>.
464 </p>
465 <div class="variablelist"><table border="0">
466 <col align="left" valign="top">
467 <tbody>
468 <tr>
469 <td><p><span class="term"><em class="parameter"><code>schema</code></em> :</span></p></td>
470 <td>a <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a>
471 </td>
472 </tr>
473 <tr>
474 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
475 <td>the ID. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
476 </td>
477 </tr>
478 </tbody>
479 </table></div>
480 </div>
481 <hr>
482 <div class="refsect2">
483 <a name="g-settings-schema-get-path"></a><h3>g_settings_schema_get_path ()</h3>
484 <pre class="programlisting">const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       g_settings_schema_get_path          (<em class="parameter"><code><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a> *schema</code></em>);</pre>
485 <p>
486 Gets the path associated with <em class="parameter"><code>schema</code></em>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
487 </p>
488 <p>
489 Schemas may be single-instance or relocatable.  Single-instance
490 schemas correspond to exactly one set of keys in the backend
491 database: those located at the path returned by this function.
492 </p>
493 <p>
494 Relocatable schemas can be referenced by other schemas and can
495 threfore describe multiple sets of keys at different locations.  For
496 relocatable schemas, this function will return <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
497 </p>
498 <div class="variablelist"><table border="0">
499 <col align="left" valign="top">
500 <tbody>
501 <tr>
502 <td><p><span class="term"><em class="parameter"><code>schema</code></em> :</span></p></td>
503 <td>a <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a>
504 </td>
505 </tr>
506 <tr>
507 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
508 <td>the path of the schema, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
509 </td>
510 </tr>
511 </tbody>
512 </table></div>
513 <p class="since">Since 2.32</p>
514 </div>
515 </div>
516 </div>
517 <div class="footer">
518 <hr>
519           Generated by GTK-Doc V1.18</div>
520 </body>
521 </html>