add e_dbus_introspect; this call can be used on any bus+objectpath that follows the...
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 31 May 2010 18:17:27 +0000 (18:17 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 31 May 2010 18:17:27 +0000 (18:17 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/e_dbus@49358 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/dbus/E_DBus.h
src/lib/dbus/e_dbus_methods.c

index 736c030..cbb2c05 100644 (file)
@@ -194,6 +194,8 @@ extern "C" {
                                                      const void *data);
 
 /* standard methods calls on objects */
+   EAPI DBusPendingCall *e_dbus_introspect(E_DBus_Connection *conn, const char *bus,
+       const char *object_path, E_DBus_Method_Return_Cb cb_return, const void *data);
    EAPI DBusPendingCall *e_dbus_peer_ping(E_DBus_Connection *conn, const char *destination,
                                          const char *path, E_DBus_Method_Return_Cb cb_return,
                                          const void *data);
index 636555e..91283a8 100644 (file)
@@ -67,6 +67,36 @@ _dbus_call__str(E_DBus_Connection *conn, const const char *method_name, const ch
   return ret;
 }
 
+/**
+ * Calls the Introspect method on a given bus and object path.
+ * @param conn The dbus connection to use
+ * @param bus The bus to call the method on
+ * @param object_path The path of the bus to call on
+ * @param cb_return The callback to call on reply from dbus
+ * @param data The data to associate with the callback
+ * @return A pending dbus call
+ */
+EAPI DBusPendingCall *
+e_dbus_introspect(E_DBus_Connection *conn, const char *bus, const char *object_path, E_DBus_Method_Return_Cb cb_return, const void *data)
+{
+   DBusPendingCall *ret;
+   DBusMessage *msg;
+
+  if (!conn)
+    {
+       ERR("E-dbus Error: no connection for use with introspection");
+       return NULL;
+    }
+
+   msg = dbus_message_new_method_call
+     (bus, object_path, "org.freedesktop.DBus.Introspectable", "Introspect");
+   if (!msg)
+     return NULL;
+   ret = e_dbus_message_send(conn, msg, cb_return, -1, (void *)data);
+   dbus_message_unref(msg);
+   return ret;
+}
+
 EAPI DBusPendingCall *
 e_dbus_request_name(E_DBus_Connection *conn, const char *name, unsigned int flags, E_DBus_Method_Return_Cb cb_return, const void *data)
 {