From 26e1f12bf1d9d74258ff66db44d478ce356c40cb Mon Sep 17 00:00:00 2001 From: englebass Date: Wed, 29 Oct 2008 07:12:55 +0000 Subject: [PATCH] implement org.freedesktop.DBus.Properties.GetAll git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/e_dbus@37293 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/dbus/E_DBus.h | 4 ++++ src/lib/dbus/e_dbus_interfaces.c | 38 +++++++++++++++++++++++++++++++++----- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/src/lib/dbus/E_DBus.h b/src/lib/dbus/E_DBus.h index 631a057..a134693 100644 --- a/src/lib/dbus/E_DBus.h +++ b/src/lib/dbus/E_DBus.h @@ -136,6 +136,10 @@ extern "C" { const char *destination, const char *path, E_DBus_Method_Return_Cb cb_return, const void *data); + EAPI DBusPendingCall *e_dbus_properties_get_all(E_DBus_Connection *conn, const char *destination, + const char *path, const char *interface, + E_DBus_Method_Return_Cb cb_return, + const void *data); EAPI DBusPendingCall *e_dbus_properties_get(E_DBus_Connection *conn, const char *destination, const char *path, const char *interface, const char *property, diff --git a/src/lib/dbus/e_dbus_interfaces.c b/src/lib/dbus/e_dbus_interfaces.c index df0dffa..f66040b 100644 --- a/src/lib/dbus/e_dbus_interfaces.c +++ b/src/lib/dbus/e_dbus_interfaces.c @@ -58,7 +58,7 @@ e_dbus_peer_ping(E_DBus_Connection *conn, const char *destination, const char *p * @param data data to pass to the callbacks */ EAPI DBusPendingCall * -e_dbus_peer_get_machine_id(E_DBus_Connection*conn, const char *destination, const char *path, E_DBus_Method_Return_Cb cb_return, const void *data) +e_dbus_peer_get_machine_id(E_DBus_Connection *conn, const char *destination, const char *path, E_DBus_Method_Return_Cb cb_return, const void *data) { return _dbus_peer_call(conn, "GetMachineId", destination, path, cb_return, data); } @@ -85,11 +85,39 @@ _dbus_message_property_method_call(E_DBus_Connection *conn, const char *method_n return NULL; } - dbus_message_append_args(msg, DBUS_TYPE_STRING, &interface, - DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID); + if (property) + { + dbus_message_append_args(msg, DBUS_TYPE_STRING, &interface, + DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID); + } + else + { + dbus_message_append_args(msg, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID); + } + return msg; } +EAPI DBusPendingCall * +e_dbus_properties_get_all(E_DBus_Connection *conn, const char *destination, const char *path, const char *interface, E_DBus_Method_Return_Cb cb_return, const void *data) +{ + DBusMessage *msg; + DBusPendingCall *ret; + + msg = _dbus_message_property_method_call + (conn, "GetAll", destination, path, interface, NULL); + if (!msg) + return NULL; + ret = e_dbus_message_send(conn, msg, cb_return, -1, (void *)data); + dbus_message_unref(msg); + + if (!ret) + fprintf(stderr, "ERROR: failed to call GetAll() at \"%s\" at \"%s\"\n", + destination, path); + + return ret; +} + /** * Get the value of a property on an object * @@ -102,7 +130,7 @@ _dbus_message_property_method_call(E_DBus_Connection *conn, const char *method_n * @param data data to pass to the callbacks */ EAPI DBusPendingCall * -e_dbus_properties_get(E_DBus_Connection*conn, const char *destination, const char *path, const char *interface, const char *property, E_DBus_Method_Return_Cb cb_return, const void *data) +e_dbus_properties_get(E_DBus_Connection *conn, const char *destination, const char *path, const char *interface, const char *property, E_DBus_Method_Return_Cb cb_return, const void *data) { DBusMessage *msg; DBusPendingCall *ret; @@ -135,7 +163,7 @@ e_dbus_properties_get(E_DBus_Connection*conn, const char *destination, const cha * @param data data to pass to the callbacks */ EAPI DBusPendingCall * -e_dbus_properties_set(E_DBus_Connection*conn, const char *destination, const char *path, const char *interface, const char *property, int value_type, const void *value, E_DBus_Method_Return_Cb cb_return, const void *data) +e_dbus_properties_set(E_DBus_Connection *conn, const char *destination, const char *path, const char *interface, const char *property, int value_type, const void *value, E_DBus_Method_Return_Cb cb_return, const void *data) { DBusMessage *msg; DBusMessageIter iter, sub; -- 2.7.4