summaryrefslogtreecommitdiff
path: root/xfconfd
diff options
context:
space:
mode:
authorBrian Tarricone <brian@tarricone.org>2007-09-05 05:38:32 +0000
committerBrian Tarricone <brian@tarricone.org>2007-09-05 05:38:32 +0000
commit4bd7ed768781c376199a11dbb674c4cedce640e4 (patch)
tree41e5edae7989293166d5983aef977476b6873674 /xfconfd
parent581c5b3e640a96f0eb88f36c01ca4cbb08fe7081 (diff)
downloadxfconf-4bd7ed768781c376199a11dbb674c4cedce640e4.tar.gz
* change xfconf_channel_get_*() API to return the values directly
and take a 'default_value' param for when a property doesn't exist * add API to DBus interface: GetAll, Exists, Remove * add XfconfChannel API: xfconf_channel_get_all(), xfconf_channel_property_exists(), xfconf_channel_remove_property() (Old svn revision: 26713)
Diffstat (limited to 'xfconfd')
-rw-r--r--xfconfd/xfconf-backend-perchannel-xml.c44
-rw-r--r--xfconfd/xfconf-backend.c43
-rw-r--r--xfconfd/xfconf-backend.h34
-rw-r--r--xfconfd/xfconf-daemon.c41
4 files changed, 161 insertions, 1 deletions
diff --git a/xfconfd/xfconf-backend-perchannel-xml.c b/xfconfd/xfconf-backend-perchannel-xml.c
index 96d0240..43787e3 100644
--- a/xfconfd/xfconf-backend-perchannel-xml.c
+++ b/xfconfd/xfconf-backend-perchannel-xml.c
@@ -57,6 +57,19 @@ static gboolean xfconf_backend_perchannel_xml_get(XfconfBackend *backend,
const gchar *property,
GValue *value,
GError **error);
+static gboolean xfconf_backend_perchannel_xml_get_all(XfconfBackend *backend,
+ const gchar *channel,
+ GHashTable **properties,
+ GError **error);
+static gboolean xfconf_backend_perchannel_xml_exists(XfconfBackend *backend,
+ const gchar *channel,
+ const gchar *property,
+ gboolean *exists,
+ GError **error);
+static gboolean xfconf_backend_perchannel_xml_remove(XfconfBackend *backend,
+ const gchar *channel,
+ const gchar *property,
+ GError **error);
static gboolean xfconf_backend_perchannel_xml_flush(XfconfBackend *backend,
GError **error);
@@ -92,6 +105,9 @@ xfconf_backend_perchannel_xml_backend_init(XfconfBackendInterface *iface)
iface->initialize = xfconf_backend_perchannel_xml_initialize;
iface->set = xfconf_backend_perchannel_xml_set;
iface->get = xfconf_backend_perchannel_xml_get;
+ iface->get_all = xfconf_backend_perchannel_xml_get_all;
+ iface->exists = xfconf_backend_perchannel_xml_exists;
+ iface->remove = xfconf_backend_perchannel_xml_remove;
iface->flush = xfconf_backend_perchannel_xml_flush;
}
@@ -139,6 +155,34 @@ xfconf_backend_perchannel_xml_get(XfconfBackend *backend,
}
static gboolean
+xfconf_backend_perchannel_xml_get_all(XfconfBackend *backend,
+ const gchar *channel,
+ GHashTable **properties,
+ GError **error)
+{
+ return FALSE;
+}
+
+static gboolean
+xfconf_backend_perchannel_xml_exists(XfconfBackend *backend,
+ const gchar *channel,
+ const gchar *property,
+ gboolean *exists,
+ GError **error)
+{
+ return FALSE;
+}
+
+static gboolean
+xfconf_backend_perchannel_xml_remove(XfconfBackend *backend,
+ const gchar *channel,
+ const gchar *property,
+ GError **error)
+{
+ return FALSE;
+}
+
+static gboolean
xfconf_backend_perchannel_xml_flush(XfconfBackend *backend,
GError **error)
{
diff --git a/xfconfd/xfconf-backend.c b/xfconfd/xfconf-backend.c
index 4b67aaf..03402a2 100644
--- a/xfconfd/xfconf-backend.c
+++ b/xfconfd/xfconf-backend.c
@@ -103,6 +103,49 @@ xfconf_backend_get(XfconfBackend *backend,
}
gboolean
+xfconf_backend_get_all(XfconfBackend *backend,
+ const gchar *channel,
+ GHashTable **properties,
+ GError **error)
+{
+ XfconfBackendInterface *iface = XFCONF_BACKEND_GET_INTERFACE(backend);
+
+ g_return_val_if_fail(iface && iface->get_all && channel && properties
+ && (!error || *error), FALSE);
+
+ return iface->get_all(backend, channel, properties, error);
+}
+
+gboolean
+xfconf_backend_exists(XfconfBackend *backend,
+ const gchar *channel,
+ const gchar *property,
+ gboolean *exists,
+ GError **error)
+{
+ XfconfBackendInterface *iface = XFCONF_BACKEND_GET_INTERFACE(backend);
+
+ g_return_val_if_fail(iface && iface->exists && channel && property && exists
+ && (!error || *error), FALSE);
+
+ return iface->exists(backend, channel, property, exists, error);
+}
+
+gboolean
+xfconf_backend_remove(XfconfBackend *backend,
+ const gchar *channel,
+ const gchar *property,
+ GError **error)
+{
+ XfconfBackendInterface *iface = XFCONF_BACKEND_GET_INTERFACE(backend);
+
+ g_return_val_if_fail(iface && iface->remove && channel && property
+ && (!error || *error), FALSE);
+
+ return iface->remove(backend, channel, property, error);
+}
+
+gboolean
xfconf_backend_flush(XfconfBackend *backend,
GError **error)
{
diff --git a/xfconfd/xfconf-backend.h b/xfconfd/xfconf-backend.h
index 112a552..3d7be58 100644
--- a/xfconfd/xfconf-backend.h
+++ b/xfconfd/xfconf-backend.h
@@ -53,6 +53,22 @@ struct _XfconfBackendInterface
GValue *value,
GError **error);
+ gboolean (*get_all)(XfconfBackend *backend,
+ const gchar *channel,
+ GHashTable **properties,
+ GError **error);
+
+ gboolean (*exists)(XfconfBackend *backend,
+ const gchar *channel,
+ const gchar *property,
+ gboolean *exists,
+ GError **error);
+
+ gboolean (*remove)(XfconfBackend *backend,
+ const gchar *channel,
+ const gchar *property,
+ GError **error);
+
gboolean (*flush)(XfconfBackend *backend,
GError **error);
@@ -74,13 +90,29 @@ gboolean xfconf_backend_set(XfconfBackend *backend,
const gchar *property,
const GValue *value,
GError **error);
-
+
gboolean xfconf_backend_get(XfconfBackend *backend,
const gchar *channel,
const gchar *property,
GValue *value,
GError **error);
+gboolean xfconf_backend_get_all(XfconfBackend *backend,
+ const gchar *channel,
+ GHashTable **properties,
+ GError **error);
+
+gboolean xfconf_backend_exists(XfconfBackend *backend,
+ const gchar *channel,
+ const gchar *property,
+ gboolean *exists,
+ GError **error);
+
+gboolean xfconf_backend_remove(XfconfBackend *backend,
+ const gchar *channel,
+ const gchar *property,
+ GError **error);
+
gboolean xfconf_backend_flush(XfconfBackend *backend,
GError **error);
diff --git a/xfconfd/xfconf-daemon.c b/xfconfd/xfconf-daemon.c
index 6f9a926..061211e 100644
--- a/xfconfd/xfconf-daemon.c
+++ b/xfconfd/xfconf-daemon.c
@@ -40,6 +40,19 @@ static gboolean xfconfd_get(XfconfDaemon *xfconfd,
const gchar *property,
GValue *value,
GError **error);
+static gboolean xfconfd_get_all(XfconfDaemon *xfconfd,
+ const gchar *channel,
+ GHashTable **properties,
+ GError **error);
+static gboolean xfconfd_exists(XfconfDaemon *xfconfd,
+ const gchar *channel,
+ const gchar *property,
+ gboolean *exists,
+ GError **error);
+static gboolean xfconfd_remove(XfconfDaemon *xfconfd,
+ const gchar *channel,
+ const gchar *property,
+ GError **error);
static gboolean xfconfd_show_list(XfconfDaemon *xfconfd,
const gchar *display,
GError **error);
@@ -133,6 +146,34 @@ xfconfd_get(XfconfDaemon *xfconfd,
}
static gboolean
+xfconfd_get_all(XfconfDaemon *xfconfd,
+ const gchar *channel,
+ GHashTable **properties,
+ GError **error)
+{
+ return xfconf_backend_get_all(xfconfd->backend, channel, properties, error);
+}
+
+static gboolean
+xfconfd_exists(XfconfDaemon *xfconfd,
+ const gchar *channel,
+ const gchar *property,
+ gboolean *exists,
+ GError **error)
+{
+ return xfconf_backend_exists(xfconfd->backend, channel, property, exists, error);
+}
+
+static gboolean
+xfconfd_remove(XfconfDaemon *xfconfd,
+ const gchar *channel,
+ const gchar *property,
+ GError **error)
+{
+ return xfconf_backend_remove(xfconfd->backend, channel, property, error);
+}
+
+static gboolean
xfconfd_show_list(XfconfDaemon *xfconfd,
const gchar *display,
GError **error)