blob: 7862d0f965a674a9d48d2b58206a5efca6f4711f [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GSettings: GIO Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="GIO Reference Manual">
<link rel="up" href="settings.html" title="Settings">
<link rel="prev" href="settings.html" title="Settings">
<link rel="next" href="GSettingsBackend.html" title="GSettingsBackend">
<meta name="generator" content="GTK-Doc V1.25.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
<a href="#GSettings.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
<a href="#GSettings.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties">  <span class="dim">|</span> 
<a href="#GSettings.properties" class="shortcut">Properties</a></span><span id="nav_signals">  <span class="dim">|</span> 
<a href="#GSettings.signals" class="shortcut">Signals</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="settings.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="settings.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GSettingsBackend.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GSettings"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GSettings.top_of_page"></a>GSettings</span></h2>
<p>GSettings — High-level API for application settings</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GSettings.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="GSettings.html" title="GSettings"><span class="returnvalue">GSettings</span></a> *
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-new" title="g_settings_new ()">g_settings_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GSettings.html" title="GSettings"><span class="returnvalue">GSettings</span></a> *
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-new-with-path" title="g_settings_new_with_path ()">g_settings_new_with_path</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GSettings.html" title="GSettings"><span class="returnvalue">GSettings</span></a> *
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-new-with-backend" title="g_settings_new_with_backend ()">g_settings_new_with_backend</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GSettings.html" title="GSettings"><span class="returnvalue">GSettings</span></a> *
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-new-with-backend-and-path" title="g_settings_new_with_backend_and_path ()">g_settings_new_with_backend_and_path</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GSettings.html" title="GSettings"><span class="returnvalue">GSettings</span></a> *
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-new-full" title="g_settings_new_full ()">g_settings_new_full</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-sync" title="g_settings_sync ()">g_settings_sync</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get-value" title="g_settings_get_value ()">g_settings_get_value</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-set-value" title="g_settings_set_value ()">g_settings_set_value</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-is-writable" title="g_settings_is_writable ()">g_settings_is_writable</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-delay" title="g_settings_delay ()">g_settings_delay</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-apply" title="g_settings_apply ()">g_settings_apply</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-revert" title="g_settings_revert ()">g_settings_revert</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get-has-unapplied" title="g_settings_get_has_unapplied ()">g_settings_get_has_unapplied</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GSettings.html" title="GSettings"><span class="returnvalue">GSettings</span></a> *
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get-child" title="g_settings_get_child ()">g_settings_get_child</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-reset" title="g_settings_reset ()">g_settings_reset</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get-user-value" title="g_settings_get_user_value ()">g_settings_get_user_value</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get-default-value" title="g_settings_get_default_value ()">g_settings_get_default_value</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * const *
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-list-schemas" title="g_settings_list_schemas ()">g_settings_list_schemas</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * const *
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-list-relocatable-schemas" title="g_settings_list_relocatable_schemas ()">g_settings_list_relocatable_schemas</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> **
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-list-keys" title="g_settings_list_keys ()">g_settings_list_keys</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> **
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-list-children" title="g_settings_list_children ()">g_settings_list_children</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get-range" title="g_settings_get_range ()">g_settings_get_range</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-range-check" title="g_settings_range_check ()">g_settings_range_check</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get" title="g_settings_get ()">g_settings_get</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-set" title="g_settings_set ()">g_settings_set</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get-boolean" title="g_settings_get_boolean ()">g_settings_get_boolean</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-set-boolean" title="g_settings_set_boolean ()">g_settings_set_boolean</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get-int" title="g_settings_get_int ()">g_settings_get_int</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-set-int" title="g_settings_set_int ()">g_settings_set_int</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gint64"><span class="returnvalue">gint64</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get-int64" title="g_settings_get_int64 ()">g_settings_get_int64</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-set-int64" title="g_settings_set_int64 ()">g_settings_set_int64</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get-uint" title="g_settings_get_uint ()">g_settings_get_uint</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-set-uint" title="g_settings_set_uint ()">g_settings_set_uint</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get-uint64" title="g_settings_get_uint64 ()">g_settings_get_uint64</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-set-uint64" title="g_settings_set_uint64 ()">g_settings_set_uint64</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get-double" title="g_settings_get_double ()">g_settings_get_double</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-set-double" title="g_settings_set_double ()">g_settings_set_double</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get-string" title="g_settings_get_string ()">g_settings_get_string</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-set-string" title="g_settings_set_string ()">g_settings_set_string</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> **
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get-strv" title="g_settings_get_strv ()">g_settings_get_strv</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-set-strv" title="g_settings_set_strv ()">g_settings_set_strv</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get-enum" title="g_settings_get_enum ()">g_settings_get_enum</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-set-enum" title="g_settings_set_enum ()">g_settings_set_enum</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get-flags" title="g_settings_get_flags ()">g_settings_get_flags</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-set-flags" title="g_settings_set_flags ()">g_settings_set_flags</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GSettings.html#GSettingsGetMapping" title="GSettingsGetMapping ()">*GSettingsGetMapping</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-get-mapped" title="g_settings_get_mapped ()">g_settings_get_mapped</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-bind" title="g_settings_bind ()">g_settings_bind</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-bind-with-mapping" title="g_settings_bind_with_mapping ()">g_settings_bind_with_mapping</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-bind-writable" title="g_settings_bind_writable ()">g_settings_bind_writable</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-unbind" title="g_settings_unbind ()">g_settings_unbind</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GSettings.html#GSettingsBindSetMapping" title="GSettingsBindSetMapping ()">*GSettingsBindSetMapping</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GSettings.html#GSettingsBindGetMapping" title="GSettingsBindGetMapping ()">*GSettingsBindGetMapping</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GAction.html" title="GAction"><span class="returnvalue">GAction</span></a> *
</td>
<td class="function_name">
<a class="link" href="GSettings.html#g-settings-create-action" title="g_settings_create_action ()">g_settings_create_action</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GSettings.properties"></a><h2>Properties</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="properties_type">
<col width="300px" class="properties_name">
<col width="200px" class="properties_flags">
</colgroup>
<tbody>
<tr>
<td class="property_type">
<a class="link" href="GSettingsBackend.html" title="GSettingsBackend"><span class="type">GSettingsBackend</span></a> *</td>
<td class="property_name"><a class="link" href="GSettings.html#GSettings--backend" title="The “backend” property">backend</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr>
<tr>
<td class="property_type"><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
<td class="property_name"><a class="link" href="GSettings.html#GSettings--delay-apply" title="The “delay-apply” property">delay-apply</a></td>
<td class="property_flags">Read</td>
</tr>
<tr>
<td class="property_type"><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
<td class="property_name"><a class="link" href="GSettings.html#GSettings--has-unapplied" title="The “has-unapplied” property">has-unapplied</a></td>
<td class="property_flags">Read</td>
</tr>
<tr>
<td class="property_type">
<a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</td>
<td class="property_name"><a class="link" href="GSettings.html#GSettings--path" title="The “path” property">path</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr>
<tr>
<td class="property_type">
<a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</td>
<td class="property_name"><a class="link" href="GSettings.html#GSettings--schema" title="The “schema” property">schema</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr>
<tr>
<td class="property_type">
<a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</td>
<td class="property_name"><a class="link" href="GSettings.html#GSettings--schema-id" title="The “schema-id” property">schema-id</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr>
<tr>
<td class="property_type">
<a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a> *</td>
<td class="property_name"><a class="link" href="GSettings.html#GSettings--settings-schema" title="The “settings-schema” property">settings-schema</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GSettings.signals"></a><h2>Signals</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="signals_return">
<col width="300px" class="signals_name">
<col width="200px" class="signals_flags">
</colgroup>
<tbody>
<tr>
<td class="signal_type"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a></td>
<td class="signal_name"><a class="link" href="GSettings.html#GSettings-change-event" title="The “change-event” signal">change-event</a></td>
<td class="signal_flags"><a href="../gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></td>
</tr>
<tr>
<td class="signal_type"><span class="returnvalue">void</span></td>
<td class="signal_name"><a class="link" href="GSettings.html#GSettings-changed" title="The “changed” signal">changed</a></td>
<td class="signal_flags"><a href="../gobject-Signals.html#G-SIGNAL-DETAILED:CAPS">Has Details</a></td>
</tr>
<tr>
<td class="signal_type"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a></td>
<td class="signal_name"><a class="link" href="GSettings.html#GSettings-writable-change-event" title="The “writable-change-event” signal">writable-change-event</a></td>
<td class="signal_flags"><a href="../gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></td>
</tr>
<tr>
<td class="signal_type"><span class="returnvalue">void</span></td>
<td class="signal_name"><a class="link" href="GSettings.html#GSettings-writable-changed" title="The “writable-changed” signal">writable-changed</a></td>
<td class="signal_flags"><a href="../gobject-Signals.html#G-SIGNAL-DETAILED:CAPS">Has Details</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GSettings.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GSettings.html#GSettings-struct" title="GSettings">GSettings</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="GSettings.html#GSettingsBindFlags" title="enum GSettingsBindFlags">GSettingsBindFlags</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GSettings.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen"> <a href="../gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
<span class="lineart">╰──</span> GSettings
</pre>
</div>
<div class="refsect1">
<a name="GSettings.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gio/gio.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GSettings.description"></a><h2>Description</h2>
<p>The <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> class provides a convenient API for storing and retrieving
application settings.</p>
<p>Reads and writes can be considered to be non-blocking. Reading
settings with <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> is typically extremely fast: on
approximately the same order of magnitude (but slower than) a
<a href="../glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a> lookup. Writing settings is also extremely fast in terms
of time to return to your application, but can be extremely expensive
for other threads and other processes. Many settings backends
(including dconf) have lazy initialisation which means in the common
case of the user using their computer without modifying any settings
a lot of work can be avoided. For dconf, the D-Bus service doesn't
even need to be started in this case. For this reason, you should
only ever modify <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> keys in response to explicit user action.
Particular care should be paid to ensure that modifications are not
made during startup -- for example, when setting the initial value
of preferences widgets. The built-in <a class="link" href="GSettings.html#g-settings-bind" title="g_settings_bind ()"><code class="function">g_settings_bind()</code></a> functionality
is careful not to write settings in response to notify signals as a
result of modifications that it makes to widgets.</p>
<p>When creating a GSettings instance, you have to specify a schema
that describes the keys in your settings and their types and default
values, as well as some other information.</p>
<p>Normally, a schema has as fixed path that determines where the settings
are stored in the conceptual global tree of settings. However, schemas
can also be '<a class="link" href="GSettings.html#gsettings-relocatable" title="Relocatable schemas">relocatable</a>', i.e. not equipped with
a fixed path. This is
useful e.g. when the schema describes an 'account', and you want to be
able to store a arbitrary number of accounts.</p>
<p>Paths must start with and end with a forward slash character ('/')
and must not contain two sequential slash characters. Paths should
be chosen based on a domain name associated with the program or
library to which the settings belong. Examples of paths are
"/org/gtk/settings/file-chooser/" and "/ca/desrt/dconf-editor/".
Paths should not start with "/apps/", "/desktop/" or "/system/" as
they often did in GConf.</p>
<p>Unlike other configuration systems (like GConf), GSettings does not
restrict keys to basic types like strings and numbers. GSettings stores
values as <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a>, and allows any <a href="../glib-GVariantType.html#GVariantType"><span class="type">GVariantType</span></a> for keys. Key names
are restricted to lowercase characters, numbers and '-'. Furthermore,
the names must begin with a lowercase character, must not end
with a '-', and must not contain consecutive dashes.</p>
<p>Similar to GConf, the default values in GSettings schemas can be
localized, but the localized values are stored in gettext catalogs
and looked up with the domain that is specified in the
<code class="literal">gettext-domain</code> attribute of the &lt;schemalist&gt; or &lt;schema&gt;
elements and the category that is specified in the <code class="literal">l10n</code> attribute of
the &lt;default&gt; element. The string which is translated includes all text in
the &lt;default&gt; element, including any surrounding quotation marks.</p>
<p>The <code class="literal">l10n</code> attribute must be set to <code class="literal">messages</code> or <code class="literal">time</code>, and sets the
<a class="ulink" href="https://www.gnu.org/software/gettext/manual/html_node/Aspects.html#index-locale-categories-1" target="_top">locale category for
translation</a>.
The <code class="literal">messages</code> category should be used by default; use <code class="literal">time</code> for
translatable date or time formats. A translation comment can be added as an
XML comment immediately above the &lt;default&gt; element — it is recommended to
add these comments to aid translators understand the meaning and
implications of the default value. An optional translation <code class="literal">context</code>
attribute can be set on the &lt;default&gt; element to disambiguate multiple
defaults which use the same string.</p>
<p>For example:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="symbol">&lt;!--</span><span class="normal"> Translators</span><span class="symbol">:</span><span class="normal"> A list of words which are not allowed to </span><span class="usertype">be</span><span class="normal"> typed</span><span class="symbol">,</span><span class="normal"> in</span>
<span class="normal"> <a href="../glib-GVariant.html#GVariant">GVariant</a> </span><span class="usertype">serialization</span><span class="normal"> syntax</span><span class="symbol">.</span>
<span class="normal"> See</span><span class="symbol">:</span><span class="normal"> https</span><span class="symbol">:</span><span class="comment">//developer.gnome.org/glib/stable/gvariant-text.html --&gt;</span>
<span class="symbol">&lt;</span><span class="keyword">default</span><span class="normal"> l10n</span><span class="symbol">=</span><span class="string">'messages'</span><span class="normal"> context</span><span class="symbol">=</span><span class="string">'Banned words'</span><span class="symbol">&gt;[</span><span class="string">'bad'</span><span class="symbol">,</span><span class="normal"> </span><span class="string">'words'</span><span class="symbol">]&lt;/</span><span class="keyword">default</span><span class="symbol">&gt;</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>Translations of default values must remain syntactically valid serialized
<a href="../glib-GVariant.html#GVariant"><span class="type">GVariants</span></a> (e.g. retaining any surrounding quotation marks) or runtime
errors will occur.</p>
<p>GSettings uses schemas in a compact binary form that is created
by the glib-compile-schemas
utility. The input is a schema description in an XML format.</p>
<p>A DTD for the gschema XML format can be found here:
<a class="ulink" href="https://git.gnome.org/browse/glib/tree/gio/gschema.dtd" target="_top">gschema.dtd</a></p>
<p>The glib-compile-schemas tool expects schema
files to have the extension <code class="literal">.gschema.xml</code>.</p>
<p>At runtime, schemas are identified by their id (as specified in the
id attribute of the &lt;schema&gt; element). The convention for schema
ids is to use a dotted name, similar in style to a D-Bus bus name,
e.g. "org.gnome.SessionManager". In particular, if the settings are
for a specific service that owns a D-Bus bus name, the D-Bus bus name
and schema id should match. For schemas which deal with settings not
associated with one named application, the id should not use
StudlyCaps, e.g. "org.gnome.font-rendering".</p>
<p>In addition to <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> types, keys can have types that have
enumerated types. These can be described by a &lt;choice&gt;,
&lt;enum&gt; or &lt;flags&gt; element, as seen in the
example. The underlying type of such a key
is string, but you can use <a class="link" href="GSettings.html#g-settings-get-enum" title="g_settings_get_enum ()"><code class="function">g_settings_get_enum()</code></a>, <a class="link" href="GSettings.html#g-settings-set-enum" title="g_settings_set_enum ()"><code class="function">g_settings_set_enum()</code></a>,
<a class="link" href="GSettings.html#g-settings-get-flags" title="g_settings_get_flags ()"><code class="function">g_settings_get_flags()</code></a>, <a class="link" href="GSettings.html#g-settings-set-flags" title="g_settings_set_flags ()"><code class="function">g_settings_set_flags()</code></a> access the numeric values
corresponding to the string value of enum and flags keys.</p>
<p>An example for default value:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="symbol">&lt;</span><span class="normal">schemalist</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">schema</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"org.gtk.Test"</span><span class="normal"> path</span><span class="symbol">=</span><span class="string">"/org/gtk/Test/"</span><span class="normal"> gettext</span><span class="symbol">-</span><span class="normal">domain</span><span class="symbol">=</span><span class="string">"test"</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">key</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"greeting"</span><span class="normal"> type</span><span class="symbol">=</span><span class="string">"s"</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="keyword">default</span><span class="normal"> l10n</span><span class="symbol">=</span><span class="string">"messages"</span><span class="symbol">&gt;</span><span class="string">"Hello, earthlings"</span><span class="symbol">&lt;/</span><span class="keyword">default</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="normal">summary</span><span class="symbol">&gt;</span><span class="usertype">A</span><span class="normal"> greeting</span><span class="symbol">&lt;/</span><span class="normal">summary</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="normal">description</span><span class="symbol">&gt;</span>
<span class="normal"> Greeting of the invading martians</span>
<span class="normal"> </span><span class="symbol">&lt;/</span><span class="normal">description</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;/</span><span class="normal">key</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">key</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"box"</span><span class="normal"> type</span><span class="symbol">=</span><span class="string">"(ii)"</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="keyword">default</span><span class="symbol">&gt;(</span><span class="number">20</span><span class="symbol">,</span><span class="number">30</span><span class="symbol">)&lt;/</span><span class="keyword">default</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;/</span><span class="normal">key</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;/</span><span class="normal">schema</span><span class="symbol">&gt;</span>
<span class="symbol">&lt;/</span><span class="normal">schemalist</span><span class="symbol">&gt;</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>An example for ranges, choices and enumerated types:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="symbol">&lt;</span><span class="normal">schemalist</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="keyword">enum</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"org.gtk.Test.myenum"</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">value</span><span class="normal"> nick</span><span class="symbol">=</span><span class="string">"first"</span><span class="normal"> value</span><span class="symbol">=</span><span class="string">"1"</span><span class="symbol">/&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">value</span><span class="normal"> nick</span><span class="symbol">=</span><span class="string">"second"</span><span class="normal"> value</span><span class="symbol">=</span><span class="string">"2"</span><span class="symbol">/&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;/</span><span class="keyword">enum</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">flags</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"org.gtk.Test.myflags"</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">value</span><span class="normal"> nick</span><span class="symbol">=</span><span class="string">"flag1"</span><span class="normal"> value</span><span class="symbol">=</span><span class="string">"1"</span><span class="symbol">/&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">value</span><span class="normal"> nick</span><span class="symbol">=</span><span class="string">"flag2"</span><span class="normal"> value</span><span class="symbol">=</span><span class="string">"2"</span><span class="symbol">/&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">value</span><span class="normal"> nick</span><span class="symbol">=</span><span class="string">"flag3"</span><span class="normal"> value</span><span class="symbol">=</span><span class="string">"4"</span><span class="symbol">/&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;/</span><span class="normal">flags</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">schema</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"org.gtk.Test"</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">key</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"key-with-range"</span><span class="normal"> type</span><span class="symbol">=</span><span class="string">"i"</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">range</span><span class="normal"> min</span><span class="symbol">=</span><span class="string">"1"</span><span class="normal"> max</span><span class="symbol">=</span><span class="string">"100"</span><span class="symbol">/&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="keyword">default</span><span class="symbol">&gt;</span><span class="number">10</span><span class="symbol">&lt;/</span><span class="keyword">default</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;/</span><span class="normal">key</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">key</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"key-with-choices"</span><span class="normal"> type</span><span class="symbol">=</span><span class="string">"s"</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="normal">choices</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">choice</span><span class="normal"> value</span><span class="symbol">=</span><span class="string">'Elisabeth'</span><span class="symbol">/&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">choice</span><span class="normal"> value</span><span class="symbol">=</span><span class="string">'Annabeth'</span><span class="symbol">/&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">choice</span><span class="normal"> value</span><span class="symbol">=</span><span class="string">'Joe'</span><span class="symbol">/&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;/</span><span class="normal">choices</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="normal">aliases</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">alias</span><span class="normal"> value</span><span class="symbol">=</span><span class="string">'Anna'</span><span class="normal"> target</span><span class="symbol">=</span><span class="string">'Annabeth'</span><span class="symbol">/&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">alias</span><span class="normal"> value</span><span class="symbol">=</span><span class="string">'Beth'</span><span class="normal"> target</span><span class="symbol">=</span><span class="string">'Elisabeth'</span><span class="symbol">/&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;/</span><span class="normal">aliases</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="keyword">default</span><span class="symbol">&gt;</span><span class="string">'Joe'</span><span class="symbol">&lt;/</span><span class="keyword">default</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;/</span><span class="normal">key</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">key</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">'enumerated-key'</span><span class="normal"> </span><span class="keyword">enum</span><span class="symbol">=</span><span class="string">'org.gtk.Test.myenum'</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="keyword">default</span><span class="symbol">&gt;</span><span class="string">'first'</span><span class="symbol">&lt;/</span><span class="keyword">default</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;/</span><span class="normal">key</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">key</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">'flags-key'</span><span class="normal"> flags</span><span class="symbol">=</span><span class="string">'org.gtk.Test.myflags'</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="keyword">default</span><span class="symbol">&gt;[</span><span class="string">"flag1"</span><span class="symbol">,</span><span class="string">"flag2"</span><span class="symbol">]&lt;/</span><span class="keyword">default</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;/</span><span class="normal">key</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;/</span><span class="normal">schema</span><span class="symbol">&gt;</span>
<span class="symbol">&lt;/</span><span class="normal">schemalist</span><span class="symbol">&gt;</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<div class="refsect3">
<a name="id-1.4.19.2.9.25"></a><h4>Vendor overrides</h4>
<p>Default values are defined in the schemas that get installed by
an application. Sometimes, it is necessary for a vendor or distributor
to adjust these defaults. Since patching the XML source for the schema
is inconvenient and error-prone,
glib-compile-schemas reads so-called vendor
override' files. These are keyfiles in the same directory as the XML
schema sources which can override default values. The schema id serves
as the group name in the key file, and the values are expected in
serialized GVariant form, as in the following example:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="symbol">[</span><span class="normal">org</span><span class="symbol">.</span><span class="normal">gtk</span><span class="symbol">.</span><span class="normal">Example</span><span class="symbol">]</span>
<span class="normal">key1</span><span class="symbol">=</span><span class="string">'string'</span>
<span class="normal">key2</span><span class="symbol">=</span><span class="number">1.5</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>glib-compile-schemas expects schema files to have the extension
<code class="literal">.gschema.override</code>.</p>
</div>
<div class="refsect3">
<a name="id-1.4.19.2.9.26"></a><h4>Binding</h4>
<p>A very convenient feature of GSettings lets you bind <a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> properties
directly to settings, using <a class="link" href="GSettings.html#g-settings-bind" title="g_settings_bind ()"><code class="function">g_settings_bind()</code></a>. Once a GObject property
has been bound to a setting, changes on either side are automatically
propagated to the other side. GSettings handles details like mapping
between GObject and GVariant types, and preventing infinite cycles.</p>
<p>This makes it very easy to hook up a preferences dialog to the
underlying settings. To make this even more convenient, GSettings
looks for a boolean property with the name "sensitivity" and
automatically binds it to the writability of the bound setting.
If this 'magic' gets in the way, it can be suppressed with the
<a class="link" href="GSettings.html#G-SETTINGS-BIND-NO-SENSITIVITY:CAPS"><span class="type">G_SETTINGS_BIND_NO_SENSITIVITY</span></a> flag.</p>
</div>
<div class="refsect3">
<a name="gsettings-relocatable"></a><h4>Relocatable schemas</h4>
<p>A relocatable schema is one with no <code class="literal">path</code> attribute specified on its
&lt;schema&gt; element. By using <a class="link" href="GSettings.html#g-settings-new-with-path" title="g_settings_new_with_path ()"><code class="function">g_settings_new_with_path()</code></a>, a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object
can be instantiated for a relocatable schema, assigning a path to the
instance. Paths passed to <a class="link" href="GSettings.html#g-settings-new-with-path" title="g_settings_new_with_path ()"><code class="function">g_settings_new_with_path()</code></a> will typically be
constructed dynamically from a constant prefix plus some form of instance
identifier; but they must still be valid GSettings paths. Paths could also
be constant and used with a globally installed schema originating from a
dependency library.</p>
<p>For example, a relocatable schema could be used to store geometry information
for different windows in an application. If the schema ID was
<code class="literal">org.foo.MyApp.Window</code>, it could be instantiated for paths
<code class="literal">/org/foo/MyApp/main/</code>, <code class="literal">/org/foo/MyApp/document-1/</code>,
<code class="literal">/org/foo/MyApp/document-2/</code>, etc. If any of the paths are well-known
they can be specified as &lt;child&gt; elements in the parent schema, e.g.:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="symbol">&lt;</span><span class="usertype">schema</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"org.foo.MyApp"</span><span class="normal"> path</span><span class="symbol">=</span><span class="string">"/org/foo/MyApp/"</span><span class="symbol">&gt;</span>
<span class="normal"> </span><span class="symbol">&lt;</span><span class="usertype">child</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"main"</span><span class="normal"> schema</span><span class="symbol">=</span><span class="string">"org.foo.MyApp.Window"</span><span class="symbol">/&gt;</span>
<span class="symbol">&lt;/</span><span class="normal">schema</span><span class="symbol">&gt;</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
</div>
<div class="refsect3">
<a name="gsettings-build-system"></a><h4>Build system integration</h4>
<p>GSettings comes with autotools integration to simplify compiling and
installing schemas. To add GSettings support to an application, add the
following to your <code class="literal">configure.ac</code>:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="normal">GLIB_GSETTINGS</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>In the appropriate <code class="literal">Makefile.am</code>, use the following snippet to compile and
install the named schema:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="normal">gsettings_SCHEMAS </span><span class="symbol">=</span><span class="normal"> org</span><span class="symbol">.</span><span class="normal">foo</span><span class="symbol">.</span><span class="normal">MyApp</span><span class="symbol">.</span><span class="normal">gschema</span><span class="symbol">.</span><span class="normal">xml</span>
<span class="normal">EXTRA_DIST </span><span class="symbol">=</span><span class="normal"> $</span><span class="symbol">(</span><span class="normal">gsettings_SCHEMAS</span><span class="symbol">)</span>
<span class="normal">@GSETTINGS_RULES@</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>No changes are needed to the build system to mark a schema XML file for
translation. Assuming it sets the <code class="literal">gettext-domain</code> attribute, a schema may
be marked for translation by adding it to <code class="literal">POTFILES.in</code>, assuming gettext
0.19 is in use (the preferred method for translation):</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="normal">data</span><span class="symbol">/</span><span class="normal">org</span><span class="symbol">.</span><span class="normal">foo</span><span class="symbol">.</span><span class="normal">MyApp</span><span class="symbol">.</span><span class="normal">gschema</span><span class="symbol">.</span><span class="normal">xml</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>Alternatively, if intltool 0.50.1 is in use:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="symbol">[</span><span class="normal">type</span><span class="symbol">:</span><span class="normal"> gettext</span><span class="symbol">/</span><span class="normal">gsettings</span><span class="symbol">]</span><span class="normal">data</span><span class="symbol">/</span><span class="normal">org</span><span class="symbol">.</span><span class="normal">foo</span><span class="symbol">.</span><span class="normal">MyApp</span><span class="symbol">.</span><span class="normal">gschema</span><span class="symbol">.</span><span class="normal">xml</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>GSettings will use gettext to look up translations for the &lt;summary&gt; and
&lt;description&gt; elements, and also any &lt;default&gt; elements which have a <code class="literal">l10n</code>
attribute set. Translations must not be included in the <code class="literal">.gschema.xml</code> file
by the build system, for example by using intltool XML rules with a
<code class="literal">.gschema.xml.in</code> template.</p>
<p>If an enumerated type defined in a C header file is to be used in a GSettings
schema, it can either be defined manually using an &lt;enum&gt; element in the
schema XML, or it can be extracted automatically from the C header. This
approach is preferred, as it ensures the two representations are always
synchronised. To do so, add the following to the relevant <code class="literal">Makefile.am</code>:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="normal">gsettings_ENUM_NAMESPACE </span><span class="symbol">=</span><span class="normal"> org</span><span class="symbol">.</span><span class="normal">foo</span><span class="symbol">.</span><span class="normal">MyApp</span>
<span class="normal">gsettings_ENUM_FILES </span><span class="symbol">=</span><span class="normal"> my</span><span class="symbol">-</span><span class="normal">app</span><span class="symbol">-</span><span class="normal">enums</span><span class="symbol">.</span><span class="usertype">h</span><span class="normal"> my</span><span class="symbol">-</span><span class="normal">app</span><span class="symbol">-</span><span class="normal">misc</span><span class="symbol">.</span><span class="normal">h</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p><code class="literal">gsettings_ENUM_NAMESPACE</code> specifies the schema namespace for the enum files,
which are specified in <code class="literal">gsettings_ENUM_FILES</code>. This will generate a
<code class="literal">org.foo.MyApp.enums.xml</code> file containing the extracted enums, which will be
automatically included in the schema compilation, install and uninstall
rules. It should not be committed to version control or included in
<code class="literal">EXTRA_DIST</code>.</p>
</div>
</div>
<div class="refsect1">
<a name="GSettings.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="g-settings-new"></a><h3>g_settings_new ()</h3>
<pre class="programlisting"><a class="link" href="GSettings.html" title="GSettings"><span class="returnvalue">GSettings</span></a> *
g_settings_new (<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *schema_id</code></em>);</pre>
<p>Creates a new <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object with the schema specified by
<em class="parameter"><code>schema_id</code></em>
.</p>
<p>Signals on the newly created <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object will be dispatched
via the thread-default <a href="../glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> in effect at the time of the
call to <a class="link" href="GSettings.html#g-settings-new" title="g_settings_new ()"><code class="function">g_settings_new()</code></a>. The new <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> will hold a reference
on the context. See <a href="../glib-The-Main-Event-Loop.html#g-main-context-push-thread-default"><code class="function">g_main_context_push_thread_default()</code></a>.</p>
<div class="refsect3">
<a name="g-settings-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>schema_id</p></td>
<td class="parameter_description"><p>the id of the schema</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-settings-new.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-new-with-path"></a><h3>g_settings_new_with_path ()</h3>
<pre class="programlisting"><a class="link" href="GSettings.html" title="GSettings"><span class="returnvalue">GSettings</span></a> *
g_settings_new_with_path (<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *schema_id</code></em>,
<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>);</pre>
<p>Creates a new <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object with the relocatable schema specified
by <em class="parameter"><code>schema_id</code></em>
and a given path.</p>
<p>You only need to do this if you want to directly create a settings
object with a schema that doesn't have a specified path of its own.
That's quite rare.</p>
<p>It is a programmer error to call this function for a schema that
has an explicitly specified path.</p>
<p>It is a programmer error if <em class="parameter"><code>path</code></em>
is not a valid path. A valid path
begins and ends with '/' and does not contain two consecutive '/'
characters.</p>
<div class="refsect3">
<a name="g-settings-new-with-path.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>schema_id</p></td>
<td class="parameter_description"><p>the id of the schema</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>path</p></td>
<td class="parameter_description"><p>the path to use</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-settings-new-with-path.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-new-with-backend"></a><h3>g_settings_new_with_backend ()</h3>
<pre class="programlisting"><a class="link" href="GSettings.html" title="GSettings"><span class="returnvalue">GSettings</span></a> *
g_settings_new_with_backend (<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *schema_id</code></em>,
<em class="parameter"><code><a class="link" href="GSettingsBackend.html" title="GSettingsBackend"><span class="type">GSettingsBackend</span></a> *backend</code></em>);</pre>
<p>Creates a new <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object with the schema specified by
<em class="parameter"><code>schema_id</code></em>
and a given <a class="link" href="GSettingsBackend.html" title="GSettingsBackend"><span class="type">GSettingsBackend</span></a>.</p>
<p>Creating a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object with a different backend allows accessing
settings from a database other than the usual one. For example, it may make
sense to pass a backend corresponding to the "defaults" settings database on
the system to get a settings object that modifies the system default
settings instead of the settings for this user.</p>
<div class="refsect3">
<a name="g-settings-new-with-backend.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>schema_id</p></td>
<td class="parameter_description"><p>the id of the schema</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>backend</p></td>
<td class="parameter_description"><p>the <a class="link" href="GSettingsBackend.html" title="GSettingsBackend"><span class="type">GSettingsBackend</span></a> to use</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-settings-new-with-backend.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-new-with-backend-and-path"></a><h3>g_settings_new_with_backend_and_path ()</h3>
<pre class="programlisting"><a class="link" href="GSettings.html" title="GSettings"><span class="returnvalue">GSettings</span></a> *
g_settings_new_with_backend_and_path (<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *schema_id</code></em>,
<em class="parameter"><code><a class="link" href="GSettingsBackend.html" title="GSettingsBackend"><span class="type">GSettingsBackend</span></a> *backend</code></em>,
<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>);</pre>
<p>Creates a new <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object with the schema specified by
<em class="parameter"><code>schema_id</code></em>
and a given <a class="link" href="GSettingsBackend.html" title="GSettingsBackend"><span class="type">GSettingsBackend</span></a> and path.</p>
<p>This is a mix of <a class="link" href="GSettings.html#g-settings-new-with-backend" title="g_settings_new_with_backend ()"><code class="function">g_settings_new_with_backend()</code></a> and
<a class="link" href="GSettings.html#g-settings-new-with-path" title="g_settings_new_with_path ()"><code class="function">g_settings_new_with_path()</code></a>.</p>
<div class="refsect3">
<a name="g-settings-new-with-backend-and-path.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>schema_id</p></td>
<td class="parameter_description"><p>the id of the schema</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>backend</p></td>
<td class="parameter_description"><p>the <a class="link" href="GSettingsBackend.html" title="GSettingsBackend"><span class="type">GSettingsBackend</span></a> to use</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>path</p></td>
<td class="parameter_description"><p>the path to use</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-settings-new-with-backend-and-path.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-new-full"></a><h3>g_settings_new_full ()</h3>
<pre class="programlisting"><a class="link" href="GSettings.html" title="GSettings"><span class="returnvalue">GSettings</span></a> *
g_settings_new_full (<em class="parameter"><code><a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a> *schema</code></em>,
<em class="parameter"><code><a class="link" href="GSettingsBackend.html" title="GSettingsBackend"><span class="type">GSettingsBackend</span></a> *backend</code></em>,
<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>);</pre>
<p>Creates a new <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object with a given schema, backend and
path.</p>
<p>It should be extremely rare that you ever want to use this function.
It is made available for advanced use-cases (such as plugin systems
that want to provide access to schemas loaded from custom locations,
etc).</p>
<p>At the most basic level, a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object is a pure composition of
4 things: a <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a>, a <a class="link" href="GSettingsBackend.html" title="GSettingsBackend"><span class="type">GSettingsBackend</span></a>, a path within that
backend, and a <a href="../glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> to which signals are dispatched.</p>
<p>This constructor therefore gives you full control over constructing
<a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> instances. The first 3 parameters are given directly as
<em class="parameter"><code>schema</code></em>
, <em class="parameter"><code>backend</code></em>
and <em class="parameter"><code>path</code></em>
, and the main context is taken from the
thread-default (as per <a class="link" href="GSettings.html#g-settings-new" title="g_settings_new ()"><code class="function">g_settings_new()</code></a>).</p>
<p>If <em class="parameter"><code>backend</code></em>
is <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then the default backend is used.</p>
<p>If <em class="parameter"><code>path</code></em>
is <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then the path from the schema is used. It is an
error if <em class="parameter"><code>path</code></em>
is <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> and the schema has no path of its own or if
<em class="parameter"><code>path</code></em>
is non-<a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> and not equal to the path that the schema does
have.</p>
<div class="refsect3">
<a name="g-settings-new-full.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>schema</p></td>
<td class="parameter_description"><p>a <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>backend</p></td>
<td class="parameter_description"><p> a <a class="link" href="GSettingsBackend.html" title="GSettingsBackend"><span class="type">GSettingsBackend</span></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>path</p></td>
<td class="parameter_description"><p> the path to use. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-settings-new-full.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-sync"></a><h3>g_settings_sync ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_settings_sync (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Ensures that all pending operations for the given are complete for
the default backend.</p>
<p>Writes made to a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> are handled asynchronously. For this
reason, it is very unlikely that the changes have it to disk by the
time <a class="link" href="GSettings.html#g-settings-set" title="g_settings_set ()"><code class="function">g_settings_set()</code></a> returns.</p>
<p>This call will block until all of the writes have made it to the
backend. Since the mainloop is not running, no change notifications
will be dispatched during this call (but some may be queued by the
time the call is done).</p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-get-value"></a><h3>g_settings_get_value ()</h3>
<pre class="programlisting"><a href="../glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
g_settings_get_value (<em class="parameter"><code><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings</code></em>,
<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key</code></em>);</pre>
<p>Gets the value that is stored in <em class="parameter"><code>settings</code></em>
for <em class="parameter"><code>key</code></em>
.</p>
<p>It is a programmer error to give a <em class="parameter"><code>key</code></em>
that isn't contained in the
schema for <em class="parameter"><code>settings</code></em>
.</p>
<div class="refsect3">
<a name="g-settings-get-value.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>settings</p></td>
<td class="parameter_description"><p>a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>key</p></td>
<td class="parameter_description"><p>the key to get the value for</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-settings-get-value.returns"></a><h4>Returns</h4>
<p> a new <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a></p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-set-value"></a><h3>g_settings_set_value ()</h3>
<pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
g_settings_set_value (<em class="parameter"><code><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings</code></em>,
<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key</code></em>,
<em class="parameter"><code><a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *value</code></em>);</pre>
<p>Sets <em class="parameter"><code>key</code></em>
in <em class="parameter"><code>settings</code></em>
to <em class="parameter"><code>value</code></em>
.</p>
<p>It is a programmer error to give a <em class="parameter"><code>key</code></em>
that isn't contained in the
schema for <em class="parameter"><code>settings</code></em>
or for <em class="parameter"><code>value</code></em>
to have the incorrect type, per
the schema.</p>
<p>If <em class="parameter"><code>value</code></em>
is floating then this function consumes the reference.</p>
<div class="refsect3">
<a name="g-settings-set-value.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>settings</p></td>
<td class="parameter_description"><p>a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>key</p></td>
<td class="parameter_description"><p>the name of the key to set</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>a <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> of the correct type</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-settings-set-value.returns"></a><h4>Returns</h4>
<p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if setting the key succeeded,
<a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if the key was not writable</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-is-writable"></a><h3>g_settings_is_writable ()</h3>
<pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
g_settings_is_writable (<em class="parameter"><code><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings</code></em>,
<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);</pre>
<p>Finds out if a key can be written or not</p>
<div class="refsect3">
<a name="g-settings-is-writable.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>settings</p></td>
<td class="parameter_description"><p>a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description"><p>the name of a key</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-settings-is-writable.returns"></a><h4>Returns</h4>
<p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the key <em class="parameter"><code>name</code></em>
is writable</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-delay"></a><h3>g_settings_delay ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_settings_delay (<em class="parameter"><code><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings</code></em>);</pre>
<p>Changes the <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object into 'delay-apply' mode. In this
mode, changes to <em class="parameter"><code>settings</code></em>
are not immediately propagated to the
backend, but kept locally until <a class="link" href="GSettings.html#g-settings-apply" title="g_settings_apply ()"><code class="function">g_settings_apply()</code></a> is called.</p>
<div class="refsect3">
<a name="g-settings-delay.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>settings</p></td>
<td class="parameter_description"><p>a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-apply"></a><h3>g_settings_apply ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_settings_apply (<em class="parameter"><code><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings</code></em>);</pre>
<p>Applies any changes that have been made to the settings. This
function does nothing unless <em class="parameter"><code>settings</code></em>
is in 'delay-apply' mode;
see <a class="link" href="GSettings.html#g-settings-delay" title="g_settings_delay ()"><code class="function">g_settings_delay()</code></a>. In the normal case settings are always
applied immediately.</p>
<div class="refsect3">
<a name="g-settings-apply.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>settings</p></td>
<td class="parameter_description"><p>a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> instance</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-revert"></a><h3>g_settings_revert ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_settings_revert (<em class="parameter"><code><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings</code></em>);</pre>
<p>Reverts all non-applied changes to the settings. This function
does nothing unless <em class="parameter"><code>settings</code></em>
is in 'delay-apply' mode; see
<a class="link" href="GSettings.html#g-settings-delay" title="g_settings_delay ()"><code class="function">g_settings_delay()</code></a>. In the normal case settings are always applied
immediately.</p>
<p>Change notifications will be emitted for affected keys.</p>
<div class="refsect3">
<a name="g-settings-revert.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>settings</p></td>
<td class="parameter_description"><p>a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> instance</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-get-has-unapplied"></a><h3>g_settings_get_has_unapplied ()</h3>
<pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
g_settings_get_has_unapplied (<em class="parameter"><code><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings</code></em>);</pre>
<p>Returns whether the <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object has any unapplied
changes. This can only be the case if it is in 'delayed-apply' mode.</p>
<div class="refsect3">
<a name="g-settings-get-has-unapplied.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>settings</p></td>
<td class="parameter_description"><p>a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-settings-get-has-unapplied.returns"></a><h4>Returns</h4>
<p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>settings</code></em>
has unapplied changes</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-get-child"></a><h3>g_settings_get_child ()</h3>
<pre class="programlisting"><a class="link" href="GSettings.html" title="GSettings"><span class="returnvalue">GSettings</span></a> *
g_settings_get_child (<em class="parameter"><code><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings</code></em>,
<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);</pre>
<p>Creates a child settings object which has a base path of
<code class="literal">base-path/@name</code>, where <code class="literal">base-path</code> is the base path of
<em class="parameter"><code>settings</code></em>
.</p>
<p>The schema for the child settings object must have been declared
in the schema of <em class="parameter"><code>settings</code></em>
using a &lt;child&gt; element.</p>
<div class="refsect3">
<a name="g-settings-get-child.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>settings</p></td>
<td class="parameter_description"><p>a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description"><p>the name of the child schema</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-settings-get-child.returns"></a><h4>Returns</h4>
<p> a 'child' settings object. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-reset"></a><h3>g_settings_reset ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_settings_reset (<em class="parameter"><code><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings</code></em>,
<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key</code></em>);</pre>
<p>Resets <em class="parameter"><code>key</code></em>
to its default value.</p>
<p>This call resets the key, as much as possible, to its default value.
That might the value specified in the schema or the one set by the
administrator.</p>
<div class="refsect3">
<a name="g-settings-reset.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>settings</p></td>
<td class="parameter_description"><p>a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>key</p></td>
<td class="parameter_description"><p>the name of a key</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-get-user-value"></a><h3>g_settings_get_user_value ()</h3>
<pre class="programlisting"><a href="../glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
g_settings_get_user_value (<em class="parameter"><code><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings</code></em>,
<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key</code></em>);</pre>
<p>Checks the "user value" of a key, if there is one.</p>
<p>The user value of a key is the last value that was set by the user.</p>
<p>After calling <a class="link" href="GSettings.html#g-settings-reset" title="g_settings_reset ()"><code class="function">g_settings_reset()</code></a> this function should always return
<a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> (assuming something is not wrong with the system
configuration).</p>
<p>It is possible that <a class="link" href="GSettings.html#g-settings-get-value" title="g_settings_get_value ()"><code class="function">g_settings_get_value()</code></a> will return a different
value than this function. This can happen in the case that the user
set a value for a key that was subsequently locked down by the system
administrator -- this function will return the user's old value.</p>
<p>This function may be useful for adding a "reset" option to a UI or
for providing indication that a particular value has been changed.</p>
<p>It is a programmer error to give a <em class="parameter"><code>key</code></em>
that isn't contained in the
schema for <em class="parameter"><code>settings</code></em>
.</p>
<div class="refsect3">
<a name="g-settings-get-user-value.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>settings</p></td>
<td class="parameter_description"><p>a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>key</p></td>
<td class="parameter_description"><p>the key to get the user value for</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-settings-get-user-value.returns"></a><h4>Returns</h4>
<p> the user's value, if set. </p>
<p><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-get-default-value"></a><h3>g_settings_get_default_value ()</h3>
<pre class="programlisting"><a href="../glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
g_settings_get_default_value (<em class="parameter"><code><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings</code></em>,
<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key</code></em>);</pre>
<p>Gets the "default value" of a key.</p>
<p>This is the value that would be read if <a class="link" href="GSettings.html#g-settings-reset" title="g_settings_reset ()"><code class="function">g_settings_reset()</code></a> were to be
called on the key.</p>
<p>Note that this may be a different value than returned by
<a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#g-settings-schema-key-get-default-value" title="g_settings_schema_key_get_default_value ()"><code class="function">g_settings_schema_key_get_default_value()</code></a> if the system administrator
has provided a default value.</p>
<p>Comparing the return values of <a class="link" href="GSettings.html#g-settings-get-default-value" title="g_settings_get_default_value ()"><code class="function">g_settings_get_default_value()</code></a> and
<a class="link" href="GSettings.html#g-settings-get-value" title="g_settings_get_value ()"><code class="function">g_settings_get_value()</code></a> is not sufficient for determining if a value
has been set because the user may have explicitly set the value to
something that happens to be equal to the default. The difference
here is that if the default changes in the future, the user's key
will still be set.</p>
<p>This function may be useful for adding an indication to a UI of what
the default value was before the user set it.</p>
<p>It is a programmer error to give a <em class="parameter"><code>key</code></em>
that isn't contained in the
schema for <em class="parameter"><code>settings</code></em>
.</p>
<div class="refsect3">
<a name="g-settings-get-default-value.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>settings</p></td>
<td class="parameter_description"><p>a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>key</p></td>
<td class="parameter_description"><p>the key to get the default value for</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-settings-get-default-value.returns"></a><h4>Returns</h4>
<p> the default value. </p>
<p><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-list-schemas"></a><h3>g_settings_list_schemas ()</h3>
<pre class="programlisting">const <a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * const *
g_settings_list_schemas (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<div class="warning">
<p><code class="literal">g_settings_list_schemas</code> has been deprecated since version 2.40 and should not be used in newly-written code.</p>
<p>Use <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#g-settings-schema-source-list-schemas" title="g_settings_schema_source_list_schemas ()"><code class="function">g_settings_schema_source_list_schemas()</code></a> instead.
If you used <a class="link" href="GSettings.html#g-settings-list-schemas" title="g_settings_list_schemas ()"><code class="function">g_settings_list_schemas()</code></a> to check for the presence of
a particular schema, use <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> instead
of your whole loop.</p>
</div>
<p>&lt;!-- --&gt;</p>
<div class="refsect3">
<a name="g-settings-list-schemas.returns"></a><h4>Returns</h4>
<p> a list of <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a>
schemas that are available. The list must not be modified or
freed. </p>
<p><span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-list-relocatable-schemas"></a><h3>g_settings_list_relocatable_schemas ()</h3>
<pre class="programlisting">const <a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * const *
g_settings_list_relocatable_schemas (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<div class="warning">
<p><code class="literal">g_settings_list_relocatable_schemas</code> has been deprecated since version 2.40 and should not be used in newly-written code.</p>
<p>Use <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#g-settings-schema-source-list-schemas" title="g_settings_schema_source_list_schemas ()"><code class="function">g_settings_schema_source_list_schemas()</code></a> instead</p>
</div>
<p>&lt;!-- --&gt;</p>
<div class="refsect3">
<a name="g-settings-list-relocatable-schemas.returns"></a><h4>Returns</h4>
<p> a list of relocatable
<a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> schemas that are available. The list must not be
modified or freed. </p>
<p><span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-list-keys"></a><h3>g_settings_list_keys ()</h3>
<pre class="programlisting"><a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> **
g_settings_list_keys (<em class="parameter"><code><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings</code></em>);</pre>
<div class="warning"><p><code class="literal">g_settings_list_keys</code> is deprecated and should not be used in newly-written code.</p></div>
<p>Introspects the list of keys on <em class="parameter"><code>settings</code></em>
.</p>
<p>You should probably not be calling this function from "normal" code
(since you should already know what keys are in your schema). This
function is intended for introspection reasons.</p>
<p>You should free the return value with <a href="../glib-String-Utility-Functions.html#g-strfreev"><code class="function">g_strfreev()</code></a> when you are done
with it.</p>
<div class="refsect3">
<a name="g-settings-list-keys.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>settings</p></td>
<td class="parameter_description"><p>a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-settings-list-keys.returns"></a><h4>Returns</h4>
<p> a list of the keys on <em class="parameter"><code>settings</code></em>
. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-list-children"></a><h3>g_settings_list_children ()</h3>
<pre class="programlisting"><a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> **
g_settings_list_children (<em class="parameter"><code><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings</code></em>);</pre>
<p>Gets the list of children on <em class="parameter"><code>settings</code></em>
.</p>
<p>The list is exactly the list of strings for which it is not an error
to call <a class="link" href="GSettings.html#g-settings-get-child" title="g_settings_get_child ()"><code class="function">g_settings_get_child()</code></a>.</p>
<p>For GSettings objects that are lists, this value can change at any
time and you should connect to the "children-changed" signal to watch
for those changes. Note that there is a race condition here: you may
request a child after listing it only for it to have been destroyed
in the meantime. For this reason, <a class="link" href="GSettings.html#g-settings-get-child" title="g_settings_get_child ()"><code class="function">g_settings_get_child()</code></a> may return
<a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> even for a child that was listed by this function.</p>
<p>For GSettings objects that are not lists, you should probably not be
calling this function from "normal" code (since you should already
know what children are in your schema). This function may still be
useful there for introspection reasons, however.</p>
<p>You should free the return value with <a href="../glib-String-Utility-Functions.html#g-strfreev"><code class="function">g_strfreev()</code></a> when you are done
with it.</p>
<div class="refsect3">
<a name="g-settings-list-children.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>settings</p></td>
<td class="parameter_description"><p>a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-settings-list-children.returns"></a><h4>Returns</h4>
<p> a list of the children on <em class="parameter"><code>settings</code></em>
. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-get-range"></a><h3>g_settings_get_range ()</h3>
<pre class="programlisting"><a href="../glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
g_settings_get_range (<em class="parameter"><code><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings</code></em>,
<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key</code></em>);</pre>
<div class="warning">
<p><code class="literal">g_settings_get_range</code> has been deprecated since version 2.40 and should not be used in newly-written code.</p>
<p>Use <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#g-settings-schema-key-get-range" title="g_settings_schema_key_get_range ()"><code class="function">g_settings_schema_key_get_range()</code></a> instead.</p>
</div>
<p>Queries the range of a key.</p>
<div class="refsect3">
<a name="g-settings-get-range.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>settings</p></td>
<td class="parameter_description"><p>a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>key</p></td>
<td class="parameter_description"><p>the key to query the range of</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-range-check"></a><h3>g_settings_range_check ()</h3>
<pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
g_settings_range_check (<em class="parameter"><code><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings</code></em>,
<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key</code></em>,
<em class="parameter"><code><a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *value</code></em>);</pre>
<div class="warning">
<p><code class="literal">g_settings_range_check</code> has been deprecated since version 2.40 and should not be used in newly-written code.</p>
<p>Use <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#g-settings-schema-key-range-check" title="g_settings_schema_key_range_check ()"><code class="function">g_settings_schema_key_range_check()</code></a> instead.</p>
</div>
<p>Checks if the given <em class="parameter"><code>value</code></em>
is of the correct type and within the
permitted range for <em class="parameter"><code>key</code></em>
.</p>
<div class="refsect3">
<a name="g-settings-range-check.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>settings</p></td>
<td class="parameter_description"><p>a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>key</p></td>
<td class="parameter_description"><p>the key to check</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>the value to check</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-settings-range-check.returns"></a><h4>Returns</h4>
<p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>value</code></em>
is valid for <em class="parameter"><code>key</code></em>
</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-get"></a><h3>g_settings_get ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_settings_get (<em class="parameter"><code><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings</code></em>,
<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key</code></em>,
<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>Gets the value that is stored at <em class="parameter"><code>key</code></em>
in <em class="parameter"><code>settings</code></em>
.</p>
<p>A convenience function that combines <a class="link" href="GSettings.html#g-settings-get-value" title="g_settings_get_value ()"><code class="function">g_settings_get_value()</code></a> with
<a href="../glib-GVariant.html#g-variant-get"><code class="function">g_variant_get()</code></a>.</p>
<p>It is a programmer error to give a <em class="parameter"><code>key</code></em>
that isn't contained in the
schema for <em class="parameter"><code>settings</code></em>
or for the <a href="../glib-GVariantType.html#GVariantType"><span class="type">GVariantType</span></a> of <em class="parameter"><code>format</code></em>
to mismatch
the type given in the schema.</p>
<div class="refsect3">
<a name="g-settings-get.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>settings</p></td>
<td class="parameter_description"><p>a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>key</p></td>
<td class="parameter_description"><p>the key to get the value for</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>a <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> format string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p>arguments as per <em class="parameter"><code>format</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-settings-set"></a><h3>g_settings_set ()</h3>
<pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
g_settings_set (<em class="parameter"><code><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings</code></em>,
<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key</code></em>,
<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>Sets <em class="parameter"><code>key</code></em>
in <em class="parameter"><code>settings</code></em>
to <em class="parameter"><code>value</code></em>
.</p>
<p>A convenience function that combines <a class="link" href="GSettings.html#g-settings-set-value" title="g_settings_set_value ()"><code class="function">g_settings_set_value()</code></a> with
<a href="../glib-GVariant.html#g-variant-new"><code cla