summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hammond <chipx86@chipx86.com>2008-03-19 04:53:30 +0000
committerChristian Hammond <chipx86@chipx86.com>2008-03-19 04:53:30 +0000
commit6b40617e90db011a3afef437b812b1cf098b77c8 (patch)
treea83d60928c4d22d7d4a9978f0e3bcd03f8a2685e
parenta94bdff41a7ea524ddb0ee31a791668f3495cc3b (diff)
downloadlibnotify-6b40617e90db011a3afef437b812b1cf098b77c8.tar.gz
Add support for sending the closed reason in the signal handler. Closes ticket #139.
-rw-r--r--ChangeLog10
-rw-r--r--NEWS2
-rw-r--r--libnotify/notification.c8
-rw-r--r--libnotify/notification.h2
-rw-r--r--libnotify/notify-marshal.list1
-rw-r--r--libnotify/notify.c8
6 files changed, 25 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 017b361..74be523 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Tue Mar 18 21:51:32 PDT 2008 Christian Hammond <chipx86@chipx86.com>
+
+ * libnotify/notification.c:
+ * libnotify/notification.h:
+ * libnotify/notify.c:
+ * libnotify/notify-marshal.list:
+ * NEWS:
+ - Add support for sending the closed reason in the signal handler.
+ Closes ticket #139.
+
Sat Aug 25 18:08:01 PDT 2007 Christian Hammond <chipx86@chipx86.com>
* tools/notify-send.c:
diff --git a/NEWS b/NEWS
index fd923da..01731e9 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
version 0.4.5:
* Added GObject property accessors for notification IDs. Patch by Lucas
Rocha.
+ * Added support for sending the closed reason in the "closed" signal
+ handler. (Ticket #139)
version 0.4.4 (27-February-2007):
* Fixed a bug where a notification's ID could be reset when a different
diff --git a/libnotify/notification.c b/libnotify/notification.c
index ae358d1..0f8260e 100644
--- a/libnotify/notification.c
+++ b/libnotify/notification.c
@@ -46,7 +46,7 @@
static void notify_notification_class_init(NotifyNotificationClass *klass);
static void notify_notification_init(NotifyNotification *sp);
static void notify_notification_finalize(GObject *object);
-static void _close_signal_handler(DBusGProxy *proxy, guint32 id,
+static void _close_signal_handler(DBusGProxy *proxy, guint32 id, guint32 reason,
NotifyNotification *notification);
static void _action_signal_handler(DBusGProxy *proxy, guint32 id,
@@ -155,7 +155,7 @@ notify_notification_class_init(NotifyNotificationClass *klass)
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET(NotifyNotificationClass, closed),
NULL, NULL,
- g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+ g_cclosure_marshal_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_INT);
g_object_class_install_property(object_class, PROP_ID,
g_param_spec_int("id", "ID",
@@ -691,13 +691,13 @@ notify_notification_set_geometry_hints(NotifyNotification *notification,
}
static void
-_close_signal_handler(DBusGProxy *proxy, guint32 id,
+_close_signal_handler(DBusGProxy *proxy, guint32 id, guint32 reason,
NotifyNotification *notification)
{
if (id == notification->priv->id)
{
g_object_ref(G_OBJECT(notification));
- g_signal_emit(notification, signals[SIGNAL_CLOSED], 0);
+ g_signal_emit(notification, signals[SIGNAL_CLOSED], 0, reason);
notification->priv->id = 0;
g_object_unref(G_OBJECT(notification));
}
diff --git a/libnotify/notification.h b/libnotify/notification.h
index c57d2af..c05e7dc 100644
--- a/libnotify/notification.h
+++ b/libnotify/notification.h
@@ -63,7 +63,7 @@ struct _NotifyNotificationClass
GObjectClass parent_class;
/* Signals */
- void (*closed)(NotifyNotification *notification);
+ void (*closed)(NotifyNotification *notification, gint reason);
};
/*
diff --git a/libnotify/notify-marshal.list b/libnotify/notify-marshal.list
index 5ab45bf..b02ebf7 100644
--- a/libnotify/notify-marshal.list
+++ b/libnotify/notify-marshal.list
@@ -1 +1,2 @@
+VOID:UINT,UINT
VOID:UINT,STRING
diff --git a/libnotify/notify.c b/libnotify/notify.c
index 8aa0499..c0c7b21 100644
--- a/libnotify/notify.c
+++ b/libnotify/notify.c
@@ -72,13 +72,19 @@ notify_init(const char *app_name)
NOTIFY_DBUS_CORE_INTERFACE);
dbus_g_connection_unref(bus);
+ dbus_g_object_register_marshaller(notify_marshal_VOID__UINT_UINT,
+ G_TYPE_NONE,
+ G_TYPE_UINT,
+ G_TYPE_UINT, G_TYPE_INVALID);
+
dbus_g_object_register_marshaller(notify_marshal_VOID__UINT_STRING,
G_TYPE_NONE,
G_TYPE_UINT,
G_TYPE_STRING, G_TYPE_INVALID);
dbus_g_proxy_add_signal(_proxy, "NotificationClosed",
- G_TYPE_UINT, G_TYPE_INVALID);
+ G_TYPE_UINT, G_TYPE_UINT,
+ G_TYPE_INVALID);
dbus_g_proxy_add_signal(_proxy, "ActionInvoked",
G_TYPE_UINT, G_TYPE_STRING,
G_TYPE_INVALID);