aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-04-27 16:36:43 -0500
committerTed Gould <ted@canonical.com>2009-04-27 16:36:43 -0500
commita641c011fd1a697b08b26284a4ed5ec02e0bd13d (patch)
tree911578c4fd0a246ab6f2a00dd2ffba4c06fd9c8e
parent6cb2ab7e906e2225091d9a45d5cbd9040fbbb908 (diff)
downloadlibdbusmenu-a641c011fd1a697b08b26284a4ed5ec02e0bd13d.tar.gz
libdbusmenu-a641c011fd1a697b08b26284a4ed5ec02e0bd13d.tar.bz2
libdbusmenu-a641c011fd1a697b08b26284a4ed5ec02e0bd13d.zip
Getting up to the XML level. Whoo, up the protocol stack we go.
-rw-r--r--libdbusmenu-glib/client.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index 320165a..f0eb408 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -2,6 +2,9 @@
#include "config.h"
#endif
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+
#include "client.h"
#include "dbusmenu-client.h"
@@ -213,13 +216,33 @@ build_proxies (DbusmenuClient * client)
return;
}
+/* Parse recursively through the XML and make it into
+ objects as need be */
+static gboolean
+parse_layout_xml(xmlNodePtr node, DbusmenuMenuitem * item, DbusmenuMenuitem * parent)
+{
+
+ return FALSE;
+}
+
/* Take the layout passed to us over DBus and turn it into
a set of beautiful objects */
static void
parse_layout (DbusmenuClient * client, const gchar * layout)
{
+ DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client);
+
+ xmlDocPtr xmldoc;
+ xmldoc = xmlReadMemory(layout, g_utf8_strlen(layout, 16*1024), "dbusmenu.xml", NULL, 0);
+ xmlNodePtr root = xmlDocGetRootElement(xmldoc);
+
+ if (!parse_layout_xml(root, priv->root, NULL)) {
+ g_warning("Unable to parse layout on client %s object %s", priv->dbus_name, priv->dbus_object);
+ }
+
+ xmlFreeDoc(xmldoc);
return;
}
@@ -243,6 +266,9 @@ update_layout_cb (DBusGProxy * proxy, DBusGProxyCall * call, void * data)
const gchar * xml = g_value_get_string(&value);
parse_layout(client, xml);
+
+ priv->layoutcall = NULL;
+
return;
}