summaryrefslogtreecommitdiff
path: root/doc/misc/dbus.texi
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2007-12-07 04:42:00 +0000
committerMichael Albinus <michael.albinus@gmx.de>2007-12-07 04:42:00 +0000
commit0ce574ef771abdc3441ca9d50074ad9cb8b5efb7 (patch)
treea4c1ab96d1935ea2742f52c33cf108d331abb8da /doc/misc/dbus.texi
parent52da95fa969125d7fe867b48dda8d80f2cc95660 (diff)
downloademacs-0ce574ef771abdc3441ca9d50074ad9cb8b5efb7.tar.gz
* dbus.texi (Synchronous Methods): Adapt dbus-call-method.
(Signals): Adapt dbus-send-signal and dbus-register-signal. (Errors and Events): Adapt dbus-event.
Diffstat (limited to 'doc/misc/dbus.texi')
-rw-r--r--doc/misc/dbus.texi47
1 files changed, 25 insertions, 22 deletions
diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi
index 14ceea37d1d..b5c8ce3efb1 100644
--- a/doc/misc/dbus.texi
+++ b/doc/misc/dbus.texi
@@ -318,7 +318,7 @@ which carries the input parameters to the object owning the method to
be called, and a reply message returning the resulting output
parameters from the object.
-@defun dbus-call-method bus method service path interface &rest args
+@defun dbus-call-method bus service path interface method &rest args
This function calls @var{method} on the D-Bus @var{bus}. @var{bus} is
either the symbol @code{:system} or the symbol @code{:session}.
@@ -336,8 +336,8 @@ Lisp objects, according to the type conversion rules described in
@example
(dbus-call-method
- :session "GetKeyField" "org.gnome.seahorse"
- "/org/gnome/seahorse/keys/openpgp" "org.gnome.seahorse.Keys"
+ :session "org.gnome.seahorse" "/org/gnome/seahorse/keys/openpgp"
+ "org.gnome.seahorse.Keys" "GetKeyField"
"openpgp:657984B8C7A966DD" "simple-name")
@result{} (t ("Philip R. Zimmermann"))
@@ -349,8 +349,9 @@ object. Example:
@example
(dbus-call-method
- :system "GetPropertyString" "org.freedesktop.Hal"
- "/org/freedesktop/Hal/devices/computer" "org.freedesktop.Hal.Device"
+ :system "org.freedesktop.Hal"
+ "/org/freedesktop/Hal/devices/computer"
+ "org.freedesktop.Hal.Device" "GetPropertyString"
"system.kernel.machine")
@result{} "i686"
@@ -368,14 +369,14 @@ emulate the @code{lshal} command on GNU/Linux systems:
@example
(dolist (device
(dbus-call-method
- :system "GetAllDevices" "org.freedesktop.Hal"
+ :system "org.freedesktop.Hal"
"/org/freedesktop/Hal/Manager"
- "org.freedesktop.Hal.Manager"))
+ "org.freedesktop.Hal.Manager" "GetAllDevices"))
(message "\nudi = %s" device)
(dolist (properties
(dbus-call-method
- :system "GetAllProperties" "org.freedesktop.Hal"
- device "org.freedesktop.Hal.Device"))
+ :system "org.freedesktop.Hal" device
+ "org.freedesktop.Hal.Device" "GetAllProperties"))
(message " %s = %S"
(car properties) (or (caar (cdr properties)) ""))))
@@ -406,7 +407,7 @@ emulate the @code{lshal} command on GNU/Linux systems:
Signals are broadcast messages. They carry input parameters, which
are received by all objects which have registered for such a signal.
-@defun dbus-send-signal bus signal service path interface &rest args
+@defun dbus-send-signal bus service path interface signal &rest args
This function is similar to @code{dbus-call-method}. The difference
is, that there are no returning output parameters.
@@ -425,12 +426,12 @@ Conversion}. Example:
@example
(dbus-send-signal
- :session "FileModified" "org.gnu.Emacs" "/org/gnu/Emacs"
- "org.gnu.Emacs.FileManager" "/home/albinus/.emacs")
+ :session "org.gnu.Emacs" "/org/gnu/Emacs"
+ "org.gnu.Emacs.FileManager" "FileModified" "/home/albinus/.emacs")
@end example
@end defun
-@defun dbus-register-signal bus signal service path interface handler
+@defun dbus-register-signal bus service path interface signal handler
With this function, an application registers for @var{signal} on the
D-Bus @var{bus}.
@@ -461,13 +462,15 @@ received. It must accept as arguments the output parameters
(defun my-dbus-signal-handler (device)
(message "Device %s added" device))
+@result{} my-dbus-signal-handler
+
(dbus-register-signal
- :system "DeviceAdded"
- (dbus-get-name-owner :system "org.freedesktop.Hal")
- "/org/freedesktop/Hal/Manager" "org.freedesktop.Hal.Manager"
+ :system "org.freedesktop.Hal" "/org/freedesktop/Hal/Manager"
+ "org.freedesktop.Hal.Manager" "DeviceAdded"
'my-dbus-signal-handler)
-@result{} (:system "org.freedesktop.Hal.Manager" "DeviceAdded")
+@result{} (:system ":1.3" "/org/freedesktop/Hal/Manager"
+ "org.freedesktop.Hal.Manager" "DeviceAdded")
@end example
As we know from the inspection data of interface
@@ -503,13 +506,9 @@ Incoming D-Bus messages are handled as Emacs events (see @pxref{Misc
Events, , , elisp}). The generated event has this form:
@example
-(dbus-event @var{handler} @var{bus} @var{service} @var{path} @var{interface} @var{member} &rest @var{args})
+(dbus-event @var{bus} @var{service} @var{path} @var{interface} @var{member} @var{handler} &rest @var{args})
@end example
-@var{handler} is the callback function which has been registered for
-this signal (see @pxref{Signals}). When a @code{dbus-event} event
-arrives, @var{handler} is called with @var{args} as arguments.
-
@var{bus} identifies the D-Bus the signal is coming from. It is
either the symbol @code{:system} or the symbol @code{:session}.
@@ -517,6 +516,10 @@ either the symbol @code{:system} or the symbol @code{:session}.
of the D-Bus object emitting the signal. @var{interface} and
@var{member} denote the signal which has been sent.
+@var{handler} is the callback function which has been registered for
+this signal (see @pxref{Signals}). When a @code{dbus-event} event
+arrives, @var{handler} is called with @var{args} as arguments.
+
In order to inspect the @code{dbus-event} data, you could extend the
definition of the callback function in @ref{Signals}: