aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-09 11:49:17 -0600
committerTed Gould <ted@gould.cx>2010-02-09 11:49:17 -0600
commitc6e66acdc7ae9cebbe3592905206760f7b168694 (patch)
tree6cd9858d8cb557474819b51cb9b10c332acd7f63
parentdb0e5c1bd674d437325638181ef0467855b19878 (diff)
downloadlibdbusmenu-c6e66acdc7ae9cebbe3592905206760f7b168694.tar.gz
libdbusmenu-c6e66acdc7ae9cebbe3592905206760f7b168694.tar.bz2
libdbusmenu-c6e66acdc7ae9cebbe3592905206760f7b168694.zip
Adding in event handling.
-rw-r--r--libdbusmenu-glib/menuitem-proxy.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/libdbusmenu-glib/menuitem-proxy.c b/libdbusmenu-glib/menuitem-proxy.c
index 13ca09c..98788c6 100644
--- a/libdbusmenu-glib/menuitem-proxy.c
+++ b/libdbusmenu-glib/menuitem-proxy.c
@@ -34,7 +34,7 @@ License version 3 and version 2.1 along with this program. If not, see
typedef struct _DbusmenuMenuitemProxyPrivate DbusmenuMenuitemProxyPrivate;
struct _DbusmenuMenuitemProxyPrivate {
- gint placeholder;
+ DbusmenuMenuitem * mi;
};
#define DBUSMENU_MENUITEM_PROXY_GET_PRIVATE(o) \
@@ -44,6 +44,7 @@ static void dbusmenu_menuitem_proxy_class_init (DbusmenuMenuitemProxyClass *klas
static void dbusmenu_menuitem_proxy_init (DbusmenuMenuitemProxy *self);
static void dbusmenu_menuitem_proxy_dispose (GObject *object);
static void dbusmenu_menuitem_proxy_finalize (GObject *object);
+static void handle_event (DbusmenuMenuitem * mi, const gchar * name, const GValue * value, guint timestamp);
G_DEFINE_TYPE (DbusmenuMenuitemProxy, dbusmenu_menuitem_proxy, DBUSMENU_TYPE_MENUITEM);
@@ -57,6 +58,10 @@ dbusmenu_menuitem_proxy_class_init (DbusmenuMenuitemProxyClass *klass)
object_class->dispose = dbusmenu_menuitem_proxy_dispose;
object_class->finalize = dbusmenu_menuitem_proxy_finalize;
+ DbusmenuMenuitemClass * miclass = DBUSMENU_MENUITEM_CLASS(klass);
+
+ miclass->handle_event = handle_event;
+
return;
}
@@ -82,3 +87,14 @@ dbusmenu_menuitem_proxy_finalize (GObject *object)
G_OBJECT_CLASS (dbusmenu_menuitem_proxy_parent_class)->finalize (object);
return;
}
+
+/* Takes the event and passes it along to the item that we're
+ playing proxy for. */
+static void
+handle_event (DbusmenuMenuitem * mi, const gchar * name, const GValue * value, guint timestamp)
+{
+ g_return_if_fail(DBUSMENU_IS_MENUITEM_PROXY(mi));
+ DbusmenuMenuitemProxyPrivate * priv = DBUSMENU_MENUITEM_PROXY_GET_PRIVATE(mi);
+ g_return_if_fail(priv->mi != NULL);
+ return dbusmenu_menuitem_handle_event(priv->mi, name, value, timestamp);
+}