gconf

gconf

Functions

gboolean gconf_init ()
void gconf_preinit ()
void gconf_postinit ()
gboolean gconf_is_initialized ()
void (*GConfNotifyFunc) ()
guint gconf_engine_notify_add ()
void gconf_engine_notify_remove ()
GConfValue * gconf_engine_get ()
GConfValue * gconf_engine_get_without_default ()
GConfEntry * gconf_engine_get_entry ()
GConfValue * gconf_engine_get_with_locale ()
GConfValue * gconf_engine_get_default_from_schema ()
gboolean gconf_engine_set ()
gboolean gconf_engine_unset ()
gboolean gconf_engine_associate_schema ()
GSList * gconf_engine_all_entries ()
GSList * gconf_engine_all_dirs ()
void gconf_engine_suggest_sync ()
gboolean gconf_engine_dir_exists ()
void gconf_engine_remove_dir ()
gboolean gconf_engine_key_is_writable ()
gboolean gconf_valid_key ()
gboolean gconf_key_is_below ()
gchar * gconf_concat_dir_and_key ()
gchar * gconf_unique_key ()
char * gconf_escape_key ()
char * gconf_unescape_key ()
gdouble gconf_engine_get_float ()
gint gconf_engine_get_int ()
gchar * gconf_engine_get_string ()
gboolean gconf_engine_get_bool ()
GConfSchema * gconf_engine_get_schema ()
GSList * gconf_engine_get_list ()
gboolean gconf_engine_get_pair ()
gboolean gconf_engine_set_float ()
gboolean gconf_engine_set_int ()
gboolean gconf_engine_set_string ()
gboolean gconf_engine_set_bool ()
gboolean gconf_engine_set_schema ()
gboolean gconf_engine_set_list ()
gboolean gconf_engine_set_pair ()
gboolean gconf_string_to_enum ()
const gchar * gconf_enum_to_string ()
void gconf_clear_cache ()
void gconf_synchronous_sync ()
GConfValue * gconf_engine_get_full ()

Types and Values

Description

Functions

gconf_init ()

gboolean
gconf_init (int argc,
            char **argv,
            GError **err);

gconf_init is deprecated and should not be used in newly-written code.


gconf_preinit ()

void
gconf_preinit (gpointer app,
               gpointer mod_info);

gconf_preinit is deprecated and should not be used in newly-written code.


gconf_postinit ()

void
gconf_postinit (gpointer app,
                gpointer mod_info);

gconf_postinit is deprecated and should not be used in newly-written code.


gconf_is_initialized ()

gboolean
gconf_is_initialized (void);

gconf_is_initialized is deprecated and should not be used in newly-written code.


GConfNotifyFunc ()

void
(*GConfNotifyFunc) (GConfEngine *conf,
                    guint cnxn_id,
                    GConfEntry *entry,
                    gpointer user_data);

gconf_engine_notify_add ()

guint
gconf_engine_notify_add (GConfEngine *conf,
                         const gchar *namespace_section,
                         GConfNotifyFunc func,
                         gpointer user_data,
                         GError **err);

[skip]

Parameters

conf

a GConfEngine to monitor for changes.

 

namespace_section

the directory or key to watch; you will be notified of changes at or below this point.

 

func

the callback to invoke when a notification is received from the server.

 

user_data

the data to pass to the callback.

 

err

the return location for an allocated GError, or NULL to ignore errors.

 

Returns

an ID for the notification request, or 0 on error.

Registers a notification request with the gconfd server. The server will notify the client when any key at or below namespace_section is set or unset. Try to watch the smallest possible part of the namespace; otherwise you will slow down the server and your application with unnecessary notifications. Note that you should prefer gconf_client_notify_add() if you're using the GObject wrapper library, because gconf_client_notify_add() does not require a client-server conversation for every callback. gconf_engine_notify_add() requests a different server notification for every callback. The function returns an ID you can use to remove the notification request; 0 is an invalid ID, and is returned if an error occurs.

Returns value: an ID for the notification request, or 0 on error.


gconf_engine_notify_remove ()

void
gconf_engine_notify_remove (GConfEngine *conf,
                            guint cnxn);

gconf_engine_get ()

GConfValue *
gconf_engine_get (GConfEngine *conf,
                  const gchar *key,
                  GError **err);

gconf_engine_get_without_default ()

GConfValue *
gconf_engine_get_without_default (GConfEngine *conf,
                                  const gchar *key,
                                  GError **err);

gconf_engine_get_entry ()

GConfEntry *
gconf_engine_get_entry (GConfEngine *conf,
                        const gchar *key,
                        const gchar *locale,
                        gboolean use_schema_default,
                        GError **err);

gconf_engine_get_with_locale ()

GConfValue *
gconf_engine_get_with_locale (GConfEngine *conf,
                              const gchar *key,
                              const gchar *locale,
                              GError **err);

gconf_engine_get_default_from_schema ()

GConfValue *
gconf_engine_get_default_from_schema (GConfEngine *conf,
                                      const gchar *key,
                                      GError **err);

gconf_engine_set ()

gboolean
gconf_engine_set (GConfEngine *conf,
                  const gchar *key,
                  const GConfValue *value,
                  GError **err);

gconf_engine_unset ()

gboolean
gconf_engine_unset (GConfEngine *conf,
                    const gchar *key,
                    GError **err);

gconf_engine_associate_schema ()

gboolean
gconf_engine_associate_schema (GConfEngine *conf,
                               const gchar *key,
                               const gchar *schema_key,
                               GError **err);

gconf_engine_all_entries ()

GSList *
gconf_engine_all_entries (GConfEngine *conf,
                          const gchar *dir,
                          GError **err);

Lists the key-value pairs in dir . Does not list subdirectories; for that use gconf_engine_all_dirs(). The returned list contains GConfEntry objects. A GConfEntry contains an absolute key and a value. The list is not recursive, it contains only the immediate children of dir . To free the returned list, gconf_entry_free() each list element, then g_slist_free() the list itself.

Returns value: (element-type GConfEntry) (transfer full): List of GConfEntry.

Parameters

conf

a GConfEngine.

 

dir

Directory to list.

 

err

the return location for an allocated GError, or NULL to ignore errors.

 

gconf_engine_all_dirs ()

GSList *
gconf_engine_all_dirs (GConfEngine *conf,
                       const gchar *dir,
                       GError **err);

Lists the subdirectories in dir . The returned list contains allocated strings. Each string is the absolute path of a subdirectory. You should g_free() each string in the list, then g_slist_free() the list itself.

Returns value: (element-type utf8) (transfer full): List of allocated subdirectory names.

Parameters

conf

a GConfEngine.

 

dir

Directory to get subdirectories from.

 

err

the return location for an allocated GError, or NULL to ignore errors.

 

gconf_engine_suggest_sync ()

void
gconf_engine_suggest_sync (GConfEngine *conf,
                           GError **err);

gconf_engine_dir_exists ()

gboolean
gconf_engine_dir_exists (GConfEngine *conf,
                         const gchar *dir,
                         GError **err);

gconf_engine_remove_dir ()

void
gconf_engine_remove_dir (GConfEngine *conf,
                         const gchar *dir,
                         GError **err);

gconf_engine_key_is_writable ()

gboolean
gconf_engine_key_is_writable (GConfEngine *conf,
                              const gchar *key,
                              GError **err);

gconf_valid_key ()

gboolean
gconf_valid_key (const gchar *key,
                 gchar **why_invalid);

gconf_key_is_below ()

gboolean
gconf_key_is_below (const gchar *above,
                    const gchar *below);

gconf_concat_dir_and_key ()

gchar *
gconf_concat_dir_and_key (const gchar *dir,
                          const gchar *key);

gconf_unique_key ()

gchar *
gconf_unique_key (void);

gconf_escape_key ()

char *
gconf_escape_key (const char *arbitrary_text,
                  int len);

Escape arbitrary_text such that it's a valid key element (i.e. one part of the key path). The escaped key won't pass gconf_valid_key() because it isn't a whole key (i.e. it doesn't have a preceding slash), but prepending a slash to the escaped text should always result in a valid key.

Parameters

arbitrary_text

some text in any encoding or format

 

len

length of arbitrary_text in bytes, or -1 if arbitrary_text is nul-terminated

 

Returns

a nul-terminated valid GConf key


gconf_unescape_key ()

char *
gconf_unescape_key (const char *escaped_key,
                    int len);

Converts a string escaped with gconf_escape_key() back into its original form.

Parameters

escaped_key

a key created with gconf_escape_key()

 

len

length of escaped_key in bytes, or -1 if escaped_key is nul-terminated

 

Returns

the original string that was escaped to create escaped_key


gconf_engine_get_float ()

gdouble
gconf_engine_get_float (GConfEngine *conf,
                        const gchar *key,
                        GError **err);

gconf_engine_get_int ()

gint
gconf_engine_get_int (GConfEngine *conf,
                      const gchar *key,
                      GError **err);

gconf_engine_get_string ()

gchar *
gconf_engine_get_string (GConfEngine *conf,
                         const gchar *key,
                         GError **err);

gconf_engine_get_bool ()

gboolean
gconf_engine_get_bool (GConfEngine *conf,
                       const gchar *key,
                       GError **err);

gconf_engine_get_schema ()

GConfSchema *
gconf_engine_get_schema (GConfEngine *conf,
                         const gchar *key,
                         GError **err);

Requests the schema (GCONF_VALUE_SCHEMA) stored at key . Automatically performs type-checking, so if a non-schema is stored at key , an error is returned. If no value is set or an error occurs,

NULL is returned.

[skip]

Parameters

conf

a GConfEngine.

 

key

key you want the value of.

 

err

the return location for an allocated GError, or NULL to ignore errors.

 

Returns

the value of key as an allocated GConfSchema, or NULL if no value was obtained.

[transfer full]


gconf_engine_get_list ()

GSList *
gconf_engine_get_list (GConfEngine *conf,
                       const gchar *key,
                       GConfValueType list_type,
                       GError **err);

Requests the list (GCONF_VALUE_LIST) stored at key . Automatically performs type-checking, so if a non-list is stored at key , or the list does not contain elements of type list_type , an error is returned. If no value is set or an error occurs, NULL is returned. Note that NULL is also the empty list, so if you need to distinguish the empty list from an unset value, you must use gconf_engine_get() to obtain a raw GConfValue.

Remember that GConf lists can only store primitive types: GCONF_VALUE_FLOAT, GCONF_VALUE_INT, GCONF_VALUE_BOOL, GCONF_VALUE_STRING, GCONF_VALUE_SCHEMA. Also remember that lists must be uniform, you may not mix types in the same list.

The type of the list elements depends on list_type . A GConfValue with type GCONF_VALUE_LIST normally stores a list of more GConfValue objects. gconf_engine_get_list() automatically converts to primitive C types. Thus, the list->data fields in the returned list contain:

GCONF_VALUE_INT The integer itself, converted with GINT_TO_POINTER()
GCONF_VALUE_BOOL The bool itself, converted with GINT_TO_POINTER()
GCONF_VALUE_FLOAT A pointer to gdouble, which should be freed with g_free()
GCONF_VALUE_STRING A pointer to gchar, which should be freed with g_free()
GCONF_VALUE_SCHEMA A pointer to GConfSchema, which should be freed with gconf_schema_free()

In the GCONF_VALUE_FLOAT and GCONF_VALUE_STRING cases, you must g_free() each list element. In the GCONF_VALUE_SCHEMA case you must gconf_schema_free() each element. In all cases you must free the list itself with g_slist_free().

[skip]

Parameters

conf

a GConfEngine.

 

key

key you want the value of.

 

list_type

type of each list element.

 

err

the return location for an allocated GError, or NULL to ignore errors.

 

Returns

an allocated list, with elements as described above.


gconf_engine_get_pair ()

gboolean
gconf_engine_get_pair (GConfEngine *conf,
                       const gchar *key,
                       GConfValueType car_type,
                       GConfValueType cdr_type,
                       gpointer car_retloc,
                       gpointer cdr_retloc,
                       GError **err);

gconf_engine_set_float ()

gboolean
gconf_engine_set_float (GConfEngine *conf,
                        const gchar *key,
                        gdouble val,
                        GError **err);

gconf_engine_set_int ()

gboolean
gconf_engine_set_int (GConfEngine *conf,
                      const gchar *key,
                      gint val,
                      GError **err);

gconf_engine_set_string ()

gboolean
gconf_engine_set_string (GConfEngine *conf,
                         const gchar *key,
                         const gchar *val,
                         GError **err);

gconf_engine_set_bool ()

gboolean
gconf_engine_set_bool (GConfEngine *conf,
                       const gchar *key,
                       gboolean val,
                       GError **err);

gconf_engine_set_schema ()

gboolean
gconf_engine_set_schema (GConfEngine *conf,
                         const gchar *key,
                         const GConfSchema *val,
                         GError **err);

gconf_engine_set_list ()

gboolean
gconf_engine_set_list (GConfEngine *conf,
                       const gchar *key,
                       GConfValueType list_type,
                       GSList *list,
                       GError **err);

gconf_engine_set_pair ()

gboolean
gconf_engine_set_pair (GConfEngine *conf,
                       const gchar *key,
                       GConfValueType car_type,
                       GConfValueType cdr_type,
                       gconstpointer address_of_car,
                       gconstpointer address_of_cdr,
                       GError **err);

gconf_string_to_enum ()

gboolean
gconf_string_to_enum (GConfEnumStringPair lookup_table[],
                      const gchar *str,
                      gint *enum_value_retloc);

gconf_enum_to_string ()

const gchar *
gconf_enum_to_string (GConfEnumStringPair lookup_table[],
                      gint enum_value);

gconf_clear_cache ()

void
gconf_clear_cache (GConfEngine *conf,
                   GError **err);

gconf_clear_cache is deprecated and should not be used in newly-written code.


gconf_synchronous_sync ()

void
gconf_synchronous_sync (GConfEngine *conf,
                        GError **err);

gconf_engine_get_full ()

GConfValue *
gconf_engine_get_full (GConfEngine *conf,
                       const gchar *key,
                       const gchar *locale,
                       gboolean use_schema_default,
                       gboolean *is_default_p,
                       gboolean *is_writable_p,
                       GError **err);

Types and Values

struct GConfEnumStringPair

struct GConfEnumStringPair {
  gint enum_value;
  const gchar* str;
};