aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib/menuitem.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-08-20 14:49:33 -0500
committerTed Gould <ted@gould.cx>2010-08-20 14:49:33 -0500
commitfc9d42883ae66f91ac330bd32bc3ffe31d88393c (patch)
tree675526fd5d6edccffe6de88608673ec1b18dd491 /libdbusmenu-glib/menuitem.c
parent607107ea135b2579c30a9efff08c626538892045 (diff)
downloadlibdbusmenu-fc9d42883ae66f91ac330bd32bc3ffe31d88393c.tar.gz
libdbusmenu-fc9d42883ae66f91ac330bd32bc3ffe31d88393c.tar.bz2
libdbusmenu-fc9d42883ae66f91ac330bd32bc3ffe31d88393c.zip
Adding the signal and function to show the menu item to the user.
Diffstat (limited to 'libdbusmenu-glib/menuitem.c')
-rw-r--r--libdbusmenu-glib/menuitem.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c
index 623539c..ea69776 100644
--- a/libdbusmenu-glib/menuitem.c
+++ b/libdbusmenu-glib/menuitem.c
@@ -70,6 +70,7 @@ enum {
CHILD_REMOVED,
CHILD_MOVED,
REALIZED,
+ SHOW_TO_USER,
LAST_SIGNAL
};
@@ -211,6 +212,22 @@ dbusmenu_menuitem_class_init (DbusmenuMenuitemClass *klass)
NULL, NULL,
_dbusmenu_menuitem_marshal_VOID__VOID,
G_TYPE_NONE, 0, G_TYPE_NONE);
+ /**
+ DbusmenuMenuitem::show-to-user:
+ @arg0: The #DbusmenuMenuitem which should be shown.
+ @arg1: Timestamp the event happened at
+
+ Signaled when the application would like the visualization
+ of this menu item shown to the user. This usually requires
+ going over the bus to get it done.
+ */
+ signals[SHOW_TO_USER] = g_signal_new(DBUSMENU_MENUITEM_SIGNAL_SHOW_TO_USER,
+ G_TYPE_FROM_CLASS(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(DbusmenuMenuitemClass, show_to_user),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__UINT,
+ G_TYPE_NONE, 1, G_TYPE_UINT, G_TYPE_NONE);
g_object_class_install_property (object_class, PROP_ID,
g_param_spec_int(PROP_ID_S, "ID for the menu item",
@@ -1349,3 +1366,22 @@ dbusmenu_menuitem_send_about_to_show (DbusmenuMenuitem * mi, dbusmenu_menuitem_a
return;
}
+
+/**
+ dbusmenu_menuitem_show_to_user:
+ @mi: #DbusmenuMenuitem to show
+ @timestamp: The time that the user requested it to be shown
+
+ Signals that this menu item should be shown to the user. If this is
+ server side the server will then take it and send it over the
+ bus.
+*/
+void
+dbusmenu_menuitem_show_to_user (DbusmenuMenuitem * mi, guint timestamp)
+{
+ g_return_if_fail(DBUSMENU_IS_MENUITEM(mi));
+
+ g_signal_emit(G_OBJECT(mi), signals[SHOW_TO_USER], 0, timestamp, TRUE);
+
+ return;
+}