diff options
author | Ted Gould <ted@canonical.com> | 2009-05-05 18:24:33 +0100 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-05-05 18:24:33 +0100 |
commit | 327bb967f21c472bd01783e1eaa6ef791826cccb (patch) | |
tree | 6383c2973ca9f38868f5ffc2b7baabce55046c82 | |
parent | 125df5401f1977f01b189b9ba598f898202d2727 (diff) | |
download | libdbusmenu-327bb967f21c472bd01783e1eaa6ef791826cccb.tar.gz libdbusmenu-327bb967f21c472bd01783e1eaa6ef791826cccb.tar.bz2 libdbusmenu-327bb967f21c472bd01783e1eaa6ef791826cccb.zip |
Adding in signals to get the update from the server updating the layout. And parsing it.
-rw-r--r-- | libdbusmenu-glib/client.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index a9c7419..143e4be 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -41,7 +41,13 @@ static void dbusmenu_client_finalize (GObject *object); static void set_property (GObject * obj, guint id, const GValue * value, GParamSpec * pspec); static void get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec); /* Private Funcs */ +static void layout_update (DBusGProxy * proxy, DbusmenuClient * client); static void build_proxies (DbusmenuClient * client); +static guint parse_node_get_id (xmlNodePtr node); +static DbusmenuMenuitem * parse_layout_xml(xmlNodePtr node, DbusmenuMenuitem * item, DbusmenuMenuitem * parent); +static void parse_layout (DbusmenuClient * client, const gchar * layout); +static void update_layout_cb (DBusGProxy * proxy, DBusGProxyCall * call, void * data); +static void update_layout (DbusmenuClient * client); /* Build a type */ G_DEFINE_TYPE (DbusmenuClient, dbusmenu_client, G_TYPE_OBJECT); @@ -173,6 +179,14 @@ get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec) /* Internal funcs */ +/* Annoying little wrapper to make the right function update */ +static void +layout_update (DBusGProxy * proxy, DbusmenuClient * client) +{ + update_layout(client); + return; +} + /* When we have a name and an object, build the two proxies and get the first version of the layout */ static void @@ -213,6 +227,9 @@ build_proxies (DbusmenuClient * client) return; } + dbus_g_proxy_add_signal(priv->menuproxy, "LayoutUpdate", G_TYPE_INVALID); + dbus_g_proxy_connect_signal(priv->menuproxy, "LayoutUpdate", G_CALLBACK(layout_update), client, NULL); + return; } |