GConfClient

GConfClient

Synopsis

enum                GConfClientPreloadType;
enum                GConfClientErrorHandlingMode;
void                (*GConfClientNotifyFunc)            (GConfClient *client,
                                                         guint cnxn_id,
                                                         GConfEntry *entry,
                                                         gpointer user_data);
void                (*GConfClientErrorHandlerFunc)      (GConfClient *client,
                                                         GError *error);
#define             GCONF_CLIENT                        (obj)
GConfClient *       gconf_client_get_default            (void);
GConfClient *       gconf_client_get_for_engine         (GConfEngine *engine);
void                gconf_client_add_dir                (GConfClient *client,
                                                         const gchar *dir,
                                                         GConfClientPreloadType preload,
                                                         GError **err);
void                gconf_client_remove_dir             (GConfClient *client,
                                                         const gchar *dir,
                                                         GError **err);
guint               gconf_client_notify_add             (GConfClient *client,
                                                         const gchar *namespace_section,
                                                         GConfClientNotifyFunc func,
                                                         gpointer user_data,
                                                         GFreeFunc destroy_notify,
                                                         GError **err);
void                gconf_client_notify_remove          (GConfClient *client,
                                                         guint cnxn);
void                gconf_client_notify                 (GConfClient *client,
                                                         const char *key);
void                gconf_client_set_error_handling     (GConfClient *client,
                                                         GConfClientErrorHandlingMode mode);
void                gconf_client_set_global_default_error_handler
                                                        (GConfClientErrorHandlerFunc func);
void                gconf_client_clear_cache            (GConfClient *client);
void                gconf_client_preload                (GConfClient *client,
                                                         const gchar *dirname,
                                                         GConfClientPreloadType type,
                                                         GError **err);
void                gconf_client_set                    (GConfClient *client,
                                                         const gchar *key,
                                                         const GConfValue *val,
                                                         GError **err);
GConfValue *        gconf_client_get                    (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);
GConfValue *        gconf_client_get_without_default    (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);
GConfEntry *        gconf_client_get_entry              (GConfClient *client,
                                                         const gchar *key,
                                                         const gchar *locale,
                                                         gboolean use_schema_default,
                                                         GError **err);
GConfValue *        gconf_client_get_default_from_schema
                                                        (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);
gboolean            gconf_client_unset                  (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);
gboolean            gconf_client_recursive_unset        (GConfClient *client,
                                                         const char *key,
                                                         GConfUnsetFlags flags,
                                                         GError **err);
GSList *            gconf_client_all_entries            (GConfClient *client,
                                                         const gchar *dir,
                                                         GError **err);
GSList *            gconf_client_all_dirs               (GConfClient *client,
                                                         const gchar *dir,
                                                         GError **err);
void                gconf_client_suggest_sync           (GConfClient *client,
                                                         GError **err);
gboolean            gconf_client_dir_exists             (GConfClient *client,
                                                         const gchar *dir,
                                                         GError **err);
gboolean            gconf_client_key_is_writable        (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);
gdouble             gconf_client_get_float              (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);
gint                gconf_client_get_int                (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);
gchar *             gconf_client_get_string             (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);
gboolean            gconf_client_get_bool               (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);
GConfSchema *       gconf_client_get_schema             (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);
GSList *            gconf_client_get_list               (GConfClient *client,
                                                         const gchar *key,
                                                         GConfValueType list_type,
                                                         GError **err);
gboolean            gconf_client_get_pair               (GConfClient *client,
                                                         const gchar *key,
                                                         GConfValueType car_type,
                                                         GConfValueType cdr_type,
                                                         gpointer car_retloc,
                                                         gpointer cdr_retloc,
                                                         GError **err);
gboolean            gconf_client_set_float              (GConfClient *client,
                                                         const gchar *key,
                                                         gdouble val,
                                                         GError **err);
gboolean            gconf_client_set_int                (GConfClient *client,
                                                         const gchar *key,
                                                         gint val,
                                                         GError **err);
gboolean            gconf_client_set_string             (GConfClient *client,
                                                         const gchar *key,
                                                         const gchar *val,
                                                         GError **err);
gboolean            gconf_client_set_bool               (GConfClient *client,
                                                         const gchar *key,
                                                         gboolean val,
                                                         GError **err);
gboolean            gconf_client_set_schema             (GConfClient *client,
                                                         const gchar *key,
                                                         const GConfSchema *val,
                                                         GError **err);
gboolean            gconf_client_set_list               (GConfClient *client,
                                                         const gchar *key,
                                                         GConfValueType list_type,
                                                         GSList *list,
                                                         GError **err);
gboolean            gconf_client_set_pair               (GConfClient *client,
                                                         const gchar *key,
                                                         GConfValueType car_type,
                                                         GConfValueType cdr_type,
                                                         gconstpointer address_of_car,
                                                         gconstpointer address_of_cdr,
                                                         GError **err);
void                gconf_client_error                  (GConfClient *client,
                                                         GError *error);
void                gconf_client_unreturned_error       (GConfClient *client,
                                                         GError *error);
void                gconf_client_value_changed          (GConfClient *client,
                                                         const gchar *key,
                                                         GConfValue *value);
gboolean            gconf_client_commit_change_set      (GConfClient *client,
                                                         GConfChangeSet *cs,
                                                         gboolean remove_committed,
                                                         GError **err);
GConfChangeSet *    gconf_client_reverse_change_set     (GConfClient *client,
                                                         GConfChangeSet *cs,
                                                         GError **err);
GConfChangeSet *    gconf_client_change_set_from_currentv
                                                        (GConfClient *client,
                                                         const gchar **keys,
                                                         GError **err);
GConfChangeSet *    gconf_client_change_set_from_current
                                                        (GConfClient *client,
                                                         GError **err,
                                                         const gchar *first_key,
                                                         ...);

Description

Details

enum GConfClientPreloadType

typedef enum {
 /*< prefix=GCONF_CLIENT >*/
  GCONF_CLIENT_PRELOAD_NONE,     /* don't preload anything */
  GCONF_CLIENT_PRELOAD_ONELEVEL, /* load entries directly under the directory. */
  GCONF_CLIENT_PRELOAD_RECURSIVE /* recurse the directory tree; possibly quite expensive! */
} GConfClientPreloadType;


enum GConfClientErrorHandlingMode

typedef enum {
 /*< prefix=GCONF_CLIENT >*/
  GCONF_CLIENT_HANDLE_NONE,
  GCONF_CLIENT_HANDLE_UNRETURNED,
  GCONF_CLIENT_HANDLE_ALL
} GConfClientErrorHandlingMode;


GConfClientNotifyFunc ()

void                (*GConfClientNotifyFunc)            (GConfClient *client,
                                                         guint cnxn_id,
                                                         GConfEntry *entry,
                                                         gpointer user_data);


GConfClientErrorHandlerFunc ()

void                (*GConfClientErrorHandlerFunc)      (GConfClient *client,
                                                         GError *error);


GCONF_CLIENT()

#define GCONF_CLIENT(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCONF_TYPE_CLIENT, GConfClient))


gconf_client_get_default ()

GConfClient *       gconf_client_get_default            (void);

Creates a new GConfClient using the default GConfEngine. Normally this is the engine you want. If someone else is already using the default GConfClient, this function returns the same one they're using, but with the reference count incremented. So you have to unref either way.

It's important to call g_type_init() before using this GObject, to initialize the type system.

Returns :

a new GConfClient. g_object_unref() when you're done. [transfer full]

gconf_client_get_for_engine ()

GConfClient *       gconf_client_get_for_engine         (GConfEngine *engine);

Creates a new GConfClient with a specific GConfEngine. Only specialized configuration-related programs should need to call this function. The returned GConfClient should be unref'd when you're done with g_object_unref(). Remember to avoid using the GConfEngine directly once you have a GConfClient wrapper.

engine :

the GConfEngine to use.

Returns :

a new GConfClient. [transfer full]

gconf_client_add_dir ()

void                gconf_client_add_dir                (GConfClient *client,
                                                         const gchar *dir,
                                                         GConfClientPreloadType preload,
                                                         GError **err);


gconf_client_remove_dir ()

void                gconf_client_remove_dir             (GConfClient *client,
                                                         const gchar *dir,
                                                         GError **err);


gconf_client_notify_add ()

guint               gconf_client_notify_add             (GConfClient *client,
                                                         const gchar *namespace_section,
                                                         GConfClientNotifyFunc func,
                                                         gpointer user_data,
                                                         GFreeFunc destroy_notify,
                                                         GError **err);

client :

namespace_section

func :

. [scope notified][closure user_data][destroy destroy_notify]

gconf_client_notify_remove ()

void                gconf_client_notify_remove          (GConfClient *client,
                                                         guint cnxn);


gconf_client_notify ()

void                gconf_client_notify                 (GConfClient *client,
                                                         const char *key);


gconf_client_set_error_handling ()

void                gconf_client_set_error_handling     (GConfClient *client,
                                                         GConfClientErrorHandlingMode mode);


gconf_client_set_global_default_error_handler ()

void                gconf_client_set_global_default_error_handler
                                                        (GConfClientErrorHandlerFunc func);

Set func as the default error handler for the GConfClient. This handler would be called for all GConfClient internal errors.

func :

pointer to the function to be called for error handling.

gconf_client_clear_cache ()

void                gconf_client_clear_cache            (GConfClient *client);


gconf_client_preload ()

void                gconf_client_preload                (GConfClient *client,
                                                         const gchar *dirname,
                                                         GConfClientPreloadType type,
                                                         GError **err);


gconf_client_set ()

void                gconf_client_set                    (GConfClient *client,
                                                         const gchar *key,
                                                         const GConfValue *val,
                                                         GError **err);


gconf_client_get ()

GConfValue *        gconf_client_get                    (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);


gconf_client_get_without_default ()

GConfValue *        gconf_client_get_without_default    (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);


gconf_client_get_entry ()

GConfEntry *        gconf_client_get_entry              (GConfClient *client,
                                                         const gchar *key,
                                                         const gchar *locale,
                                                         gboolean use_schema_default,
                                                         GError **err);


gconf_client_get_default_from_schema ()

GConfValue *        gconf_client_get_default_from_schema
                                                        (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);


gconf_client_unset ()

gboolean            gconf_client_unset                  (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);


gconf_client_recursive_unset ()

gboolean            gconf_client_recursive_unset        (GConfClient *client,
                                                         const char *key,
                                                         GConfUnsetFlags flags,
                                                         GError **err);


gconf_client_all_entries ()

GSList *            gconf_client_all_entries            (GConfClient *client,
                                                         const gchar *dir,
                                                         GError **err);

Lists the key-value pairs in dir. Does not list subdirectories; for that use gconf_client_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. Just like gconf_engine_all_entries(), but uses GConfClient caching and error-handling features.

client :

a GConfClient.

dir :

directory to list.

err :

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

Returns :

List of GConfEntry. [element-type GConfEntry][transfer full]

gconf_client_all_dirs ()

GSList *            gconf_client_all_dirs               (GConfClient *client,
                                                         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. Just like gconf_engine_all_dirs(), but uses GConfClient caching and error-handling features.

client :

a GConfClient.

dir :

directory to get subdirectories from.

err :

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

Returns :

List of allocated subdirectory names. [element-type utf8][transfer full]

gconf_client_suggest_sync ()

void                gconf_client_suggest_sync           (GConfClient *client,
                                                         GError **err);


gconf_client_dir_exists ()

gboolean            gconf_client_dir_exists             (GConfClient *client,
                                                         const gchar *dir,
                                                         GError **err);


gconf_client_key_is_writable ()

gboolean            gconf_client_key_is_writable        (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);


gconf_client_get_float ()

gdouble             gconf_client_get_float              (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);


gconf_client_get_int ()

gint                gconf_client_get_int                (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);


gconf_client_get_string ()

gchar *             gconf_client_get_string             (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);


gconf_client_get_bool ()

gboolean            gconf_client_get_bool               (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);


gconf_client_get_schema ()

GConfSchema *       gconf_client_get_schema             (GConfClient *client,
                                                         const gchar *key,
                                                         GError **err);


gconf_client_get_list ()

GSList *            gconf_client_get_list               (GConfClient *client,
                                                         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_client_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_client_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().

Just like gconf_engine_get_list(), but uses GConfClient caching and error-handling features.

client :

a GConfClient.

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_client_get_pair ()

gboolean            gconf_client_get_pair               (GConfClient *client,
                                                         const gchar *key,
                                                         GConfValueType car_type,
                                                         GConfValueType cdr_type,
                                                         gpointer car_retloc,
                                                         gpointer cdr_retloc,
                                                         GError **err);


gconf_client_set_float ()

gboolean            gconf_client_set_float              (GConfClient *client,
                                                         const gchar *key,
                                                         gdouble val,
                                                         GError **err);


gconf_client_set_int ()

gboolean            gconf_client_set_int                (GConfClient *client,
                                                         const gchar *key,
                                                         gint val,
                                                         GError **err);


gconf_client_set_string ()

gboolean            gconf_client_set_string             (GConfClient *client,
                                                         const gchar *key,
                                                         const gchar *val,
                                                         GError **err);


gconf_client_set_bool ()

gboolean            gconf_client_set_bool               (GConfClient *client,
                                                         const gchar *key,
                                                         gboolean val,
                                                         GError **err);


gconf_client_set_schema ()

gboolean            gconf_client_set_schema             (GConfClient *client,
                                                         const gchar *key,
                                                         const GConfSchema *val,
                                                         GError **err);


gconf_client_set_list ()

gboolean            gconf_client_set_list               (GConfClient *client,
                                                         const gchar *key,
                                                         GConfValueType list_type,
                                                         GSList *list,
                                                         GError **err);


gconf_client_set_pair ()

gboolean            gconf_client_set_pair               (GConfClient *client,
                                                         const gchar *key,
                                                         GConfValueType car_type,
                                                         GConfValueType cdr_type,
                                                         gconstpointer address_of_car,
                                                         gconstpointer address_of_cdr,
                                                         GError **err);


gconf_client_error ()

void                gconf_client_error                  (GConfClient *client,
                                                         GError *error);


gconf_client_unreturned_error ()

void                gconf_client_unreturned_error       (GConfClient *client,
                                                         GError *error);


gconf_client_value_changed ()

void                gconf_client_value_changed          (GConfClient *client,
                                                         const gchar *key,
                                                         GConfValue *value);


gconf_client_commit_change_set ()

gboolean            gconf_client_commit_change_set      (GConfClient *client,
                                                         GConfChangeSet *cs,
                                                         gboolean remove_committed,
                                                         GError **err);


gconf_client_reverse_change_set ()

GConfChangeSet *    gconf_client_reverse_change_set     (GConfClient *client,
                                                         GConfChangeSet *cs,
                                                         GError **err);


gconf_client_change_set_from_currentv ()

GConfChangeSet *    gconf_client_change_set_from_currentv
                                                        (GConfClient *client,
                                                         const gchar **keys,
                                                         GError **err);


gconf_client_change_set_from_current ()

GConfChangeSet *    gconf_client_change_set_from_current
                                                        (GConfClient *client,
                                                         GError **err,
                                                         const gchar *first_key,
                                                         ...);