aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Albinus2020-09-08 16:24:11 +0200
committerMichael Albinus2020-09-08 16:24:11 +0200
commit39230fadbc7eb5428246334d7e41936e5c06254d (patch)
treee51ca675f0952263e3c8eecca5c26d58baa4a445 /src
parent65565a16cfb16881c625f4431fd8d8f85a892ecc (diff)
downloademacs-39230fadbc7eb5428246334d7e41936e5c06254d.tar.gz
emacs-39230fadbc7eb5428246334d7e41936e5c06254d.zip
Implement typed D-Bus properties (Bug#43252)
* doc/misc/dbus.texi (Properties and Annotations) (Receiving Method Call): Document optional type symbol in `dbus-set-property' and `dbus-register-property'. * lisp/net/dbus.el (dbus-error-unknown-interface) (dbus-error-unknown-method, dbus-error-unknown-object) (dbus-error-unknown-property): New defconsts. (dbus-peer-handler): Improve error handling. (dbus-introspect-get-signature): Handle also properties. (dbus-set-property, dbus-register-property): Allow optional TYPE symbol for VALUE. (Bug#43252) (dbus-property-handler): Implement property types. Improve error handling. * src/dbusbind.c (dbus-message-internal, dbus-registered-objects-table): Fix docstring. * test/lisp/net/dbus-tests.el (dbus-test05-register-property): Extend test. (dbus-test05-register-property-several-paths): New test.
Diffstat (limited to 'src')
-rw-r--r--src/dbusbind.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/dbusbind.c b/src/dbusbind.c
index b637c0e58aa..af294afe92c 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -1252,7 +1252,7 @@ The following usages are expected:
1252 1252
1253`dbus-method-error-internal': 1253`dbus-method-error-internal':
1254 (dbus-message-internal 1254 (dbus-message-internal
1255 dbus-message-type-error BUS SERVICE SERIAL &rest ARGS) 1255 dbus-message-type-error BUS SERVICE SERIAL ERROR-NAME &rest ARGS)
1256 1256
1257usage: (dbus-message-internal &rest REST) */) 1257usage: (dbus-message-internal &rest REST) */)
1258 (ptrdiff_t nargs, Lisp_Object *args) 1258 (ptrdiff_t nargs, Lisp_Object *args)
@@ -1572,10 +1572,9 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus)
1572 EVENT_INIT (event); 1572 EVENT_INIT (event);
1573 event.kind = DBUS_EVENT; 1573 event.kind = DBUS_EVENT;
1574 event.frame_or_window = Qnil; 1574 event.frame_or_window = Qnil;
1575 event.arg = 1575 event.arg = Fcons (value,
1576 Fcons (value, 1576 (mtype == DBUS_MESSAGE_TYPE_ERROR)
1577 (mtype == DBUS_MESSAGE_TYPE_ERROR) 1577 ? (Fcons (build_string (error_name), args)) : args);
1578 ? (Fcons (build_string (error_name), args)) : args);
1579 } 1578 }
1580 1579
1581 else /* DBUS_MESSAGE_TYPE_METHOD_CALL, DBUS_MESSAGE_TYPE_SIGNAL. */ 1580 else /* DBUS_MESSAGE_TYPE_METHOD_CALL, DBUS_MESSAGE_TYPE_SIGNAL. */
@@ -1748,7 +1747,8 @@ syms_of_dbusbind (void)
1748 DEFSYM (QCstruct, ":struct"); 1747 DEFSYM (QCstruct, ":struct");
1749 DEFSYM (QCdict_entry, ":dict-entry"); 1748 DEFSYM (QCdict_entry, ":dict-entry");
1750 1749
1751 /* Lisp symbols of objects in `dbus-registered-objects-table'. */ 1750 /* Lisp symbols of objects in `dbus-registered-objects-table'.
1751 `:property', which does exist there as well, is not used here. */
1752 DEFSYM (QCserial, ":serial"); 1752 DEFSYM (QCserial, ":serial");
1753 DEFSYM (QCmethod, ":method"); 1753 DEFSYM (QCmethod, ":method");
1754 DEFSYM (QCsignal, ":signal"); 1754 DEFSYM (QCsignal, ":signal");
@@ -1826,8 +1826,8 @@ registered methods and properties, UNAME is nil. PATH is the object
1826path of the sending object. All of them can be nil, which means a 1826path of the sending object. All of them can be nil, which means a
1827wildcard then. OBJECT is either the handler to be called when a D-Bus 1827wildcard then. OBJECT is either the handler to be called when a D-Bus
1828message, which matches the key criteria, arrives (TYPE `:method' and 1828message, which matches the key criteria, arrives (TYPE `:method' and
1829`:signal'), or a cons cell containing the value of the property (TYPE 1829`:signal'), or a list containing the value of the property and its
1830`:property'). 1830attributes (TYPE `:property').
1831 1831
1832For entries of type `:signal', there is also a fifth element RULE, 1832For entries of type `:signal', there is also a fifth element RULE,
1833which keeps the match string the signal is registered with. 1833which keeps the match string the signal is registered with.