1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-30 09:00:31 -08:00
Commit graph

31 commits

Author SHA1 Message Date
Michael Albinus
4baa2377ae * dbusbind.c (XD_ERROR, XD_DEBUG_MESSAGE): Use strncpy and
snprintf, respectively.
(xd_append_arg): Convert strings with Fstring_make_unibyte.
2008-08-28 20:28:12 +00:00
Michael Albinus
367ea1732a * dbusbind.c (xd_read_message): Handle D-Bus error messages. 2008-08-01 18:35:49 +00:00
Michael Albinus
13ecc6dc53 * dbusbind.c (Fdbus_call_method_asynchronously)
(Fdbus_method_error_internal): New defuns.
(xd_read_message): Handle also reply messages.
(Vdbus_registered_functions_table): Extend docstring.
2008-07-31 18:56:51 +00:00
Michael Albinus
c0894fb9cb * dbusbind.c (Fdbus_register_signal): Use sprintf + strcat instead
only sprintf.
2008-07-21 04:28:50 +00:00
Michael Albinus
944cc4a883 * dbusbind.c (Fdbus_register_signal): Allow also signal arguments
for filtering.
2008-07-13 15:07:10 +00:00
Glenn Morris
9ec0b715e2 Switch to recommended form of GPLv3 permissions notice. 2008-05-14 07:50:26 +00:00
Michael Albinus
48f7d2134f * dbusbind.c (dbus-get-unique-name): Remove extra copying of name string. 2008-04-13 16:29:55 +00:00
Michael Albinus
90b3fc8415 * dbusbind.c (QCdbus_timeout): New D-Bus internal symbol.
(Fdbus_call_method): New parameter TIMEOUT.
(dbus-send-signal): Optimize UNGCPRO call.
2008-03-30 12:38:49 +00:00
Michael Albinus
a8e72f4f9b * dbusbind.c (xd_read_message): Removed extra copying of message
strings.  Check for NULL `interface' or `member'.
2008-03-23 16:46:08 +00:00
Michael Albinus
b35c64e48f * dbusbind.c (xd_retrieve_arg): Pacify GCC on x86_64 GNU/Linux. 2008-01-25 18:56:46 +00:00
Michael Albinus
8c7a4ac525 * dbusbind.el (Fdbus_method_return_internal): Renamed from
Fdbus_method_return.
(Fdbus_unregister_object): Moved to dbus.el.
(Fdbus_call_method, Fdbus_method_return_internal)
(Fdbus_send_signal): Debug messages improved.
2008-01-21 20:19:16 +00:00
Michael Albinus
abe136eecd * dbusbind.c (Fdbus_method_return): New function.
(xd_read_message): Add the serial number to the event.
(Fdbus_register_method): Activate the function.
2008-01-04 21:39:47 +00:00
Michael Albinus
5125905efd * dbusbind.c (all): Replace XCAR by CAR_SAFE and XCDR by CDR_SAFE.
(xd_signature, xd_append_arg): Handle element type detection for
empty arrays.
(Fdbus_call_method, Fdbus_send_signal): Undo type casting for
SDATA () calls; this must be solved more general.
(Fdbus_register_signal): Use SBYTES instead of strlen.
2008-01-03 21:27:25 +00:00
Magnus Henoch
2c3a8b2787 * dbusbind.c (Fdbus_call_method): Handle the case of no returned
arguments.
2008-01-03 16:35:44 +00:00
Magnus Henoch
8bba1b5cbb * dbusbind.c (xd_append_arg): Use unsigned char instead of
unsigned int for byte values (necessary for big-endian platform).
2008-01-03 16:34:07 +00:00
Michael Albinus
15f16c1ba7 * dbusbind.c (xd_read_message): Use non-static input_event struct. 2007-12-31 10:22:52 +00:00
Magnus Henoch
a271e124f4 * dbusbind.c (xd_signature): Signature of variant is just "v". 2007-12-31 00:57:51 +00:00
Michael Albinus
80f9d13bff *** empty log message *** 2007-12-30 15:55:29 +00:00
Michael Albinus
17bc8f9494 * dbusbind.c: Fix several errors and compiler warnings. Reported
by Tom Tromey <tromey@redhat.com>
(XD_ERROR, XD_DEBUG_MESSAGE)
(XD_DEBUG_VALID_LISP_OBJECT_P): Wrap code with "do ... while (0)".
(xd_append_arg): Part for basic D-Bus types rewitten.
(xd_retrieve_arg): Split implementation of DBUS_TYPE_BYTE and
DBUS_TYPE_(U)INT16.  Don't call XD_DEBUG_MESSAGE with "%f" if not
appropriate.
(xd_read_message): Return Qnil.  Don't signal an error; it is not
useful during event reading.
(Fdbus_register_signal): Signal an error if the check for
FUNCTIONP fails.
(Fdbus_register_method): New function.  The implementation is not
complete, the call of the function signals an error therefore.
(Fdbus_unregister_object): New function, renamed from
Fdbus_unregister_signal.  The initial check signals an error, if
it the objct is not well formed.
2007-12-30 15:41:47 +00:00
Michael Albinus
b17f4b438f *** empty log message *** 2007-12-22 14:55:43 +00:00
Michael Albinus
9af5078b39 * dbusbind.c (xd_retrieve_arg): Handle DBUS_TYPE_BYTE,
DBUS_TYPE_INT16, DBUS_TYPE_UINT16, DBUS_TYPE_INT64,
DBUS_TYPE_UINT64, DBUS_TYPE_DOUBLE and DBUS_TYPE_SIGNATURE.
Return float when DBUS_TYPE_INT32 or DBUS_TYPE_UINT32 do not fit
as number.
(Fdbus_call_method): Fix docstring.
2007-12-22 14:54:23 +00:00
Michael Albinus
87cf1a39ef * dbusbind.c (XD_BASIC_DBUS_TYPE, XD_DBUS_TYPE_P, XD_NEXT_VALUE):
New macros.
(XD_SYMBOL_TO_DBUS_TYPE): Renamed from
XD_LISP_SYMBOL_TO_DBUS_TYPE.
(XD_OBJECT_TO_DBUS_TYPE): Renamed from
XD_LISP_OBJECT_TO_DBUS_TYPE. Simplify.
(xd_signature): New function.
(xd_append_arg): Compute also signatures.  Major rewrite.
(xd_retrieve_arg): Make debug messages friendly.
(Fdbus_call_method, Fdbus_send_signal): Extend docstring.  Check
for signatures of arguments.
2007-12-21 22:01:43 +00:00
Michael Albinus
54371585f7 * dbusbind.c (QCdbus_type_byte, QCdbus_type_boolean)
(QCdbus_type_int16, QCdbus_type_uint16, QCdbus_type_int32)
(QCdbus_type_uint32, QCdbus_type_int64, QCdbus_type_uint64)
(QCdbus_type_double, QCdbus_type_string, QCdbus_type_object_path)
(QCdbus_type_signature, QCdbus_type_array, QCdbus_type_variant)
(QCdbus_type_struct, QCdbus_type_dict_entry): New D-Bus type
symbols.
(XD_LISP_SYMBOL_TO_DBUS_TYPE): New macro.
(XD_LISP_OBJECT_TO_DBUS_TYPE): Add compound types.
(xd_retrieve_value): Removed. Functionality included in ...
(xd_append_arg): New function.
(Fdbus_call_method, Fdbus_send_signal): Apply it.
2007-12-19 22:50:22 +00:00
Michael Albinus
f5306ca30f * dbusbind.c (top): Include <stdio.h>.
(Fdbus_call_method, Fdbus_send_signal): Apply type cast in
dbus_message_new_method_call and dbus_message_new_signal.
(Fdbus_register_signal): Rename unique_name to uname.  Check
handler for FUNCTIONP instead of CHECK_SYMBOL.  Handle case of
non-existing unique name.  Fix typos in matching rule.  Return an
object which is useful in Fdbus_unregister_signal.
(Fdbus_unregister_signal): Reimplementation, in order to remove
only the corresponding entry.
(Vdbus_registered_functions_table): Change the order of entries.
Apply these changes in xd_read_message and Fdbus_register_signal.
2007-12-16 22:36:47 +00:00
Michael Albinus
eb7c7bf54e * dbusbind.c (xd_retrieve_value, xd_retrieve_arg)
(Fdbus_call_method, Fdbus_send_signal, xd_read_message): Use
`unsigned int' instead of `uint'.
(xd_read_message, Fdbus_register_signal): Split expressions into
multiple lines before operators "&&" and "||", according to the
GNU Coding Standards.
2007-12-14 21:49:52 +00:00
Michael Albinus
a31d47c7dd * dbusbind.c (xd_read_message): Generate an event for every
registered handler.  There might be several handlers registered
for the same signal.
(Fdbus_register_signal): Don't overwrite a registration for the
same signal.  Add a new registration if handlers are different.
(Vdbus_registered_functions_table): Rework doc string.
2007-12-08 12:53:37 +00:00
Michael Albinus
52da95fa96 * dbusbind.c (Fdbus_get_unique_name, xd_read_message)
(Fdbus_register_signal): Use DBUS_MAXIMUM_NAME_LENGTH and
DBUS_MAXIMUM_MATCH_RULE_LENGTH for string lengths.
(Fdbus_call_method, Fdbus_send_signal, Fdbus_register_signal):
Unify argument lists.
(xd_read_message, Fdbus_register_signal) Reorder and extend event
arguments and hash table keys.  Use unique name for service.
(Fdbus_unregister_signal): Remove checks.
(Vdbus_registered_functions_table): Fix doc string.
2007-12-07 04:40:28 +00:00
Michael Albinus
96faeb40c2 * dbusbind.c (xd_read_message): Return value is a Lisp_Object.
Move check for Vdbus_registered_functions_table to
xd_read_queued_messages.
(xd_read_queued_messages): Protect xd_read_message calls by
internal_condition_case_1.
2007-12-05 21:53:40 +00:00
Miles Bader
79f10da0c3 Add arch tagline 2007-12-04 22:41:47 +00:00
Michael Albinus
39abdd4a8a * dbusbind.c (QCdbus_system_bus, QCdbus_session_bus): Renamed from
Qdbus_system_bus and Qdbus_session_bus, respectively.
(Vdbus_intern_symbols): Removed.
(Vdbus_registered_functions_table): New hash table.
(XD_SYMBOL_INTERN_SYMBOL): Removed.
(xd_read_message, Fdbus_register_signal, Fdbus_unregister_signal):
Rewritten in order to manage registered functions by hash table
Vdbus_registered_functions_table.
2007-12-04 21:29:40 +00:00
Michael Albinus
033b73e2e0 * config.in (HAVE_DBUS): Add.
* Makefile.in: (HAVE_DBUS): Add D-Bus definitions if defined.
(ALL_CFLAGS): Add ${DBUS_CFLAGS}.
(obj): Add $(DBUS_OBJ).
(LIBES): Add $(DBUS_LIBS).
(dbusbind.o): New target.

* dbusbind.c: New file.

* emacs.c (main): Call syms_of_dbusbind when HAVE_DBUS is defined.

* keyboard.c: All D-Bus related code is wrapped by "#ifdef HAVE_DBUS".
(Qdbus_event) New Lisp symbol.
(kbd_buffer_get_event, make_lispy_event): Handle DBUS_EVENT.
(gobble_input): Call xd_read_queued_messages, reading D-Bus
messages.
(keys_of_keyboard ): Define dbus-event.

* termhooks.h (event_kind): Add DBUS_EVENT when HAVE_DBUS is defined.
2007-12-02 16:23:40 +00:00