From 70ed48c403fd63620320aa8c3924568a4a7c0289 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 20 Apr 2009 17:14:07 -0500 Subject: Starting to flesh out the client a little bit --- libdbusmenu-glib/client.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index fc60101..65871fc 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -9,6 +9,11 @@ typedef struct _DbusmenuClientPrivate DbusmenuClientPrivate; struct _DbusmenuClientPrivate { + DbusmenuMenuitem * root; + + DBusGProxy * menuproxy; + DBusGProxy * propproxy; + DBusGProxyCall * layoutcall; }; #define DBUSMENU_CLIENT_GET_PRIVATE(o) \ @@ -37,6 +42,14 @@ dbusmenu_client_class_init (DbusmenuClientClass *klass) static void dbusmenu_client_init (DbusmenuClient *self) { + DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(self); + + priv->root = NULL; + priv->menuproxy = NULL; + priv->propproxy = NULL; + priv->layoutcall = NULL; + + return; } static void @@ -52,3 +65,53 @@ dbusmenu_client_finalize (GObject *object) G_OBJECT_CLASS (dbusmenu_client_parent_class)->finalize (object); return; } + +/* Internal funcs */ + +/* When we have a name and an object, build the two proxies and get the + first version of the layout */ +static void +build_proxies (DbusmenuClient * client) +{ + + +} + +/* When the layout property returns, here's where we take care of that. */ +static void +update_layout_cb (DBusGProxy * proxy, DBusGProxyCall * call, void * data) +{ + + +} + +/* Call the property on the server we're connected to and set it up to + be async back to _update_layout_cb */ +static void +update_layout (DbusmenuClient * client) +{ + + +} + +/* Public API */ +DbusmenuClient * +dbusmenu_client_new (const gchar * name, const gchar * object) +{ + DbusmenuClient * self = g_object_new(DBUSMENU_TYPE_CLIENT, "name", name, "object", object, NULL); + + return self; +} + +DbusmenuMenuitem * +dbusmenu_client_get_root (DbusmenuClient * client) +{ + DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client); + + if (priv->layoutcall != NULL) { + /* Oh, we're in the middle of getting it */ + /* TODO: Wait here */ + } + + return priv->root; +} -- cgit v1.2.3