Skip to content

Commit

Permalink
Add NOTIFICATION_NO_CLOSE_CALLBACK; use it instead of NULL.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgorny committed Aug 29, 2011
1 parent 04f2510 commit 0aa1a7b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/libtinynotify-sections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ NOTIFICATION_CLOSED_BY_USER
NotificationCloseCallback
NOTIFICATION_FREE_ON_CLOSE
NOTIFICATION_NOOP_ON_CLOSE
NOTIFICATION_NO_CLOSE_CALLBACK
notification_bind_close_callback
NotifyDispatchStatus
NOTIFY_DISPATCH_DONE
Expand Down
17 changes: 15 additions & 2 deletions lib/tinynotify.h
Original file line number Diff line number Diff line change
Expand Up @@ -664,14 +664,27 @@ extern const NotificationCloseCallback NOTIFICATION_NOOP_ON_CLOSE;
*/
extern const NotificationCloseCallback NOTIFICATION_FREE_ON_CLOSE;

/**
* NOTIFICATION_NO_CLOSE_CALLBACK
*
* A constant used to disable close callback.
*/
extern const NotificationCloseCallback NOTIFICATION_NO_CLOSE_CALLBACK;

/**
* notification_bind_close_callback
* @notification: notification to operate on
* @callback: new callback function, or %NULL to disable
* @callback: new callback function, or %NOTIFICATION_NO_CLOSE_CALLBACK
* to disable
* @user_data: additional user data to pass to the callback
*
* Bind a callback function which will be executed when notification is closed,
* or remove a current binding (when @callback is %NULL).
* or remove a current binding (when @callback is
* %NOTIFICATION_NO_CLOSE_CALLBACK).
*
* A few standard callbacks are provided as well:
* - %NOTIFICATION_NOOP_ON_CLOSE,
* - %NOTIFICATION_FREE_ON_CLOSE.
*/
void notification_bind_close_callback(Notification notification,
NotificationCloseCallback callback, void* user_data);
Expand Down

0 comments on commit 0aa1a7b

Please sign in to comment.