aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-04-20 17:14:07 -0500
committerTed Gould <ted@canonical.com>2009-04-20 17:14:07 -0500
commit70ed48c403fd63620320aa8c3924568a4a7c0289 (patch)
treea9c1ea55cde546547d2e664deba8e619a262b93e
parent29e7e02e7f006cde4a5f142fe656ac6936fd6976 (diff)
downloadlibdbusmenu-70ed48c403fd63620320aa8c3924568a4a7c0289.tar.gz
libdbusmenu-70ed48c403fd63620320aa8c3924568a4a7c0289.tar.bz2
libdbusmenu-70ed48c403fd63620320aa8c3924568a4a7c0289.zip
Starting to flesh out the client a little bit
-rw-r--r--libdbusmenu-glib/client.c63
1 files changed, 63 insertions, 0 deletions
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;
+}