diff options
author | Sebastien Bacher <seb128@ubuntu.com> | 2010-04-01 12:41:41 +0200 |
---|---|---|
committer | Sebastien Bacher <seb128@ubuntu.com> | 2010-04-01 12:41:41 +0200 |
commit | 042dd16d3e0f8b6149e80243aa833832aa4fc1f6 (patch) | |
tree | 48bcee799eeeb8ca7e73e2000e2d48c6e79d55ab /libdbusmenu-glib/menuitem.c | |
parent | 0f343edd778547d86b08bc4550f29429715928f1 (diff) | |
parent | 65bd97a9dfb54716be7797923773e1ad7a33a67c (diff) | |
download | libdbusmenu-042dd16d3e0f8b6149e80243aa833832aa4fc1f6.tar.gz libdbusmenu-042dd16d3e0f8b6149e80243aa833832aa4fc1f6.tar.bz2 libdbusmenu-042dd16d3e0f8b6149e80243aa833832aa4fc1f6.zip |
releasing version 0.2.8-0ubuntu2
Diffstat (limited to 'libdbusmenu-glib/menuitem.c')
-rw-r--r-- | libdbusmenu-glib/menuitem.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index 28d3134..fce8ed5 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -1203,3 +1203,32 @@ dbusmenu_menuitem_handle_event (DbusmenuMenuitem * mi, const gchar * name, const } return; } + +/** + dbusmenu_menuitem_send_about_to_show: + @mi: The #DbusmenuMenuitem to send the signal on. + @cb: Callback to call when the call has returned. + @cb_data: Data to pass to the callback. + + This function is used to send the even that the submenu + of this item is about to be shown. Callers to this event + should delay showing the menu until their callback is + called if possible. +*/ +void +dbusmenu_menuitem_send_about_to_show (DbusmenuMenuitem * mi, dbusmenu_menuitem_about_to_show_cb cb, gpointer cb_data) +{ + g_return_if_fail(DBUSMENU_IS_MENUITEM(mi)); + #ifdef MASSIVEDEBUGGING + g_debug("Submenu for menuitem %d (%s) is about to be shown", ID(mi), LABEL(mi)); + #endif + DbusmenuMenuitemClass * class = DBUSMENU_MENUITEM_GET_CLASS(mi); + + if (class->send_about_to_show != NULL) { + return class->send_about_to_show(mi, cb, cb_data); + } else if (cb != NULL) { + cb(mi, cb_data); + } + + return; +} |