aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMichael Albinus2007-12-07 04:42:00 +0000
committerMichael Albinus2007-12-07 04:42:00 +0000
commit0ce574ef771abdc3441ca9d50074ad9cb8b5efb7 (patch)
treea4c1ab96d1935ea2742f52c33cf108d331abb8da /doc
parent52da95fa969125d7fe867b48dda8d80f2cc95660 (diff)
downloademacs-0ce574ef771abdc3441ca9d50074ad9cb8b5efb7.tar.gz
emacs-0ce574ef771abdc3441ca9d50074ad9cb8b5efb7.zip
* 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')
-rw-r--r--doc/misc/ChangeLog6
-rw-r--r--doc/misc/dbus.texi47
2 files changed, 31 insertions, 22 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 61fd28a0622..89e4974490d 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,9 @@
12007-12-07 Michael Albinus <michael.albinus@gmx.de>
2
3 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
4 (Signals): Adapt dbus-send-signal and dbus-register-signal.
5 (Errors and Events): Adapt dbus-event.
6
12007-12-03 Lars Magne Ingebrigtsen <larsi@gnus.org> 72007-12-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 8
3 * gnus.texi (Other Files): Add the yenc command. 9 * gnus.texi (Other Files): Add the yenc command.
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
318be called, and a reply message returning the resulting output 318be called, and a reply message returning the resulting output
319parameters from the object. 319parameters from the object.
320 320
321@defun dbus-call-method bus method service path interface &rest args 321@defun dbus-call-method bus service path interface method &rest args
322This function calls @var{method} on the D-Bus @var{bus}. @var{bus} is 322This function calls @var{method} on the D-Bus @var{bus}. @var{bus} is
323either the symbol @code{:system} or the symbol @code{:session}. 323either the symbol @code{:system} or the symbol @code{:session}.
324 324
@@ -336,8 +336,8 @@ Lisp objects, according to the type conversion rules described in
336 336
337@example 337@example
338(dbus-call-method 338(dbus-call-method
339 :session "GetKeyField" "org.gnome.seahorse" 339 :session "org.gnome.seahorse" "/org/gnome/seahorse/keys/openpgp"
340 "/org/gnome/seahorse/keys/openpgp" "org.gnome.seahorse.Keys" 340 "org.gnome.seahorse.Keys" "GetKeyField"
341 "openpgp:657984B8C7A966DD" "simple-name") 341 "openpgp:657984B8C7A966DD" "simple-name")
342 342
343@result{} (t ("Philip R. Zimmermann")) 343@result{} (t ("Philip R. Zimmermann"))
@@ -349,8 +349,9 @@ object. Example:
349 349
350@example 350@example
351(dbus-call-method 351(dbus-call-method
352 :system "GetPropertyString" "org.freedesktop.Hal" 352 :system "org.freedesktop.Hal"
353 "/org/freedesktop/Hal/devices/computer" "org.freedesktop.Hal.Device" 353 "/org/freedesktop/Hal/devices/computer"
354 "org.freedesktop.Hal.Device" "GetPropertyString"
354 "system.kernel.machine") 355 "system.kernel.machine")
355 356
356@result{} "i686" 357@result{} "i686"
@@ -368,14 +369,14 @@ emulate the @code{lshal} command on GNU/Linux systems:
368@example 369@example
369(dolist (device 370(dolist (device
370 (dbus-call-method 371 (dbus-call-method
371 :system "GetAllDevices" "org.freedesktop.Hal" 372 :system "org.freedesktop.Hal"
372 "/org/freedesktop/Hal/Manager" 373 "/org/freedesktop/Hal/Manager"
373 "org.freedesktop.Hal.Manager")) 374 "org.freedesktop.Hal.Manager" "GetAllDevices"))
374 (message "\nudi = %s" device) 375 (message "\nudi = %s" device)
375 (dolist (properties 376 (dolist (properties
376 (dbus-call-method 377 (dbus-call-method
377 :system "GetAllProperties" "org.freedesktop.Hal" 378 :system "org.freedesktop.Hal" device
378 device "org.freedesktop.Hal.Device")) 379 "org.freedesktop.Hal.Device" "GetAllProperties"))
379 (message " %s = %S" 380 (message " %s = %S"
380 (car properties) (or (caar (cdr properties)) "")))) 381 (car properties) (or (caar (cdr properties)) ""))))
381 382
@@ -406,7 +407,7 @@ emulate the @code{lshal} command on GNU/Linux systems:
406Signals are broadcast messages. They carry input parameters, which 407Signals are broadcast messages. They carry input parameters, which
407are received by all objects which have registered for such a signal. 408are received by all objects which have registered for such a signal.
408 409
409@defun dbus-send-signal bus signal service path interface &rest args 410@defun dbus-send-signal bus service path interface signal &rest args
410This function is similar to @code{dbus-call-method}. The difference 411This function is similar to @code{dbus-call-method}. The difference
411is, that there are no returning output parameters. 412is, that there are no returning output parameters.
412 413
@@ -425,12 +426,12 @@ Conversion}. Example:
425 426
426@example 427@example
427(dbus-send-signal 428(dbus-send-signal
428 :session "FileModified" "org.gnu.Emacs" "/org/gnu/Emacs" 429 :session "org.gnu.Emacs" "/org/gnu/Emacs"
429 "org.gnu.Emacs.FileManager" "/home/albinus/.emacs") 430 "org.gnu.Emacs.FileManager" "FileModified" "/home/albinus/.emacs")
430@end example 431@end example
431@end defun 432@end defun
432 433
433@defun dbus-register-signal bus signal service path interface handler 434@defun dbus-register-signal bus service path interface signal handler
434With this function, an application registers for @var{signal} on the 435With this function, an application registers for @var{signal} on the
435D-Bus @var{bus}. 436D-Bus @var{bus}.
436 437
@@ -461,13 +462,15 @@ received. It must accept as arguments the output parameters
461(defun my-dbus-signal-handler (device) 462(defun my-dbus-signal-handler (device)
462 (message "Device %s added" device)) 463 (message "Device %s added" device))
463 464
465@result{} my-dbus-signal-handler
466
464(dbus-register-signal 467(dbus-register-signal
465 :system "DeviceAdded" 468 :system "org.freedesktop.Hal" "/org/freedesktop/Hal/Manager"
466 (dbus-get-name-owner :system "org.freedesktop.Hal") 469 "org.freedesktop.Hal.Manager" "DeviceAdded"
467 "/org/freedesktop/Hal/Manager" "org.freedesktop.Hal.Manager"
468 'my-dbus-signal-handler) 470 'my-dbus-signal-handler)
469 471
470@result{} (:system "org.freedesktop.Hal.Manager" "DeviceAdded") 472@result{} (:system ":1.3" "/org/freedesktop/Hal/Manager"
473 "org.freedesktop.Hal.Manager" "DeviceAdded")
471@end example 474@end example
472 475
473As we know from the inspection data of interface 476As we know from the inspection data of interface
@@ -503,13 +506,9 @@ Incoming D-Bus messages are handled as Emacs events (see @pxref{Misc
503Events, , , elisp}). The generated event has this form: 506Events, , , elisp}). The generated event has this form:
504 507
505@example 508@example
506(dbus-event @var{handler} @var{bus} @var{service} @var{path} @var{interface} @var{member} &rest @var{args}) 509(dbus-event @var{bus} @var{service} @var{path} @var{interface} @var{member} @var{handler} &rest @var{args})
507@end example 510@end example
508 511
509@var{handler} is the callback function which has been registered for
510this signal (see @pxref{Signals}). When a @code{dbus-event} event
511arrives, @var{handler} is called with @var{args} as arguments.
512
513@var{bus} identifies the D-Bus the signal is coming from. It is 512@var{bus} identifies the D-Bus the signal is coming from. It is
514either the symbol @code{:system} or the symbol @code{:session}. 513either the symbol @code{:system} or the symbol @code{:session}.
515 514
@@ -517,6 +516,10 @@ either the symbol @code{:system} or the symbol @code{:session}.
517of the D-Bus object emitting the signal. @var{interface} and 516of the D-Bus object emitting the signal. @var{interface} and
518@var{member} denote the signal which has been sent. 517@var{member} denote the signal which has been sent.
519 518
519@var{handler} is the callback function which has been registered for
520this signal (see @pxref{Signals}). When a @code{dbus-event} event
521arrives, @var{handler} is called with @var{args} as arguments.
522
520In order to inspect the @code{dbus-event} data, you could extend the 523In order to inspect the @code{dbus-event} data, you could extend the
521definition of the callback function in @ref{Signals}: 524definition of the callback function in @ref{Signals}:
522 525