aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-notifications.c
diff options
context:
space:
mode:
authorJason Conti <jason.conti@gmail.com>2011-05-16 14:14:36 -0400
committerJason Conti <jason.conti@gmail.com>2011-05-16 14:14:36 -0400
commit2fe93bc6c6c9d86277bc6b5f77135ed77e837fe4 (patch)
tree6d1a19f8c69f6bc2c97895fa17161ddb0a156283 /src/indicator-notifications.c
parentf055a17dbc1fcd39fc279ce60d65e62268ff30aa (diff)
downloadayatana-indicator-notifications-2fe93bc6c6c9d86277bc6b5f77135ed77e837fe4.tar.gz
ayatana-indicator-notifications-2fe93bc6c6c9d86277bc6b5f77135ed77e837fe4.tar.bz2
ayatana-indicator-notifications-2fe93bc6c6c9d86277bc6b5f77135ed77e837fe4.zip
Adding a new notification menuitem type. It isn't currently a custom menuitem, but may need to be eventually.
Diffstat (limited to 'src/indicator-notifications.c')
-rw-r--r--src/indicator-notifications.c17
1 files changed, 15 insertions, 2 deletions
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)
{