From 2fe93bc6c6c9d86277bc6b5f77135ed77e837fe4 Mon Sep 17 00:00:00 2001 From: Jason Conti Date: Mon, 16 May 2011 14:14:36 -0400 Subject: Adding a new notification menuitem type. It isn't currently a custom menuitem, but may need to be eventually. --- src/indicator-notifications.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/indicator-notifications.c') diff --git a/src/indicator-notifications.c b/src/indicator-notifications.c index 01bddb7..f66f4c6 100644 --- a/src/indicator-notifications.c +++ b/src/indicator-notifications.c @@ -96,8 +96,9 @@ static void indicator_notifications_finalize(GObject *object); static GtkImage *get_image(IndicatorObject *io); static GtkMenu *get_menu(IndicatorObject *io); static const gchar *get_accessible_desc(IndicatorObject *io); -static GdkPixbuf *load_icon(const gchar *, guint); -static void menu_visible_notify_cb(GtkWidget *, GParamSpec *, gpointer); +static GdkPixbuf *load_icon(const gchar *name, guint size) +static void menu_visible_notify_cb(GtkWidget *menu, G_GNUC_UNUSED GParamSpec *pspec, gpointer user_data) +static boolean new_notification_menuitem(DbusmenuMenuitem *new_item, DbusmenuMenuitem *parent, DbusmenuClient *client, gpointer user_data); static void receive_signal(GDBusProxy *proxy, gchar *sender_name, gchar *signal_name, GVariant *parameters, gpointer user_data); static void service_proxy_cb(GObject *object, GAsyncResult *res, gpointer user_data); @@ -162,6 +163,10 @@ indicator_notifications_init(IndicatorNotifications *self) g_signal_connect(self->priv->menu, "notify::visible", G_CALLBACK(menu_visible_notify_cb), self); + DbusmenuGtkClient *client = dbusmenu_gtkmenu_get_client(self->priv->menu); + + dbusmenu_client_add_type_handler_full(DBUSMENU_CLIENT(client), DBUSMENU_NOTIFICATION_MENUITEM_TYPE, new_notification_menuitem, self, NULL); + self->priv->service_proxy_cancel = g_cancellable_new(); g_dbus_proxy_new_for_bus(G_BUS_TYPE_SESSION, @@ -277,6 +282,14 @@ receive_signal(GDBusProxy *proxy, gchar *sender_name, gchar *signal_name, return; } +static boolean +new_notification_menuitem(DbusmenuMenuitem *new_item, DbusmenuMenuitem *parent, + DbusmenuClient *client, gpointer user_data) +{ + g_debug("New notification item"); + return TRUE; +} + static GdkPixbuf * load_icon(const gchar *name, guint size) { -- cgit v1.2.3