aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2012-04-24 17:19:07 +0200
committerMichael Albinus2012-04-24 17:19:07 +0200
commitb613912badfb9050e6310ee14fddc90e0fd16b2c (patch)
tree4272e3287e843d565c07b06acd7d1d53ffae8a41
parent257440aa1c368048203a111db15f5a791a07f53f (diff)
downloademacs-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/ChangeLog4
-rw-r--r--doc/lispref/os.texi39
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/notifications.el36
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 @@
12012-04-24 Michael Albinus <michael.albinus@gmx.de>
2
3 * os.texi: (Notifications): Add notifications-get-capabilities.
4
12012-04-20 Chong Yidong <cyd@gnu.org> 52012-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
2358Which parameters are accepted by the notification server can be
2359checked via @code{notifications-get-capabilities}.
2360
2358This function returns a notification id, an integer, which can be used 2361This function returns a notification id, an integer, which can be used
2359to manipulate the notification item with 2362to 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"
2395This function closes a notification with identifier @var{id}. 2398This function closes a notification with identifier @var{id}.
2396@end defun 2399@end defun
2397 2400
2401@defun notifications-get-capabilities
2402Returns the capabilities of the notification server, a list of strings.
2403The following capabilities can be expected:
2404
2405@table @asis
2406@item "actions"
2407The server will provide the specified actions to the user.
2408
2409@item "body"
2410Supports body text.
2411
2412@item "body-hyperlinks"
2413The server supports hyperlinks in the notifications.
2414
2415@item "body-images"
2416The server supports images in the notifications.
2417
2418@item "body-markup"
2419Supports markup in the body text.
2420
2421@item "icon-multi"
2422The server will render an animation of all the frames in a given image
2423array.
2424
2425@item "icon-static"
2426Supports display of exactly 1 frame of any given image array. This
2427value is mutually exclusive with "icon-multi".
2428
2429@item "sound"
2430The server supports sounds on notifications.
2431@end table
2432
2433Further 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 @@
12012-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
12012-04-24 Leo Liu <sdl.web@gmail.com> 92012-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
194Which parameters are accepted by the notification server can be
195checked via `notifications-get-capabilities'.
196
191This function returns a notification id, an integer, which can be 197This function returns a notification id, an integer, which can be
192used to manipulate the notification item with 198used 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.
333The 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
348Further 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)