From 5971493366cde4f9cc55d963b22d451dd7ffbbcd Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 12 May 2009 16:34:49 -0500 Subject: Adding in the activate signal and a function to emit it on the server side of things. --- libdbusmenu-glib/menuitem-marshal.list | 1 + libdbusmenu-glib/menuitem.c | 29 +++++++++++++++++++++++++++++ libdbusmenu-glib/menuitem.h | 1 + 3 files changed, 31 insertions(+) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/menuitem-marshal.list b/libdbusmenu-glib/menuitem-marshal.list index 0d9d340..fc0318f 100644 --- a/libdbusmenu-glib/menuitem-marshal.list +++ b/libdbusmenu-glib/menuitem-marshal.list @@ -1,2 +1,3 @@ VOID: STRING, STRING VOID: OBJECT +VOID: VOID 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 @@ -111,6 +111,20 @@ dbusmenu_menuitem_class_init (DbusmenuMenuitemClass *klass) NULL, NULL, _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. @@ -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; +} diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h index 122c9fb..3ba886a 100644 --- a/libdbusmenu-glib/menuitem.h +++ b/libdbusmenu-glib/menuitem.h @@ -117,6 +117,7 @@ gboolean dbusmenu_menuitem_property_exist (DbusmenuMenuitem * mi, const gchar * void dbusmenu_menuitem_buildxml (DbusmenuMenuitem * mi, GPtrArray * array); void dbusmenu_menuitem_foreach (DbusmenuMenuitem * mi, void (*func) (DbusmenuMenuitem * mi, gpointer data), gpointer data); +void dbusmenu_menuitem_activate (DbusmenuMenuitem * mi); /** SECTION:menuitem -- cgit v1.2.3