aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib/server.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-04-01 09:09:51 -0500
committerTed Gould <ted@gould.cx>2010-04-01 09:09:51 -0500
commit187a33539569163ee953903010169356b8d57beb (patch)
treebef8679b4997713c15ac3ce8ef84f7571020d1e8 /libdbusmenu-glib/server.c
parent63a5d2daa865aa68b4ea152a92373e3c187e13af (diff)
parent122de5e9d523e6327b44609b634a6e30d48370da (diff)
downloadlibdbusmenu-187a33539569163ee953903010169356b8d57beb.tar.gz
libdbusmenu-187a33539569163ee953903010169356b8d57beb.tar.bz2
libdbusmenu-187a33539569163ee953903010169356b8d57beb.zip
Import upstream version 0.2.9
Diffstat (limited to 'libdbusmenu-glib/server.c')
-rw-r--r--libdbusmenu-glib/server.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c
index f6dddf1..d87c024 100644
--- a/libdbusmenu-glib/server.c
+++ b/libdbusmenu-glib/server.c
@@ -41,6 +41,7 @@ static gboolean _dbusmenu_server_get_properties (DbusmenuServer * server, gint i
static gboolean _dbusmenu_server_get_group_properties (DbusmenuServer * server, GArray * ids, GArray * properties, GHashTable ** values, GError ** error);
static gboolean _dbusmenu_server_event (DbusmenuServer * server, gint id, gchar * eventid, GValue * data, guint timestamp, GError ** error);
static gboolean _dbusmenu_server_get_children (DbusmenuServer * server, gint id, GPtrArray * properties, GPtrArray ** output, GError ** error);
+static gboolean _dbusmenu_server_about_to_show (DbusmenuServer * server, gint id, gboolean * need_update, GError ** error);
#include "dbusmenu-server.h"
@@ -578,6 +579,29 @@ _dbusmenu_server_event (DbusmenuServer * server, gint id, gchar * eventid, GValu
return TRUE;
}
+/* Recieve the About To Show function. Pass it to our menu item. */
+static gboolean
+_dbusmenu_server_about_to_show (DbusmenuServer * server, gint id, gboolean * need_update, GError ** error)
+{
+ DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server);
+ DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id);
+
+ if (mi == NULL) {
+ if (error != NULL) {
+ g_set_error(error,
+ error_quark(),
+ INVALID_MENUITEM_ID,
+ "The ID supplied %d does not refer to a menu item we have",
+ id);
+ }
+ return FALSE;
+ }
+
+ /* GTK+ does not support about-to-show concept for now */
+ *need_update = FALSE;
+ return TRUE;
+}
+
/* Public Interface */
/**
dbusmenu_server_new: