| <!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 <gio/gio.h> |
| </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 <schemalist> or <schema> |
| elements and the category that is specified in the <code class="literal">l10n</code> attribute of |
| the <default> element. The string which is translated includes all text in |
| the <default> 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 <default> 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 <default> 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"><!--</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 --></span> |
| <span class="symbol"><</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">>[</span><span class="string">'bad'</span><span class="symbol">,</span><span class="normal"> </span><span class="string">'words'</span><span class="symbol">]</</span><span class="keyword">default</span><span class="symbol">></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 <schema> 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 <choice>, |
| <enum> or <flags> 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"><</span><span class="normal">schemalist</span><span class="symbol">></span> |
| <span class="normal"> </span><span class="symbol"><</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">></span> |
| |
| <span class="normal"> </span><span class="symbol"><</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">></span> |
| <span class="normal"> </span><span class="symbol"><</span><span class="keyword">default</span><span class="normal"> l10n</span><span class="symbol">=</span><span class="string">"messages"</span><span class="symbol">></span><span class="string">"Hello, earthlings"</span><span class="symbol"></</span><span class="keyword">default</span><span class="symbol">></span> |
| <span class="normal"> </span><span class="symbol"><</span><span class="normal">summary</span><span class="symbol">></span><span class="usertype">A</span><span class="normal"> greeting</span><span class="symbol"></</span><span class="normal">summary</span><span class="symbol">></span> |
| <span class="normal"> </span><span class="symbol"><</span><span class="normal">description</span><span class="symbol">></span> |
| <span class="normal"> Greeting of the invading martians</span> |
| <span class="normal"> </span><span class="symbol"></</span><span class="normal">description</span><span class="symbol">></span> |
| <span class="normal"> </span><span class="symbol"></</span><span class="normal">key</span><span class="symbol">></span> |
| |
| <span class="normal"> </span><span class="symbol"><</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">></span> |
| <span class="normal"> </span><span class="symbol"><</span><span class="keyword">default</span><span class="symbol">>(</span><span class="number">20</span><span class="symbol">,</span><span class="number">30</span><span class="symbol">)</</span><span class="keyword">default</span><span class="symbol">></span> |
| <span class="normal"> </span><span class="symbol"></</span><span class="normal">key</span><span class="symbol">></span> |
| |
| <span class="normal"> </span><span class="symbol"></</span><span class="normal">schema</span><span class="symbol">></span> |
| <span class="symbol"></</span><span class="normal">schemalist</span><span class="symbol">></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"><</span><span class="normal">schemalist</span><span class="symbol">></span> |
| |
| <span class="normal"> </span><span class="symbol"><</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">></span> |
| <span class="normal"> </span><span class="symbol"><</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">/></span> |
| <span class="normal"> </span><span class="symbol"><</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">/></span> |
| <span class="normal"> </span><span class="symbol"></</span><span class="keyword">enum</span><span class="symbol">></span> |
| |
| <span class="normal"> </span><span class="symbol"><</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">></span> |
| <span class="normal"> </span><span class="symbol"><</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">/></span> |
| <span class="normal"> </span><span class="symbol"><</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">/></span> |
| <span class="normal"> </span><span class="symbol"><</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">/></span> |
| <span class="normal"> </span><span class="symbol"></</span><span class="normal">flags</span><span class="symbol">></span> |
| |
| <span class="normal"> </span><span class="symbol"><</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">></span> |
| |
| <span class="normal"> </span><span class="symbol"><</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">></span> |
| <span class="normal"> </span><span class="symbol"><</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">/></span> |
| <span class="normal"> </span><span class="symbol"><</span><span class="keyword">default</span><span class="symbol">></span><span class="number">10</span><span class="symbol"></</span><span class="keyword">default</span><span class="symbol">></span> |
| <span class="normal"> </span><span class="symbol"></</span><span class="normal">key</span><span class="symbol">></span> |
| |
| <span class="normal"> </span><span class="symbol"><</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">></span> |
| <span class="normal"> </span><span class="symbol"><</span><span class="normal">choices</span><span class="symbol">></span> |
| <span class="normal"> </span><span class="symbol"><</span><span class="usertype">choice</span><span class="normal"> value</span><span class="symbol">=</span><span class="string">'Elisabeth'</span><span class="symbol">/></span> |
| <span class="normal"> </span><span class="symbol"><</span><span class="usertype">choice</span><span class="normal"> value</span><span class="symbol">=</span><span class="string">'Annabeth'</span><span class="symbol">/></span> |
| <span class="normal"> </span><span class="symbol"><</span><span class="usertype">choice</span><span class="normal"> value</span><span class="symbol">=</span><span class="string">'Joe'</span><span class="symbol">/></span> |
| <span class="normal"> </span><span class="symbol"></</span><span class="normal">choices</span><span class="symbol">></span> |
| <span class="normal"> </span><span class="symbol"><</span><span class="normal">aliases</span><span class="symbol">></span> |
| <span class="normal"> </span><span class="symbol"><</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">/></span> |
| <span class="normal"> </span><span class="symbol"><</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">/></span> |
| <span class="normal"> </span><span class="symbol"></</span><span class="normal">aliases</span><span class="symbol">></span> |
| <span class="normal"> </span><span class="symbol"><</span><span class="keyword">default</span><span class="symbol">></span><span class="string">'Joe'</span><span class="symbol"></</span><span class="keyword">default</span><span class="symbol">></span> |
| <span class="normal"> </span><span class="symbol"></</span><span class="normal">key</span><span class="symbol">></span> |
| |
| <span class="normal"> </span><span class="symbol"><</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">></span> |
| <span class="normal"> </span><span class="symbol"><</span><span class="keyword">default</span><span class="symbol">></span><span class="string">'first'</span><span class="symbol"></</span><span class="keyword">default</span><span class="symbol">></span> |
| <span class="normal"> </span><span class="symbol"></</span><span class="normal">key</span><span class="symbol">></span> |
| |
| <span class="normal"> </span><span class="symbol"><</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">></span> |
| <span class="normal"> </span><span class="symbol"><</span><span class="keyword">default</span><span class="symbol">>[</span><span class="string">"flag1"</span><span class="symbol">,</span><span class="string">"flag2"</span><span class="symbol">]</</span><span class="keyword">default</span><span class="symbol">></span> |
| <span class="normal"> </span><span class="symbol"></</span><span class="normal">key</span><span class="symbol">></span> |
| <span class="normal"> </span><span class="symbol"></</span><span class="normal">schema</span><span class="symbol">></span> |
| <span class="symbol"></</span><span class="normal">schemalist</span><span class="symbol">></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 |
| <schema> 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 <child> 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"><</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">></span> |
| <span class="normal"> </span><span class="symbol"><</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">/></span> |
| <span class="symbol"></</span><span class="normal">schema</span><span class="symbol">></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 <summary> and |
| <description> elements, and also any <default> 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 <enum> 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 <child> 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><!-- --></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><!-- --></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 class="function">g_variant_new()</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-set.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>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> |
| <div class="refsect3"> |
| <a name="g-settings-set.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-get-boolean"></a><h3>g_settings_get_boolean ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_settings_get_boolean (<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 at <em class="parameter"><code>key</code></em> |
| in <em class="parameter"><code>settings</code></em> |
| .</p> |
| <p>A convenience variant of <a class="link" href="GSettings.html#g-settings-get" title="g_settings_get ()"><code class="function">g_settings_get()</code></a> for booleans.</p> |
| <p>It is a programmer error to give a <em class="parameter"><code>key</code></em> |
| that isn't specified as |
| having a boolean type in the schema for <em class="parameter"><code>settings</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-get-boolean.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-boolean.returns"></a><h4>Returns</h4> |
| <p> a boolean</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-boolean"></a><h3>g_settings_set_boolean ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_settings_set_boolean (<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-Basic-Types.html#gboolean"><span class="type">gboolean</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>A convenience variant of <a class="link" href="GSettings.html#g-settings-set" title="g_settings_set ()"><code class="function">g_settings_set()</code></a> for booleans.</p> |
| <p>It is a programmer error to give a <em class="parameter"><code>key</code></em> |
| that isn't specified as |
| having a boolean type in the schema for <em class="parameter"><code>settings</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-set-boolean.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>the value to set it to</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-settings-set-boolean.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-get-int"></a><h3>g_settings_get_int ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> |
| g_settings_get_int (<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 at <em class="parameter"><code>key</code></em> |
| in <em class="parameter"><code>settings</code></em> |
| .</p> |
| <p>A convenience variant of <a class="link" href="GSettings.html#g-settings-get" title="g_settings_get ()"><code class="function">g_settings_get()</code></a> for 32-bit integers.</p> |
| <p>It is a programmer error to give a <em class="parameter"><code>key</code></em> |
| that isn't specified as |
| having a int32 type in the schema for <em class="parameter"><code>settings</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-get-int.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-int.returns"></a><h4>Returns</h4> |
| <p> an integer</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-int"></a><h3>g_settings_set_int ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_settings_set_int (<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-Basic-Types.html#gint"><span class="type">gint</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>A convenience variant of <a class="link" href="GSettings.html#g-settings-set" title="g_settings_set ()"><code class="function">g_settings_set()</code></a> for 32-bit integers.</p> |
| <p>It is a programmer error to give a <em class="parameter"><code>key</code></em> |
| that isn't specified as |
| having a int32 type in the schema for <em class="parameter"><code>settings</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-set-int.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>the value to set it to</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-settings-set-int.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-get-int64"></a><h3>g_settings_get_int64 ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gint64"><span class="returnvalue">gint64</span></a> |
| g_settings_get_int64 (<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 at <em class="parameter"><code>key</code></em> |
| in <em class="parameter"><code>settings</code></em> |
| .</p> |
| <p>A convenience variant of <a class="link" href="GSettings.html#g-settings-get" title="g_settings_get ()"><code class="function">g_settings_get()</code></a> for 64-bit integers.</p> |
| <p>It is a programmer error to give a <em class="parameter"><code>key</code></em> |
| that isn't specified as |
| having a int64 type in the schema for <em class="parameter"><code>settings</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-get-int64.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-int64.returns"></a><h4>Returns</h4> |
| <p> a 64-bit integer</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-50.html#api-index-2.50">2.50</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-settings-set-int64"></a><h3>g_settings_set_int64 ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_settings_set_int64 (<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-Basic-Types.html#gint64"><span class="type">gint64</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>A convenience variant of <a class="link" href="GSettings.html#g-settings-set" title="g_settings_set ()"><code class="function">g_settings_set()</code></a> for 64-bit integers.</p> |
| <p>It is a programmer error to give a <em class="parameter"><code>key</code></em> |
| that isn't specified as |
| having a int64 type in the schema for <em class="parameter"><code>settings</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-set-int64.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>the value to set it to</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-settings-set-int64.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-50.html#api-index-2.50">2.50</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-settings-get-uint"></a><h3>g_settings_get_uint ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> |
| g_settings_get_uint (<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 at <em class="parameter"><code>key</code></em> |
| in <em class="parameter"><code>settings</code></em> |
| .</p> |
| <p>A convenience variant of <a class="link" href="GSettings.html#g-settings-get" title="g_settings_get ()"><code class="function">g_settings_get()</code></a> for 32-bit unsigned |
| integers.</p> |
| <p>It is a programmer error to give a <em class="parameter"><code>key</code></em> |
| that isn't specified as |
| having a uint32 type in the schema for <em class="parameter"><code>settings</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-get-uint.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-uint.returns"></a><h4>Returns</h4> |
| <p> an unsigned integer</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-30.html#api-index-2.30">2.30</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-settings-set-uint"></a><h3>g_settings_set_uint ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_settings_set_uint (<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-Basic-Types.html#guint"><span class="type">guint</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>A convenience variant of <a class="link" href="GSettings.html#g-settings-set" title="g_settings_set ()"><code class="function">g_settings_set()</code></a> for 32-bit unsigned |
| integers.</p> |
| <p>It is a programmer error to give a <em class="parameter"><code>key</code></em> |
| that isn't specified as |
| having a uint32 type in the schema for <em class="parameter"><code>settings</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-set-uint.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>the value to set it to</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-settings-set-uint.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-30.html#api-index-2.30">2.30</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-settings-get-uint64"></a><h3>g_settings_get_uint64 ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a> |
| g_settings_get_uint64 (<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 at <em class="parameter"><code>key</code></em> |
| in <em class="parameter"><code>settings</code></em> |
| .</p> |
| <p>A convenience variant of <a class="link" href="GSettings.html#g-settings-get" title="g_settings_get ()"><code class="function">g_settings_get()</code></a> for 64-bit unsigned |
| integers.</p> |
| <p>It is a programmer error to give a <em class="parameter"><code>key</code></em> |
| that isn't specified as |
| having a uint64 type in the schema for <em class="parameter"><code>settings</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-get-uint64.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-uint64.returns"></a><h4>Returns</h4> |
| <p> a 64-bit unsigned integer</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-50.html#api-index-2.50">2.50</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-settings-set-uint64"></a><h3>g_settings_set_uint64 ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_settings_set_uint64 (<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-Basic-Types.html#guint64"><span class="type">guint64</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>A convenience variant of <a class="link" href="GSettings.html#g-settings-set" title="g_settings_set ()"><code class="function">g_settings_set()</code></a> for 64-bit unsigned |
| integers.</p> |
| <p>It is a programmer error to give a <em class="parameter"><code>key</code></em> |
| that isn't specified as |
| having a uint64 type in the schema for <em class="parameter"><code>settings</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-set-uint64.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>the value to set it to</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-settings-set-uint64.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-50.html#api-index-2.50">2.50</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-settings-get-double"></a><h3>g_settings_get_double ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a> |
| g_settings_get_double (<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 at <em class="parameter"><code>key</code></em> |
| in <em class="parameter"><code>settings</code></em> |
| .</p> |
| <p>A convenience variant of <a class="link" href="GSettings.html#g-settings-get" title="g_settings_get ()"><code class="function">g_settings_get()</code></a> for doubles.</p> |
| <p>It is a programmer error to give a <em class="parameter"><code>key</code></em> |
| that isn't specified as |
| having a 'double' type in the schema for <em class="parameter"><code>settings</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-get-double.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-double.returns"></a><h4>Returns</h4> |
| <p> a double</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-double"></a><h3>g_settings_set_double ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_settings_set_double (<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-Basic-Types.html#gdouble"><span class="type">gdouble</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>A convenience variant of <a class="link" href="GSettings.html#g-settings-set" title="g_settings_set ()"><code class="function">g_settings_set()</code></a> for doubles.</p> |
| <p>It is a programmer error to give a <em class="parameter"><code>key</code></em> |
| that isn't specified as |
| having a 'double' type in the schema for <em class="parameter"><code>settings</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-set-double.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>the value to set it to</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-settings-set-double.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-get-string"></a><h3>g_settings_get_string ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * |
| g_settings_get_string (<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 at <em class="parameter"><code>key</code></em> |
| in <em class="parameter"><code>settings</code></em> |
| .</p> |
| <p>A convenience variant of <a class="link" href="GSettings.html#g-settings-get" title="g_settings_get ()"><code class="function">g_settings_get()</code></a> for strings.</p> |
| <p>It is a programmer error to give a <em class="parameter"><code>key</code></em> |
| that isn't specified as |
| having a string type in the schema for <em class="parameter"><code>settings</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-get-string.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-string.returns"></a><h4>Returns</h4> |
| <p> a newly-allocated string</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-string"></a><h3>g_settings_set_string ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_settings_set_string (<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> *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>A convenience variant of <a class="link" href="GSettings.html#g-settings-set" title="g_settings_set ()"><code class="function">g_settings_set()</code></a> for strings.</p> |
| <p>It is a programmer error to give a <em class="parameter"><code>key</code></em> |
| that isn't specified as |
| having a string type in the schema for <em class="parameter"><code>settings</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-set-string.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>the value to set it to</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-settings-set-string.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-get-strv"></a><h3>g_settings_get_strv ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> ** |
| g_settings_get_strv (<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>A convenience variant of <a class="link" href="GSettings.html#g-settings-get" title="g_settings_get ()"><code class="function">g_settings_get()</code></a> for string arrays.</p> |
| <p>It is a programmer error to give a <em class="parameter"><code>key</code></em> |
| that isn't specified as |
| having an array of strings type in the schema for <em class="parameter"><code>settings</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-get-strv.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-strv.returns"></a><h4>Returns</h4> |
| <p> a |
| newly-allocated, <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>-terminated array of strings, the value that |
| is stored at <em class="parameter"><code>key</code></em> |
| in <em class="parameter"><code>settings</code></em> |
| . </p> |
| <p><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1][<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-set-strv"></a><h3>g_settings_set_strv ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_settings_set_strv (<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> *const *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>A convenience variant of <a class="link" href="GSettings.html#g-settings-set" title="g_settings_set ()"><code class="function">g_settings_set()</code></a> for string arrays. If |
| <em class="parameter"><code>value</code></em> |
| is <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then <em class="parameter"><code>key</code></em> |
| is set to be the empty array.</p> |
| <p>It is a programmer error to give a <em class="parameter"><code>key</code></em> |
| that isn't specified as |
| having an array of strings type in the schema for <em class="parameter"><code>settings</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-set-strv.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> the value to set it to, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></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>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1]</span></td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-settings-set-strv.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-get-enum"></a><h3>g_settings_get_enum ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> |
| g_settings_get_enum (<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> |
| and converts it |
| to the enum value that it represents.</p> |
| <p>In order to use this function the type of the value must be a string |
| and it must be marked in the schema file as an enumerated type.</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 is not marked as an enumerated type.</p> |
| <p>If the value stored in the configuration database is not a valid |
| value for the enumerated type then this function will return the |
| default value.</p> |
| <div class="refsect3"> |
| <a name="g-settings-get-enum.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-enum.returns"></a><h4>Returns</h4> |
| <p> the enum value</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-enum"></a><h3>g_settings_set_enum ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_settings_set_enum (<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-Basic-Types.html#gint"><span class="type">gint</span></a> value</code></em>);</pre> |
| <p>Looks up the enumerated type nick for <em class="parameter"><code>value</code></em> |
| and writes it to <em class="parameter"><code>key</code></em> |
| , |
| within <em class="parameter"><code>settings</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 is not marked as an enumerated type, or for |
| <em class="parameter"><code>value</code></em> |
| not to be a valid value for the named type.</p> |
| <p>After performing the write, accessing <em class="parameter"><code>key</code></em> |
| directly with |
| <a class="link" href="GSettings.html#g-settings-get-string" title="g_settings_get_string ()"><code class="function">g_settings_get_string()</code></a> will return the 'nick' associated with |
| <em class="parameter"><code>value</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-set-enum.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>a key, within <em class="parameter"><code>settings</code></em> |
| </p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>value</p></td> |
| <td class="parameter_description"><p>an enumerated value</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-settings-set-enum.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, if the set succeeds</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-settings-get-flags"></a><h3>g_settings_get_flags ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> |
| g_settings_get_flags (<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> |
| and converts it |
| to the flags value that it represents.</p> |
| <p>In order to use this function the type of the value must be an array |
| of strings and it must be marked in the schema file as an flags type.</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 is not marked as a flags type.</p> |
| <p>If the value stored in the configuration database is not a valid |
| value for the flags type then this function will return the default |
| value.</p> |
| <div class="refsect3"> |
| <a name="g-settings-get-flags.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-flags.returns"></a><h4>Returns</h4> |
| <p> the flags value</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-flags"></a><h3>g_settings_set_flags ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| g_settings_set_flags (<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-Basic-Types.html#guint"><span class="type">guint</span></a> value</code></em>);</pre> |
| <p>Looks up the flags type nicks for the bits specified by <em class="parameter"><code>value</code></em> |
| , puts |
| them in an array of strings and writes the array to <em class="parameter"><code>key</code></em> |
| , within |
| <em class="parameter"><code>settings</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 is not marked as a flags type, or for <em class="parameter"><code>value</code></em> |
| |
| to contain any bits that are not value for the named type.</p> |
| <p>After performing the write, accessing <em class="parameter"><code>key</code></em> |
| directly with |
| <a class="link" href="GSettings.html#g-settings-get-strv" title="g_settings_get_strv ()"><code class="function">g_settings_get_strv()</code></a> will return an array of 'nicks'; one for each |
| bit in <em class="parameter"><code>value</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-settings-set-flags.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>a key, within <em class="parameter"><code>settings</code></em> |
| </p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>value</p></td> |
| <td class="parameter_description"><p>a flags value</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-settings-set-flags.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, if the set succeeds</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GSettingsGetMapping"></a><h3>GSettingsGetMapping ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| <span class="c_punctuation">(</span>*GSettingsGetMapping<span class="c_punctuation">)</span> (<em class="parameter"><code><a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *value</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> *result</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre> |
| <p>The type of the function that is used to convert from a value stored |
| in a <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> to a value that is useful to the application.</p> |
| <p>If the value is successfully mapped, the result should be stored at |
| <em class="parameter"><code>result</code></em> |
| and <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> returned. If mapping fails (for example, if <em class="parameter"><code>value</code></em> |
| |
| is not in the right format) then <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> should be returned.</p> |
| <p>If <em class="parameter"><code>value</code></em> |
| is <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then it means that the mapping function is being |
| given a "last chance" to successfully return a valid value. <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> |
| must be returned in this case.</p> |
| <div class="refsect3"> |
| <a name="GSettingsGetMapping.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>value</p></td> |
| <td class="parameter_description"><p>the <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> to map, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>result</p></td> |
| <td class="parameter_description"><p> the result of the mapping. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p> the user data that was passed to |
| <a class="link" href="GSettings.html#g-settings-get-mapped" title="g_settings_get_mapped ()"><code class="function">g_settings_get_mapped()</code></a>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="GSettingsGetMapping.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the conversion succeeded, <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> in case of an error</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-settings-get-mapped"></a><h3>g_settings_get_mapped ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> |
| g_settings_get_mapped (<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 class="link" href="GSettings.html#GSettingsGetMapping" title="GSettingsGetMapping ()"><span class="type">GSettingsGetMapping</span></a> mapping</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</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> |
| , subject to |
| application-level validation/mapping.</p> |
| <p>You should use this function when the application needs to perform |
| some processing on the value of the key (for example, parsing). The |
| <em class="parameter"><code>mapping</code></em> |
| function performs that processing. If the function |
| indicates that the processing was unsuccessful (due to a parse error, |
| for example) then the mapping is tried again with another value.</p> |
| <p>This allows a robust 'fall back to defaults' behaviour to be |
| implemented somewhat automatically.</p> |
| <p>The first value that is tried is the user's setting for the key. If |
| the mapping function fails to map this value, other values may be |
| tried in an unspecified order (system or site defaults, translated |
| schema default values, untranslated schema default values, etc).</p> |
| <p>If the mapping function fails for all possible values, one additional |
| attempt is made: the mapping function is called with a <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> value. |
| If the mapping function still indicates failure at this point then |
| the application will be aborted.</p> |
| <p>The result parameter for the <em class="parameter"><code>mapping</code></em> |
| function is pointed to a |
| <a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> which is initially set to <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. The same pointer is given |
| to each invocation of <em class="parameter"><code>mapping</code></em> |
| . The final value of that <a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> is |
| what is returned by this function. <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is valid; it is returned |
| just as any other value would be.</p> |
| <div class="refsect3"> |
| <a name="g-settings-get-mapped.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>mapping</p></td> |
| <td class="parameter_description"><p> the function to map the value in the |
| settings database to the value used by the application. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid only during the call to the method."><span class="acronym">scope call</span></acronym>]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p>user data for <em class="parameter"><code>mapping</code></em> |
| </p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-settings-get-mapped.returns"></a><h4>Returns</h4> |
| <p> the result, which may be <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p> |
| <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-settings-bind"></a><h3>g_settings_bind ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| g_settings_bind (<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-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> object</code></em>, |
| <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *property</code></em>, |
| <em class="parameter"><code><a class="link" href="GSettings.html#GSettingsBindFlags" title="enum GSettingsBindFlags"><span class="type">GSettingsBindFlags</span></a> flags</code></em>);</pre> |
| <p>Create a binding between the <em class="parameter"><code>key</code></em> |
| in the <em class="parameter"><code>settings</code></em> |
| object |
| and the property <em class="parameter"><code>property</code></em> |
| of <em class="parameter"><code>object</code></em> |
| .</p> |
| <p>The binding uses the default GIO mapping functions to map |
| between the settings and property values. These functions |
| handle booleans, numeric types and string types in a |
| straightforward way. Use <a class="link" href="GSettings.html#g-settings-bind-with-mapping" title="g_settings_bind_with_mapping ()"><code class="function">g_settings_bind_with_mapping()</code></a> if |
| you need a custom mapping, or map between types that are not |
| supported by the default mapping functions.</p> |
| <p>Unless the <em class="parameter"><code>flags</code></em> |
| include <a class="link" href="GSettings.html#G-SETTINGS-BIND-NO-SENSITIVITY:CAPS"><code class="literal">G_SETTINGS_BIND_NO_SENSITIVITY</code></a>, this |
| function also establishes a binding between the writability of |
| <em class="parameter"><code>key</code></em> |
| and the "sensitive" property of <em class="parameter"><code>object</code></em> |
| (if <em class="parameter"><code>object</code></em> |
| has |
| a boolean property by that name). See <a class="link" href="GSettings.html#g-settings-bind-writable" title="g_settings_bind_writable ()"><code class="function">g_settings_bind_writable()</code></a> |
| for more details about writable bindings.</p> |
| <p>Note that the lifecycle of the binding is tied to the object, |
| and that you can have only one binding per object property. |
| If you bind the same property twice on the same object, the second |
| binding overrides the first one.</p> |
| <div class="refsect3"> |
| <a name="g-settings-bind.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 bind</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>object</p></td> |
| <td class="parameter_description"><p> a <a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.Object]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>property</p></td> |
| <td class="parameter_description"><p>the name of the property to bind</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>flags</p></td> |
| <td class="parameter_description"><p>flags for the binding</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-bind-with-mapping"></a><h3>g_settings_bind_with_mapping ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| g_settings_bind_with_mapping (<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-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> object</code></em>, |
| <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *property</code></em>, |
| <em class="parameter"><code><a class="link" href="GSettings.html#GSettingsBindFlags" title="enum GSettingsBindFlags"><span class="type">GSettingsBindFlags</span></a> flags</code></em>, |
| <em class="parameter"><code><a class="link" href="GSettings.html#GSettingsBindGetMapping" title="GSettingsBindGetMapping ()"><span class="type">GSettingsBindGetMapping</span></a> get_mapping</code></em>, |
| <em class="parameter"><code><a class="link" href="GSettings.html#GSettingsBindSetMapping" title="GSettingsBindSetMapping ()"><span class="type">GSettingsBindSetMapping</span></a> set_mapping</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>, |
| <em class="parameter"><code><a href="../glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);</pre> |
| <p>Create a binding between the <em class="parameter"><code>key</code></em> |
| in the <em class="parameter"><code>settings</code></em> |
| object |
| and the property <em class="parameter"><code>property</code></em> |
| of <em class="parameter"><code>object</code></em> |
| .</p> |
| <p>The binding uses the provided mapping functions to map between |
| settings and property values.</p> |
| <p>Note that the lifecycle of the binding is tied to the object, |
| and that you can have only one binding per object property. |
| If you bind the same property twice on the same object, the second |
| binding overrides the first one.</p> |
| <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p> |
| <div class="refsect3"> |
| <a name="g-settings-bind-with-mapping.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 bind</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>object</p></td> |
| <td class="parameter_description"><p> a <a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.Object]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>property</p></td> |
| <td class="parameter_description"><p>the name of the property to bind</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>flags</p></td> |
| <td class="parameter_description"><p>flags for the binding</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>get_mapping</p></td> |
| <td class="parameter_description"><p>a function that gets called to convert values |
| from <em class="parameter"><code>settings</code></em> |
| to <em class="parameter"><code>object</code></em> |
| , or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to use the default GIO mapping</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>set_mapping</p></td> |
| <td class="parameter_description"><p>a function that gets called to convert values |
| from <em class="parameter"><code>object</code></em> |
| to <em class="parameter"><code>settings</code></em> |
| , or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to use the default GIO mapping</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p>data that gets passed to <em class="parameter"><code>get_mapping</code></em> |
| and <em class="parameter"><code>set_mapping</code></em> |
| </p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>destroy</p></td> |
| <td class="parameter_description"><p><a href="../glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> function for <em class="parameter"><code>user_data</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-bind-writable"></a><h3>g_settings_bind_writable ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| g_settings_bind_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> *key</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> object</code></em>, |
| <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *property</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> inverted</code></em>);</pre> |
| <p>Create a binding between the writability of <em class="parameter"><code>key</code></em> |
| in the |
| <em class="parameter"><code>settings</code></em> |
| object and the property <em class="parameter"><code>property</code></em> |
| of <em class="parameter"><code>object</code></em> |
| . |
| The property must be boolean; "sensitive" or "visible" |
| properties of widgets are the most likely candidates.</p> |
| <p>Writable bindings are always uni-directional; changes of the |
| writability of the setting will be propagated to the object |
| property, not the other way.</p> |
| <p>When the <em class="parameter"><code>inverted</code></em> |
| argument is <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, the binding inverts the |
| value as it passes from the setting to the object, i.e. <em class="parameter"><code>property</code></em> |
| |
| will be set to <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the key is not writable.</p> |
| <p>Note that the lifecycle of the binding is tied to the object, |
| and that you can have only one binding per object property. |
| If you bind the same property twice on the same object, the second |
| binding overrides the first one.</p> |
| <div class="refsect3"> |
| <a name="g-settings-bind-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>key</p></td> |
| <td class="parameter_description"><p>the key to bind</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>object</p></td> |
| <td class="parameter_description"><p>a <a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.Object]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>property</p></td> |
| <td class="parameter_description"><p>the name of a boolean property to bind</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>inverted</p></td> |
| <td class="parameter_description"><p>whether to 'invert' the value</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-unbind"></a><h3>g_settings_unbind ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| g_settings_unbind (<em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> object</code></em>, |
| <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *property</code></em>);</pre> |
| <p>Removes an existing binding for <em class="parameter"><code>property</code></em> |
| on <em class="parameter"><code>object</code></em> |
| .</p> |
| <p>Note that bindings are automatically removed when the |
| object is finalized, so it is rarely necessary to call this |
| function.</p> |
| <div class="refsect3"> |
| <a name="g-settings-unbind.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>object</p></td> |
| <td class="parameter_description"><p> the object. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GObject.Object]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>property</p></td> |
| <td class="parameter_description"><p>the property whose binding is removed</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="GSettingsBindSetMapping"></a><h3>GSettingsBindSetMapping ()</h3> |
| <pre class="programlisting"><a href="../glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> * |
| <span class="c_punctuation">(</span>*GSettingsBindSetMapping<span class="c_punctuation">)</span> (<em class="parameter"><code>const <a href="../gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>, |
| <em class="parameter"><code>const <a href="../glib-GVariantType.html#GVariantType"><span class="type">GVariantType</span></a> *expected_type</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre> |
| <p>The type for the function that is used to convert an object property |
| value to a <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> for storing it in <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a>.</p> |
| <div class="refsect3"> |
| <a name="GSettingsBindSetMapping.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>value</p></td> |
| <td class="parameter_description"><p>a <a href="../gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> containing the property value to map</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>expected_type</p></td> |
| <td class="parameter_description"><p>the <a href="../glib-GVariantType.html#GVariantType"><span class="type">GVariantType</span></a> to create</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p>user data that was specified when the binding was created</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="GSettingsBindSetMapping.returns"></a><h4>Returns</h4> |
| <p> a new <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> holding the data from <em class="parameter"><code>value</code></em> |
| , |
| or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> in case of an error</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GSettingsBindGetMapping"></a><h3>GSettingsBindGetMapping ()</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| <span class="c_punctuation">(</span>*GSettingsBindGetMapping<span class="c_punctuation">)</span> (<em class="parameter"><code><a href="../gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>, |
| <em class="parameter"><code><a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *variant</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre> |
| <p>The type for the function that is used to convert from <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> to |
| an object property. The <em class="parameter"><code>value</code></em> |
| is already initialized to hold values |
| of the appropriate type.</p> |
| <div class="refsect3"> |
| <a name="GSettingsBindGetMapping.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>value</p></td> |
| <td class="parameter_description"><p>return location for the property value</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>variant</p></td> |
| <td class="parameter_description"><p>the <a href="../glib-GVariant.html#GVariant"><span class="type">GVariant</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p>user data that was specified when the binding was created</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="GSettingsBindGetMapping.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the conversion succeeded, <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> in case of an error</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-settings-create-action"></a><h3>g_settings_create_action ()</h3> |
| <pre class="programlisting"><a class="link" href="GAction.html" title="GAction"><span class="returnvalue">GAction</span></a> * |
| g_settings_create_action (<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>Creates a <a class="link" href="GAction.html" title="GAction"><span class="type">GAction</span></a> corresponding to a given <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> key.</p> |
| <p>The action has the same name as the key.</p> |
| <p>The value of the key becomes the state of the action and the action |
| is enabled when the key is writable. Changing the state of the |
| action results in the key being written to. Changes to the value or |
| writability of the key cause appropriate change notifications to be |
| emitted for the action.</p> |
| <p>For boolean-valued keys, action activations take no parameter and |
| result in the toggling of the value. For all other types, |
| activations take the new value for the key (which must have the |
| correct type).</p> |
| <div class="refsect3"> |
| <a name="g-settings-create-action.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 name of a key in <em class="parameter"><code>settings</code></em> |
| </p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-settings-create-action.returns"></a><h4>Returns</h4> |
| <p> a new <a class="link" href="GAction.html" title="GAction"><span class="type">GAction</span></a>. </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-32.html#api-index-2.32">2.32</a></p> |
| </div> |
| </div> |
| <div class="refsect1"> |
| <a name="GSettings.other_details"></a><h2>Types and Values</h2> |
| <div class="refsect2"> |
| <a name="GSettings-struct"></a><h3>GSettings</h3> |
| <pre class="programlisting">typedef struct _GSettings GSettings;</pre> |
| <p><a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> is an opaque data structure and can only be accessed |
| using the following functions.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GSettingsBindFlags"></a><h3>enum GSettingsBindFlags</h3> |
| <p>Flags used when creating a binding. These flags determine in which |
| direction the binding works. The default is to synchronize in both |
| directions.</p> |
| <div class="refsect3"> |
| <a name="GSettingsBindFlags.members"></a><h4>Members</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="300px" class="enum_members_name"> |
| <col class="enum_members_description"> |
| <col width="200px" class="enum_members_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-SETTINGS-BIND-DEFAULT:CAPS"></a>G_SETTINGS_BIND_DEFAULT</p></td> |
| <td class="enum_member_description"> |
| <p>Equivalent to <code class="literal">G_SETTINGS_BIND_GET|G_SETTINGS_BIND_SET</code></p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-SETTINGS-BIND-GET:CAPS"></a>G_SETTINGS_BIND_GET</p></td> |
| <td class="enum_member_description"> |
| <p>Update the <a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> property when the setting changes. |
| It is an error to use this flag if the property is not writable.</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-SETTINGS-BIND-SET:CAPS"></a>G_SETTINGS_BIND_SET</p></td> |
| <td class="enum_member_description"> |
| <p>Update the setting when the <a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> property changes. |
| It is an error to use this flag if the property is not readable.</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-SETTINGS-BIND-NO-SENSITIVITY:CAPS"></a>G_SETTINGS_BIND_NO_SENSITIVITY</p></td> |
| <td class="enum_member_description"> |
| <p>Do not try to bind a "sensitivity" property to the writability of the setting</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-SETTINGS-BIND-GET-NO-CHANGES:CAPS"></a>G_SETTINGS_BIND_GET_NO_CHANGES</p></td> |
| <td class="enum_member_description"> |
| <p>When set in addition to <a class="link" href="GSettings.html#G-SETTINGS-BIND-GET:CAPS"><span class="type">G_SETTINGS_BIND_GET</span></a>, set the <a href="../gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> property |
| value initially from the setting, but do not listen for changes of the setting</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-SETTINGS-BIND-INVERT-BOOLEAN:CAPS"></a>G_SETTINGS_BIND_INVERT_BOOLEAN</p></td> |
| <td class="enum_member_description"> |
| <p>When passed to <a class="link" href="GSettings.html#g-settings-bind" title="g_settings_bind ()"><code class="function">g_settings_bind()</code></a>, uses a pair of mapping functions that invert |
| the boolean value when mapping between the setting and the property. The setting and property must both |
| be booleans. You cannot pass this flag to <a class="link" href="GSettings.html#g-settings-bind-with-mapping" title="g_settings_bind_with_mapping ()"><code class="function">g_settings_bind_with_mapping()</code></a>.</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| </div> |
| <div class="refsect1"> |
| <a name="GSettings.property-details"></a><h2>Property Details</h2> |
| <div class="refsect2"> |
| <a name="GSettings--backend"></a><h3>The <code class="literal">“backend”</code> property</h3> |
| <pre class="programlisting"> “backend” <a class="link" href="GSettingsBackend.html" title="GSettingsBackend"><span class="type">GSettingsBackend</span></a> *</pre> |
| <p>The GSettingsBackend for this settings object.</p> |
| <p>Flags: Read / Write / Construct Only</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GSettings--delay-apply"></a><h3>The <code class="literal">“delay-apply”</code> property</h3> |
| <pre class="programlisting"> “delay-apply” <a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre> |
| <p>Whether the <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object 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> for details.</p> |
| <p>Flags: Read</p> |
| <p>Default value: FALSE</p> |
| <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="GSettings--has-unapplied"></a><h3>The <code class="literal">“has-unapplied”</code> property</h3> |
| <pre class="programlisting"> “has-unapplied” <a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre> |
| <p>If this property is <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, the <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object has outstanding |
| changes that will be applied when <a class="link" href="GSettings.html#g-settings-apply" title="g_settings_apply ()"><code class="function">g_settings_apply()</code></a> is called.</p> |
| <p>Flags: Read</p> |
| <p>Default value: FALSE</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GSettings--path"></a><h3>The <code class="literal">“path”</code> property</h3> |
| <pre class="programlisting"> “path” <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</pre> |
| <p>The path within the backend where the settings are stored.</p> |
| <p>Flags: Read / Write / Construct Only</p> |
| <p>Default value: NULL</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GSettings--schema"></a><h3>The <code class="literal">“schema”</code> property</h3> |
| <pre class="programlisting"> “schema” <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</pre> |
| <p>The name of the schema that describes the types of keys |
| for this <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object.</p> |
| <p>The type of this property is *not* <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a>. |
| <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a> has only existed since version 2.32 and |
| unfortunately this name was used in previous versions to refer to |
| the schema ID rather than the schema itself. Take care to use the |
| 'settings-schema' property if you wish to pass in a |
| <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a>.</p> |
| <div class="warning"> |
| <p><code class="literal">GSettings:schema</code> has been deprecated since version 2.32 and should not be used in newly-written code.</p> |
| <p>Use the 'schema-id' property instead. In a future |
| version, this property may instead refer to a <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a>.</p> |
| </div> |
| <p>Flags: Read / Write / Construct Only</p> |
| <p>Default value: NULL</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GSettings--schema-id"></a><h3>The <code class="literal">“schema-id”</code> property</h3> |
| <pre class="programlisting"> “schema-id” <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</pre> |
| <p>The name of the schema that describes the types of keys |
| for this <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object.</p> |
| <p>Flags: Read / Write / Construct Only</p> |
| <p>Default value: NULL</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GSettings--settings-schema"></a><h3>The <code class="literal">“settings-schema”</code> property</h3> |
| <pre class="programlisting"> “settings-schema” <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a> *</pre> |
| <p>The <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a> describing the types of keys for this |
| <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object.</p> |
| <p>Ideally, this property would be called 'schema'. <a class="link" href="gio-GSettingsSchema-GSettingsSchemaSource.html#GSettingsSchema"><span class="type">GSettingsSchema</span></a> |
| has only existed since version 2.32, however, and before then the |
| 'schema' property was used to refer to the ID of the schema rather |
| than the schema itself. Take care.</p> |
| <p>Flags: Read / Write / Construct Only</p> |
| </div> |
| </div> |
| <div class="refsect1"> |
| <a name="GSettings.signal-details"></a><h2>Signal Details</h2> |
| <div class="refsect2"> |
| <a name="GSettings-change-event"></a><h3>The <code class="literal">“change-event”</code> signal</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| user_function (<a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings, |
| <a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> keys, |
| <a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> n_keys, |
| <a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data)</pre> |
| <p>The "change-event" signal is emitted once per change event that |
| affects this settings object. You should connect to this signal |
| only if you are interested in viewing groups of changes before they |
| are split out into multiple emissions of the "changed" signal. |
| For most use cases it is more appropriate to use the "changed" signal.</p> |
| <p>In the event that the change event applies to one or more specified |
| keys, <em class="parameter"><code>keys</code></em> |
| will be an array of <a href="../glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> of length <em class="parameter"><code>n_keys</code></em> |
| . In the |
| event that the change event applies to the <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object as a |
| whole (ie: potentially every key has been changed) then <em class="parameter"><code>keys</code></em> |
| will |
| be <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> and <em class="parameter"><code>n_keys</code></em> |
| will be 0.</p> |
| <p>The default handler for this signal invokes the "changed" signal |
| for each affected key. If any other connected handler returns |
| <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> then this default functionality will be suppressed.</p> |
| <div class="refsect3"> |
| <a name="GSettings-change-event.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>the object on which the signal was emitted</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>keys</p></td> |
| <td class="parameter_description"><p> an array of <a href="../glib-Quarks.html#GQuark"><span class="type">GQuarks</span></a> for the changed keys, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_keys][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GQuark][<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>n_keys</p></td> |
| <td class="parameter_description"><p>the length of the <em class="parameter"><code>keys</code></em> |
| array, or 0</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p>user data set when the signal handler was connected.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="GSettings-change-event.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to stop other handlers from being invoked for the |
| event. FALSE to propagate the event further.</p> |
| </div> |
| <p>Flags: <a href="../gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GSettings-changed"></a><h3>The <code class="literal">“changed”</code> signal</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| user_function (<a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings, |
| <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key, |
| <a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data)</pre> |
| <p>The "changed" signal is emitted when a key has potentially changed. |
| You should call one of the <a class="link" href="GSettings.html#g-settings-get" title="g_settings_get ()"><code class="function">g_settings_get()</code></a> calls to check the new |
| value.</p> |
| <p>This signal supports detailed connections. You can connect to the |
| detailed signal "changed::x" in order to only receive callbacks |
| when key "x" changes.</p> |
| <p>Note that <em class="parameter"><code>settings</code></em> |
| only emits this signal if you have read <em class="parameter"><code>key</code></em> |
| at |
| least once while a signal handler was already connected for <em class="parameter"><code>key</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="GSettings-changed.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>the object on which the signal was emitted</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 that changed</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p>user data set when the signal handler was connected.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p>Flags: <a href="../gobject-Signals.html#G-SIGNAL-DETAILED:CAPS">Has Details</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GSettings-writable-change-event"></a><h3>The <code class="literal">“writable-change-event”</code> signal</h3> |
| <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| user_function (<a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings, |
| <a href="../glib-Basic-Types.html#guint"><span class="type">guint</span></a> key, |
| <a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data)</pre> |
| <p>The "writable-change-event" signal is emitted once per writability |
| change event that affects this settings object. You should connect |
| to this signal if you are interested in viewing groups of changes |
| before they are split out into multiple emissions of the |
| "writable-changed" signal. For most use cases it is more |
| appropriate to use the "writable-changed" signal.</p> |
| <p>In the event that the writability change applies only to a single |
| key, <em class="parameter"><code>key</code></em> |
| will be set to the <a href="../glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> for that key. In the event |
| that the writability change affects the entire settings object, |
| <em class="parameter"><code>key</code></em> |
| will be 0.</p> |
| <p>The default handler for this signal invokes the "writable-changed" |
| and "changed" signals for each affected key. This is done because |
| changes in writability might also imply changes in value (if for |
| example, a new mandatory setting is introduced). If any other |
| connected handler returns <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> then this default functionality |
| will be suppressed.</p> |
| <div class="refsect3"> |
| <a name="GSettings-writable-change-event.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>the object on which the signal was emitted</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>key</p></td> |
| <td class="parameter_description"><p>the quark of the key, or 0</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p>user data set when the signal handler was connected.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="GSettings-writable-change-event.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to stop other handlers from being invoked for the |
| event. FALSE to propagate the event further.</p> |
| </div> |
| <p>Flags: <a href="../gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GSettings-writable-changed"></a><h3>The <code class="literal">“writable-changed”</code> signal</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| user_function (<a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> *settings, |
| <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key, |
| <a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data)</pre> |
| <p>The "writable-changed" signal is emitted when the writability of a |
| key has potentially changed. You should call |
| <a class="link" href="GSettings.html#g-settings-is-writable" title="g_settings_is_writable ()"><code class="function">g_settings_is_writable()</code></a> in order to determine the new status.</p> |
| <p>This signal supports detailed connections. You can connect to the |
| detailed signal "writable-changed::x" in order to only receive |
| callbacks when the writability of "x" changes.</p> |
| <div class="refsect3"> |
| <a name="GSettings-writable-changed.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>the object on which the signal was emitted</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>key</p></td> |
| <td class="parameter_description"><p>the key</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p>user data set when the signal handler was connected.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p>Flags: <a href="../gobject-Signals.html#G-SIGNAL-DETAILED:CAPS">Has Details</a></p> |
| </div> |
| </div> |
| </div> |
| <div class="footer"> |
| <hr>Generated by GTK-Doc V1.25.1</div> |
| </body> |
| </html> |