From 20ad762cf2fc9511b237007ec7412f6574e09223 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 20 Jul 2010 05:37:35 -0500 Subject: Adding open menu signal --- libdbusmenu-glib/dbus-menu.xml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/dbus-menu.xml b/libdbusmenu-glib/dbus-menu.xml index 53b67de..f2f1db6 100644 --- a/libdbusmenu-glib/dbus-menu.xml +++ b/libdbusmenu-glib/dbus-menu.xml @@ -344,6 +344,9 @@ License version 3 and version 2.1 along with this program. If not, see + + + -- cgit v1.2.3 From eab9731dcd26336aa44aee62073881919201df6f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 20 Jul 2010 05:48:07 -0500 Subject: Changing to name to match --- libdbusmenu-glib/dbus-menu.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/dbus-menu.xml b/libdbusmenu-glib/dbus-menu.xml index f2f1db6..b09604b 100644 --- a/libdbusmenu-glib/dbus-menu.xml +++ b/libdbusmenu-glib/dbus-menu.xml @@ -344,7 +344,7 @@ License version 3 and version 2.1 along with this program. If not, see - + -- cgit v1.2.3 From 93c287ff9d2c7029eb275f10cf5f372b0edb54ef Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 20 Jul 2010 05:55:55 -0500 Subject: Docs and a tense fix --- libdbusmenu-glib/dbus-menu.xml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/dbus-menu.xml b/libdbusmenu-glib/dbus-menu.xml index b09604b..b4f4439 100644 --- a/libdbusmenu-glib/dbus-menu.xml +++ b/libdbusmenu-glib/dbus-menu.xml @@ -344,8 +344,16 @@ License version 3 and version 2.1 along with this program. If not, see - - + + + The server is requesting that all clients displaying this + menu open it to the user. This would be for things like + hotkeys that when the user presses them the menu should + open and display itself to the user. + + + ID of the menu that should be activated + -- cgit v1.2.3 From 63bb196ef8482430bbf742a7a6389a9897766f43 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 20 Jul 2010 08:18:22 -0500 Subject: Adding a timestamp --- libdbusmenu-glib/dbus-menu.xml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/dbus-menu.xml b/libdbusmenu-glib/dbus-menu.xml index b4f4439..9e8013c 100644 --- a/libdbusmenu-glib/dbus-menu.xml +++ b/libdbusmenu-glib/dbus-menu.xml @@ -354,6 +354,9 @@ License version 3 and version 2.1 along with this program. If not, see ID of the menu that should be activated + + The time that the event occured + -- cgit v1.2.3 From 3d98145e318bb486451603c2a312e65c14ea809f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 20 Jul 2010 16:09:35 -0500 Subject: Building the signal slot --- libdbusmenu-glib/server.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/server.h b/libdbusmenu-glib/server.h index f4e3527..4daf448 100644 --- a/libdbusmenu-glib/server.h +++ b/libdbusmenu-glib/server.h @@ -58,10 +58,10 @@ G_BEGIN_DECLS @id_prop_update: Slot for #DbusmenuServer::id-prop-update. @id_update: Slot for #DbusmenuServer::id-update. @layout_updated: Slot for #DbusmenuServer::layout-update. + @item_activation_requested: Slot for #DbusmenuServer::item-activation-requested. @dbusmenu_server_reserved1: Reserved for future use. @dbusmenu_server_reserved2: Reserved for future use. @dbusmenu_server_reserved3: Reserved for future use. - @dbusmenu_server_reserved4: Reserved for future use. The class implementing the virtual functions for #DbusmenuServer. */ @@ -73,12 +73,12 @@ struct _DbusmenuServerClass { void (*id_prop_update)(gint id, gchar * property, gchar * value); void (*id_update)(gint id); void (*layout_updated)(gint revision); + void (*item_activation_requested)(gint id, guint timestamp); /* Reserved */ void (*dbusmenu_server_reserved1)(void); void (*dbusmenu_server_reserved2)(void); void (*dbusmenu_server_reserved3)(void); - void (*dbusmenu_server_reserved4)(void); }; /** -- cgit v1.2.3 From 903aaf402c081506173b31c755fe58338b6cd930 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 20 Jul 2010 16:15:25 -0500 Subject: Actually build the signal and put it on the object. --- libdbusmenu-glib/server-marshal.list | 1 + libdbusmenu-glib/server.c | 17 +++++++++++++++++ libdbusmenu-glib/server.h | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/server-marshal.list b/libdbusmenu-glib/server-marshal.list index 1689a05..0d68c4e 100644 --- a/libdbusmenu-glib/server-marshal.list +++ b/libdbusmenu-glib/server-marshal.list @@ -1,2 +1,3 @@ VOID: INT, STRING, POINTER VOID: UINT, INT +VOID: INT, UINT diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 13c2843..deee5da 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -65,6 +65,7 @@ enum { ID_PROP_UPDATE, ID_UPDATE, LAYOUT_UPDATED, + ITEM_ACTIVATION, LAST_SIGNAL }; @@ -165,6 +166,22 @@ dbusmenu_server_class_init (DbusmenuServerClass *class) NULL, NULL, _dbusmenu_server_marshal_VOID__UINT_INT, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_INT); + /** + DbusmenuServer::item-activation-requested: + @arg0: The #DbusmenuServer emitting the signal. + @arg1: The ID of the parent for this update. + @arg2: The timestamp of when the event happened + + This is signaled when a menuitem under this server + sends it's activate signal. + */ + signals[ITEM_ACTIVATION] = g_signal_new(DBUSMENU_SERVER_SIGNAL_ITEM_ACTIVATION, + G_TYPE_FROM_CLASS(class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(DbusmenuServerClass, item_activation), + NULL, NULL, + _dbusmenu_server_marshal_VOID__INT_UINT, + G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_UINT); g_object_class_install_property (object_class, PROP_DBUS_OBJECT, diff --git a/libdbusmenu-glib/server.h b/libdbusmenu-glib/server.h index 4daf448..a9bf213 100644 --- a/libdbusmenu-glib/server.h +++ b/libdbusmenu-glib/server.h @@ -46,6 +46,7 @@ G_BEGIN_DECLS #define DBUSMENU_SERVER_SIGNAL_ID_PROP_UPDATE "item-property-updated" #define DBUSMENU_SERVER_SIGNAL_ID_UPDATE "item-updated" #define DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATED "layout-updated" +#define DBUSMENU_SERVER_SIGNAL_ITEM_ACTIVATION "item-activation-requested" #define DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATE DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATED #define DBUSMENU_SERVER_PROP_DBUS_OBJECT "dbus-object" @@ -73,7 +74,7 @@ struct _DbusmenuServerClass { void (*id_prop_update)(gint id, gchar * property, gchar * value); void (*id_update)(gint id); void (*layout_updated)(gint revision); - void (*item_activation_requested)(gint id, guint timestamp); + void (*item_activation)(gint id, guint timestamp); /* Reserved */ void (*dbusmenu_server_reserved1)(void); -- cgit v1.2.3 From 4fbfb66b98d31283facfd425a91d084c61288ac8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 20 Jul 2010 16:21:13 -0500 Subject: Setting up listening on the menuitems to send the activate signal over. --- libdbusmenu-glib/server.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index deee5da..aa8dfac 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -376,6 +376,15 @@ menuitem_child_moved (DbusmenuMenuitem * parent, DbusmenuMenuitem * child, guint return; } +/* Called when a menu item emits its activated signal so it + gets passed across the bus. */ +static void +menuitem_activated (DbusmenuMenuitem * mi, guint timestamp, DbusmenuServer * server) +{ + g_signal_emit(G_OBJECT(server), signals[ITEM_ACTIVATION], 0, dbusmenu_menuitem_get_id(mi), timestamp, TRUE); + return; +} + /* Connects all the signals that we're interested in coming from a menuitem */ static void @@ -385,6 +394,7 @@ menuitem_signals_create (DbusmenuMenuitem * mi, gpointer data) g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED, G_CALLBACK(menuitem_child_removed), data); g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_CHILD_MOVED, G_CALLBACK(menuitem_child_moved), data); g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(menuitem_property_changed), data); + g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(menuitem_activated), data); return; } -- cgit v1.2.3