Commit 033b73e2 authored by Michael Albinus's avatar Michael Albinus

* 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.
parent 131e4133
2007-12-02 Michael Albinus <michael.albinus@gmx.de>
* 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-01 Richard Stallman <rms@gnu.org>
* search.c (syms_of_search) <inhibit-changing-match-data>: Doc fix.
......
......@@ -262,6 +262,12 @@ TOOLKIT_DEFINES =
#endif
#endif
#ifdef HAVE_DBUS
DBUS_CFLAGS = @DBUS_CFLAGS@
DBUS_LIBS = @DBUS_LIBS@
DBUS_OBJ = dbusbind.o
#endif
/* DO NOT use -R. There is a special hack described in lastfile.c
which is used instead. Some initialized data areas are modified
at initial startup, then labeled as part of the text area when
......@@ -275,7 +281,7 @@ TOOLKIT_DEFINES =
/* C_SWITCH_X_SITE must come before C_SWITCH_X_MACHINE and C_SWITCH_X_SYSTEM
since it may have -I options that should override those two. */
ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(TOOLKIT_DEFINES) $(MYCPPFLAGS) -I. -I${srcdir} C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_SITE C_SWITCH_X_SITE C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM C_SWITCH_SYSTEM_TEMACS ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${CFLAGS}
ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(TOOLKIT_DEFINES) $(MYCPPFLAGS) -I. -I${srcdir} C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_SITE C_SWITCH_X_SITE C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM C_SWITCH_SYSTEM_TEMACS ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} ${CFLAGS}
.c.o:
$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
......@@ -588,7 +594,7 @@ emacsappsrc = ${srcdir}/../mac/Emacs.app/
whose initialized data areas should be dumped as pure by dump-emacs. */
obj= dispnew.o frame.o scroll.o xdisp.o $(XMENU_OBJ) window.o \
charset.o coding.o category.o ccl.o \
cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ)\
cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
emacs.o keyboard.o macros.o keymap.o sysdep.o \
buffer.o filelock.o insdel.o marker.o \
minibuf.o fileio.o dired.o filemode.o \
......@@ -938,8 +944,8 @@ SOME_MACHINE_LISP = ${dotdot}/lisp/mouse.elc \
Note that SunOS needs -lm to come before -lc; otherwise, you get
duplicated symbols. If the standard libraries were compiled
with GCC, we might need gnulib again after them. */
LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) $(RSVG_LIBS) LIBGPM \
LIBRESOLV LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \
LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) $(RSVG_LIBS) $(DBUS_LIBS) \
LIBGPM LIBRESOLV LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \
LIBS_DEBUG $(GETLOADAVG_LIBS) $(GNULIB_VAR) LIB_MATH LIB_STANDARD \
$(GNULIB_VAR)
......@@ -1231,6 +1237,7 @@ xsmfns.o: xsmfns.c $(config_h) systime.h sysselect.h termhooks.h xterm.h \
gtkutil.o: gtkutil.c gtkutil.h xterm.h lisp.h frame.h $(config_h) \
blockinput.h window.h atimer.h systime.h termhooks.h keyboard.h \
charset.h coding.h
dbusbind.o: dbusbind.c termhooks.h $(config_h)
hftctl.o: hftctl.c $(config_h)
sound.o: sound.c dispextern.h $(config_h)
......
......@@ -238,6 +238,9 @@ Boston, MA 02110-1301, USA. */
/* Define to 1 if you have the `grantpt' function. */
#undef HAVE_GRANTPT
/* Define to 1 if using D-BUS. */
#undef HAVE_DBUS
/* Define to 1 if using GTK. */
#undef HAVE_GTK
......
This diff is collapsed.
......@@ -353,7 +353,7 @@ int fatal_error_in_progress;
void (*fatal_error_signal_hook) P_ ((void));
#ifdef HAVE_GTK_AND_PTHREAD
/* When compiled with GTK and running under Gnome, multiple threads meay be
/* When compiled with GTK and running under Gnome, multiple threads may be
created. Keep track of our main thread to make sure signals are delivered
to it (see syssignal.h). */
......@@ -1639,6 +1639,10 @@ main (argc, argv
syms_of_fontset ();
#endif /* MAC_OSX && HAVE_CARBON */
#ifdef HAVE_DBUS
syms_of_dbusbind ();
#endif /* HAVE_DBUS */
#ifdef SYMS_SYSTEM
SYMS_SYSTEM;
#endif
......
......@@ -514,7 +514,9 @@ Lisp_Object Qsave_session;
#ifdef MAC_OS
Lisp_Object Qmac_apple_event;
#endif
#ifdef HAVE_DBUS
Lisp_Object Qdbus_event;
#endif
/* Lisp_Object Qmouse_movement; - also an event header */
/* Properties of event headers. */
......@@ -4309,6 +4311,13 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
internal_last_event_frame = frame;
kbd_fetch_ptr = event + 1;
}
#ifdef HAVE_DBUS
else if (event->kind == DBUS_EVENT)
{
obj = make_lispy_event (event);
kbd_fetch_ptr = event + 1;
}
#endif
else
{
/* If this event is on a different frame, return a switch-frame this
......@@ -6187,6 +6196,13 @@ make_lispy_event (event)
}
#endif
#ifdef HAVE_DBUS
case DBUS_EVENT:
{
return Fcons (Qdbus_event, event->arg);
}
#endif /* HAVE_DBUS */
#ifdef HAVE_GPM
case GPM_CLICK_EVENT:
{
......@@ -7001,6 +7017,11 @@ void
gobble_input (expected)
int expected;
{
#ifdef HAVE_DBUS
/* Check whether a D-Bus message has arrived. */
xd_read_queued_messages ();
#endif /* HAVE_DBUS */
#ifndef VMS
#ifdef SIGIO
if (interrupt_input)
......@@ -11793,6 +11814,11 @@ syms_of_keyboard ()
staticpro (&Qmac_apple_event);
#endif
#ifdef HAVE_DBUS
Qdbus_event = intern ("dbus-event");
staticpro (&Qdbus_event);
#endif
Qmenu_enable = intern ("menu-enable");
staticpro (&Qmenu_enable);
Qmenu_alias = intern ("menu-alias");
......@@ -12522,6 +12548,13 @@ keys_of_keyboard ()
* "handle-select-window"); */
initial_define_lispy_key (Vspecial_event_map, "save-session",
"handle-save-session");
#ifdef HAVE_DBUS
/* Define a special event which is raised for dbus callback
functions. */
initial_define_lispy_key (Vspecial_event_map, "dbus-event",
"dbus-handle-event");
#endif
}
/* Mark the pointers in the kboard objects.
......
......@@ -197,6 +197,10 @@ enum event_kind
, GPM_CLICK_EVENT
#endif
#ifdef HAVE_DBUS
, DBUS_EVENT
#endif
#ifdef WINDOWSNT
/* Generated when an APPCOMMAND event is received, in response to
Multimedia or Internet buttons on some keyboards.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment