Mercurial > emacs
comparison doc/misc/dbus.texi @ 112114:2e84d340bbaf
* dbus.texi (Receiving Method Calls): Describe new optional
parameter dont-register-service of dbus-register-{method,property}.
author | Michael Albinus <michael.albinus@gmx.de> |
---|---|
date | Tue, 04 Jan 2011 13:38:33 +0100 |
parents | 5cb8f9659806 |
children | 57d3123a1003 |
comparison
equal
deleted
inserted
replaced
112113:f68ebb34e243 | 112114:2e84d340bbaf |
---|---|
7 | 7 |
8 @syncodeindex vr cp | 8 @syncodeindex vr cp |
9 @syncodeindex fn cp | 9 @syncodeindex fn cp |
10 | 10 |
11 @copying | 11 @copying |
12 Copyright @copyright{} 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | 12 Copyright @copyright{} 2007, 2008, 2009, 2010, |
13 2011 Free Software Foundation, Inc. | |
13 | 14 |
14 @quotation | 15 @quotation |
15 Permission is granted to copy, distribute and/or modify this document | 16 Permission is granted to copy, distribute and/or modify this document |
16 under the terms of the GNU Free Documentation License, Version 1.3 or | 17 under the terms of the GNU Free Documentation License, Version 1.3 or |
17 any later version published by the Free Software Foundation; with no | 18 any later version published by the Free Software Foundation; with no |
1262 The object path head "/org/gnu/Emacs" used by Emacs. All object | 1263 The object path head "/org/gnu/Emacs" used by Emacs. All object |
1263 paths, used by offered methods or signals, shall start with this | 1264 paths, used by offered methods or signals, shall start with this |
1264 string. | 1265 string. |
1265 @end deffn | 1266 @end deffn |
1266 | 1267 |
1267 @defun dbus-register-method bus service path interface method handler | 1268 @defun dbus-register-method bus service path interface method handler dont-register-service |
1268 With this function, an application registers @var{method} on the D-Bus | 1269 With this function, an application registers @var{method} on the D-Bus |
1269 @var{bus}. | 1270 @var{bus}. |
1270 | 1271 |
1271 @var{bus} is either the symbol @code{:system} or the symbol | 1272 @var{bus} is either the symbol @code{:system} or the symbol |
1272 @code{:session}. | 1273 @code{:session}. |
1273 | 1274 |
1274 @var{service} is the D-Bus service name of the D-Bus object | 1275 @var{service} is the D-Bus service name of the D-Bus object |
1275 @var{method} is registered for. It must be a known name. | 1276 @var{method} is registered for. It must be a known name (See |
1276 | 1277 discussion of @var{dont-register-service} below). |
1277 @var{path} is the D-Bus object path @var{service} is | 1278 |
1278 registered. | 1279 @var{path} is the D-Bus object path @var{service} is registered (See |
1280 discussion of @var{dont-register-service} below). | |
1279 | 1281 |
1280 @var{interface} is the interface offered by @var{service}. It must | 1282 @var{interface} is the interface offered by @var{service}. It must |
1281 provide @var{method}. | 1283 provide @var{method}. |
1282 | 1284 |
1283 @var{handler} is a Lisp function to be called when a @var{method} call | 1285 @var{handler} is a Lisp function to be called when a @var{method} call |
1291 cons cell, @var{handler} can return this object directly, instead of | 1293 cons cell, @var{handler} can return this object directly, instead of |
1292 returning a list containing the object. | 1294 returning a list containing the object. |
1293 | 1295 |
1294 In case @var{handler} shall return a reply message with an empty | 1296 In case @var{handler} shall return a reply message with an empty |
1295 argument list, @var{handler} must return the symbol @code{:ignore}. | 1297 argument list, @var{handler} must return the symbol @code{:ignore}. |
1298 | |
1299 When @var{dont-register-service} is non-@code{nil}, the known name | |
1300 @var{service} is not registered. This means that other D-Bus clients | |
1301 have no way of noticing the newly registered method. When interfaces | |
1302 are constructed incrementally by adding single methods or properties | |
1303 at a time, @var{dont-register-service} can be use to prevent other | |
1304 clients from discovering the still incomplete interface. | |
1296 | 1305 |
1297 The default D-Bus timeout when waiting for a message reply is 25 | 1306 The default D-Bus timeout when waiting for a message reply is 25 |
1298 seconds. This value could be even smaller, depending on the calling | 1307 seconds. This value could be even smaller, depending on the calling |
1299 client. Therefore, @var{handler} shall not last longer than | 1308 client. Therefore, @var{handler} shall not last longer than |
1300 absolutely necessary. | 1309 absolutely necessary. |
1366 @print{} Error org.freedesktop.DBus.Error.Failed: | 1375 @print{} Error org.freedesktop.DBus.Error.Failed: |
1367 Wrong argument list: ("/etc/hosts" "/etc/passwd") | 1376 Wrong argument list: ("/etc/hosts" "/etc/passwd") |
1368 @end example | 1377 @end example |
1369 @end defun | 1378 @end defun |
1370 | 1379 |
1371 @defun dbus-register-property bus service path interface property access value &optional emits-signal | 1380 @defun dbus-register-property bus service path interface property access value &optional emits-signal dont-register-service |
1372 With this function, an application declares a @var{property} on the D-Bus | 1381 With this function, an application declares a @var{property} on the D-Bus |
1373 @var{bus}. | 1382 @var{bus}. |
1374 | 1383 |
1375 @var{bus} is either the symbol @code{:system} or the symbol | 1384 @var{bus} is either the symbol @code{:system} or the symbol |
1376 @code{:session}. | 1385 @code{:session}. |
1377 | 1386 |
1378 @var{service} is the D-Bus service name of the D-Bus. It must be a | 1387 @var{service} is the D-Bus service name of the D-Bus. It must be a |
1379 known name. | 1388 known name. |
1380 | 1389 |
1381 @var{path} is the D-Bus object path @var{service} is | 1390 @var{path} is the D-Bus object path @var{service} is registered (See |
1382 registered. | 1391 discussion of @var{dont-register-service} below). |
1383 | 1392 |
1384 @var{interface} is the name of the interface used at @var{path}, | 1393 @var{interface} is the name of the interface used at @var{path}, |
1385 @var{property} is the name of the property of @var{interface}. | 1394 @var{property} is the name of the property of @var{interface}. |
1386 | 1395 |
1387 @var{access} indicates, whether the property can be changed by other | 1396 @var{access} indicates, whether the property can be changed by other |
1398 @var{path}, including a default handler for the @samp{Get}, | 1407 @var{path}, including a default handler for the @samp{Get}, |
1399 @samp{GetAll} and @samp{Set} methods of this interface. When | 1408 @samp{GetAll} and @samp{Set} methods of this interface. When |
1400 @var{emits-signal} is non-@code{nil}, the signal | 1409 @var{emits-signal} is non-@code{nil}, the signal |
1401 @samp{PropertiesChanged} is sent when the property is changed by | 1410 @samp{PropertiesChanged} is sent when the property is changed by |
1402 @code{dbus-set-property}. | 1411 @code{dbus-set-property}. |
1412 | |
1413 When @var{dont-register-service} is non-@code{nil}, the known name | |
1414 @var{service} is not registered. This means that other D-Bus clients | |
1415 have no way of noticing the newly registered method. When interfaces | |
1416 are constructed incrementally by adding single methods or properties | |
1417 at a time, @var{dont-register-service} can be use to prevent other | |
1418 clients from discovering the still incomplete interface. | |
1403 | 1419 |
1404 @noindent Example: | 1420 @noindent Example: |
1405 | 1421 |
1406 @lisp | 1422 @lisp |
1407 (dbus-register-property | 1423 (dbus-register-property |