aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib/menuitem.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-05-12 16:34:49 -0500
committerTed Gould <ted@canonical.com>2009-05-12 16:34:49 -0500
commit5971493366cde4f9cc55d963b22d451dd7ffbbcd (patch)
treec37e6152f578b0ffd7516a90e97d513626ccecc3 /libdbusmenu-glib/menuitem.c
parent7b53f1b10253936c905c77e29187493c4e3781e7 (diff)
downloadlibdbusmenu-5971493366cde4f9cc55d963b22d451dd7ffbbcd.tar.gz
libdbusmenu-5971493366cde4f9cc55d963b22d451dd7ffbbcd.tar.bz2
libdbusmenu-5971493366cde4f9cc55d963b22d451dd7ffbbcd.zip
Adding in the activate signal and a function to emit it on the server side of things.
Diffstat (limited to 'libdbusmenu-glib/menuitem.c')
-rw-r--r--libdbusmenu-glib/menuitem.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c
index c4ffa3d..6cfd581 100644
--- a/libdbusmenu-glib/menuitem.c
+++ b/libdbusmenu-glib/menuitem.c
@@ -112,6 +112,20 @@ dbusmenu_menuitem_class_init (DbusmenuMenuitemClass *klass)
_dbusmenu_menuitem_marshal_VOID__STRING_STRING,
G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING);
/**
+ DbusmenuMenuitem::item-activated:
+ @arg0: The #DbusmenuMenuitem object.
+
+ Emitted on the objects on the server side when
+ they are signaled on the client side.
+ */
+ signals[ITEM_ACTIVATED] = g_signal_new(DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
+ G_TYPE_FROM_CLASS(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(DbusmenuMenuitemClass, item_activated),
+ NULL, NULL,
+ _dbusmenu_menuitem_marshal_VOID__VOID,
+ G_TYPE_NONE, 0, G_TYPE_NONE);
+ /**
DbusmenuMenuitem::child-added:
@arg0: The #DbusmenuMenuitem which is the parent.
@arg1: The #DbusmenuMenuitem which is the child.
@@ -590,3 +604,18 @@ dbusmenu_menuitem_foreach (DbusmenuMenuitem * mi, void (*func) (DbusmenuMenuitem
g_list_foreach(children, foreach_helper, &foreach_data);
return;
}
+
+/**
+ dbusmenu_menuitem_activate:
+ @mi: The #DbusmenuMenuitem to send the signal on.
+
+ Emits the #DbusmenuMenuitem::item-activate signal on this
+ menu item. Called by server objects when they get the
+ appropriate DBus signals from the client.
+*/
+void
+dbusmenu_menuitem_activate (DbusmenuMenuitem * mi)
+{
+ g_signal_emit(G_OBJECT(mi), signals[ITEM_ACTIVATED], 0, TRUE);
+ return;
+}