diff options
| author | Michael Albinus | 2007-12-04 21:12:46 +0000 |
|---|---|---|
| committer | Michael Albinus | 2007-12-04 21:12:46 +0000 |
| commit | a4397af9ae03da8dbb3efe23fd9e5c146ec5b98b (patch) | |
| tree | d833a0709f902e8578a20dedbc1c08e28c349da4 | |
| parent | 35d5727ce99e800bb9b9766a79c147c69c922c1a (diff) | |
| download | emacs-a4397af9ae03da8dbb3efe23fd9e5c146ec5b98b.tar.gz emacs-a4397af9ae03da8dbb3efe23fd9e5c146ec5b98b.zip | |
* dbus.texi (Signals): Precise `dbus-register-signal'.
(Errors and Events): Rework events part, the internal structure of
dbus-event has changed.
| -rw-r--r-- | doc/misc/ChangeLog | 6 | ||||
| -rw-r--r-- | doc/misc/dbus.texi | 47 |
2 files changed, 36 insertions, 17 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index d31b84a8659..6bd7de9102c 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2007-12-04 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * dbus.texi (Signals): Precise `dbus-register-signal'. | ||
| 4 | (Errors and Events): Rework events part, the internal structure of | ||
| 5 | dbus-event has changed. | ||
| 6 | |||
| 1 | 2007-12-03 Juanma Barranquero <lekktu@gmail.com> | 7 | 2007-12-03 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 8 | ||
| 3 | * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, clean): Add dbus. | 9 | * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, clean): Add dbus. |
diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi index 9f7514ad10e..3e3e1584d21 100644 --- a/doc/misc/dbus.texi +++ b/doc/misc/dbus.texi | |||
| @@ -157,9 +157,8 @@ string. | |||
| 157 | 157 | ||
| 158 | @defun dbus-get-name-owner bus service | 158 | @defun dbus-get-name-owner bus service |
| 159 | For a given service, registered at D-Bus @var{bus} under the name | 159 | For a given service, registered at D-Bus @var{bus} under the name |
| 160 | @var{service}, the unique name of the name owner is returned. The | 160 | @var{service}, the unique name of the name owner is returned. The result is a |
| 161 | result is a string, or @code{nil} when there exist no name owner of | 161 | string, or @code{nil} when there exist no name owner of @var{service}. |
| 162 | @var{service}. | ||
| 163 | 162 | ||
| 164 | @var{bus} must be either the symbol @code{:system} or the symbol | 163 | @var{bus} must be either the symbol @code{:system} or the symbol |
| 165 | @code{:session}. @var{service} must be a known service name as | 164 | @code{:session}. @var{service} must be a known service name as |
| @@ -438,10 +437,21 @@ D-Bus @var{bus}. | |||
| 438 | @var{bus} is either the symbol @code{:system} or the symbol | 437 | @var{bus} is either the symbol @code{:system} or the symbol |
| 439 | @code{:session}. | 438 | @code{:session}. |
| 440 | 439 | ||
| 441 | @var{service} is the D-Bus service name of the object the signal is | 440 | @var{service} is the D-Bus service name used by the sending D-Bus |
| 442 | emitted from. @var{path} is the corresponding D-Bus object path, | 441 | object. It can be either a known name or the unique name of the D-Bus |
| 443 | @var{service} is registered at. @var{interface} is an interface | 442 | object sending the signal. In case of a unique name, signals won't be |
| 444 | offered by @var{service}. It must provide @var{signal}. | 443 | received any longer once the object owning this unique name has |
| 444 | disappeared, and a new queued object has replaced it. | ||
| 445 | |||
| 446 | When @var{service} is @code{nil}, related signals from all D-Bus | ||
| 447 | objects shall be accepted. | ||
| 448 | |||
| 449 | @var{path} is the corresponding D-Bus object path, @var{service} is | ||
| 450 | registered at. It can also be @code{nil} if the path name of incoming | ||
| 451 | signals shall not be checked. | ||
| 452 | |||
| 453 | @var{interface} is an interface offered by @var{service}. It must | ||
| 454 | provide @var{signal}. | ||
| 445 | 455 | ||
| 446 | @var{handler} is a Lisp function to be called when the @var{signal} is | 456 | @var{handler} is a Lisp function to be called when the @var{signal} is |
| 447 | received. It must accept as arguments the output parameters | 457 | received. It must accept as arguments the output parameters |
| @@ -452,11 +462,12 @@ received. It must accept as arguments the output parameters | |||
| 452 | (message "Device %s added" device)) | 462 | (message "Device %s added" device)) |
| 453 | 463 | ||
| 454 | (dbus-register-signal | 464 | (dbus-register-signal |
| 455 | :system "DeviceAdded" "org.freedesktop.Hal" | 465 | :system "DeviceAdded" |
| 466 | (dbus-get-name-owner :system "org.freedesktop.Hal") | ||
| 456 | "/org/freedesktop/Hal/Manager" "org.freedesktop.Hal.Manager" | 467 | "/org/freedesktop/Hal/Manager" "org.freedesktop.Hal.Manager" |
| 457 | 'my-dbus-signal-handler) | 468 | 'my-dbus-signal-handler) |
| 458 | 469 | ||
| 459 | @result{} :system.org.freedesktop.Hal.Manager.DeviceAdded | 470 | @result{} (:system "org.freedesktop.Hal.Manager" "DeviceAdded") |
| 460 | @end example | 471 | @end example |
| 461 | 472 | ||
| 462 | As we know from the inspection data of interface | 473 | As we know from the inspection data of interface |
| @@ -488,21 +499,23 @@ All errors raised by D-Bus are signaled with the error symbol | |||
| 488 | @code{condition-case} form. If possible, error messages from D-Bus | 499 | @code{condition-case} form. If possible, error messages from D-Bus |
| 489 | are appended to the @code{dbus-error}. | 500 | are appended to the @code{dbus-error}. |
| 490 | 501 | ||
| 491 | Incoming D-Bus messages are handled as Emacs event (see @pxref{Misc | 502 | Incoming D-Bus messages are handled as Emacs events (see @pxref{Misc |
| 492 | Events, , , elisp}). The generated event has this form: | 503 | Events, , , elisp}). The generated event has this form: |
| 493 | 504 | ||
| 494 | @example | 505 | @example |
| 495 | (dbus-event @var{symbol} @var{service} @var{path} &rest @var{args}) | 506 | (dbus-event @var{handler} @var{bus} @var{service} @var{path} @var{interface} @var{member} &rest @var{args}) |
| 496 | @end example | 507 | @end example |
| 497 | 508 | ||
| 498 | @var{symbol} is the interned Lisp symbol which has been generated | 509 | @var{handler} is the callback function which has been registered for |
| 499 | during signal registration (see @pxref{Signals}). Its function cell | 510 | this signal (see @pxref{Signals}). When a @code{dbus-event} event |
| 500 | is the argument @var{handler}, the callback function which was | 511 | arrives, @var{handler} is called with @var{args} as arguments. |
| 501 | provided by @code{dbus-register-signal}. When a @code{dbus-event} | 512 | |
| 502 | event arrives, @var{handler} is called with @var{args} as arguments. | 513 | @var{bus} identifies the D-Bus the signal is coming from. It is |
| 514 | either the symbol @code{:system} or the symbol @code{:session}. | ||
| 503 | 515 | ||
| 504 | @var{service} and @var{path} are the unique name and the object path | 516 | @var{service} and @var{path} are the unique name and the object path |
| 505 | of the D-Bus object emitting the signal. | 517 | of the D-Bus object emitting the signal. @var{interface} and |
| 518 | @var{member} denote the signal which has been sent. | ||
| 506 | 519 | ||
| 507 | In order to inspect the @code{dbus-event} data, you could extend the | 520 | In order to inspect the @code{dbus-event} data, you could extend the |
| 508 | definition of the callback function in @ref{Signals}: | 521 | definition of the callback function in @ref{Signals}: |