annotate doc/misc/dbus.texi @ 112409:0222e3f822e3

Add ERT manual to Info dir file.
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 21 Jan 2011 23:01:40 -0500
parents ef719132ddfa
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1 \input texinfo @c -*-texinfo-*-
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
2 @setfilename ../../info/dbus
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
3 @c %**start of header
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
4 @settitle Using of D-Bus
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
5 @c @setchapternewpage odd
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
6 @c %**end of header
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
7
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
8 @syncodeindex vr cp
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
9 @syncodeindex fn cp
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
10
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
11 @copying
112114
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
12 Copyright @copyright{} 2007, 2008, 2009, 2010,
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
13 2011 Free Software Foundation, Inc.
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
14
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
15 @quotation
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
16 Permission is granted to copy, distribute and/or modify this document
99709
6de181810d0f Relicense all texi files under FDL 1.3 or later.
Glenn Morris <rgm@gnu.org>
parents: 97253
diff changeset
17 under the terms of the GNU Free Documentation License, Version 1.3 or
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
18 any later version published by the Free Software Foundation; with no
95937
6f0fce2c3559 Remove references to external license, since doclicense is included.
Glenn Morris <rgm@gnu.org>
parents: 95874
diff changeset
19 Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
6f0fce2c3559 Remove references to external license, since doclicense is included.
Glenn Morris <rgm@gnu.org>
parents: 95874
diff changeset
20 and with the Back-Cover Texts as in (a) below. A copy of the license
6f0fce2c3559 Remove references to external license, since doclicense is included.
Glenn Morris <rgm@gnu.org>
parents: 95874
diff changeset
21 is included in the section entitled ``GNU Free Documentation License''.
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
22
95874
eafbd7a5c9be Update Back-Cover Text as per maintain.info.
Glenn Morris <rgm@gnu.org>
parents: 93422
diff changeset
23 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
eafbd7a5c9be Update Back-Cover Text as per maintain.info.
Glenn Morris <rgm@gnu.org>
parents: 93422
diff changeset
24 modify this GNU manual. Buying copies from the FSF supports it in
eafbd7a5c9be Update Back-Cover Text as per maintain.info.
Glenn Morris <rgm@gnu.org>
parents: 93422
diff changeset
25 developing GNU and promoting software freedom.''
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
26 @end quotation
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
27 @end copying
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
28
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
29 @dircategory Emacs
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
30 @direntry
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
31 * D-Bus: (dbus). Using D-Bus in Emacs.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
32 @end direntry
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
33
102059
9bcea07061a8 consistently use @insertcopying, @direntry, @contents
Karl Berry <karl@gnu.org>
parents: 101617
diff changeset
34 @contents
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
35
106052
5434fb0a77d8 * dbus.texi (Receiving Method Calls): New defun
Michael Albinus <michael.albinus@gmx.de>
parents: 105991
diff changeset
36
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
37 @node Top, Overview, (dir), (dir)
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
38 @top D-Bus integration in Emacs
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
39
104607
560601220dae * dbus.texi (Top): Remove footnote saying D-Bus is not enabled by
Michael Albinus <michael.albinus@gmx.de>
parents: 104590
diff changeset
40 This manual documents an API for usage of D-Bus in Emacs. D-Bus is a
560601220dae * dbus.texi (Top): Remove footnote saying D-Bus is not enabled by
Michael Albinus <michael.albinus@gmx.de>
parents: 104590
diff changeset
41 message bus system, a simple way for applications to talk to one
560601220dae * dbus.texi (Top): Remove footnote saying D-Bus is not enabled by
Michael Albinus <michael.albinus@gmx.de>
parents: 104590
diff changeset
42 another. An overview of D-Bus can be found at
560601220dae * dbus.texi (Top): Remove footnote saying D-Bus is not enabled by
Michael Albinus <michael.albinus@gmx.de>
parents: 104590
diff changeset
43 @uref{http://dbus.freedesktop.org/}.
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
44
102059
9bcea07061a8 consistently use @insertcopying, @direntry, @contents
Karl Berry <karl@gnu.org>
parents: 101617
diff changeset
45 @ifnottex
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
46 @insertcopying
102059
9bcea07061a8 consistently use @insertcopying, @direntry, @contents
Karl Berry <karl@gnu.org>
parents: 101617
diff changeset
47 @end ifnottex
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
48
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
49 @menu
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
50 * Overview:: An overview of D-Bus.
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
51 * Inspection:: Inspection of D-Bus services.
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
52 * Type Conversion:: Mapping Lisp types and D-Bus types.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
53 * Synchronous Methods:: Calling methods in a blocking way.
97163
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
54 * Asynchronous Methods:: Calling methods non-blocking.
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
55 * Receiving Method Calls:: Offering own methods.
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
56 * Signals:: Sending and receiving signals.
109963
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
57 * Alternative Buses:: Alternative buses.
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
58 * Errors and Events:: Errors and events.
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
59 * Index:: Index including concepts, functions, variables.
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
60
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
61 * GNU Free Documentation License:: The license for this documentation.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
62 @end menu
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
63
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
64
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
65 @node Overview
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
66 @chapter An overview of D-Bus
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
67 @cindex overview
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
68
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
69 D-Bus is an inter-process communication mechanism for applications
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
70 residing on the same host. The communication is based on
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
71 @dfn{messages}. Data in the messages is carried in a structured way,
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
72 it is not just a byte stream.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
73
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
74 The communication is connection oriented to two kinds of message
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
75 buses: a so called @dfn{system bus}, and a @dfn{session bus}. On a
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
76 given machine, there is always one single system bus for miscellaneous
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
77 system-wide communication, like changing of hardware configuration.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
78 On the other hand, the session bus is always related to a single
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
79 user's session.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
80
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
81 Every client application, which is connected to a bus, registers under
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
82 a @dfn{unique name} at the bus. This name is used for identifying the
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
83 client application. Such a unique name starts always with a colon,
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
84 and looks like @samp{:1.42}.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
85
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
86 Additionally, a client application can register itself to a so called
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
87 @dfn{known name}, which is a series of identifiers separated by dots,
86972
acea77e0ee56 (Overview): Minor cleanup.
Richard M. Stallman <rms@gnu.org>
parents: 86944
diff changeset
88 as in @samp{org.gnu.Emacs}. If several applications register to the
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
89 same known name, these registrations are queued, and only the first
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
90 application which has registered for the known name is reachable via
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
91 this name. If this application disconnects from the bus, the next
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
92 queued unique name becomes the owner of this known name.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
93
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
94 An application can install one or several objects under its name.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
95 Such objects are identified by an @dfn{object path}, which looks
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
96 similar to paths in a filesystem. An example of such an object path
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
97 could be @samp{/org/gnu/Emacs/}.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
98
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
99 Applications might send a request to an object, that means sending a
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
100 message with some data as input parameters, and receiving a message
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
101 from that object with the result of this message, the output
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
102 parameters. Such a request is called @dfn{method} in D-Bus.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
103
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
104 The other form of communication are @dfn{signals}. The underlying
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
105 message is emitted from an object and will be received by all other
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
106 applications which have registered for such a signal.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
107
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
108 All methods and signals an object supports are called @dfn{interface}
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
109 of the object. Interfaces are specified under a hierarchical name in
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
110 D-Bus; an object can support several interfaces. Such an interface
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
111 name could be @samp{org.gnu.Emacs.TextEditor} or
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
112 @samp{org.gnu.Emacs.FileManager}.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
113
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
114
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
115 @node Inspection
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
116 @chapter Inspection of D-Bus services.
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
117 @cindex inspection
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
118
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
119 @menu
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
120 * Bus names:: Discovering D-Bus names.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
121 * Introspection:: Knowing the details of D-Bus services.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
122 * Nodes and Interfaces:: Detecting object paths and interfaces.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
123 * Methods and Signal:: Applying the functionality.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
124 * Properties and Annotations:: What else to know about interfaces.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
125 * Arguments and Signatures:: The final details.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
126 @end menu
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
127
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
128
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
129 @node Bus names
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
130 @section Bus names.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
131
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
132 There are several basic functions which inspect the buses for
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
133 registered names. Internally they use the basic interface
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
134 @samp{org.freedesktop.DBus}, which is supported by all objects of a bus.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
135
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
136 @defun dbus-list-activatable-names
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
137 This function returns the D-Bus service names, which can be activated.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
138 An activatable service is described in a service registration file.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
139 Under GNU/Linux, such files are located at
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
140 @file{/usr/share/dbus-1/services/}.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
141
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
142 The result is a list of strings, which is @code{nil} when there are no
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
143 activatable service names at all.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
144 @end defun
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
145
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
146 @defun dbus-list-names bus
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
147 All service names, which are registered at D-Bus @var{bus}, are
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
148 returned. The result is a list of strings, which is @code{nil} when
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
149 there are no registered service names at all. Well known names are
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
150 strings like @samp{org.freedesktop.DBus}. Names starting with
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
151 @samp{:} are unique names for services.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
152
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
153 @var{bus} must be either the symbol @code{:system} or the symbol
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
154 @code{:session}.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
155 @end defun
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
156
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
157 @defun dbus-list-known-names bus
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
158 Retrieves all services which correspond to a known name in @var{bus}.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
159 A service has a known name if it doesn't start with @samp{:}. The
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
160 result is a list of strings, which is @code{nil} when there are no
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
161 known names at all.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
162
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
163 @var{bus} must be either the symbol @code{:system} or the symbol
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
164 @code{:session}.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
165 @end defun
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
166
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
167 @defun dbus-list-queued-owners bus service
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
168 For a given service, registered at D-Bus @var{bus} under the name
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
169 @var{service}, all queued unique names are returned. The result is a
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
170 list of strings, or @code{nil} when there are no queued names for
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
171 @var{service} at all.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
172
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
173 @var{bus} must be either the symbol @code{:system} or the symbol
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
174 @code{:session}. @var{service} must be a known service name as
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
175 string.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
176 @end defun
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
177
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
178 @defun dbus-get-name-owner bus service
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
179 For a given service, registered at D-Bus @var{bus} under the name
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
180 @var{service}, the unique name of the name owner is returned. The
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
181 result is a string, or @code{nil} when there exist no name owner of
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
182 @var{service}.
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
183
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
184 @var{bus} must be either the symbol @code{:system} or the symbol
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
185 @code{:session}. @var{service} must be a known service name as
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
186 string.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
187 @end defun
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
188
104590
8e031ee168ec * dbus.texi (Bus names): Add optional parameter TIMEOUT to dbus-ping.
Michael Albinus <michael.albinus@gmx.de>
parents: 104307
diff changeset
189 @defun dbus-ping bus service &optional timeout
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
190 Check whether the service name @var{service} is registered at D-Bus
104590
8e031ee168ec * dbus.texi (Bus names): Add optional parameter TIMEOUT to dbus-ping.
Michael Albinus <michael.albinus@gmx.de>
parents: 104307
diff changeset
191 @var{bus}. @var{service} might not have been started yet, it is
8e031ee168ec * dbus.texi (Bus names): Add optional parameter TIMEOUT to dbus-ping.
Michael Albinus <michael.albinus@gmx.de>
parents: 104307
diff changeset
192 autostarted if possible. The result is either @code{t} or @code{nil}.
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
193
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
194 @var{bus} must be either the symbol @code{:system} or the symbol
104590
8e031ee168ec * dbus.texi (Bus names): Add optional parameter TIMEOUT to dbus-ping.
Michael Albinus <michael.albinus@gmx.de>
parents: 104307
diff changeset
195 @code{:session}. @var{service} must be a string. @var{timeout}, a
8e031ee168ec * dbus.texi (Bus names): Add optional parameter TIMEOUT to dbus-ping.
Michael Albinus <michael.albinus@gmx.de>
parents: 104307
diff changeset
196 nonnegative integer, specifies the maximum number of milliseconds
8e031ee168ec * dbus.texi (Bus names): Add optional parameter TIMEOUT to dbus-ping.
Michael Albinus <michael.albinus@gmx.de>
parents: 104307
diff changeset
197 @code{dbus-ping} must return. The default value is 25,000. Example:
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
198
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
199 @lisp
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
200 (message
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
201 "%s screensaver on board."
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
202 (cond
104590
8e031ee168ec * dbus.texi (Bus names): Add optional parameter TIMEOUT to dbus-ping.
Michael Albinus <michael.albinus@gmx.de>
parents: 104307
diff changeset
203 ((dbus-ping :session "org.gnome.ScreenSaver" 100) "Gnome")
8e031ee168ec * dbus.texi (Bus names): Add optional parameter TIMEOUT to dbus-ping.
Michael Albinus <michael.albinus@gmx.de>
parents: 104307
diff changeset
204 ((dbus-ping :session "org.freedesktop.ScreenSaver" 100) "KDE")
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
205 (t "No")))
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
206 @end lisp
104590
8e031ee168ec * dbus.texi (Bus names): Add optional parameter TIMEOUT to dbus-ping.
Michael Albinus <michael.albinus@gmx.de>
parents: 104307
diff changeset
207
8e031ee168ec * dbus.texi (Bus names): Add optional parameter TIMEOUT to dbus-ping.
Michael Albinus <michael.albinus@gmx.de>
parents: 104307
diff changeset
208 If it shall be checked whether @var{service} is already running
8e031ee168ec * dbus.texi (Bus names): Add optional parameter TIMEOUT to dbus-ping.
Michael Albinus <michael.albinus@gmx.de>
parents: 104307
diff changeset
209 without autostarting it, one shall apply
8e031ee168ec * dbus.texi (Bus names): Add optional parameter TIMEOUT to dbus-ping.
Michael Albinus <michael.albinus@gmx.de>
parents: 104307
diff changeset
210
8e031ee168ec * dbus.texi (Bus names): Add optional parameter TIMEOUT to dbus-ping.
Michael Albinus <michael.albinus@gmx.de>
parents: 104307
diff changeset
211 @lisp
8e031ee168ec * dbus.texi (Bus names): Add optional parameter TIMEOUT to dbus-ping.
Michael Albinus <michael.albinus@gmx.de>
parents: 104307
diff changeset
212 (member service (dbus-list-known-names bus))
8e031ee168ec * dbus.texi (Bus names): Add optional parameter TIMEOUT to dbus-ping.
Michael Albinus <michael.albinus@gmx.de>
parents: 104307
diff changeset
213 @end lisp
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
214 @end defun
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
215
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
216 @defun dbus-get-unique-name bus
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
217 The unique name, under which Emacs is registered at D-Bus @var{bus},
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
218 is returned as string.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
219
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
220 @var{bus} must be either the symbol @code{:system} or the symbol
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
221 @code{:session}.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
222 @end defun
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
223
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
224
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
225 @node Introspection
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
226 @section Knowing the details of D-Bus services.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
227
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
228 D-Bus services publish their interfaces. This can be retrieved and
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
229 analyzed during runtime, in order to understand the used
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
230 implementation.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
231
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
232 The resulting introspection data are in XML format. The root
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
233 introspection element is always a @code{node} element. It might have
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
234 a @code{name} attribute, which denotes the (absolute) object path an
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
235 interface is introspected.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
236
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
237 The root @code{node} element may have @code{node} and @code{interface}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
238 children. A child @code{node} element must have a @code{name}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
239 attribute, this case it is the relative object path to the root
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
240 @code{node} element.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
241
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
242 An @code{interface} element has just one attribute, @code{name}, which
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
243 is the full name of that interface. The default interface
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
244 @samp{org.freedesktop.DBus.Introspectable} is always present. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
245
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
246 @example
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
247 <node name="/org/bluez">
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
248 <interface name="org.freedesktop.DBus.Introspectable">
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
249 @dots{}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
250 </interface>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
251 <interface name="org.bluez.Manager">
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
252 @dots{}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
253 </interface>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
254 <interface name="org.bluez.Database">
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
255 @dots{}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
256 </interface>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
257 <interface name="org.bluez.Security">
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
258 @dots{}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
259 </interface>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
260 <node name="service_audio"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
261 <node name="service_input"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
262 <node name="service_network"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
263 <node name="service_serial"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
264 </node>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
265 @end example
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
266
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
267 Children of an @code{interface} element can be @code{method},
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
268 @code{signal} and @code{property} elements. A @code{method} element
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
269 stands for a D-Bus method of the surrounding interface. The element
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
270 itself has a @code{name} attribute, showing the method name. Children
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
271 elements @code{arg} stand for the arguments of a method. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
272
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
273 @example
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
274 <method name="ResolveHostName">
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
275 <arg name="interface" type="i" direction="in"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
276 <arg name="protocol" type="i" direction="in"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
277 <arg name="name" type="s" direction="in"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
278 <arg name="aprotocol" type="i" direction="in"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
279 <arg name="flags" type="u" direction="in"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
280 <arg name="interface" type="i" direction="out"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
281 <arg name="protocol" type="i" direction="out"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
282 <arg name="name" type="s" direction="out"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
283 <arg name="aprotocol" type="i" direction="out"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
284 <arg name="address" type="s" direction="out"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
285 <arg name="flags" type="u" direction="out"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
286 </method>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
287 @end example
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
288
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
289 @code{arg} elements can have the attributes @code{name}, @code{type}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
290 and @code{direction}. The @code{name} attribute is optional. The
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
291 @code{type} attribute stands for the @dfn{signature} of the argument
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
292 in D-Bus. For a discussion of D-Bus types and their Lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
293 representation see @ref{Type Conversion}.@footnote{D-Bus signatures
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
294 are explained in the D-Bus specification
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
295 @uref{http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures}.}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
296 The @code{direction} attribute of an @code{arg} element can be only
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
297 @samp{in} or @samp{out}; in case it is omitted, it defaults to
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
298 @samp{in}.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
299
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
300 A @code{signal} element of an @code{interface} has a similar
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
301 structure. The @code{direction} attribute of an @code{arg} child
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
302 element can be only @samp{out} here; which is also the default value.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
303 Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
304
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
305 @example
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
306 <signal name="StateChanged">
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
307 <arg name="state" type="i"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
308 <arg name="error" type="s"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
309 </signal>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
310 @end example
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
311
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
312 A @code{property} element has no @code{arg} child
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
313 element. It just has the attributes @code{name}, @code{type} and
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
314 @code{access}, which are all mandatory. The @code{access} attribute
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
315 allows the values @samp{readwrite}, @samp{read}, and @samp{write}.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
316 Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
317
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
318 @example
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
319 <property name="Status" type="u" direction="read"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
320 @end example
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
321
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
322 @code{annotation} elements can be children of @code{interface},
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
323 @code{method}, @code{signal}, and @code{property} elements. Unlike
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
324 properties, which can change their values during lifetime of a D-Bus
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
325 object, annotations are static. Often they are used for code
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
326 generators of D-Bus langugae bindings. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
327
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
328 @example
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
329 <annotation name="de.berlios.Pinot.GetStatistics" value="pinotDBus"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
330 @end example
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
331
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
332 Annotations have just @code{name} and @code{value} attributes, both
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
333 must be strings.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
334
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
335 @defun dbus-introspect bus service path
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
336 This function returns all interfaces and sub-nodes of @var{service},
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
337 registered at object path @var{path} at bus @var{bus}.
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
338
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
339 @var{bus} must be either the symbol @code{:system} or the symbol
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
340 @code{:session}. @var{service} must be a known service name, and
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
341 @var{path} must be a valid object path. The last two parameters are
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
342 strings. The result, the introspection data, is a string in XML
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
343 format. Example:
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
344
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
345 @lisp
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
346 (dbus-introspect
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
347 :system "org.freedesktop.Hal"
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
348 "/org/freedesktop/Hal/devices/computer")
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
349
86944
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
350 @result{} "<!DOCTYPE node PUBLIC
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
351 "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
352 "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
86944
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
353 <node>
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
354 <interface name="org.freedesktop.Hal.Device">
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
355 <method name="GetAllProperties">
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
356 <arg name="properties" direction="out" type="a@{sv@}"/>
86944
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
357 </method>
87491
dd7c58c2342a * dbus.texi (all): Replace "..." by @dots{}.
Michael Albinus <michael.albinus@gmx.de>
parents: 87365
diff changeset
358 @dots{}
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
359 <signal name="PropertyModified">
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
360 <arg name="num_updates" type="i"/>
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
361 <arg name="updates" type="a(sbb)"/>
86944
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
362 </signal>
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
363 </interface>
87491
dd7c58c2342a * dbus.texi (all): Replace "..." by @dots{}.
Michael Albinus <michael.albinus@gmx.de>
parents: 87365
diff changeset
364 @dots{}
86944
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
365 </node>"
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
366 @end lisp
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
367
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
368 This example informs us, that the service @samp{org.freedesktop.Hal}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
369 at object path @samp{/org/freedesktop/Hal/devices/computer} offers the
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
370 interface @samp{org.freedesktop.Hal.Device} (and 2 other interfaces
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
371 not documented here). This interface contains the method
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
372 @samp{GetAllProperties}, which needs no input parameters, but returns
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
373 as output parameter an array of dictionary entries (key-value pairs).
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
374 Every dictionary entry has a string as key, and a variant as value.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
375
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
376 The interface offers also a signal, which returns 2 parameters: an
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
377 integer, and an array consisting of elements which are a struct of a
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
378 string and 2 boolean values.@footnote{ The interfaces of the service
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
379 @samp{org.freedesktop.Hal} are described at
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
380 @uref{http://people.freedesktop.org/~david/hal-spec/hal-spec.html#interfaces}.}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
381 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
382
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
383 @defun dbus-introspect-xml bus service path
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
384 This function has the same intention as function
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
385 @code{dbus-introspect}. The returned value is a parsed XML tree,
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
386 which can be used for further analysis. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
387
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
388 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
389 (dbus-introspect-xml
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
390 :session "org.freedesktop.xesam.searcher"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
391 "/org/freedesktop/xesam/searcher/main")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
392
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
393 @result{} (node ((name . "/org/freedesktop/xesam/searcher/main"))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
394 (interface ((name . "org.freedesktop.xesam.Search"))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
395 (method ((name . "GetHitData"))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
396 (arg ((name . "search") (type . "s") (direction . "in")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
397 (arg ((name . "hit_ids") (type . "au") (direction . "in")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
398 (arg ((name . "fields") (type . "as") (direction . "in")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
399 (arg ((name . "hit_data") (type . "aav") (direction . "out")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
400 )
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
401 @dots{}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
402 (signal ((name . "HitsAdded"))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
403 (arg ((name . "search") (type . "s")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
404 (arg ((name . "count") (type . "u")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
405 )
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
406 )
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
407 @dots{}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
408 )
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
409 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
410 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
411
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
412 @defun dbus-introspect-get-attribute object attribute
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
413 It returns the @var{attribute} value of a D-Bus introspection
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
414 @var{object}. @var{object} can be every subtree of a parsed XML tree
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
415 as retrieved with @code{dbus-introspect-xml}. @var{attribute} must be
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
416 a string according to the attribute names in the D-Bus specification.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
417 Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
418
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
419 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
420 (dbus-introspect-get-attribute
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
421 (dbus-introspect-xml :system "org.freedesktop.SystemToolsBackends"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
422 "/org/freedesktop/SystemToolsBackends/UsersConfig")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
423 "name")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
424
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
425 @result{} "/org/freedesktop/SystemToolsBackends/UsersConfig"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
426 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
427
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
428 If @var{object} has no @var{attribute}, the function returns
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
429 @code{nil}.
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
430 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
431
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
432
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
433 @node Nodes and Interfaces
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
434 @section Detecting object paths and interfaces.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
435
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
436 The first elements, to be introspected for a D-Bus object, are further
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
437 object paths and interfaces.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
438
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
439 @defun dbus-introspect-get-node-names bus service path
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
440 All node names of @var{service} in D-Bus @var{bus} at object path
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
441 @var{path} are returned as list of strings. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
442
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
443 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
444 (dbus-introspect-get-node-names
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
445 :session "org.gnome.seahorse" "/org/gnome/seahorse")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
446
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
447 @result{} ("crypto" "keys")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
448 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
449
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
450 The node names stand for further object paths of the D-Bus
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
451 @var{service}, relative to @var{path}. In the example,
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
452 @samp{/org/gnome/seahorse/crypto} and @samp{/org/gnome/seahorse/keys}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
453 are also object paths of the D-Bus service @samp{org.gnome.seahorse}.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
454 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
455
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
456 @defun dbus-introspect-get-all-nodes bus service path
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
457 This function returns all node names of @var{service} in D-Bus
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
458 @var{bus} at object path @var{path}. It returns a list of strings
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
459 with all object paths of @var{service}, starting at @var{path}.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
460 Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
461
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
462 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
463 (dbus-introspect-get-all-nodes :session "org.gnome.seahorse" "/")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
464
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
465 @result{} ("/" "/org" "/org/gnome" "/org/gnome/seahorse"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
466 "/org/gnome/seahorse/crypto"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
467 "/org/gnome/seahorse/keys"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
468 "/org/gnome/seahorse/keys/openpgp"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
469 "/org/gnome/seahorse/keys/openpgp/local"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
470 "/org/gnome/seahorse/keys/openssh"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
471 "/org/gnome/seahorse/keys/openssh/local")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
472 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
473 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
474
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
475 @defun dbus-introspect-get-interface-names bus service path
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
476 There will be returned a list strings of all interface names of
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
477 @var{service} in D-Bus @var{bus} at object path @var{path}. This list
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
478 will contain the default interface @samp{org.freedesktop.DBus.Introspectable}.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
479
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
480 Another default interface is @samp{org.freedesktop.DBus.Properties}.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
481 If present, @code{interface} elements can also have @code{property}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
482 children. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
483
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
484 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
485 (dbus-introspect-get-interface-names
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
486 :system "org.freedesktop.Hal"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
487 "/org/freedesktop/Hal/devices/computer")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
488
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
489 @result{} ("org.freedesktop.DBus.Introspectable"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
490 "org.freedesktop.Hal.Device"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
491 "org.freedesktop.Hal.Device.SystemPowerManagement"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
492 "org.freedesktop.Hal.Device.CPUFreq")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
493 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
494 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
495
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
496 @defun dbus-introspect-get-interface bus service path interface
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
497 Return @var{interface} of @var{service} in D-Bus @var{bus} at object
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
498 path @var{path}. The return value is an XML element. @var{interface}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
499 must be a string, element of the list returned by
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
500 @code{dbus-introspect-get-interface-names}. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
501
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
502 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
503 (dbus-introspect-get-interface
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
504 :session "org.freedesktop.xesam.searcher"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
505 "/org/freedesktop/xesam/searcher/main"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
506 "org.freedesktop.xesam.Search")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
507
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
508 @result{} (interface ((name . "org.freedesktop.xesam.Search"))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
509 (method ((name . "GetHitData"))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
510 (arg ((name . "search") (type . "s") (direction . "in")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
511 (arg ((name . "hit_ids") (type . "au") (direction . "in")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
512 (arg ((name . "fields") (type . "as") (direction . "in")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
513 (arg ((name . "hit_data") (type . "aav") (direction . "out")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
514 )
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
515 @dots{}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
516 (signal ((name . "HitsAdded"))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
517 (arg ((name . "search") (type . "s")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
518 (arg ((name . "count") (type . "u")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
519 )
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
520 )
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
521 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
522 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
523
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
524 @noindent
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
525 With these functions, it is possible to retrieve all introspection
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
526 data from a running system:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
527
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
528 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
529 (with-current-buffer (switch-to-buffer "*introspect*")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
530 (erase-buffer)
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
531 (dolist (service (dbus-list-known-names :session))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
532 (dolist (path (dbus-introspect-get-all-nodes :session service "/"))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
533 ;; We want to introspect only elements, which have more than
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
534 ;; the default interface "org.freedesktop.DBus.Introspectable".
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
535 (when (delete
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
536 "org.freedesktop.DBus.Introspectable"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
537 (dbus-introspect-get-interface-names :session service path))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
538 (insert (message "\nservice: \"%s\" path: \"%s\"\n" service path)
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
539 (dbus-introspect :session service path))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
540 (redisplay t)))))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
541 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
542
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
543
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
544 @node Methods and Signal
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
545 @section Applying the functionality.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
546
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
547 Methods and signals are the communicatione means to D-Bus. The
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
548 following functions return their specifications.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
549
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
550 @defun dbus-introspect-get-method-names bus service path interface
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
551 Return a list of strings of all method names of @var{interface} of
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
552 @var{service} in D-Bus @var{bus} at object path @var{path}. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
553
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
554 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
555 (dbus-introspect-get-method-names
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
556 :session "org.freedesktop.xesam.searcher"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
557 "/org/freedesktop/xesam/searcher/main"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
558 "org.freedesktop.xesam.Search")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
559
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
560 @result{} ("GetState" "StartSearch" "GetHitCount" "GetHits" "NewSession"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
561 "CloseSession" "GetHitData" "SetProperty" "NewSearch"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
562 "GetProperty" "CloseSearch")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
563 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
564 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
565
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
566 @defun dbus-introspect-get-method bus service path interface method
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
567 This function returns @var{method} of @var{interface} as XML element.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
568 It must be located at @var{service} in D-Bus @var{bus} at object path
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
569 @var{path}. @var{method} must be a string, element of the list
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
570 returned by @code{dbus-introspect-get-method-names}. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
571
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
572 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
573 (dbus-introspect-get-method
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
574 :session "org.freedesktop.xesam.searcher"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
575 "/org/freedesktop/xesam/searcher/main"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
576 "org.freedesktop.xesam.Search" "GetHitData")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
577
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
578 @result{} (method ((name . "GetHitData"))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
579 (arg ((name . "search") (type . "s") (direction . "in")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
580 (arg ((name . "hit_ids") (type . "au") (direction . "in")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
581 (arg ((name . "fields") (type . "as") (direction . "in")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
582 (arg ((name . "hit_data") (type . "aav") (direction . "out")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
583 )
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
584 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
585 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
586
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
587 @defun dbus-introspect-get-signal-names bus service path interface
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
588 Return a list of strings of all signal names of @var{interface} of
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
589 @var{service} in D-Bus @var{bus} at object path @var{path}. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
590
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
591 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
592 (dbus-introspect-get-signal-names
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
593 :session "org.freedesktop.xesam.searcher"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
594 "/org/freedesktop/xesam/searcher/main"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
595 "org.freedesktop.xesam.Search")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
596
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
597 @result{} ("StateChanged" "SearchDone" "HitsModified"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
598 "HitsRemoved" "HitsAdded")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
599 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
600 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
601
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
602 @defun dbus-introspect-get-signal bus service path interface signal
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
603 This function returns @var{signal} of @var{interface} as XML element.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
604 It must be located at @var{service} in D-Bus @var{bus} at object path
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
605 @var{path}. @var{signal} must be a string, element of the list
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
606 returned by @code{dbus-introspect-get-signal-names}. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
607
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
608 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
609 (dbus-introspect-get-signal
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
610 :session "org.freedesktop.xesam.searcher"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
611 "/org/freedesktop/xesam/searcher/main"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
612 "org.freedesktop.xesam.Search" "HitsAdded")
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
613
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
614 @result{} (signal ((name . "HitsAdded"))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
615 (arg ((name . "search") (type . "s")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
616 (arg ((name . "count") (type . "u")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
617 )
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
618 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
619 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
620
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
621
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
622 @node Properties and Annotations
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
623 @section What else to know about interfaces.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
624
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
625 Interfaces can have properties. These can be exposed via the
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
626 @samp{org.freedesktop.DBus.Properties} interface@footnote{See
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
627 @uref{http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties}}.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
628 That is, properties can be retrieved and changed during lifetime of an
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
629 element.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
630
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
631 Annotations, on the other hand, are static values for an element.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
632 Often, they are used to instruct generators, how to generate code from
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
633 the interface for a given language binding.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
634
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
635 @defun dbus-introspect-get-property-names bus service path interface
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
636 Return a list of strings with all property names of @var{interface} of
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
637 @var{service} in D-Bus @var{bus} at object path @var{path}. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
638
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
639 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
640 (dbus-introspect-get-property-names
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
641 :session "org.kde.kded" "/modules/networkstatus"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
642 "org.kde.Solid.Networking.Client")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
643
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
644 @result{} ("Status")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
645 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
646
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
647 If an interface declares properties, the corresponding element supports
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
648 also the @samp{org.freedesktop.DBus.Properties} interface.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
649 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
650
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
651 @defun dbus-introspect-get-property bus service path interface property
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
652 This function returns @var{property} of @var{interface} as XML element.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
653 It must be located at @var{service} in D-Bus @var{bus} at object path
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
654 @var{path}. @var{property} must be a string, element of the list
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
655 returned by @code{dbus-introspect-get-property-names}.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
656
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
657 A @var{property} value can be retrieved by the function
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
658 @code{dbus-introspect-get-attribute}. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
659
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
660 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
661 (dbus-introspect-get-property
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
662 :session "org.kde.kded" "/modules/networkstatus"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
663 "org.kde.Solid.Networking.Client" "Status")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
664
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
665 @result{} (property ((access . "read") (type . "u") (name . "Status")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
666
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
667 (dbus-introspect-get-attribute
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
668 (dbus-introspect-get-property
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
669 :session "org.kde.kded" "/modules/networkstatus"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
670 "org.kde.Solid.Networking.Client" "Status")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
671 "access")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
672
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
673 @result{} "read"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
674 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
675 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
676
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
677 @defun dbus-get-property bus service path interface property
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
678 This function returns the value of @var{property} of @var{interface}.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
679 It will be checked at @var{bus}, @var{service}, @var{path}. The
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
680 result can be any valid D-Bus value, or @code{nil} if there is no
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
681 @var{property}. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
682
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
683 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
684 (dbus-get-property
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
685 :session "org.kde.kded" "/modules/networkstatus"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
686 "org.kde.Solid.Networking.Client" "Status")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
687
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
688 @result{} 4
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
689 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
690 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
691
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
692 @defun dbus-set-property bus service path interface property value
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
693 Set value of @var{property} of @var{interface} to @var{value}. It
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
694 will be checked at @var{bus}, @var{service}, @var{path}. When the
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
695 value has been set successful, the result is @var{value}. Otherwise,
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
696 @code{nil} is returned. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
697
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
698 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
699 (dbus-set-property
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
700 :session "org.kde.kaccess" "/MainApplication"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
701 "com.trolltech.Qt.QApplication" "doubleClickInterval" 500)
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
702
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
703 @result{} 500
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
704 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
705 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
706
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
707 @defun dbus-get-all-properties bus service path interface
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
708 This function returns all properties of @var{interface}. It will be
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
709 checked at @var{bus}, @var{service}, @var{path}. The result is a list
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
710 of cons. Every cons contains the name of the property, and its value.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
711 If there are no properties, @code{nil} is returned. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
712
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
713 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
714 (dbus-get-all-properties
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
715 :session "org.kde.kaccess" "/MainApplication"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
716 "com.trolltech.Qt.QApplication")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
717
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
718 @result{} (("cursorFlashTime" . 1000) ("doubleClickInterval" . 500)
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
719 ("keyboardInputInterval" . 400) ("wheelScrollLines" . 3)
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
720 ("globalStrut" 0 0) ("startDragTime" . 500)
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
721 ("startDragDistance" . 4) ("quitOnLastWindowClosed" . t)
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
722 ("styleSheet" . ""))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
723 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
724 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
725
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
726 @defun dbus-introspect-get-annotation-names bus service path interface &optional name
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
727 Return a list of all annotation names as list of strings. If
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
728 @var{name} is @code{nil}, the annotations are children of
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
729 @var{interface}, otherwise @var{name} must be a @code{method},
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
730 @code{signal}, or @code{property} XML element, where the annotations
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
731 belong to. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
732
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
733 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
734 (dbus-introspect-get-annotation-names
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
735 :session "de.berlios.Pinot" "/de/berlios/Pinot"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
736 "de.berlios.Pinot" "GetStatistics")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
737
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
738 @result{} ("de.berlios.Pinot.GetStatistics")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
739 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
740
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
741 Default annotation names@footnote{See
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
742 @uref{http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format}}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
743 are
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
744
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
745 @table @samp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
746 @item org.freedesktop.DBus.Deprecated
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
747 Whether or not the entity is deprecated; defaults to @code{nil}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
748
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
749 @item org.freedesktop.DBus.GLib.CSymbol
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
750 The C symbol; may be used for @code{methods} and @code{interfaces}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
751
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
752 @item org.freedesktop.DBus.Method.NoReply
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
753 If set, don't expect a reply to the @code{method} call; defaults to @code{nil}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
754 @end table
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
755 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
756
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
757 @defun dbus-introspect-get-annotation bus service path interface name annotation
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
758 Return annotation @var{ANNOTATION} as XML object. If @var{name} is
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
759 @code{nil}, @var{ANNOTATION} is a child of @var{interface}, otherwise
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
760 @var{name} must be the name of a @code{method}, @code{signal}, or
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
761 @code{property} XML element, where the @var{ANNOTATION} belongs to.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
762
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
763 An attribute value can be retrieved by
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
764 @code{dbus-introspect-get-attribute}. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
765
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
766 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
767 (dbus-introspect-get-annotation
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
768 :session "de.berlios.Pinot" "/de/berlios/Pinot"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
769 "de.berlios.Pinot" "GetStatistics"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
770 "de.berlios.Pinot.GetStatistics")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
771
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
772 @result{} (annotation ((name . "de.berlios.Pinot.GetStatistics")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
773 (value . "pinotDBus")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
774
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
775 (dbus-introspect-get-attribute
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
776 (dbus-introspect-get-annotation
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
777 :session "de.berlios.Pinot" "/de/berlios/Pinot"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
778 "de.berlios.Pinot" "GetStatistics"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
779 "de.berlios.Pinot.GetStatistics")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
780 "value")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
781
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
782 @result{} "pinotDBus"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
783 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
784 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
785
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
786
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
787 @node Arguments and Signatures
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
788 @section The final details.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
789
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
790 Methods and signals have arguments. They are described in the
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
791 @code{arg} XML elements.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
792
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
793 @defun dbus-introspect-get-argument-names bus service path interface name
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
794 Return a list of all argument names as list of strings. @var{name}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
795 must be a @code{method} or @code{signal} XML element. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
796
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
797 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
798 (dbus-introspect-get-argument-names
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
799 :session "org.freedesktop.xesam.searcher"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
800 "/org/freedesktop/xesam/searcher/main"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
801 "org.freedesktop.xesam.Search" "GetHitData")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
803 @result{} ("search" "hit_ids" "fields" "hit_data")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
804 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
805
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
806 Argument names are optional; the function can return @code{nil}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
807 therefore, even if the method or signal has arguments.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
808 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
809
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
810 @defun dbus-introspect-get-argument bus service path interface name arg
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
811 Return argument @var{ARG} as XML object. @var{name}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
812 must be a @code{method} or @code{signal} XML element. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
813
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
814 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
815 (dbus-introspect-get-argument
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
816 :session "org.freedesktop.xesam.searcher"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
817 "/org/freedesktop/xesam/searcher/main"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
818 "org.freedesktop.xesam.Search" "GetHitData" "search")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
819
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
820 @result{} (arg ((name . "search") (type . "s") (direction . "in")))
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
821 @end lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
822 @end defun
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
823
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
824 @defun dbus-introspect-get-signature bus service path interface name &optional direction
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
825 Return signature of a @code{method} or @code{signal}, represented by
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
826 @var{name}, as string.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
827
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
828 If @var{name} is a @code{method}, @var{direction} can be either
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
829 @samp{in} or @samp{out}. If @var{direction} is @code{nil}, @samp{in}
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
830 is assumed.
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
831
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
832 If @var{name} is a @code{signal}, and @var{direction} is
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
833 non-@code{nil}, @var{direction} must be @samp{out}. Example:
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
834
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
835 @lisp
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
836 (dbus-introspect-get-signature
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
837 :session "org.freedesktop.xesam.searcher"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
838 "/org/freedesktop/xesam/searcher/main"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
839 "org.freedesktop.xesam.Search" "GetHitData" "in")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
840
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
841 @result{} "sauas"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
842
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
843 (dbus-introspect-get-signature
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
844 :session "org.freedesktop.xesam.searcher"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
845 "/org/freedesktop/xesam/searcher/main"
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
846 "org.freedesktop.xesam.Search" "HitsAdded")
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
847
97163
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
848 @result{} "su"
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
849 @end lisp
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
850 @end defun
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
851
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
852
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
853 @node Type Conversion
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
854 @chapter Mapping Lisp types and D-Bus types.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
855 @cindex type conversion
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
856
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
857 D-Bus method calls and signals accept usually several arguments as
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
858 parameters, either as input parameter, or as output parameter. Every
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
859 argument belongs to a D-Bus type.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
860
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
861 Such arguments must be mapped between the value encoded as a D-Bus
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
862 type, and the corresponding type of Lisp objects. The mapping is
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
863 applied Lisp object @expansion{} D-Bus type for input parameters, and
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
864 D-Bus type @expansion{} Lisp object for output parameters.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
865
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
866
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
867 @section Input parameters.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
868
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
869 Input parameters for D-Bus methods and signals occur as arguments of a
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
870 Lisp function call. The following mapping to D-Bus types is
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
871 applied, when the corresponding D-Bus message is created:
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
872
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
873 @example
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
874 @multitable {negative integer} {@expansion{}} {DBUS_TYPE_BOOLEAN}
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
875 @item Lisp type @tab @tab D-Bus type
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
876 @item
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
877 @item @code{t} and @code{nil} @tab @expansion{} @tab DBUS_TYPE_BOOLEAN
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
878 @item natural number @tab @expansion{} @tab DBUS_TYPE_UINT32
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
879 @item negative integer @tab @expansion{} @tab DBUS_TYPE_INT32
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
880 @item float @tab @expansion{} @tab DBUS_TYPE_DOUBLE
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
881 @item string @tab @expansion{} @tab DBUS_TYPE_STRING
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
882 @item list @tab @expansion{} @tab DBUS_TYPE_ARRAY
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
883 @end multitable
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
884 @end example
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
885
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
886 Other Lisp objects, like symbols or hash tables, are not accepted as
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
887 input parameter.
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
888
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
889 If it is necessary to use another D-Bus type, a corresponding type
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
890 symbol can be preceeded to the corresponding Lisp object. Basic D-Bus
87365
7744259cbbc0 * dbus.texi (Type Conversion): Correct input parameters mapping.
Michael Albinus <michael.albinus@gmx.de>
parents: 87362
diff changeset
891 types are represented by the type symbols @code{:byte},
7744259cbbc0 * dbus.texi (Type Conversion): Correct input parameters mapping.
Michael Albinus <michael.albinus@gmx.de>
parents: 87362
diff changeset
892 @code{:boolean}, @code{:int16}, @code{:uint16}, @code{:int32},
7744259cbbc0 * dbus.texi (Type Conversion): Correct input parameters mapping.
Michael Albinus <michael.albinus@gmx.de>
parents: 87362
diff changeset
893 @code{:uint32}, @code{:int64}, @code{:uint64}, @code{:double},
111471
5cb8f9659806 * dbus.texi (Type Conversion): Introduce `:unix-fd' type mapping.
Michael Albinus <michael.albinus@gmx.de>
parents: 109963
diff changeset
894 @code{:string}, @code{:object-path}, @code{:signature} and
5cb8f9659806 * dbus.texi (Type Conversion): Introduce `:unix-fd' type mapping.
Michael Albinus <michael.albinus@gmx.de>
parents: 109963
diff changeset
895 @code{:unix-fd}.
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
896
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
897 @noindent
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
898 Example:
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
899
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
900 @lisp
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
901 (dbus-call-method @dots{} @var{NAT-NUMBER} @var{STRING})
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
902 @end lisp
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
903
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
904 is equivalent to
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
905
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
906 @lisp
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
907 (dbus-call-method @dots{} :uint32 @var{NAT-NUMBER} :string @var{STRING})
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
908 @end lisp
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
909
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
910 but different to
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
911
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
912 @lisp
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
913 (dbus-call-method @dots{} :int32 @var{NAT-NUMBER} :signature @var{STRING})
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
914 @end lisp
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
915
87540
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
916 The value for a byte D-Bus type can be any integer in the range 0
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
917 through 255. If a character is used as argument, modifiers
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
918 represented outside this range are stripped of. For example,
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
919 @code{:byte ?x} is equal to @code{:byte ?\M-x}, but it is not equal to
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
920 @code{:byte ?\C-x} or @code{:byte ?\M-\C-x}.
87491
dd7c58c2342a * dbus.texi (all): Replace "..." by @dots{}.
Michael Albinus <michael.albinus@gmx.de>
parents: 87365
diff changeset
921
87540
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
922 A D-Bus compound type is always represented as a list. The @sc{car}
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
923 of this list can be the type symbol @code{:array}, @code{:variant},
87365
7744259cbbc0 * dbus.texi (Type Conversion): Correct input parameters mapping.
Michael Albinus <michael.albinus@gmx.de>
parents: 87362
diff changeset
924 @code{:struct} or @code{:dict-entry}, which would result in a
7744259cbbc0 * dbus.texi (Type Conversion): Correct input parameters mapping.
Michael Albinus <michael.albinus@gmx.de>
parents: 87362
diff changeset
925 corresponding D-Bus container. @code{:array} is optional, because
87540
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
926 this is the default compound D-Bus type for a list.
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
927
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
928 The objects being elements of the list are checked according to the
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
929 D-Bus compound type rules.
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
930
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
931 @itemize
87540
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
932 @item An array must contain only elements of the same D-Bus type. It
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
933 can be empty.
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
934
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
935 @item A variant must contain only one single element.
87540
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
936
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
937 @item A dictionary entry must be element of an array, and it must
87540
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
938 contain only a key-value pair of two elements, with a basic D-Bus type
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
939 key.
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
940
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
941 @item There is no restriction for structs.
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
942 @end itemize
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
943
87540
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
944 If an empty array needs an element D-Bus type other than string, it
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
945 can contain exactly one element of D-Bus type @code{:signature}. The
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
946 value of this element (a string) is used as the signature of the
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
947 elements of this array. Example:
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
948
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
949 @lisp
87540
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
950 (dbus-call-method
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
951 :session "org.freedesktop.Notifications"
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
952 "/org/freedesktop/Notifications"
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
953 "org.freedesktop.Notifications" "Notify"
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
954 "GNU Emacs" ;; Application name.
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
955 0 ;; No replacement of other notifications.
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
956 "" ;; No icon.
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
957 "Notification summary" ;; Summary.
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
958 (format ;; Body.
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
959 "This is a test notification, raised from %s" (emacs-version))
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
960 '(:array) ;; No actions (empty array of strings).
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
961 '(:array :signature "@{sv@}") ;; No hints
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
962 ;; (empty array of dictionary entries).
105991
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
963 :int32 -1) ;; Default timeout.
87540
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
964
084340c0bd27 * dbus.texi (Type Conversion): Explain the type specification for empty
Michael Albinus <michael.albinus@gmx.de>
parents: 87491
diff changeset
965 @result{} 3
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
966 @end lisp
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
967
99952
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
968 @defun dbus-string-to-byte-array string
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
969 Sometimes, D-Bus methods require as input parameter an array of bytes,
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
970 instead of a string. If it is guaranteed, that @var{string} is an
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
971 UTF8 string, this function performs the conversion. Example:
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
972
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
973 @lisp
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
974 (dbus-string-to-byte-array "/etc/hosts")
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
975
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
976 @result{} (:array :byte 47 :byte 101 :byte 116 :byte 99 :byte 47
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
977 :byte 104 :byte 111 :byte 115 :byte 116 :byte 115)
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
978 @end lisp
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
979 @end defun
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
980
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
981 @defun dbus-escape-as-identifier string
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
982 Escape an arbitrary @var{string} so it follows the rules for a C
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
983 identifier. The escaped string can be used as object path component,
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
984 interface element component, bus name component or member name in
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
985 D-Bus.
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
986
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
987 The escaping consists of replacing all non-alphanumerics, and the
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
988 first character if it's a digit, with an underscore and two
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
989 lower-case hex digits. As a special case, "" is escaped to
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
990 "_". Example:
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
991
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
992 @lisp
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
993 (dbus-escape-as-identifier "0123abc_xyz\x01\xff")
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
994
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
995 @result{} "_30123abc_5fxyz_01_ff"
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
996 @end lisp
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
997 @end defun
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
998
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
999
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1000 @section Output parameters.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1001
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1002 Output parameters of D-Bus methods and signals are mapped to Lisp
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
1003 objects.
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1004
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1005 @example
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1006 @multitable {DBUS_TYPE_OBJECT_PATH} {@expansion{}} {natural number or float}
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1007 @item D-Bus type @tab @tab Lisp type
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1008 @item
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1009 @item DBUS_TYPE_BOOLEAN @tab @expansion{} @tab @code{t} or @code{nil}
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1010 @item DBUS_TYPE_BYTE @tab @expansion{} @tab natural number
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1011 @item DBUS_TYPE_UINT16 @tab @expansion{} @tab natural number
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1012 @item DBUS_TYPE_INT16 @tab @expansion{} @tab integer
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1013 @item DBUS_TYPE_UINT32 @tab @expansion{} @tab natural number or float
111471
5cb8f9659806 * dbus.texi (Type Conversion): Introduce `:unix-fd' type mapping.
Michael Albinus <michael.albinus@gmx.de>
parents: 109963
diff changeset
1014 @item DBUS_TYPE_UNIX_FD @tab @expansion{} @tab natural number or float
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1015 @item DBUS_TYPE_INT32 @tab @expansion{} @tab integer or float
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1016 @item DBUS_TYPE_UINT64 @tab @expansion{} @tab natural number or float
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1017 @item DBUS_TYPE_INT64 @tab @expansion{} @tab integer or float
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1018 @item DBUS_TYPE_DOUBLE @tab @expansion{} @tab float
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1019 @item DBUS_TYPE_STRING @tab @expansion{} @tab string
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1020 @item DBUS_TYPE_OBJECT_PATH @tab @expansion{} @tab string
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
1021 @item DBUS_TYPE_SIGNATURE @tab @expansion{} @tab string
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1022 @item DBUS_TYPE_ARRAY @tab @expansion{} @tab list
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1023 @item DBUS_TYPE_VARIANT @tab @expansion{} @tab list
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1024 @item DBUS_TYPE_STRUCT @tab @expansion{} @tab list
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1025 @item DBUS_TYPE_DICT_ENTRY @tab @expansion{} @tab list
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1026 @end multitable
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1027 @end example
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1028
87365
7744259cbbc0 * dbus.texi (Type Conversion): Correct input parameters mapping.
Michael Albinus <michael.albinus@gmx.de>
parents: 87362
diff changeset
1029 A float object in case of @code{DBUS_TYPE_UINT32},
111471
5cb8f9659806 * dbus.texi (Type Conversion): Introduce `:unix-fd' type mapping.
Michael Albinus <michael.albinus@gmx.de>
parents: 109963
diff changeset
1030 @code{DBUS_TYPE_INT32}, @code{DBUS_TYPE_UINT64},
5cb8f9659806 * dbus.texi (Type Conversion): Introduce `:unix-fd' type mapping.
Michael Albinus <michael.albinus@gmx.de>
parents: 109963
diff changeset
1031 @code{DBUS_TYPE_INT64} and @code{DBUS_TYPE_UNIX_FD} is returned, when
5cb8f9659806 * dbus.texi (Type Conversion): Introduce `:unix-fd' type mapping.
Michael Albinus <michael.albinus@gmx.de>
parents: 109963
diff changeset
1032 the C value exceeds the Emacs number size range.
87365
7744259cbbc0 * dbus.texi (Type Conversion): Correct input parameters mapping.
Michael Albinus <michael.albinus@gmx.de>
parents: 87362
diff changeset
1033
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1034 The resulting list of the last 4 D-Bus compound types contains as
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1035 elements the elements of the D-Bus container, mapped according to the
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1036 same rules.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1037
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1038 The signal @code{PropertyModified}, discussed as example in
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1039 @ref{Inspection}, would offer as Lisp data the following object
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1040 (@var{BOOL} stands here for either @code{nil} or @code{t}):
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1041
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1042 @lisp
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1043 (@var{INTEGER} ((@var{STRING} @var{BOOL} @var{BOOL}) (@var{STRING} @var{BOOL} @var{BOOL}) @dots{}))
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1044 @end lisp
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1045
99952
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1046 @defun dbus-byte-array-to-string byte-array
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1047 If a D-Bus method or signal returns an array of bytes, which are known
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1048 to represent an UTF8 string, this function converts @var{byte-array}
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1049 to the corresponding string. Example:
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1050
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1051 @lisp
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1052 (dbus-byte-array-to-string '(47 101 116 99 47 104 111 115 116 115))
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1053
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1054 @result{} "/etc/hosts"
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1055 @end lisp
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1056 @end defun
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1057
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1058 @defun dbus-unescape-from-identifier string
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1059 Retrieve the original string from the encoded @var{string}.
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1060 @var{string} must have been coded with
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1061 @code{dbus-escape-as-identifier}. Example:
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1062
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1063 @lisp
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1064 (dbus-unescape-from-identifier "_30123abc_5fxyz_01_ff")
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1065
103670
cbbd2a335c8c (Type Conversion): Don't use literal control character.
Andreas Schwab <schwab@linux-m68k.org>
parents: 102151
diff changeset
1066 @ifinfo
cbbd2a335c8c (Type Conversion): Don't use literal control character.
Andreas Schwab <schwab@linux-m68k.org>
parents: 102151
diff changeset
1067 @result{} "0123abc_xyz^Aÿ"
cbbd2a335c8c (Type Conversion): Don't use literal control character.
Andreas Schwab <schwab@linux-m68k.org>
parents: 102151
diff changeset
1068 @end ifinfo
cbbd2a335c8c (Type Conversion): Don't use literal control character.
Andreas Schwab <schwab@linux-m68k.org>
parents: 102151
diff changeset
1069 @ifnotinfo
cbbd2a335c8c (Type Conversion): Don't use literal control character.
Andreas Schwab <schwab@linux-m68k.org>
parents: 102151
diff changeset
1070 @result{} "0123abc_xyz^A@"y"
cbbd2a335c8c (Type Conversion): Don't use literal control character.
Andreas Schwab <schwab@linux-m68k.org>
parents: 102151
diff changeset
1071 @end ifnotinfo
99952
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1072 @end lisp
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1073 @end defun
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1074
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1075
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1076 @node Synchronous Methods
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1077 @chapter Calling methods in a blocking way.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1078 @cindex method calls, synchronous
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1079 @cindex synchronous method calls
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1080
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1081 Methods can be called synchronously (@dfn{blocking}) or asynchronously
97163
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1082 (@dfn{non-blocking}).
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1083
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1084 At D-Bus level, a method call consist of two messages: one message
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1085 which carries the input parameters to the object owning the method to
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1086 be called, and a reply message returning the resulting output
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1087 parameters from the object.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1088
93422
d2f671c73132 * dbus.texi (Synchronous Methods): New parameter TIMEOUT for
Michael Albinus <michael.albinus@gmx.de>
parents: 93130
diff changeset
1089 @defun dbus-call-method bus service path interface method &optional :timeout timeout &rest args
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1090 This function calls @var{method} on the D-Bus @var{bus}. @var{bus} is
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1091 either the symbol @code{:system} or the symbol @code{:session}.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1092
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1093 @var{service} is the D-Bus service name to be used. @var{path} is the
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1094 D-Bus object path, @var{service} is registered at. @var{interface} is
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1095 an interface offered by @var{service}. It must provide @var{method}.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1096
93422
d2f671c73132 * dbus.texi (Synchronous Methods): New parameter TIMEOUT for
Michael Albinus <michael.albinus@gmx.de>
parents: 93130
diff changeset
1097 If the parameter @code{:timeout} is given, the following integer
97163
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1098 @var{timeout} specifies the maximum number of milliseconds the method
104590
8e031ee168ec * dbus.texi (Bus names): Add optional parameter TIMEOUT to dbus-ping.
Michael Albinus <michael.albinus@gmx.de>
parents: 104307
diff changeset
1099 call must return. The default value is 25,000. If the method call
93422
d2f671c73132 * dbus.texi (Synchronous Methods): New parameter TIMEOUT for
Michael Albinus <michael.albinus@gmx.de>
parents: 93130
diff changeset
1100 doesn't return in time, a D-Bus error is raised (@pxref{Errors and
d2f671c73132 * dbus.texi (Synchronous Methods): New parameter TIMEOUT for
Michael Albinus <michael.albinus@gmx.de>
parents: 93130
diff changeset
1101 Events}).
d2f671c73132 * dbus.texi (Synchronous Methods): New parameter TIMEOUT for
Michael Albinus <michael.albinus@gmx.de>
parents: 93130
diff changeset
1102
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1103 All other arguments args are passed to @var{method} as arguments.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1104 They are converted into D-Bus types as described in @ref{Type
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1105 Conversion}.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1106
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1107 The function returns the resulting values of @var{method} as a list of
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1108 Lisp objects, according to the type conversion rules described in
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1109 @ref{Type Conversion}. Example:
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1110
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
1111 @lisp
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1112 (dbus-call-method
87158
f10e4cb7d001 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
Michael Albinus <michael.albinus@gmx.de>
parents: 87053
diff changeset
1113 :session "org.gnome.seahorse" "/org/gnome/seahorse/keys/openpgp"
f10e4cb7d001 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
Michael Albinus <michael.albinus@gmx.de>
parents: 87053
diff changeset
1114 "org.gnome.seahorse.Keys" "GetKeyField"
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1115 "openpgp:657984B8C7A966DD" "simple-name")
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1116
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1117 @result{} (t ("Philip R. Zimmermann"))
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
1118 @end lisp
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1119
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1120 If the result of the method call is just one value, the converted Lisp
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1121 object is returned instead of a list containing this single Lisp
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1122 object. Example:
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1123
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
1124 @lisp
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1125 (dbus-call-method
87158
f10e4cb7d001 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
Michael Albinus <michael.albinus@gmx.de>
parents: 87053
diff changeset
1126 :system "org.freedesktop.Hal"
f10e4cb7d001 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
Michael Albinus <michael.albinus@gmx.de>
parents: 87053
diff changeset
1127 "/org/freedesktop/Hal/devices/computer"
f10e4cb7d001 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
Michael Albinus <michael.albinus@gmx.de>
parents: 87053
diff changeset
1128 "org.freedesktop.Hal.Device" "GetPropertyString"
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1129 "system.kernel.machine")
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1130
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1131 @result{} "i686"
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
1132 @end lisp
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1133
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1134 With the @code{dbus-introspect} function it is possible to explore the
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1135 interfaces of @samp{org.freedesktop.Hal} service. It offers the
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1136 interfaces @samp{org.freedesktop.Hal.Manager} for the object at the
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1137 path @samp{/org/freedesktop/Hal/Manager} as well as the interface
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1138 @samp{org.freedesktop.Hal.Device} for all objects prefixed with the
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1139 path @samp{/org/freedesktop/Hal/devices}. With the methods
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1140 @samp{GetAllDevices} and @samp{GetAllProperties}, it is simple to
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1141 emulate the @code{lshal} command on GNU/Linux systems:
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1142
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
1143 @lisp
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1144 (dolist (device
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1145 (dbus-call-method
87158
f10e4cb7d001 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
Michael Albinus <michael.albinus@gmx.de>
parents: 87053
diff changeset
1146 :system "org.freedesktop.Hal"
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1147 "/org/freedesktop/Hal/Manager"
87158
f10e4cb7d001 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
Michael Albinus <michael.albinus@gmx.de>
parents: 87053
diff changeset
1148 "org.freedesktop.Hal.Manager" "GetAllDevices"))
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1149 (message "\nudi = %s" device)
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1150 (dolist (properties
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1151 (dbus-call-method
87158
f10e4cb7d001 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
Michael Albinus <michael.albinus@gmx.de>
parents: 87053
diff changeset
1152 :system "org.freedesktop.Hal" device
f10e4cb7d001 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
Michael Albinus <michael.albinus@gmx.de>
parents: 87053
diff changeset
1153 "org.freedesktop.Hal.Device" "GetAllProperties"))
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1154 (message " %s = %S"
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1155 (car properties) (or (caar (cdr properties)) ""))))
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1156
87004
0877a1d16074 * Makefile.in (INFO_TARGETS, DVI_TARGETS): Apply dbus and dbus.dvi
Michael Albinus <michael.albinus@gmx.de>
parents: 86972
diff changeset
1157 @print{} "udi = /org/freedesktop/Hal/devices/computer
86944
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
1158 info.addons = (\"hald-addon-acpi\")
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
1159 info.bus = \"unknown\"
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
1160 info.product = \"Computer\"
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
1161 info.subsystem = \"unknown\"
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
1162 info.udi = \"/org/freedesktop/Hal/devices/computer\"
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
1163 linux.sysfs_path_device = \"(none)\"
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
1164 power_management.acpi.linux.version = \"20051216\"
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
1165 power_management.can_suspend_to_disk = t
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
1166 power_management.can_suspend_to_ram = \"\"
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
1167 power_management.type = \"acpi\"
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
1168 smbios.bios.release_date = \"11/07/2001\"
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
1169 system.chassis.manufacturer = \"COMPAL\"
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
1170 system.chassis.type = \"Notebook\"
9ae2c39a9be6 * dbus.texi: Applying comments from RMS.
Michael Albinus <michael.albinus@gmx.de>
parents: 86942
diff changeset
1171 system.firmware.release_date = \"03/19/2005\"
87491
dd7c58c2342a * dbus.texi (all): Replace "..." by @dots{}.
Michael Albinus <michael.albinus@gmx.de>
parents: 87365
diff changeset
1172 @dots{}"
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
1173 @end lisp
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1174 @end defun
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1175
97163
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1176 @defun dbus-call-method-non-blocking bus service path interface method &optional :timeout timeout &rest args
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1177 Call @var{method} on the D-Bus @var{bus}, but don't block the event queue.
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1178 This is necessary for communicating to registered D-Bus methods,
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1179 which are running in the same Emacs process.
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1180
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1181 The arguments are the same as in @code{dbus-call-method}. Example:
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1182
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1183 @lisp
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1184 (dbus-call-method-non-blocking
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1185 :system "org.freedesktop.Hal"
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1186 "/org/freedesktop/Hal/devices/computer"
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1187 "org.freedesktop.Hal.Device" "GetPropertyString"
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1188 "system.kernel.machine")
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1189
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1190 @result{} "i686"
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1191 @end lisp
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1192 @end defun
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1193
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1194
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1195 @node Asynchronous Methods
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1196 @chapter Calling methods non-blocking.
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1197 @cindex method calls, asynchronous
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1198 @cindex asynchronous method calls
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1199
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1200 @defun dbus-call-method-asynchronously bus service path interface method handler &optional :timeout timeout &rest args
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1201 This function calls @var{method} on the D-Bus @var{bus}
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1202 asynchronously. @var{bus} is either the symbol @code{:system} or the
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1203 symbol @code{:session}.
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1204
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1205 @var{service} is the D-Bus service name to be used. @var{path} is the
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1206 D-Bus object path, @var{service} is registered at. @var{interface} is
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1207 an interface offered by @var{service}. It must provide @var{method}.
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1208
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1209 @var{handler} is a Lisp function, which is called when the
104307
562b1d80843b * dbus.texi (Asynchronous Methods): Allow nil handler.
Michael Albinus <michael.albinus@gmx.de>
parents: 104083
diff changeset
1210 corresponding return message has arrived. If @var{handler} is
562b1d80843b * dbus.texi (Asynchronous Methods): Allow nil handler.
Michael Albinus <michael.albinus@gmx.de>
parents: 104083
diff changeset
1211 @code{nil}, no return message will be expected.
97163
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1212
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1213 If the parameter @code{:timeout} is given, the following integer
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1214 @var{timeout} specifies the maximum number of milliseconds a reply
104590
8e031ee168ec * dbus.texi (Bus names): Add optional parameter TIMEOUT to dbus-ping.
Michael Albinus <michael.albinus@gmx.de>
parents: 104307
diff changeset
1215 message must arrive. The default value is 25,000. If there is no
97163
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1216 reply message in time, a D-Bus error is raised (@pxref{Errors and
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1217 Events}).
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1218
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1219 All other arguments args are passed to @var{method} as arguments.
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1220 They are converted into D-Bus types as described in @ref{Type
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1221 Conversion}.
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1222
104307
562b1d80843b * dbus.texi (Asynchronous Methods): Allow nil handler.
Michael Albinus <michael.albinus@gmx.de>
parents: 104083
diff changeset
1223 Unless @var{handler} is @code{nil}, the function returns a key into
105991
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1224 the hash table @code{dbus-registered-objects-table}. The
104307
562b1d80843b * dbus.texi (Asynchronous Methods): Allow nil handler.
Michael Albinus <michael.albinus@gmx.de>
parents: 104083
diff changeset
1225 corresponding entry in the hash table is removed, when the return
562b1d80843b * dbus.texi (Asynchronous Methods): Allow nil handler.
Michael Albinus <michael.albinus@gmx.de>
parents: 104083
diff changeset
1226 message has been arrived, and @var{handler} is called. Example:
97163
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1227
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1228 @lisp
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1229 (dbus-call-method-asynchronously
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1230 :system "org.freedesktop.Hal"
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1231 "/org/freedesktop/Hal/devices/computer"
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1232 "org.freedesktop.Hal.Device" "GetPropertyString" 'message
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1233 "system.kernel.machine")
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1234
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1235 @result{} (:system 2)
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1236
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1237 @print{} i686
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1238 @end lisp
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1239 @end defun
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1240
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1241
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1242 @node Receiving Method Calls
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1243 @chapter Offering own methods.
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1244 @cindex method calls, returning
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1245 @cindex returning method calls
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1246
112179
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1247 In order to register methods on the D-Bus, Emacs has to request a well
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1248 known name on the D-Bus under which it will be available for other
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1249 clients. Names on the D-Bus can be registered and unregistered using
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1250 the following functions:
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1251
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1252 @defun dbus-register-service bus service &rest flags
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1253 Register the known name @var{service} on D-Bus @var{bus}.
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1254
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1255 @var{bus} is either the symbol @code{:system} or the symbol
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1256 @code{:session}.
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1257
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1258 @var{service} is the service name to be registered on the D-Bus. It
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1259 must be a known name.
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1260
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1261 @var{flags} is a subset of the following keywords:
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1262
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1263 @itemize
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1264 @item @code{:allow-replacement}: Allow another service to become the primary
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1265 owner if requested.
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1266
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1267 @item @code{:replace-existing}: Request to replace the current primary owner.
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1268
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1269 @item @code{:do-not-queue}: If we can not become the primary owner do not
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1270 place us in the queue.
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1271 @end itemize
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1272
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1273 One of the following keywords is returned:
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1274
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1275 @itemize
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1276
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1277 @item @code{:primary-owner}: We have become the primary owner of the name
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1278 @var{service}.
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1279
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1280 @item @code{:in-queue}: We could not become the primary owner and
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1281 have been placed in the queue.
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1282
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1283 @item @code{:exists}: We already are in the queue.
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1284
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1285 @item @code{:already-owner}: We already are the primary
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1286 owner.
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1287 @end itemize
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1288 @end defun
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1289
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1290 @defun dbus-unregister-service bus service
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1291 Unregister all objects from D-Bus @var{bus}, registered by Emacs for
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1292 @var{service}.
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1293
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1294 @var{bus} is either the symbol @code{:system} or the symbol
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1295 @code{:session}.
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1296
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1297 @var{service} is the D-Bus service name of the D-Bus. It must be a
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1298 known name. Emacs releases its association to @var{service} from
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1299 D-Bus.
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1300
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1301 One of the following keywords is returned:
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1302
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1303 @itemize
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1304 @item @code{:released}: We successfully released the name @var{service}.
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1305 @item @code{:non-existent}: The name @var{service} does not exist on the bus.
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1306 @item @code{:not-owner}: We are not an owner of the name @var{service}.
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1307 @end itemize
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1308 @end defun
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1309
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1310 When a name has been chosen, Emacs can offer own methods, which can be
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1311 called by other applications. These methods could be an
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1312 implementation of an interface of a well known service, like
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1313 @samp{org.freedesktop.TextEditor}.
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1314
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1315 It could be also an implementation of an own interface. In this case,
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
1316 the service name must be @samp{org.gnu.Emacs}. The object path shall
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
1317 begin with @samp{/org/gnu/Emacs/@strong{Application}/}, and the
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1318 interface name shall be @code{org.gnu.Emacs.@strong{Application}}.
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
1319 @samp{@strong{Application}} is the name of the application which
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1320 provides the interface.
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1321
99952
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1322 @deffn Constant dbus-service-emacs
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1323 The well known service name of Emacs.
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1324 @end deffn
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1325
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1326 @deffn Constant dbus-path-emacs
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1327 The object path head "/org/gnu/Emacs" used by Emacs. All object
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1328 paths, used by offered methods or signals, shall start with this
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1329 string.
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1330 @end deffn
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1331
112114
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1332 @defun dbus-register-method bus service path interface method handler dont-register-service
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1333 With this function, an application registers @var{method} on the D-Bus
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1334 @var{bus}.
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1335
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1336 @var{bus} is either the symbol @code{:system} or the symbol
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1337 @code{:session}.
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1338
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1339 @var{service} is the D-Bus service name of the D-Bus object
112114
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1340 @var{method} is registered for. It must be a known name (See
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1341 discussion of @var{dont-register-service} below).
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1342
112114
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1343 @var{path} is the D-Bus object path @var{service} is registered (See
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1344 discussion of @var{dont-register-service} below).
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1345
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1346 @var{interface} is the interface offered by @var{service}. It must
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1347 provide @var{method}.
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1348
100008
caa9c8dbbeb0 (Receiving Method Calls): Clean up previous change.
Richard M. Stallman <rms@gnu.org>
parents: 99966
diff changeset
1349 @var{handler} is a Lisp function to be called when a @var{method} call
caa9c8dbbeb0 (Receiving Method Calls): Clean up previous change.
Richard M. Stallman <rms@gnu.org>
parents: 99966
diff changeset
1350 is received. It must accept as arguments the input arguments of
caa9c8dbbeb0 (Receiving Method Calls): Clean up previous change.
Richard M. Stallman <rms@gnu.org>
parents: 99966
diff changeset
1351 @var{method}. @var{handler} should return a list, whose elements are
caa9c8dbbeb0 (Receiving Method Calls): Clean up previous change.
Richard M. Stallman <rms@gnu.org>
parents: 99966
diff changeset
1352 to be used as arguments for the reply message of @var{method}. This
caa9c8dbbeb0 (Receiving Method Calls): Clean up previous change.
Richard M. Stallman <rms@gnu.org>
parents: 99966
diff changeset
1353 list can be composed like the input parameters in @ref{Type
caa9c8dbbeb0 (Receiving Method Calls): Clean up previous change.
Richard M. Stallman <rms@gnu.org>
parents: 99966
diff changeset
1354 Conversion}.
caa9c8dbbeb0 (Receiving Method Calls): Clean up previous change.
Richard M. Stallman <rms@gnu.org>
parents: 99966
diff changeset
1355
caa9c8dbbeb0 (Receiving Method Calls): Clean up previous change.
Richard M. Stallman <rms@gnu.org>
parents: 99966
diff changeset
1356 If @var{handler} wants to return just one Lisp object and it is not a
caa9c8dbbeb0 (Receiving Method Calls): Clean up previous change.
Richard M. Stallman <rms@gnu.org>
parents: 99966
diff changeset
1357 cons cell, @var{handler} can return this object directly, instead of
caa9c8dbbeb0 (Receiving Method Calls): Clean up previous change.
Richard M. Stallman <rms@gnu.org>
parents: 99966
diff changeset
1358 returning a list containing the object.
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1359
104083
5baa98667482 * dbus.texi (Receiving Method Calls): Describe special return value
Michael Albinus <michael.albinus@gmx.de>
parents: 103670
diff changeset
1360 In case @var{handler} shall return a reply message with an empty
5baa98667482 * dbus.texi (Receiving Method Calls): Describe special return value
Michael Albinus <michael.albinus@gmx.de>
parents: 103670
diff changeset
1361 argument list, @var{handler} must return the symbol @code{:ignore}.
5baa98667482 * dbus.texi (Receiving Method Calls): Describe special return value
Michael Albinus <michael.albinus@gmx.de>
parents: 103670
diff changeset
1362
112114
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1363 When @var{dont-register-service} is non-@code{nil}, the known name
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1364 @var{service} is not registered. This means that other D-Bus clients
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1365 have no way of noticing the newly registered method. When interfaces
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1366 are constructed incrementally by adding single methods or properties
112179
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1367 at a time, @var{dont-register-service} can be used to prevent other
112114
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1368 clients from discovering the still incomplete interface.
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1369
93130
83be756929f1 * dbus.texi (Receiving Method Calls): Mention default D-Bus timeout.
Michael Albinus <michael.albinus@gmx.de>
parents: 91590
diff changeset
1370 The default D-Bus timeout when waiting for a message reply is 25
93422
d2f671c73132 * dbus.texi (Synchronous Methods): New parameter TIMEOUT for
Michael Albinus <michael.albinus@gmx.de>
parents: 93130
diff changeset
1371 seconds. This value could be even smaller, depending on the calling
d2f671c73132 * dbus.texi (Synchronous Methods): New parameter TIMEOUT for
Michael Albinus <michael.albinus@gmx.de>
parents: 93130
diff changeset
1372 client. Therefore, @var{handler} shall not last longer than
93130
83be756929f1 * dbus.texi (Receiving Method Calls): Mention default D-Bus timeout.
Michael Albinus <michael.albinus@gmx.de>
parents: 91590
diff changeset
1373 absolutely necessary.
83be756929f1 * dbus.texi (Receiving Method Calls): Mention default D-Bus timeout.
Michael Albinus <michael.albinus@gmx.de>
parents: 91590
diff changeset
1374
96646
5e58654e97ff * dbus.texi (Receiving Method Calls): Fix description of
Michael Albinus <michael.albinus@gmx.de>
parents: 95937
diff changeset
1375 @code{dbus-register-method} returns a Lisp object, which can be used
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1376 as argument in @code{dbus-unregister-object} for removing the
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1377 registration for @var{method}. Example:
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1378
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
1379 @lisp
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1380 (defun my-dbus-method-handler (filename)
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1381 (let (result)
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1382 (if (find-file filename)
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1383 (setq result '(:boolean t))
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1384 (setq result '(:boolean nil)))
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1385 result))
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1386
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1387 @result{} my-dbus-method-handler
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1388
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1389 (dbus-register-method
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1390 :session "org.freedesktop.TextEditor" "/org/freedesktop/TextEditor"
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1391 "org.freedesktop.TextEditor" "OpenFile"
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1392 'my-dbus-method-handler)
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1393
97253
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1394 @result{} ((:session "org.freedesktop.TextEditor" "OpenFile")
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1395 ("org.freedesktop.TextEditor" "/org/freedesktop/TextEditor"
97253
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1396 my-dbus-method-handler))
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
1397 @end lisp
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1398
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
1399 If you invoke the method @samp{org.freedesktop.TextEditor.OpenFile}
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1400 from another D-Bus application with a filename as parameter, the file
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1401 is opened in Emacs, and the method returns either @var{true} or
105991
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1402 @var{false}, indicating the success of the method. As test tool one
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1403 could use the command line tool @code{dbus-send} in a shell:
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1404
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1405 @example
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1406 # dbus-send --session --print-reply \
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1407 --dest="org.freedesktop.TextEditor" \
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1408 "/org/freedesktop/TextEditor" \
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1409 "org.freedesktop.TextEditor.OpenFile" string:"/etc/hosts"
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1410
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1411 @print{} method return sender=:1.22 -> dest=:1.23 reply_serial=2
97253
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1412 boolean true
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1413 @end example
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1414
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1415 You can indicate an error by raising the Emacs signal
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1416 @code{dbus-error}. The handler above could be changed like this:
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1417
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1418 @lisp
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1419 (defun my-dbus-method-handler (&rest args)
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1420 (unless (and (= (length args) 1) (stringp (car args)))
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1421 (signal 'dbus-error (list (format "Wrong argument list: %S" args))))
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1422 (condition-case err
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1423 (find-file (car args))
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1424 (error (signal 'dbus-error (cdr err))))
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1425 t)
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1426
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1427 @result{} my-dbus-method-handler
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1428 @end lisp
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1429
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1430 The test runs then
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1431
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1432 @example
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1433 # dbus-send --session --print-reply \
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1434 --dest="org.freedesktop.TextEditor" \
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1435 "/org/freedesktop/TextEditor" \
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1436 "org.freedesktop.TextEditor.OpenFile" \
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1437 string:"/etc/hosts" string:"/etc/passwd"
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1438
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1439 @print{} Error org.freedesktop.DBus.Error.Failed:
cd0a7b292982 * dbus.texi (Receiving Method Calls): Document error handling of own
Michael Albinus <michael.albinus@gmx.de>
parents: 97163
diff changeset
1440 Wrong argument list: ("/etc/hosts" "/etc/passwd")
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1441 @end example
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1442 @end defun
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1443
112114
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1444 @defun dbus-register-property bus service path interface property access value &optional emits-signal dont-register-service
105991
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1445 With this function, an application declares a @var{property} on the D-Bus
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1446 @var{bus}.
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1447
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1448 @var{bus} is either the symbol @code{:system} or the symbol
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1449 @code{:session}.
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1450
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1451 @var{service} is the D-Bus service name of the D-Bus. It must be a
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1452 known name.
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1453
112114
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1454 @var{path} is the D-Bus object path @var{service} is registered (See
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1455 discussion of @var{dont-register-service} below).
105991
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1456
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1457 @var{interface} is the name of the interface used at @var{path},
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1458 @var{property} is the name of the property of @var{interface}.
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1459
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1460 @var{access} indicates, whether the property can be changed by other
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1461 services via D-Bus. It must be either the symbol @code{:read} or
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1462 @code{:readwrite}. @var{value} is the initial value of the property,
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1463 it can be of any valid type (see @code{dbus-call-method} for details).
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1464
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1465 If @var{property} already exists on @var{path}, it will be
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1466 overwritten. For properties with access type @code{:read} this is the
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1467 only way to change their values. Properties with access type
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1468 @code{:readwrite} can be changed by @code{dbus-set-property}.
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1469
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1470 The interface @samp{org.freedesktop.DBus.Properties} is added to
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1471 @var{path}, including a default handler for the @samp{Get},
109128
89fa0d8c2e83 * dbus.texi (Receiving Method Calls): Add optional argument
Michael Albinus <albinus@detlef>
parents: 107253
diff changeset
1472 @samp{GetAll} and @samp{Set} methods of this interface. When
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1473 @var{emits-signal} is non-@code{nil}, the signal
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1474 @samp{PropertiesChanged} is sent when the property is changed by
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1475 @code{dbus-set-property}.
109128
89fa0d8c2e83 * dbus.texi (Receiving Method Calls): Add optional argument
Michael Albinus <albinus@detlef>
parents: 107253
diff changeset
1476
112114
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1477 When @var{dont-register-service} is non-@code{nil}, the known name
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1478 @var{service} is not registered. This means that other D-Bus clients
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1479 have no way of noticing the newly registered method. When interfaces
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1480 are constructed incrementally by adding single methods or properties
112179
57d3123a1003 * dbus.texi (Receiving Method Calls): New function
Michael Albinus <michael.albinus@gmx.de>
parents: 112114
diff changeset
1481 at a time, @var{dont-register-service} can be used to prevent other
112114
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1482 clients from discovering the still incomplete interface.
2e84d340bbaf * dbus.texi (Receiving Method Calls): Describe new optional
Michael Albinus <michael.albinus@gmx.de>
parents: 111471
diff changeset
1483
109128
89fa0d8c2e83 * dbus.texi (Receiving Method Calls): Add optional argument
Michael Albinus <albinus@detlef>
parents: 107253
diff changeset
1484 @noindent Example:
105991
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1485
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1486 @lisp
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1487 (dbus-register-property
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1488 :session "org.freedesktop.TextEditor" "/org/freedesktop/TextEditor"
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1489 "org.freedesktop.TextEditor" "name" :read "GNU Emacs")
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1490
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1491 @result{} ((:session "org.freedesktop.TextEditor" "name")
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1492 ("org.freedesktop.TextEditor" "/org/freedesktop/TextEditor"))
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1493
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1494 (dbus-register-property
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1495 :session "org.freedesktop.TextEditor" "/org/freedesktop/TextEditor"
109128
89fa0d8c2e83 * dbus.texi (Receiving Method Calls): Add optional argument
Michael Albinus <albinus@detlef>
parents: 107253
diff changeset
1496 "org.freedesktop.TextEditor" "version" :readwrite emacs-version t)
105991
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1497
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1498 @result{} ((:session "org.freedesktop.TextEditor" "version")
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1499 ("org.freedesktop.TextEditor" "/org/freedesktop/TextEditor"))
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1500 @end lisp
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1501
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1502 Other D-Bus applications can read the property via the default methods
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1503 @samp{org.freedesktop.DBus.Properties.Get} and
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1504 @samp{org.freedesktop.DBus.Properties.GetAll}. Testing is also
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1505 possible via the command line tool @code{dbus-send} in a shell:
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1506
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1507 @example
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1508 # dbus-send --session --print-reply \
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1509 --dest="org.freedesktop.TextEditor" \
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1510 "/org/freedesktop/TextEditor" \
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1511 "org.freedesktop.DBus.Properties.GetAll" \
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1512 string:"org.freedesktop.TextEditor"
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1513
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1514 @print{} method return sender=:1.22 -> dest=:1.23 reply_serial=3
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1515 array [
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1516 dict entry(
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1517 string "name"
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1518 variant string "GNU Emacs"
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1519 )
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1520 dict entry(
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1521 string "version"
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1522 variant string "23.1.50.5"
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1523 )
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1524 ]
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1525 @end example
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1526
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1527 It is also possible, to apply the @code{dbus-get-property},
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1528 @code{dbus-get-all-properties} and @code{dbus-set-property} functions
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1529 (@pxref{Properties and Annotations}).
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1530
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1531 @lisp
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1532 (dbus-set-property
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1533 :session "org.freedesktop.TextEditor" "/org/freedesktop/TextEditor"
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1534 "org.freedesktop.TextEditor" "version" "23.1.50")
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1535
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1536 @result{} "23.1.50"
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1537
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1538 (dbus-get-property
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1539 :session "org.freedesktop.TextEditor" "/org/freedesktop/TextEditor"
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1540 "org.freedesktop.TextEditor" "version")
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1541
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1542 @result{} "23.1.50"
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1543 @end lisp
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1544 @end defun
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1545
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1546 @defun dbus-unregister-object object
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1547 Unregister @var{object} from the D-Bus. @var{object} must be the
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1548 result of a preceding @code{dbus-register-method},
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1549 @code{dbus-register-property} or @code{dbus-register-signal} call
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1550 (@pxref{Signals}). It returns @code{t} if @var{object} has been
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1551 unregistered, @code{nil} otherwise.
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1552
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1553 When @var{object} identifies the last method or property, which is
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1554 registered for the respective service, Emacs releases its association
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1555 to the service from D-Bus.
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1556 @end defun
afb7aa4cabcc * dbus.texi (Type Conversion): Fix typo.
Michael Albinus <michael.albinus@gmx.de>
parents: 104607
diff changeset
1557
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1558
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1559 @node Signals
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1560 @chapter Sending and receiving signals.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1561 @cindex signals
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1562
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1563 Signals are broadcast messages. They carry input parameters, which
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1564 are received by all objects which have registered for such a signal.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1565
87158
f10e4cb7d001 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
Michael Albinus <michael.albinus@gmx.de>
parents: 87053
diff changeset
1566 @defun dbus-send-signal bus service path interface signal &rest args
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1567 This function is similar to @code{dbus-call-method}. The difference
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1568 is, that there are no returning output parameters.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1569
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1570 The function emits @var{signal} on the D-Bus @var{bus}. @var{bus} is
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1571 either the symbol @code{:system} or the symbol @code{:session}. It
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1572 doesn't matter whether another object has registered for @var{signal}.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1573
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1574 @var{service} is the D-Bus service name of the object the signal is
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1575 emitted from. @var{path} is the corresponding D-Bus object path,
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1576 @var{service} is registered at. @var{interface} is an interface
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1577 offered by @var{service}. It must provide @var{signal}.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1578
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1579 All other arguments args are passed to @var{signal} as arguments.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1580 They are converted into D-Bus types as described in @ref{Type
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1581 Conversion}. Example:
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1582
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
1583 @lisp
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1584 (dbus-send-signal
99952
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1585 :session dbus-service-emacs dbus-path-emacs
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1586 (concat dbus-service-emacs ".FileManager") "FileModified"
f89674a00bdc * dbus.texi (Type Conversion): New defuns `dbus-string-to-byte-array',
Michael Albinus <michael.albinus@gmx.de>
parents: 99709
diff changeset
1587 "/home/albinus/.emacs")
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
1588 @end lisp
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1589 @end defun
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1590
96646
5e58654e97ff * dbus.texi (Receiving Method Calls): Fix description of
Michael Albinus <michael.albinus@gmx.de>
parents: 95937
diff changeset
1591 @defun dbus-register-signal bus service path interface signal handler &rest args
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1592 With this function, an application registers for @var{signal} on the
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1593 D-Bus @var{bus}.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1594
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1595 @var{bus} is either the symbol @code{:system} or the symbol
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1596 @code{:session}.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1597
87049
cbcfa9b4201e * dbus.texi (Signals): Precise `dbus-register-signal'.
Michael Albinus <michael.albinus@gmx.de>
parents: 87004
diff changeset
1598 @var{service} is the D-Bus service name used by the sending D-Bus
cbcfa9b4201e * dbus.texi (Signals): Precise `dbus-register-signal'.
Michael Albinus <michael.albinus@gmx.de>
parents: 87004
diff changeset
1599 object. It can be either a known name or the unique name of the D-Bus
cbcfa9b4201e * dbus.texi (Signals): Precise `dbus-register-signal'.
Michael Albinus <michael.albinus@gmx.de>
parents: 87004
diff changeset
1600 object sending the signal. In case of a unique name, signals won't be
cbcfa9b4201e * dbus.texi (Signals): Precise `dbus-register-signal'.
Michael Albinus <michael.albinus@gmx.de>
parents: 87004
diff changeset
1601 received any longer once the object owning this unique name has
cbcfa9b4201e * dbus.texi (Signals): Precise `dbus-register-signal'.
Michael Albinus <michael.albinus@gmx.de>
parents: 87004
diff changeset
1602 disappeared, and a new queued object has replaced it.
cbcfa9b4201e * dbus.texi (Signals): Precise `dbus-register-signal'.
Michael Albinus <michael.albinus@gmx.de>
parents: 87004
diff changeset
1603
cbcfa9b4201e * dbus.texi (Signals): Precise `dbus-register-signal'.
Michael Albinus <michael.albinus@gmx.de>
parents: 87004
diff changeset
1604 When @var{service} is @code{nil}, related signals from all D-Bus
cbcfa9b4201e * dbus.texi (Signals): Precise `dbus-register-signal'.
Michael Albinus <michael.albinus@gmx.de>
parents: 87004
diff changeset
1605 objects shall be accepted.
cbcfa9b4201e * dbus.texi (Signals): Precise `dbus-register-signal'.
Michael Albinus <michael.albinus@gmx.de>
parents: 87004
diff changeset
1606
cbcfa9b4201e * dbus.texi (Signals): Precise `dbus-register-signal'.
Michael Albinus <michael.albinus@gmx.de>
parents: 87004
diff changeset
1607 @var{path} is the corresponding D-Bus object path, @var{service} is
cbcfa9b4201e * dbus.texi (Signals): Precise `dbus-register-signal'.
Michael Albinus <michael.albinus@gmx.de>
parents: 87004
diff changeset
1608 registered at. It can also be @code{nil} if the path name of incoming
cbcfa9b4201e * dbus.texi (Signals): Precise `dbus-register-signal'.
Michael Albinus <michael.albinus@gmx.de>
parents: 87004
diff changeset
1609 signals shall not be checked.
cbcfa9b4201e * dbus.texi (Signals): Precise `dbus-register-signal'.
Michael Albinus <michael.albinus@gmx.de>
parents: 87004
diff changeset
1610
cbcfa9b4201e * dbus.texi (Signals): Precise `dbus-register-signal'.
Michael Albinus <michael.albinus@gmx.de>
parents: 87004
diff changeset
1611 @var{interface} is an interface offered by @var{service}. It must
cbcfa9b4201e * dbus.texi (Signals): Precise `dbus-register-signal'.
Michael Albinus <michael.albinus@gmx.de>
parents: 87004
diff changeset
1612 provide @var{signal}.
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1613
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1614 @var{handler} is a Lisp function to be called when the @var{signal} is
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1615 received. It must accept as arguments the output parameters
96646
5e58654e97ff * dbus.texi (Receiving Method Calls): Fix description of
Michael Albinus <michael.albinus@gmx.de>
parents: 95937
diff changeset
1616 @var{signal} is sending.
5e58654e97ff * dbus.texi (Receiving Method Calls): Fix description of
Michael Albinus <michael.albinus@gmx.de>
parents: 95937
diff changeset
1617
5e58654e97ff * dbus.texi (Receiving Method Calls): Fix description of
Michael Albinus <michael.albinus@gmx.de>
parents: 95937
diff changeset
1618 All other arguments @var{args}, if specified, must be strings. They
5e58654e97ff * dbus.texi (Receiving Method Calls): Fix description of
Michael Albinus <michael.albinus@gmx.de>
parents: 95937
diff changeset
1619 stand for the respective arguments of @var{signal} in their order, and
5e58654e97ff * dbus.texi (Receiving Method Calls): Fix description of
Michael Albinus <michael.albinus@gmx.de>
parents: 95937
diff changeset
1620 are used for filtering as well. A @code{nil} argument might be used
5e58654e97ff * dbus.texi (Receiving Method Calls): Fix description of
Michael Albinus <michael.albinus@gmx.de>
parents: 95937
diff changeset
1621 to preserve the order.
5e58654e97ff * dbus.texi (Receiving Method Calls): Fix description of
Michael Albinus <michael.albinus@gmx.de>
parents: 95937
diff changeset
1622
5e58654e97ff * dbus.texi (Receiving Method Calls): Fix description of
Michael Albinus <michael.albinus@gmx.de>
parents: 95937
diff changeset
1623 @code{dbus-register-signal} returns a Lisp object, which can be used
5e58654e97ff * dbus.texi (Receiving Method Calls): Fix description of
Michael Albinus <michael.albinus@gmx.de>
parents: 95937
diff changeset
1624 as argument in @code{dbus-unregister-object} for removing the
5e58654e97ff * dbus.texi (Receiving Method Calls): Fix description of
Michael Albinus <michael.albinus@gmx.de>
parents: 95937
diff changeset
1625 registration for @var{signal}. Example:
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1626
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
1627 @lisp
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1628 (defun my-dbus-signal-handler (device)
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1629 (message "Device %s added" device))
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1630
87158
f10e4cb7d001 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
Michael Albinus <michael.albinus@gmx.de>
parents: 87053
diff changeset
1631 @result{} my-dbus-signal-handler
f10e4cb7d001 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
Michael Albinus <michael.albinus@gmx.de>
parents: 87053
diff changeset
1632
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1633 (dbus-register-signal
87158
f10e4cb7d001 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
Michael Albinus <michael.albinus@gmx.de>
parents: 87053
diff changeset
1634 :system "org.freedesktop.Hal" "/org/freedesktop/Hal/Manager"
f10e4cb7d001 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
Michael Albinus <michael.albinus@gmx.de>
parents: 87053
diff changeset
1635 "org.freedesktop.Hal.Manager" "DeviceAdded"
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1636 'my-dbus-signal-handler)
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1637
87309
44eebe469b1f * dbus.texi (Signals): Fix example in dbus-register-signal.
Michael Albinus <michael.albinus@gmx.de>
parents: 87158
diff changeset
1638 @result{} ((:system "org.freedesktop.Hal.Manager" "DeviceAdded")
44eebe469b1f * dbus.texi (Signals): Fix example in dbus-register-signal.
Michael Albinus <michael.albinus@gmx.de>
parents: 87158
diff changeset
1639 ("org.freedesktop.Hal" "/org/freedesktop/Hal/Manager"
44eebe469b1f * dbus.texi (Signals): Fix example in dbus-register-signal.
Michael Albinus <michael.albinus@gmx.de>
parents: 87158
diff changeset
1640 my-signal-handler))
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
1641 @end lisp
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1642
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
1643 As we know from the introspection data of interface
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
1644 @samp{org.freedesktop.Hal.Manager}, the signal @samp{DeviceAdded}
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1645 provides one single parameter, which is mapped into a Lisp string.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1646 The callback function @code{my-dbus-signal-handler} must define one
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1647 single string argument therefore. Plugging an USB device to your
96802
de3f169b53eb * dbus.texi (Inspection): Rework, introduce submenus.
Michael Albinus <michael.albinus@gmx.de>
parents: 96646
diff changeset
1648 machine, when registered for signal @samp{DeviceAdded}, will show you
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1649 which objects the GNU/Linux @code{hal} daemon adds.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1650 @end defun
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1651
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1652
109963
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1653 @node Alternative Buses
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1654 @chapter Alternative buses.
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1655 @cindex bus names
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1656 @cindex UNIX domain socket
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1657
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1658 Until now, we have spoken about the system and the session buses,
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1659 which are the default buses to be connected to. However, it is
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1660 possible to connect to any bus, from which the address is known. This
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1661 is a UNIX domain socket. Everywhere, where a @var{bus} is mentioned
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1662 as argument of a function (the symbol @code{:system} or the symbol
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1663 @code{:session}), this address can be used instead. The connection to
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1664 this bus must be initialized first.
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1665
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1666 @defun dbus-init-bus bus
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1667 Establish the connection to D-Bus @var{bus}.
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1668
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1669 @var{bus} can be either the symbol @code{:system} or the symbol
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1670 @code{:session}, or it can be a string denoting the address of the
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1671 corresponding bus. For the system and session busses, this function
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1672 is called when loading @file{dbus.el}, there is no need to call it
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1673 again.
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1674
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1675 Example: You open another session bus in a terminal window on your host:
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1676
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1677 @example
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1678 # eval `dbus-launch --auto-syntax`
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1679 # echo $DBUS_SESSION_BUS_ADDRESS
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1680
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1681 @print{} unix:abstract=/tmp/dbus-JoFtAVG92w,guid=2f320a1ebe50b7ef58e
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1682 @end example
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1683
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1684 In Emacs, you can access to this bus via its address:
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1685
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1686 @lisp
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1687 (setq my-bus
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1688 "unix:abstract=/tmp/dbus-JoFtAVG92w,guid=2f320a1ebe50b7ef58e")
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1689
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1690 @result{} "unix:abstract=/tmp/dbus-JoFtAVG92w,guid=2f320a1ebe50b7ef58e"
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1691
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1692 (dbus-init-bus my-bus)
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1693
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1694 @result{} nil
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1695
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1696 (dbus-get-unique-name my-bus)
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1697
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1698 @result{} ":1.0"
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1699 @end lisp
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1700 @end defun
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1701
8a3f86c30b0c * dbus.texi (Alternative Buses): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 109186
diff changeset
1702
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1703 @node Errors and Events
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1704 @chapter Errors and events.
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1705 @cindex debugging
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1706 @cindex errors
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1707 @cindex events
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1708
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1709 The internal actions can be traced by running in a debug mode.
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1710
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1711 @defvar dbus-debug
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1712 If this variable is non-@code{nil}, D-Bus specific debug messages are raised.
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1713 @end defvar
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1714
97163
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1715 Input parameters of @code{dbus-call-method},
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1716 @code{dbus-call-method-non-blocking},
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1717 @code{dbus-call-method-asynchronously}, and
87362
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
1718 @code{dbus-register-signal} are checked for correct D-Bus types. If
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
1719 there is a type mismatch, the Lisp error @code{wrong-type-argument}
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
1720 @code{D-Bus ARG} is raised.
85cef0528c37 * dbus.texi (Type Conversion): Extend for D-Bus compound types.
Michael Albinus <michael.albinus@gmx.de>
parents: 87309
diff changeset
1721
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1722 All errors raised by D-Bus are signaled with the error symbol
87883
af599a62c634 * dbus.texi (Errors and Events): New macro dbus-ignore-errors.
Michael Albinus <michael.albinus@gmx.de>
parents: 87585
diff changeset
1723 @code{dbus-error}. If possible, error messages from D-Bus are
af599a62c634 * dbus.texi (Errors and Events): New macro dbus-ignore-errors.
Michael Albinus <michael.albinus@gmx.de>
parents: 87585
diff changeset
1724 appended to the @code{dbus-error}.
af599a62c634 * dbus.texi (Errors and Events): New macro dbus-ignore-errors.
Michael Albinus <michael.albinus@gmx.de>
parents: 87585
diff changeset
1725
af599a62c634 * dbus.texi (Errors and Events): New macro dbus-ignore-errors.
Michael Albinus <michael.albinus@gmx.de>
parents: 87585
diff changeset
1726 @defspec dbus-ignore-errors forms@dots{}
af599a62c634 * dbus.texi (Errors and Events): New macro dbus-ignore-errors.
Michael Albinus <michael.albinus@gmx.de>
parents: 87585
diff changeset
1727 This executes @var{forms} exactly like a @code{progn}, except that
af599a62c634 * dbus.texi (Errors and Events): New macro dbus-ignore-errors.
Michael Albinus <michael.albinus@gmx.de>
parents: 87585
diff changeset
1728 @code{dbus-error} errors are ignored during the @var{forms}. These
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1729 errors can be made visible when @code{dbus-debug} is set to @code{t}.
87883
af599a62c634 * dbus.texi (Errors and Events): New macro dbus-ignore-errors.
Michael Albinus <michael.albinus@gmx.de>
parents: 87585
diff changeset
1730 @end defspec
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1731
107253
691c23d02cec * dbus.el (Errors and Events): D-Bus messages are retrieved only, when
Michael Albinus <albinus@detlef>
parents: 106815
diff changeset
1732 Incoming D-Bus messages are handled as Emacs events, see @pxref{Misc
691c23d02cec * dbus.el (Errors and Events): D-Bus messages are retrieved only, when
Michael Albinus <albinus@detlef>
parents: 106815
diff changeset
1733 Events, , , elisp}. They are retrieved only, when Emacs runs in
691c23d02cec * dbus.el (Errors and Events): D-Bus messages are retrieved only, when
Michael Albinus <albinus@detlef>
parents: 106815
diff changeset
1734 interactive mode. The generated event has this form:
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1735
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
1736 @lisp
97163
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1737 (dbus-event @var{bus} @var{type} @var{serial} @var{service} @var{path} @var{interface} @var{member} @var{handler}
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1738 &rest @var{args})
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
1739 @end lisp
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1740
97163
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1741 @var{bus} identifies the D-Bus the message is coming from. It is
87049
cbcfa9b4201e * dbus.texi (Signals): Precise `dbus-register-signal'.
Michael Albinus <michael.albinus@gmx.de>
parents: 87004
diff changeset
1742 either the symbol @code{:system} or the symbol @code{:session}.
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1743
97163
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1744 @var{type} is the D-Bus message type which has caused the event. It
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1745 can be @code{dbus-message-type-invalid},
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1746 @code{dbus-message-type-method-call},
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1747 @code{dbus-message-type-method-return},
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1748 @code{dbus-message-type-error}, or @code{dbus-message-type-signal}.
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1749 @var{serial} is the serial number of the received D-Bus message.
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1750
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1751 @var{service} and @var{path} are the unique name and the object path
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1752 of the D-Bus object emitting the message. @var{interface} and
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1753 @var{member} denote the message which has been sent.
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1754
87158
f10e4cb7d001 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
Michael Albinus <michael.albinus@gmx.de>
parents: 87053
diff changeset
1755 @var{handler} is the callback function which has been registered for
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1756 this message (see @pxref{Signals}). When a @code{dbus-event} event
87158
f10e4cb7d001 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
Michael Albinus <michael.albinus@gmx.de>
parents: 87053
diff changeset
1757 arrives, @var{handler} is called with @var{args} as arguments.
f10e4cb7d001 * dbus.texi (Synchronous Methods): Adapt dbus-call-method.
Michael Albinus <michael.albinus@gmx.de>
parents: 87053
diff changeset
1758
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1759 In order to inspect the @code{dbus-event} data, you could extend the
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1760 definition of the callback function in @ref{Signals}:
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1761
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
1762 @lisp
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1763 (defun my-dbus-signal-handler (&rest args)
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1764 (message "my-dbus-signal-handler: %S" last-input-event))
91590
6834ec860aff * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
Michael Albinus <michael.albinus@gmx.de>
parents: 87883
diff changeset
1765 @end lisp
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1766
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1767 There exist convenience functions which could be called inside a
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1768 callback function in order to retrieve the information from the event.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1769
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1770 @defun dbus-event-bus-name event
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1771 Returns the bus name @var{event} is coming from.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1772 The result is either the symbol @code{:system} or the symbol @code{:session}.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1773 @end defun
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1774
97163
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1775 @defun dbus-event-message-type event
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1776 Returns the message type of the corresponding D-Bus message. The
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1777 result is a natural number.
97163
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1778 @end defun
48b3629e41d1 * dbus.texi (Arguments and Signatures): Fix example.
Michael Albinus <michael.albinus@gmx.de>
parents: 96802
diff changeset
1779
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1780 @defun dbus-event-serial-number event
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1781 Returns the serial number of the corresponding D-Bus message.
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1782 The result is a natural number.
87585
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1783 @end defun
072778cd2f17 * dbus.texi (Receiving Method Calls): New chapter.
Michael Albinus <michael.albinus@gmx.de>
parents: 87540
diff changeset
1784
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1785 @defun dbus-event-service-name event
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1786 Returns the unique name of the D-Bus object @var{event} is coming from.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1787 @end defun
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1788
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1789 @defun dbus-event-path-name event
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1790 Returns the object path of the D-Bus object @var{event} is coming from.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1791 @end defun
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1792
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1793 @defun dbus-event-interface-name event
101617
bb28e4b4c12c * dbus.texi (Errors and Events): Fix typos. Describe second parameter
Michael Albinus <michael.albinus@gmx.de>
parents: 101523
diff changeset
1794 Returns the interface name of the D-Bus object @var{event} is coming from.
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1795 @end defun
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1796
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1797 @defun dbus-event-member-name event
101617
bb28e4b4c12c * dbus.texi (Errors and Events): Fix typos. Describe second parameter
Michael Albinus <michael.albinus@gmx.de>
parents: 101523
diff changeset
1798 Returns the member name of the D-Bus object @var{event} is coming
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1799 from. It is either a signal name or a method name.
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1800 @end defun
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1801
87491
dd7c58c2342a * dbus.texi (all): Replace "..." by @dots{}.
Michael Albinus <michael.albinus@gmx.de>
parents: 87365
diff changeset
1802 D-Bus errors are not propagated during event handling, because it is
dd7c58c2342a * dbus.texi (all): Replace "..." by @dots{}.
Michael Albinus <michael.albinus@gmx.de>
parents: 87365
diff changeset
1803 usually not desired. D-Bus errors in events can be made visible by
101523
7b5ca0afd795 * dbus.texi (Errors and Events): New variable dbus-event-error-hooks.
Michael Albinus <michael.albinus@gmx.de>
parents: 100974
diff changeset
1804 setting the variable @code{dbus-debug} to @code{t}. They can also be
7b5ca0afd795 * dbus.texi (Errors and Events): New variable dbus-event-error-hooks.
Michael Albinus <michael.albinus@gmx.de>
parents: 100974
diff changeset
1805 handled by a hook function.
7b5ca0afd795 * dbus.texi (Errors and Events): New variable dbus-event-error-hooks.
Michael Albinus <michael.albinus@gmx.de>
parents: 100974
diff changeset
1806
7b5ca0afd795 * dbus.texi (Errors and Events): New variable dbus-event-error-hooks.
Michael Albinus <michael.albinus@gmx.de>
parents: 100974
diff changeset
1807 @defvar dbus-event-error-hooks
7b5ca0afd795 * dbus.texi (Errors and Events): New variable dbus-event-error-hooks.
Michael Albinus <michael.albinus@gmx.de>
parents: 100974
diff changeset
1808 This hook variable keeps a list of functions, which are called when a
7b5ca0afd795 * dbus.texi (Errors and Events): New variable dbus-event-error-hooks.
Michael Albinus <michael.albinus@gmx.de>
parents: 100974
diff changeset
1809 D-Bus error happens in the event handler. Every function must accept
101617
bb28e4b4c12c * dbus.texi (Errors and Events): Fix typos. Describe second parameter
Michael Albinus <michael.albinus@gmx.de>
parents: 101523
diff changeset
1810 two arguments, the event and the error variable catched in
bb28e4b4c12c * dbus.texi (Errors and Events): Fix typos. Describe second parameter
Michael Albinus <michael.albinus@gmx.de>
parents: 101523
diff changeset
1811 @code{condition-case} by @code{dbus-error}.
bb28e4b4c12c * dbus.texi (Errors and Events): Fix typos. Describe second parameter
Michael Albinus <michael.albinus@gmx.de>
parents: 101523
diff changeset
1812
bb28e4b4c12c * dbus.texi (Errors and Events): Fix typos. Describe second parameter
Michael Albinus <michael.albinus@gmx.de>
parents: 101523
diff changeset
1813 Such functions can be used the adapt the error signal to be raised.
bb28e4b4c12c * dbus.texi (Errors and Events): Fix typos. Describe second parameter
Michael Albinus <michael.albinus@gmx.de>
parents: 101523
diff changeset
1814 Example:
101523
7b5ca0afd795 * dbus.texi (Errors and Events): New variable dbus-event-error-hooks.
Michael Albinus <michael.albinus@gmx.de>
parents: 100974
diff changeset
1815
7b5ca0afd795 * dbus.texi (Errors and Events): New variable dbus-event-error-hooks.
Michael Albinus <michael.albinus@gmx.de>
parents: 100974
diff changeset
1816 @lisp
101617
bb28e4b4c12c * dbus.texi (Errors and Events): Fix typos. Describe second parameter
Michael Albinus <michael.albinus@gmx.de>
parents: 101523
diff changeset
1817 (defun my-dbus-event-error-handler (event error)
bb28e4b4c12c * dbus.texi (Errors and Events): Fix typos. Describe second parameter
Michael Albinus <michael.albinus@gmx.de>
parents: 101523
diff changeset
1818 (when (string-equal (concat dbus-service-emacs ".FileManager")
bb28e4b4c12c * dbus.texi (Errors and Events): Fix typos. Describe second parameter
Michael Albinus <michael.albinus@gmx.de>
parents: 101523
diff changeset
1819 (dbus-event-interface-name event))
bb28e4b4c12c * dbus.texi (Errors and Events): Fix typos. Describe second parameter
Michael Albinus <michael.albinus@gmx.de>
parents: 101523
diff changeset
1820 (message "my-dbus-event-error-handler: %S %S" event error)
bb28e4b4c12c * dbus.texi (Errors and Events): Fix typos. Describe second parameter
Michael Albinus <michael.albinus@gmx.de>
parents: 101523
diff changeset
1821 (signal 'file-error (cdr error))))
101523
7b5ca0afd795 * dbus.texi (Errors and Events): New variable dbus-event-error-hooks.
Michael Albinus <michael.albinus@gmx.de>
parents: 100974
diff changeset
1822
7b5ca0afd795 * dbus.texi (Errors and Events): New variable dbus-event-error-hooks.
Michael Albinus <michael.albinus@gmx.de>
parents: 100974
diff changeset
1823 (add-hook 'dbus-event-error-hooks 'my-dbus-event-error-handler)
7b5ca0afd795 * dbus.texi (Errors and Events): New variable dbus-event-error-hooks.
Michael Albinus <michael.albinus@gmx.de>
parents: 100974
diff changeset
1824 @end lisp
7b5ca0afd795 * dbus.texi (Errors and Events): New variable dbus-event-error-hooks.
Michael Albinus <michael.albinus@gmx.de>
parents: 100974
diff changeset
1825 @end defvar
87491
dd7c58c2342a * dbus.texi (all): Replace "..." by @dots{}.
Michael Albinus <michael.albinus@gmx.de>
parents: 87365
diff changeset
1826
101617
bb28e4b4c12c * dbus.texi (Errors and Events): Fix typos. Describe second parameter
Michael Albinus <michael.albinus@gmx.de>
parents: 101523
diff changeset
1827 Hook functions shall take into account, that there might be other
bb28e4b4c12c * dbus.texi (Errors and Events): Fix typos. Describe second parameter
Michael Albinus <michael.albinus@gmx.de>
parents: 101523
diff changeset
1828 D-Bus applications running. Therefore, they shall check carefully,
bb28e4b4c12c * dbus.texi (Errors and Events): Fix typos. Describe second parameter
Michael Albinus <michael.albinus@gmx.de>
parents: 101523
diff changeset
1829 whether a given D-Bus error is related to them.
bb28e4b4c12c * dbus.texi (Errors and Events): Fix typos. Describe second parameter
Michael Albinus <michael.albinus@gmx.de>
parents: 101523
diff changeset
1830
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1831
109186
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1832 @node Index
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1833 @unnumbered Index
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1834
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1835 @printindex cp
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1836
29eae48799da * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever
Michael Albinus <albinus@detlef>
parents: 109128
diff changeset
1837
86942
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1838 @node GNU Free Documentation License
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1839 @appendix GNU Free Documentation License
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1840 @include doclicense.texi
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1841
2fa0494ae318 * dbus.texi: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff changeset
1842 @bye