Top | ![]() |
![]() |
![]() |
![]() |
void (*GConfClientNotifyFunc) (GConfClient *client
,guint cnxn_id
,GConfEntry *entry
,gpointer user_data
);
void (*GConfClientErrorHandlerFunc) (GConfClient *client
,GError *error
);
#define GCONF_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCONF_TYPE_CLIENT, GConfClient))
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.
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.
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
);
client |
|
|
func |
. |
[scope notified][closure user_data][destroy destroy_notify] |
void gconf_client_set_error_handling (GConfClient *client
,GConfClientErrorHandlingMode mode
);
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.
[skip]
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
);
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.
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.
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
);
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.
[skip]
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_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
);
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
,...
);