diff options
author | Ryan Lortie <desrt@desrt.ca> | 2010-05-21 12:18:10 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2010-05-21 12:18:43 -0400 |
commit | 86bff9e98374d13d74dd59316f8bc8575a7671e1 (patch) | |
tree | 0d9075c7fb1cd479bfbce7ce0fb93184d058fa23 /client/dconf-client.h | |
parent | 128e53d2b39698efbf13f65c08ef27ef31403593 (diff) | |
download | dconf-86bff9e98374d13d74dd59316f8bc8575a7671e1.tar.gz |
factor-out common client-side code
Preparing for creating standalone client-side library.
Diffstat (limited to 'client/dconf-client.h')
-rw-r--r-- | client/dconf-client.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/client/dconf-client.h b/client/dconf-client.h new file mode 100644 index 0000000..b6ae36a --- /dev/null +++ b/client/dconf-client.h @@ -0,0 +1,74 @@ +#ifndef _dconf_client_h_ +#define _dconf_client_h_ + +#include <glib.h> + +typedef struct _DConfClient DConfClient; +typedef struct _DConfClientResetList DConfClientResetList; + +typedef enum +{ + DCONF_CLIENT_READ_NORMAL, + DCONF_CLIENT_READ_SET, + DCONF_CLIENT_READ_RESET +} DConfClientReadType; + +typedef struct +{ + gint bus_type; + const gchar *destination; + const gchar *object_path; + const gchar *interface; + const gchar *method; + GVariant *body; +} DConfClientMessage; + + + +typedef GVariant * (*DConfClientServiceFunc) (DConfClient *client, + DConfClientMessage *message); + +DConfClient * dconf_client_new (DConfClientServiceFunc service_func); +void dconf_client_unref (DConfClient *client); +DConfClient * dconf_client_ref (DConfClient *client); + +GVariant * dconf_client_read (DConfClient *client, + const gchar *key, + const GVariantType *required_type, + DConfClientReadType type); +gchar ** dconf_client_list (DConfClient *client, + const gchar *path, + DConfClientResetList *resets); + +void dconf_client_get_service_info (DConfClient *client, + const gchar **bus_type, + const gchar **destination, + const gchar **object_path); +gboolean dconf_client_is_writable (DConfClient *client, + DConfClientMessage *message, + const gchar *name); +gboolean dconf_client_write (DConfClient *client, + DConfClientMessage *message, + const gchar *key, + GVariant *value); +gboolean dconf_client_write_tree (DConfClient *client, + DConfClientMessage *message, + GTree *tree); +void dconf_client_watch (DConfClient *client, + DConfClientMessage *message, + const gchar *name); +void dconf_client_unwatch (DConfClient *client, + DConfClientMessage *message, + const gchar *name); +void dconf_client_decode_notify (DConfClient *client, + const gchar **prefix, + const gchar ***keys, + GVariant *body); + +void dconf_client_reset_list_init (DConfClientResetList *resets, + const gchar * const *list); +void dconf_client_reset_list_add (DConfClientResetList *resets, + const gchar *item); +void dconf_client_reset_list_clear (DConfClientResetList *resets); + +#endif /* _dconf_client_h_ */ |