diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2010-07-30 14:24:01 -0400 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2010-07-30 14:24:01 -0400 |
commit | 8dbd3ed2a39b885de434da32079cd64ef264ba99 (patch) | |
tree | a1cdd19f70adbdac51fe80f300356043ee352d93 /libdbusmenu-glib/server.c | |
parent | 3412a47ce42136704ce787de7d1d66b358c6074d (diff) | |
parent | b16ca914ae9a5511f1e1b07dbb647fdde57f4027 (diff) | |
download | libdbusmenu-8dbd3ed2a39b885de434da32079cd64ef264ba99.tar.gz libdbusmenu-8dbd3ed2a39b885de434da32079cd64ef264ba99.tar.bz2 libdbusmenu-8dbd3ed2a39b885de434da32079cd64ef264ba99.zip |
releasing version 0.3.8-0ubuntu1
Diffstat (limited to 'libdbusmenu-glib/server.c')
-rw-r--r-- | libdbusmenu-glib/server.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 13c2843..aa8dfac 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, @@ -359,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 @@ -368,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; } |