]> git.eshelyaron.com Git - emacs.git/commitdiff
* notifications.el (notifications-interface)
authorMichael Albinus <michael.albinus@gmx.de>
Tue, 24 Apr 2012 15:19:07 +0000 (17:19 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Tue, 24 Apr 2012 15:19:07 +0000 (17:19 +0200)
(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.

doc/lispref/ChangeLog
doc/lispref/os.texi
lisp/ChangeLog
lisp/notifications.el

index cc5660653f6767e7948f6e10968ccd55e0e4d77e..3bb2abd7cfe7cf42ff8dac1b47c87c05546ea63b 100644 (file)
@@ -1,3 +1,7 @@
+2012-04-24  Michael Albinus  <michael.albinus@gmx.de>
+
+       * os.texi: (Notifications): Add notifications-get-capabilities.
+
 2012-04-20  Chong Yidong  <cyd@gnu.org>
 
        * processes.texi (Asynchronous Processes): Mention nil argument to
index aae2e4434d72be7539bd065495c8fc162e997773..424cddaff0a41dff9f5a51be2eaebd0d6b0186ae 100644 (file)
@@ -2355,6 +2355,9 @@ by the user.  The function receive the notification @var{id} and the closing
 @end itemize
 @end table
 
+Which parameters are accepted by the notification server can be
+checked via @code{notifications-get-capabilities}.
+
 This function returns a notification id, an integer, which can be used
 to manipulate the notification item with
 @code{notifications-close-notification} or the @code{:replaces-id}
@@ -2395,6 +2398,42 @@ A message window opens on the desktop.  Press "I agree"
 This function closes a notification with identifier @var{id}.
 @end defun
 
+@defun notifications-get-capabilities
+Returns the capabilities of the notification server, a list of strings.
+The following capabilities can be expected:
+
+@table @asis
+@item "actions"
+The server will provide the specified actions to the user.
+
+@item "body"
+Supports body text.
+
+@item "body-hyperlinks"
+The server supports hyperlinks in the notifications.
+
+@item "body-images"
+The server supports images in the notifications.
+
+@item "body-markup"
+Supports markup in the body text.
+
+@item "icon-multi"
+The server will render an animation of all the frames in a given image
+array.
+
+@item "icon-static"
+Supports display of exactly 1 frame of any given image array.  This
+value is mutually exclusive with "icon-multi".
+
+@item "sound"
+The server supports sounds on notifications.
+@end table
+
+Further vendor-specific caps start with "x-vendor", like "x-gnome-foo-cap".
+@end defun
+
+
 @node Dynamic Libraries
 @section Dynamically Loaded Libraries
 @cindex dynamic libraries
index b1f1ad99b233cfa4e855c292d1f86691c383a03b..269d72e37547539d05afc2f9d117b57b5668b2d4 100644 (file)
@@ -1,3 +1,11 @@
+2012-04-24  Michael Albinus  <michael.albinus@gmx.de>
+
+       * 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.
+
 2012-04-24  Leo Liu  <sdl.web@gmail.com>
 
        * progmodes/python.el: Move hideshow setup to the end.
index b825eb65abfbdbda752f445bbc6226196130712a..9dad2a91b93147b35b5bef99a5e4f927137c3f52 100644 (file)
   "D-Bus notifications service path.")
 
 (defconst notifications-interface "org.freedesktop.Notifications"
-  "D-Bus notifications service path.")
+  "D-Bus notifications service interface.")
 
 (defconst notifications-notify-method "Notify"
-  "D-Bus notifications service path.")
+  "D-Bus notifications notify method.")
 
 (defconst notifications-close-notification-method "CloseNotification"
-  "D-Bus notifications service path.")
+  "D-Bus notifications close notification method.")
+
+(defconst notifications-get-capabilities-method "GetCapabilities"
+  "D-Bus notifications get capabilities method.")
 
 (defconst notifications-action-signal "ActionInvoked"
   "D-Bus notifications action signal.")
@@ -188,6 +191,9 @@ Various PARAMS can be set:
                    - `undefined' if the notification server hasn't provided
                      a reason
 
+Which parameters are accepted by the notification server can be
+checked via `notifications-get-capabilities'.
+
 This function returns a notification id, an integer, which can be
 used to manipulate the notification item with
 `notifications-close-notification' or the `:replaces-id' argument
@@ -322,4 +328,28 @@ of another `notifications-notify' call."
                     notifications-close-notification-method
                     :int32 id))
 
+(defun notifications-get-capabilities ()
+  "Return the capabilities of the notification server, a list of strings.
+The following capabilities can be expected:
+
+  \"actions\"         The server will provide the specified actions
+                    to the user.
+  \"body\"            Supports body text.
+  \"body-hyperlinks\" The server supports hyperlinks in the notifications.
+  \"body-images\"     The server supports images in the notifications.
+  \"body-markup\"     Supports markup in the body text.
+  \"icon-multi\"      The server will render an animation of all the
+                    frames in a given image array.
+  \"icon-static\"     Supports display of exactly 1 frame of any
+                    given image array.  This value is mutually exclusive
+                    with \"icon-multi\".
+  \"sound\"           The server supports sounds on notifications.
+
+Further vendor-specific caps start with \"x-vendor\", like \"x-gnome-foo-cap\"."
+  (dbus-call-method :session
+                    notifications-service
+                    notifications-path
+                    notifications-interface
+                    notifications-get-capabilities-method))
+
 (provide 'notifications)