dbus/glib dbus-gobject.c,1.13,1.14
Havoc Pennington
hp at freedesktop.org
Sat Jan 29 12:12:24 PST 2005
Update of /cvs/dbus/dbus/glib
In directory gabe:/tmp/cvs-serv21445/glib
Modified Files:
dbus-gobject.c
Log Message:
2005-01-29 Havoc Pennington <hp at redhat.com>
* tools/dbus-tree-view.c: add support for displaying properties.
(run dbus-viewer with an introspect xml file as arg, then resize
the window so the tree elements show up, not sure what that is)
* glib/dbus-gobject.c (handle_introspect): return
org.freedesktop.Properties and org.freedesktop.Introspectable
interfaces when we are introspected.
* doc/dbus-specification.xml: allow empty interface name when
Get/Set a property
Index: dbus-gobject.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gobject.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- dbus-gobject.c 29 Jan 2005 19:52:19 -0000 1.13
+++ dbus-gobject.c 29 Jan 2005 20:12:21 -0000 1.14
@@ -290,6 +290,27 @@
xml = g_string_new (NULL);
g_string_append (xml, "<node>\n");
+
+ /* We are introspectable, though I guess that was pretty obvious */
+ g_string_append (xml, " <interface name=\"org.freedesktop.Introspectable\">\n");
+ g_string_append (xml, " <method name=\"Introspect\">\n");
+ g_string_append (xml, " <arg name=\"data\" direction=\"out\" type=\"string\"\"/>\n");
+ g_string_append (xml, " </method>\n");
+ g_string_append (xml, " </interface>\n");
+
+ /* We support get/set properties */
+ g_string_append (xml, " <interface name=\"org.freedesktop.Properties\">\n");
+ g_string_append (xml, " <method name=\"Get\">\n");
+ g_string_append (xml, " <arg name=\"interface\" direction=\"in\" type=\"string\"\"/>\n");
+ g_string_append (xml, " <arg name=\"propname\" direction=\"in\" type=\"string\"\"/>\n");
+ g_string_append (xml, " <arg name=\"value\" direction=\"out\" type=\"variant\"\"/>\n");
+ g_string_append (xml, " </method>\n");
+ g_string_append (xml, " <method name=\"Set\">\n");
+ g_string_append (xml, " <arg name=\"interface\" direction=\"in\" type=\"string\"\"/>\n");
+ g_string_append (xml, " <arg name=\"propname\" direction=\"in\" type=\"string\"\"/>\n");
+ g_string_append (xml, " <arg name=\"value\" direction=\"in\" type=\"variant\"\"/>\n");
+ g_string_append (xml, " </method>\n");
+ g_string_append (xml, " </interface>\n");
introspect_signals (G_OBJECT_TYPE (object), xml);
introspect_properties (object, xml);
@@ -409,7 +430,7 @@
gboolean getter;
char *s;
const char *wincaps_propname;
- const char *wincaps_propiface;
+ /* const char *wincaps_propiface; */
DBusMessageIter iter;
object = G_OBJECT (user_data);
@@ -460,7 +481,10 @@
g_warning ("Property get or set does not have an interface string as first arg\n");
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
- dbus_message_iter_get_basic (&iter, &wincaps_propiface);
+ /* We never use the interface name; if we did, we'd need to
+ * remember that it can be empty string for "pick one for me"
+ */
+ /* dbus_message_iter_get_basic (&iter, &wincaps_propiface); */
dbus_message_iter_next (&iter);
if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRING)
More information about the dbus-commit
mailing list