Mercurial > emacs
comparison doc/misc/dbus.texi @ 96646:5e58654e97ff
* dbus.texi (Receiving Method Calls): Fix description of
`dbus-register-method'.
(Signals): Allow also signal arguments for filtering in
`dbus-register-signal'.
author | Michael Albinus <michael.albinus@gmx.de> |
---|---|
date | Sun, 13 Jul 2008 15:12:43 +0000 |
parents | 6f0fce2c3559 |
children | de3f169b53eb |
comparison
equal
deleted
inserted
replaced
96645:45b707df336e | 96646:5e58654e97ff |
---|---|
548 The default D-Bus timeout when waiting for a message reply is 25 | 548 The default D-Bus timeout when waiting for a message reply is 25 |
549 seconds. This value could be even smaller, depending on the calling | 549 seconds. This value could be even smaller, depending on the calling |
550 client. Therefore, @var{handler} shall not last longer than | 550 client. Therefore, @var{handler} shall not last longer than |
551 absolutely necessary. | 551 absolutely necessary. |
552 | 552 |
553 @code{dbus-register-method} returns a Lisp symbol, which can be used | 553 @code{dbus-register-method} returns a Lisp object, which can be used |
554 as argument in @code{dbus-unregister-object} for removing the | 554 as argument in @code{dbus-unregister-object} for removing the |
555 registration for @var{method}. Example: | 555 registration for @var{method}. Example: |
556 | 556 |
557 @lisp | 557 @lisp |
558 (defun my-dbus-method-handler (filename) | 558 (defun my-dbus-method-handler (filename) |
621 :session "org.gnu.Emacs" "/org/gnu/Emacs" | 621 :session "org.gnu.Emacs" "/org/gnu/Emacs" |
622 "org.gnu.Emacs.FileManager" "FileModified" "/home/albinus/.emacs") | 622 "org.gnu.Emacs.FileManager" "FileModified" "/home/albinus/.emacs") |
623 @end lisp | 623 @end lisp |
624 @end defun | 624 @end defun |
625 | 625 |
626 @defun dbus-register-signal bus service path interface signal handler | 626 @defun dbus-register-signal bus service path interface signal handler &rest args |
627 With this function, an application registers for @var{signal} on the | 627 With this function, an application registers for @var{signal} on the |
628 D-Bus @var{bus}. | 628 D-Bus @var{bus}. |
629 | 629 |
630 @var{bus} is either the symbol @code{:system} or the symbol | 630 @var{bus} is either the symbol @code{:system} or the symbol |
631 @code{:session}. | 631 @code{:session}. |
646 @var{interface} is an interface offered by @var{service}. It must | 646 @var{interface} is an interface offered by @var{service}. It must |
647 provide @var{signal}. | 647 provide @var{signal}. |
648 | 648 |
649 @var{handler} is a Lisp function to be called when the @var{signal} is | 649 @var{handler} is a Lisp function to be called when the @var{signal} is |
650 received. It must accept as arguments the output parameters | 650 received. It must accept as arguments the output parameters |
651 @var{signal} is sending. Example: | 651 @var{signal} is sending. |
652 | |
653 All other arguments @var{args}, if specified, must be strings. They | |
654 stand for the respective arguments of @var{signal} in their order, and | |
655 are used for filtering as well. A @code{nil} argument might be used | |
656 to preserve the order. | |
657 | |
658 @code{dbus-register-signal} returns a Lisp object, which can be used | |
659 as argument in @code{dbus-unregister-object} for removing the | |
660 registration for @var{signal}. Example: | |
652 | 661 |
653 @lisp | 662 @lisp |
654 (defun my-dbus-signal-handler (device) | 663 (defun my-dbus-signal-handler (device) |
655 (message "Device %s added" device)) | 664 (message "Device %s added" device)) |
656 | 665 |
671 provides one single parameter, which is mapped into a Lisp string. | 680 provides one single parameter, which is mapped into a Lisp string. |
672 The callback function @code{my-dbus-signal-handler} must define one | 681 The callback function @code{my-dbus-signal-handler} must define one |
673 single string argument therefore. Plugging an USB device to your | 682 single string argument therefore. Plugging an USB device to your |
674 machine, when registered for signal @code{DeviceAdded}, will show you | 683 machine, when registered for signal @code{DeviceAdded}, will show you |
675 which objects the GNU/Linux @code{hal} daemon adds. | 684 which objects the GNU/Linux @code{hal} daemon adds. |
676 | |
677 @code{dbus-register-signal} returns a Lisp symbol, which can be used | |
678 as argument in @code{dbus-unregister-object} for removing the | |
679 registration for @var{signal}. | |
680 @end defun | 685 @end defun |
681 | 686 |
682 @defun dbus-unregister-object object | 687 @defun dbus-unregister-object object |
683 Unregister @var{object} from the the D-Bus. @var{object} must be the | 688 Unregister @var{object} from the the D-Bus. @var{object} must be the |
684 result of a preceding @code{dbus-register-signal} or | 689 result of a preceding @code{dbus-register-signal} or |