emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r108020: * notifications.el (notifica


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108020: * notifications.el (notifications-interface)
Date: Tue, 24 Apr 2012 17:19:07 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 108020
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Tue 2012-04-24 17:19:07 +0200
message:
  * 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.
modified:
  doc/lispref/ChangeLog
  doc/lispref/os.texi
  lisp/ChangeLog
  lisp/notifications.el
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog     2012-04-20 16:27:52 +0000
+++ b/doc/lispref/ChangeLog     2012-04-24 15:19:07 +0000
@@ -1,3 +1,7 @@
+2012-04-24  Michael Albinus  <address@hidden>
+
+       * os.texi: (Notifications): Add notifications-get-capabilities.
+
 2012-04-20  Chong Yidong  <address@hidden>
 
        * processes.texi (Asynchronous Processes): Mention nil argument to

=== modified file 'doc/lispref/os.texi'
--- a/doc/lispref/os.texi       2012-04-14 01:59:01 +0000
+++ b/doc/lispref/os.texi       2012-04-24 15:19:07 +0000
@@ -2355,6 +2355,9 @@
 @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 @@
 This function closes a notification with identifier @var{id}.
 @end defun
 
address@hidden notifications-get-capabilities
+Returns the capabilities of the notification server, a list of strings.
+The following capabilities can be expected:
+
address@hidden @asis
address@hidden "actions"
+The server will provide the specified actions to the user.
+
address@hidden "body"
+Supports body text.
+
address@hidden "body-hyperlinks"
+The server supports hyperlinks in the notifications.
+
address@hidden "body-images"
+The server supports images in the notifications.
+
address@hidden "body-markup"
+Supports markup in the body text.
+
address@hidden "icon-multi"
+The server will render an animation of all the frames in a given image
+array.
+
address@hidden "icon-static"
+Supports display of exactly 1 frame of any given image array.  This
+value is mutually exclusive with "icon-multi".
+
address@hidden "sound"
+The server supports sounds on notifications.
address@hidden table
+
+Further vendor-specific caps start with "x-vendor", like "x-gnome-foo-cap".
address@hidden defun
+
+
 @node Dynamic Libraries
 @section Dynamically Loaded Libraries
 @cindex dynamic libraries

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-04-24 14:58:29 +0000
+++ b/lisp/ChangeLog    2012-04-24 15:19:07 +0000
@@ -1,3 +1,11 @@
+2012-04-24  Michael Albinus  <address@hidden>
+
+       * 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  <address@hidden>
 
        * progmodes/python.el: Move hideshow setup to the end.

=== modified file 'lisp/notifications.el'
--- a/lisp/notifications.el     2012-04-03 07:20:32 +0000
+++ b/lisp/notifications.el     2012-04-24 15:19:07 +0000
@@ -64,13 +64,16 @@
   "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 @@
                    - `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 @@
                     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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]