Add support for sending the closed reason in the signal handler. Closes ticket #139.

This commit is contained in:
Christian Hammond 2008-03-19 04:53:30 +00:00
parent a94bdff41a
commit 6b40617e90
6 changed files with 25 additions and 6 deletions

View File

@ -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:

2
NEWS
View File

@ -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

View File

@ -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));
}

View File

@ -63,7 +63,7 @@ struct _NotifyNotificationClass
GObjectClass parent_class;
/* Signals */
void (*closed)(NotifyNotification *notification);
void (*closed)(NotifyNotification *notification, gint reason);
};
/*

View File

@ -1 +1,2 @@
VOID:UINT,UINT
VOID:UINT,STRING

View File

@ -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);