diff options
| author | Michael Albinus | 2012-04-24 17:19:07 +0200 |
|---|---|---|
| committer | Michael Albinus | 2012-04-24 17:19:07 +0200 |
| commit | b613912badfb9050e6310ee14fddc90e0fd16b2c (patch) | |
| tree | 4272e3287e843d565c07b06acd7d1d53ffae8a41 | |
| parent | 257440aa1c368048203a111db15f5a791a07f53f (diff) | |
| download | emacs-b613912badfb9050e6310ee14fddc90e0fd16b2c.tar.gz emacs-b613912badfb9050e6310ee14fddc90e0fd16b2c.zip | |
* notifications.el (notifications-interface)
(notifications-notify-method, notifications-notify)
(notifications-close-notification-method): Fix docstring.
(notifications-get-capabilities-method): New defconst.
(notifications-get-capabilities): New defun.
* os.texi: (Notifications): Add notifications-get-capabilities.
| -rw-r--r-- | doc/lispref/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/lispref/os.texi | 39 | ||||
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/notifications.el | 36 |
4 files changed, 84 insertions, 3 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index cc5660653f6..3bb2abd7cfe 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-04-24 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * os.texi: (Notifications): Add notifications-get-capabilities. | ||
| 4 | |||
| 1 | 2012-04-20 Chong Yidong <cyd@gnu.org> | 5 | 2012-04-20 Chong Yidong <cyd@gnu.org> |
| 2 | 6 | ||
| 3 | * processes.texi (Asynchronous Processes): Mention nil argument to | 7 | * processes.texi (Asynchronous Processes): Mention nil argument to |
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index aae2e4434d7..424cddaff0a 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -2355,6 +2355,9 @@ by the user. The function receive the notification @var{id} and the closing | |||
| 2355 | @end itemize | 2355 | @end itemize |
| 2356 | @end table | 2356 | @end table |
| 2357 | 2357 | ||
| 2358 | Which parameters are accepted by the notification server can be | ||
| 2359 | checked via @code{notifications-get-capabilities}. | ||
| 2360 | |||
| 2358 | This function returns a notification id, an integer, which can be used | 2361 | This function returns a notification id, an integer, which can be used |
| 2359 | to manipulate the notification item with | 2362 | to manipulate the notification item with |
| 2360 | @code{notifications-close-notification} or the @code{:replaces-id} | 2363 | @code{notifications-close-notification} or the @code{:replaces-id} |
| @@ -2395,6 +2398,42 @@ A message window opens on the desktop. Press "I agree" | |||
| 2395 | This function closes a notification with identifier @var{id}. | 2398 | This function closes a notification with identifier @var{id}. |
| 2396 | @end defun | 2399 | @end defun |
| 2397 | 2400 | ||
| 2401 | @defun notifications-get-capabilities | ||
| 2402 | Returns the capabilities of the notification server, a list of strings. | ||
| 2403 | The following capabilities can be expected: | ||
| 2404 | |||
| 2405 | @table @asis | ||
| 2406 | @item "actions" | ||
| 2407 | The server will provide the specified actions to the user. | ||
| 2408 | |||
| 2409 | @item "body" | ||
| 2410 | Supports body text. | ||
| 2411 | |||
| 2412 | @item "body-hyperlinks" | ||
| 2413 | The server supports hyperlinks in the notifications. | ||
| 2414 | |||
| 2415 | @item "body-images" | ||
| 2416 | The server supports images in the notifications. | ||
| 2417 | |||
| 2418 | @item "body-markup" | ||
| 2419 | Supports markup in the body text. | ||
| 2420 | |||
| 2421 | @item "icon-multi" | ||
| 2422 | The server will render an animation of all the frames in a given image | ||
| 2423 | array. | ||
| 2424 | |||
| 2425 | @item "icon-static" | ||
| 2426 | Supports display of exactly 1 frame of any given image array. This | ||
| 2427 | value is mutually exclusive with "icon-multi". | ||
| 2428 | |||
| 2429 | @item "sound" | ||
| 2430 | The server supports sounds on notifications. | ||
| 2431 | @end table | ||
| 2432 | |||
| 2433 | Further vendor-specific caps start with "x-vendor", like "x-gnome-foo-cap". | ||
| 2434 | @end defun | ||
| 2435 | |||
| 2436 | |||
| 2398 | @node Dynamic Libraries | 2437 | @node Dynamic Libraries |
| 2399 | @section Dynamically Loaded Libraries | 2438 | @section Dynamically Loaded Libraries |
| 2400 | @cindex dynamic libraries | 2439 | @cindex dynamic libraries |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b1f1ad99b23..269d72e3754 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2012-04-24 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * notifications.el (notifications-interface) | ||
| 4 | (notifications-notify-method, notifications-notify) | ||
| 5 | (notifications-close-notification-method): Fix docstring. | ||
| 6 | (notifications-get-capabilities-method): New defconst. | ||
| 7 | (notifications-get-capabilities): New defun. | ||
| 8 | |||
| 1 | 2012-04-24 Leo Liu <sdl.web@gmail.com> | 9 | 2012-04-24 Leo Liu <sdl.web@gmail.com> |
| 2 | 10 | ||
| 3 | * progmodes/python.el: Move hideshow setup to the end. | 11 | * progmodes/python.el: Move hideshow setup to the end. |
diff --git a/lisp/notifications.el b/lisp/notifications.el index b825eb65abf..9dad2a91b93 100644 --- a/lisp/notifications.el +++ b/lisp/notifications.el | |||
| @@ -64,13 +64,16 @@ | |||
| 64 | "D-Bus notifications service path.") | 64 | "D-Bus notifications service path.") |
| 65 | 65 | ||
| 66 | (defconst notifications-interface "org.freedesktop.Notifications" | 66 | (defconst notifications-interface "org.freedesktop.Notifications" |
| 67 | "D-Bus notifications service path.") | 67 | "D-Bus notifications service interface.") |
| 68 | 68 | ||
| 69 | (defconst notifications-notify-method "Notify" | 69 | (defconst notifications-notify-method "Notify" |
| 70 | "D-Bus notifications service path.") | 70 | "D-Bus notifications notify method.") |
| 71 | 71 | ||
| 72 | (defconst notifications-close-notification-method "CloseNotification" | 72 | (defconst notifications-close-notification-method "CloseNotification" |
| 73 | "D-Bus notifications service path.") | 73 | "D-Bus notifications close notification method.") |
| 74 | |||
| 75 | (defconst notifications-get-capabilities-method "GetCapabilities" | ||
| 76 | "D-Bus notifications get capabilities method.") | ||
| 74 | 77 | ||
| 75 | (defconst notifications-action-signal "ActionInvoked" | 78 | (defconst notifications-action-signal "ActionInvoked" |
| 76 | "D-Bus notifications action signal.") | 79 | "D-Bus notifications action signal.") |
| @@ -188,6 +191,9 @@ Various PARAMS can be set: | |||
| 188 | - `undefined' if the notification server hasn't provided | 191 | - `undefined' if the notification server hasn't provided |
| 189 | a reason | 192 | a reason |
| 190 | 193 | ||
| 194 | Which parameters are accepted by the notification server can be | ||
| 195 | checked via `notifications-get-capabilities'. | ||
| 196 | |||
| 191 | This function returns a notification id, an integer, which can be | 197 | This function returns a notification id, an integer, which can be |
| 192 | used to manipulate the notification item with | 198 | used to manipulate the notification item with |
| 193 | `notifications-close-notification' or the `:replaces-id' argument | 199 | `notifications-close-notification' or the `:replaces-id' argument |
| @@ -322,4 +328,28 @@ of another `notifications-notify' call." | |||
| 322 | notifications-close-notification-method | 328 | notifications-close-notification-method |
| 323 | :int32 id)) | 329 | :int32 id)) |
| 324 | 330 | ||
| 331 | (defun notifications-get-capabilities () | ||
| 332 | "Return the capabilities of the notification server, a list of strings. | ||
| 333 | The following capabilities can be expected: | ||
| 334 | |||
| 335 | \"actions\" The server will provide the specified actions | ||
| 336 | to the user. | ||
| 337 | \"body\" Supports body text. | ||
| 338 | \"body-hyperlinks\" The server supports hyperlinks in the notifications. | ||
| 339 | \"body-images\" The server supports images in the notifications. | ||
| 340 | \"body-markup\" Supports markup in the body text. | ||
| 341 | \"icon-multi\" The server will render an animation of all the | ||
| 342 | frames in a given image array. | ||
| 343 | \"icon-static\" Supports display of exactly 1 frame of any | ||
| 344 | given image array. This value is mutually exclusive | ||
| 345 | with \"icon-multi\". | ||
| 346 | \"sound\" The server supports sounds on notifications. | ||
| 347 | |||
| 348 | Further vendor-specific caps start with \"x-vendor\", like \"x-gnome-foo-cap\"." | ||
| 349 | (dbus-call-method :session | ||
| 350 | notifications-service | ||
| 351 | notifications-path | ||
| 352 | notifications-interface | ||
| 353 | notifications-get-capabilities-method)) | ||
| 354 | |||
| 325 | (provide 'notifications) | 355 | (provide 'notifications) |