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> 2007-12-01 Richard Stallman <rms@gnu.org>
* search.c (syms_of_search) <inhibit-changing-match-data>: Doc fix. * search.c (syms_of_search) <inhibit-changing-match-data>: Doc fix.
......
...@@ -262,6 +262,12 @@ TOOLKIT_DEFINES = ...@@ -262,6 +262,12 @@ TOOLKIT_DEFINES =
#endif #endif
#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 /* DO NOT use -R. There is a special hack described in lastfile.c
which is used instead. Some initialized data areas are modified which is used instead. Some initialized data areas are modified
at initial startup, then labeled as part of the text area when at initial startup, then labeled as part of the text area when
...@@ -275,7 +281,7 @@ TOOLKIT_DEFINES = ...@@ -275,7 +281,7 @@ TOOLKIT_DEFINES =
/* C_SWITCH_X_SITE must come before C_SWITCH_X_MACHINE and C_SWITCH_X_SYSTEM /* 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. */ 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: .c.o:
$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
...@@ -588,7 +594,7 @@ emacsappsrc = ${srcdir}/../mac/Emacs.app/ ...@@ -588,7 +594,7 @@ emacsappsrc = ${srcdir}/../mac/Emacs.app/
whose initialized data areas should be dumped as pure by dump-emacs. */ 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 \ obj= dispnew.o frame.o scroll.o xdisp.o $(XMENU_OBJ) window.o \
charset.o coding.o category.o ccl.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 \ emacs.o keyboard.o macros.o keymap.o sysdep.o \
buffer.o filelock.o insdel.o marker.o \ buffer.o filelock.o insdel.o marker.o \
minibuf.o fileio.o dired.o filemode.o \ minibuf.o fileio.o dired.o filemode.o \
...@@ -938,8 +944,8 @@ SOME_MACHINE_LISP = ${dotdot}/lisp/mouse.elc \ ...@@ -938,8 +944,8 @@ SOME_MACHINE_LISP = ${dotdot}/lisp/mouse.elc \
Note that SunOS needs -lm to come before -lc; otherwise, you get Note that SunOS needs -lm to come before -lc; otherwise, you get
duplicated symbols. If the standard libraries were compiled duplicated symbols. If the standard libraries were compiled
with GCC, we might need gnulib again after them. */ with GCC, we might need gnulib again after them. */
LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) $(RSVG_LIBS) LIBGPM \ LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) $(RSVG_LIBS) $(DBUS_LIBS) \
LIBRESOLV LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \ LIBGPM LIBRESOLV LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \
LIBS_DEBUG $(GETLOADAVG_LIBS) $(GNULIB_VAR) LIB_MATH LIB_STANDARD \ LIBS_DEBUG $(GETLOADAVG_LIBS) $(GNULIB_VAR) LIB_MATH LIB_STANDARD \
$(GNULIB_VAR) $(GNULIB_VAR)
...@@ -1228,9 +1234,10 @@ xselect.o: xselect.c process.h dispextern.h frame.h xterm.h blockinput.h \ ...@@ -1228,9 +1234,10 @@ xselect.o: xselect.c process.h dispextern.h frame.h xterm.h blockinput.h \
xrdb.o: xrdb.c $(config_h) epaths.h xrdb.o: xrdb.c $(config_h) epaths.h
xsmfns.o: xsmfns.c $(config_h) systime.h sysselect.h termhooks.h xterm.h \ xsmfns.o: xsmfns.c $(config_h) systime.h sysselect.h termhooks.h xterm.h \
lisp.h termopts.h lisp.h termopts.h
gtkutil.o: gtkutil.c gtkutil.h xterm.h lisp.h frame.h $(config_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 \ blockinput.h window.h atimer.h systime.h termhooks.h keyboard.h \
charset.h coding.h charset.h coding.h
dbusbind.o: dbusbind.c termhooks.h $(config_h)
hftctl.o: hftctl.c $(config_h) hftctl.o: hftctl.c $(config_h)
sound.o: sound.c dispextern.h $(config_h) sound.o: sound.c dispextern.h $(config_h)
......
...@@ -238,6 +238,9 @@ Boston, MA 02110-1301, USA. */ ...@@ -238,6 +238,9 @@ Boston, MA 02110-1301, USA. */
/* Define to 1 if you have the `grantpt' function. */ /* Define to 1 if you have the `grantpt' function. */
#undef HAVE_GRANTPT #undef HAVE_GRANTPT
/* Define to 1 if using D-BUS. */
#undef HAVE_DBUS
/* Define to 1 if using GTK. */ /* Define to 1 if using GTK. */
#undef HAVE_GTK #undef HAVE_GTK
......
This diff is collapsed.
...@@ -353,7 +353,7 @@ int fatal_error_in_progress; ...@@ -353,7 +353,7 @@ int fatal_error_in_progress;
void (*fatal_error_signal_hook) P_ ((void)); void (*fatal_error_signal_hook) P_ ((void));
#ifdef HAVE_GTK_AND_PTHREAD #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 created. Keep track of our main thread to make sure signals are delivered
to it (see syssignal.h). */ to it (see syssignal.h). */
...@@ -1639,6 +1639,10 @@ main (argc, argv ...@@ -1639,6 +1639,10 @@ main (argc, argv
syms_of_fontset (); syms_of_fontset ();
#endif /* MAC_OSX && HAVE_CARBON */ #endif /* MAC_OSX && HAVE_CARBON */
#ifdef HAVE_DBUS
syms_of_dbusbind ();
#endif /* HAVE_DBUS */
#ifdef SYMS_SYSTEM #ifdef SYMS_SYSTEM
SYMS_SYSTEM; SYMS_SYSTEM;
#endif #endif
......
...@@ -514,7 +514,9 @@ Lisp_Object Qsave_session; ...@@ -514,7 +514,9 @@ Lisp_Object Qsave_session;
#ifdef MAC_OS #ifdef MAC_OS
Lisp_Object Qmac_apple_event; Lisp_Object Qmac_apple_event;
#endif #endif
#ifdef HAVE_DBUS
Lisp_Object Qdbus_event;
#endif
/* Lisp_Object Qmouse_movement; - also an event header */ /* Lisp_Object Qmouse_movement; - also an event header */
/* Properties of event headers. */ /* Properties of event headers. */
...@@ -1570,7 +1572,7 @@ command_loop_1 () ...@@ -1570,7 +1572,7 @@ command_loop_1 ()
#ifdef MULTI_KBOARD #ifdef MULTI_KBOARD
int was_locked = single_kboard; int was_locked = single_kboard;
#endif #endif
#endif #endif
int already_adjusted = 0; int already_adjusted = 0;
current_kboard->Vprefix_arg = Qnil; current_kboard->Vprefix_arg = Qnil;
...@@ -2566,7 +2568,7 @@ do { if (polling_stopped_here) start_polling (); \ ...@@ -2566,7 +2568,7 @@ do { if (polling_stopped_here) start_polling (); \
USED_MOUSE_MENU is null, we don't dereference it. USED_MOUSE_MENU is null, we don't dereference it.
Value is -2 when we find input on another keyboard. A second call Value is -2 when we find input on another keyboard. A second call
to read_char will read it. to read_char will read it.
If END_TIME is non-null, it is a pointer to an EMACS_TIME If END_TIME is non-null, it is a pointer to an EMACS_TIME
specifying the maximum time to wait until. If no input arrives by specifying the maximum time to wait until. If no input arrives by
...@@ -3181,7 +3183,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) ...@@ -3181,7 +3183,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
int count = SPECPDL_INDEX (); int count = SPECPDL_INDEX ();
record_single_kboard_state (); record_single_kboard_state ();
#endif #endif
last_input_char = c; last_input_char = c;
Fcommand_execute (tem, Qnil, Fvector (1, &last_input_char), Qt); Fcommand_execute (tem, Qnil, Fvector (1, &last_input_char), Qt);
...@@ -4097,7 +4099,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time) ...@@ -4097,7 +4099,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
events. */ events. */
if (CONSP (Vunread_command_events)) if (CONSP (Vunread_command_events))
break; break;
if (kbd_fetch_ptr != kbd_store_ptr) if (kbd_fetch_ptr != kbd_store_ptr)
break; break;
#if defined (HAVE_MOUSE) || defined (HAVE_GPM) #if defined (HAVE_MOUSE) || defined (HAVE_GPM)
...@@ -4309,6 +4311,13 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time) ...@@ -4309,6 +4311,13 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
internal_last_event_frame = frame; internal_last_event_frame = frame;
kbd_fetch_ptr = event + 1; 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 else
{ {
/* If this event is on a different frame, return a switch-frame this /* If this event is on a different frame, return a switch-frame this
...@@ -6187,6 +6196,13 @@ make_lispy_event (event) ...@@ -6187,6 +6196,13 @@ make_lispy_event (event)
} }
#endif #endif
#ifdef HAVE_DBUS
case DBUS_EVENT:
{
return Fcons (Qdbus_event, event->arg);
}
#endif /* HAVE_DBUS */
#ifdef HAVE_GPM #ifdef HAVE_GPM
case GPM_CLICK_EVENT: case GPM_CLICK_EVENT:
{ {
...@@ -7001,6 +7017,11 @@ void ...@@ -7001,6 +7017,11 @@ void
gobble_input (expected) gobble_input (expected)
int expected; int expected;
{ {
#ifdef HAVE_DBUS
/* Check whether a D-Bus message has arrived. */
xd_read_queued_messages ();
#endif /* HAVE_DBUS */
#ifndef VMS #ifndef VMS
#ifdef SIGIO #ifdef SIGIO
if (interrupt_input) if (interrupt_input)
...@@ -7120,7 +7141,7 @@ read_avail_input (expected) ...@@ -7120,7 +7141,7 @@ read_avail_input (expected)
nread += nr; nread += nr;
expected = 0; expected = 0;
} }
if (nr == -1) /* Not OK to read input now. */ if (nr == -1) /* Not OK to read input now. */
{ {
err = 1; err = 1;
...@@ -7128,7 +7149,7 @@ read_avail_input (expected) ...@@ -7128,7 +7149,7 @@ read_avail_input (expected)
else if (nr == -2) /* Non-transient error. */ else if (nr == -2) /* Non-transient error. */
{ {
/* The terminal device terminated; it should be closed. */ /* The terminal device terminated; it should be closed. */
/* Kill Emacs if this was our last terminal. */ /* Kill Emacs if this was our last terminal. */
if (!terminal_list->next_terminal) if (!terminal_list->next_terminal)
/* Formerly simply reported no input, but that /* Formerly simply reported no input, but that
...@@ -7140,7 +7161,7 @@ read_avail_input (expected) ...@@ -7140,7 +7161,7 @@ read_avail_input (expected)
group? Perhaps on systems with FIONREAD Emacs is group? Perhaps on systems with FIONREAD Emacs is
alone in its group. */ alone in its group. */
kill (getpid (), SIGHUP); kill (getpid (), SIGHUP);
/* XXX Is calling delete_terminal safe here? It calls Fdelete_frame. */ /* XXX Is calling delete_terminal safe here? It calls Fdelete_frame. */
if (t->delete_terminal_hook) if (t->delete_terminal_hook)
(*t->delete_terminal_hook) (t); (*t->delete_terminal_hook) (t);
...@@ -7313,14 +7334,14 @@ tty_read_avail_input (struct terminal *terminal, ...@@ -7313,14 +7334,14 @@ tty_read_avail_input (struct terminal *terminal,
buf.modifiers = meta_modifier; buf.modifiers = meta_modifier;
if (tty->meta_key != 2) if (tty->meta_key != 2)
cbuf[i] &= ~0x80; cbuf[i] &= ~0x80;
buf.code = cbuf[i]; buf.code = cbuf[i];
/* Set the frame corresponding to the active tty. Note that the /* Set the frame corresponding to the active tty. Note that the
value of selected_frame is not reliable here, redisplay tends value of selected_frame is not reliable here, redisplay tends
to temporarily change it. */ to temporarily change it. */
buf.frame_or_window = tty->top_frame; buf.frame_or_window = tty->top_frame;
buf.arg = Qnil; buf.arg = Qnil;
kbd_buffer_store_event (&buf); kbd_buffer_store_event (&buf);
/* Don't look at input that follows a C-g too closely. /* Don't look at input that follows a C-g too closely.
This reduces lossage due to autorepeat on C-g. */ This reduces lossage due to autorepeat on C-g. */
...@@ -9236,7 +9257,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, ...@@ -9236,7 +9257,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
last_nonmenu_event = Qnil; last_nonmenu_event = Qnil;
delayed_switch_frame = Qnil; delayed_switch_frame = Qnil;
if (INTERACTIVE) if (INTERACTIVE)
{ {
if (!NILP (prompt)) if (!NILP (prompt))
...@@ -11252,7 +11273,7 @@ See also `current-input-mode'. */) ...@@ -11252,7 +11273,7 @@ See also `current-input-mode'. */)
new_interrupt_input = 1; new_interrupt_input = 1;
#endif #endif
if (new_interrupt_input != interrupt_input) if (new_interrupt_input != interrupt_input)
{ {
#ifdef POLL_FOR_INPUT #ifdef POLL_FOR_INPUT
stop_polling (); stop_polling ();
...@@ -11332,7 +11353,7 @@ See also `current-input-mode'. */) ...@@ -11332,7 +11353,7 @@ See also `current-input-mode'. */)
struct terminal *t = get_terminal (terminal, 1); struct terminal *t = get_terminal (terminal, 1);
struct tty_display_info *tty; struct tty_display_info *tty;
int new_meta; int new_meta;
if (t == NULL || t->type != output_termcap) if (t == NULL || t->type != output_termcap)
return Qnil; return Qnil;
tty = t->display_info.tty; tty = t->display_info.tty;
...@@ -11344,7 +11365,7 @@ See also `current-input-mode'. */) ...@@ -11344,7 +11365,7 @@ See also `current-input-mode'. */)
else else
new_meta = 2; new_meta = 2;
if (tty->meta_key != new_meta) if (tty->meta_key != new_meta)
{ {
#ifndef DOS_NT #ifndef DOS_NT
/* this causes startup screen to be restored and messes with the mouse */ /* this causes startup screen to be restored and messes with the mouse */
...@@ -11352,7 +11373,7 @@ See also `current-input-mode'. */) ...@@ -11352,7 +11373,7 @@ See also `current-input-mode'. */)
#endif #endif
tty->meta_key = new_meta; tty->meta_key = new_meta;
#ifndef DOS_NT #ifndef DOS_NT
init_sys_modes (tty); init_sys_modes (tty);
#endif #endif
...@@ -11384,7 +11405,7 @@ See also `current-input-mode'. */) ...@@ -11384,7 +11405,7 @@ See also `current-input-mode'. */)
/* this causes startup screen to be restored and messes with the mouse */ /* this causes startup screen to be restored and messes with the mouse */
reset_sys_modes (tty); reset_sys_modes (tty);
#endif #endif
/* Don't let this value be out of range. */ /* Don't let this value be out of range. */
quit_char = XINT (quit) & (tty->meta_key == 0 ? 0177 : 0377); quit_char = XINT (quit) & (tty->meta_key == 0 ? 0177 : 0377);
...@@ -11394,7 +11415,7 @@ See also `current-input-mode'. */) ...@@ -11394,7 +11415,7 @@ See also `current-input-mode'. */)
return Qnil; return Qnil;
} }
DEFUN ("set-input-mode", Fset_input_mode, Sset_input_mode, 3, 4, 0, DEFUN ("set-input-mode", Fset_input_mode, Sset_input_mode, 3, 4, 0,
doc: /* Set mode of reading keyboard input. doc: /* Set mode of reading keyboard input.
First arg INTERRUPT non-nil means use input interrupts; First arg INTERRUPT non-nil means use input interrupts;
...@@ -11793,6 +11814,11 @@ syms_of_keyboard () ...@@ -11793,6 +11814,11 @@ syms_of_keyboard ()
staticpro (&Qmac_apple_event); staticpro (&Qmac_apple_event);
#endif #endif
#ifdef HAVE_DBUS
Qdbus_event = intern ("dbus-event");
staticpro (&Qdbus_event);
#endif
Qmenu_enable = intern ("menu-enable"); Qmenu_enable = intern ("menu-enable");
staticpro (&Qmenu_enable); staticpro (&Qmenu_enable);
Qmenu_alias = intern ("menu-alias"); Qmenu_alias = intern ("menu-alias");
...@@ -12355,7 +12381,7 @@ here. If a mapping is defined in both the current ...@@ -12355,7 +12381,7 @@ here. If a mapping is defined in both the current
`local-function-key-map' binding and this variable, then the local `local-function-key-map' binding and this variable, then the local
definition will take precendence. */); definition will take precendence. */);
Vfunction_key_map = Fmake_sparse_keymap (Qnil); Vfunction_key_map = Fmake_sparse_keymap (Qnil);
DEFVAR_LISP ("key-translation-map", &Vkey_translation_map, DEFVAR_LISP ("key-translation-map", &Vkey_translation_map,
doc: /* Keymap of key translations that can override keymaps. doc: /* Keymap of key translations that can override keymaps.
This keymap works like `function-key-map', but comes after that, This keymap works like `function-key-map', but comes after that,
...@@ -12477,7 +12503,7 @@ and tool-bar buttons. */); ...@@ -12477,7 +12503,7 @@ and tool-bar buttons. */);
/* Vwindow_system is left at t for now. */ /* Vwindow_system is left at t for now. */
initial_kboard->next_kboard = all_kboards; initial_kboard->next_kboard = all_kboards;
all_kboards = initial_kboard; all_kboards = initial_kboard;
#endif #endif
} }
void void
...@@ -12522,6 +12548,13 @@ keys_of_keyboard () ...@@ -12522,6 +12548,13 @@ keys_of_keyboard ()
* "handle-select-window"); */ * "handle-select-window"); */
initial_define_lispy_key (Vspecial_event_map, "save-session", initial_define_lispy_key (Vspecial_event_map, "save-session",
"handle-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. /* Mark the pointers in the kboard objects.
......
...@@ -197,6 +197,10 @@ enum event_kind ...@@ -197,6 +197,10 @@ enum event_kind
, GPM_CLICK_EVENT , GPM_CLICK_EVENT
#endif #endif
#ifdef HAVE_DBUS
, DBUS_EVENT
#endif
#ifdef WINDOWSNT #ifdef WINDOWSNT
/* Generated when an APPCOMMAND event is received, in response to /* Generated when an APPCOMMAND event is received, in response to
Multimedia or Internet buttons on some keyboards. Multimedia or Internet buttons on some keyboards.
...@@ -336,7 +340,7 @@ struct terminal ...@@ -336,7 +340,7 @@ struct terminal
/* All fields before `next_terminal' should be Lisp_Object and are traced /* All fields before `next_terminal' should be Lisp_Object and are traced
by the GC. All fields afterwards are ignored by the GC. */ by the GC. All fields afterwards are ignored by the GC. */
/* Chain of all terminal devices. */ /* Chain of all terminal devices. */
struct terminal *next_terminal; struct terminal *next_terminal;
...@@ -382,12 +386,12 @@ struct terminal ...@@ -382,12 +386,12 @@ struct terminal
/* Terminal characteristics. */ /* Terminal characteristics. */
/* XXX Are these really used on non-termcap displays? */ /* XXX Are these really used on non-termcap displays? */
int must_write_spaces; /* Nonzero means spaces in the text must int must_write_spaces; /* Nonzero means spaces in the text must
actually be output; can't just skip over actually be output; can't just skip over
some columns to leave them blank. */ some columns to leave them blank. */
int fast_clear_end_of_line; /* Nonzero means terminal has a `ce' string */ int fast_clear_end_of_line; /* Nonzero means terminal has a `ce' string */
int line_ins_del_ok; /* Terminal can insert and delete lines */ int line_ins_del_ok; /* Terminal can insert and delete lines */
int char_ins_del_ok; /* Terminal can insert and delete chars */ int char_ins_del_ok; /* Terminal can insert and delete chars */
int scroll_region_ok; /* Terminal supports setting the scroll int scroll_region_ok; /* Terminal supports setting the scroll
...@@ -410,24 +414,24 @@ struct terminal ...@@ -410,24 +414,24 @@ struct terminal
struct redisplay_interface *rif; struct redisplay_interface *rif;
/* Frame-based redisplay interface. */ /* Frame-based redisplay interface. */
/* Text display hooks. */ /* Text display hooks. */
void (*cursor_to_hook) P_ ((struct frame *f, int vpos, int hpos)); void (*cursor_to_hook) P_ ((struct frame *f, int vpos, int hpos));
void (*raw_cursor_to_hook) P_ ((struct frame *, int, int)); void (*raw_cursor_to_hook) P_ ((struct frame *, int, int));
void (*clear_to_end_hook) P_ ((struct frame *)); void (*clear_to_end_hook) P_ ((struct frame *));
void (*clear_frame_hook) P_ ((struct frame *)); void (*clear_frame_hook) P_ ((struct frame *));
void (*clear_end_of_line_hook) P_ ((struct frame *, int)); void (*clear_end_of_line_hook) P_ ((struct frame *, int));
void (*ins_del_lines_hook) P_ ((struct frame *f, int, int)); void (*ins_del_lines_hook) P_ ((struct frame *f, int, int));
void (*insert_glyphs_hook) P_ ((struct frame *f, struct glyph *s, int n)); void (*insert_glyphs_hook) P_ ((struct frame *f, struct glyph *s, int n));
void (*write_glyphs_hook) P_ ((struct frame *f, struct glyph *s, int n)); void (*write_glyphs_hook) P_ ((struct frame *f, struct glyph *s, int n));
void (*delete_glyphs_hook) P_ ((struct frame *, int)); void (*delete_glyphs_hook) P_ ((struct frame *, int));
void (*ring_bell_hook) P_ ((struct frame *f)); void (*ring_bell_hook) P_ ((struct frame *f));
void (*reset_terminal_modes_hook) P_ ((struct terminal *)); void (*reset_terminal_modes_hook) P_ ((struct terminal *));
void (*set_terminal_modes_hook) P_ ((struct terminal *)); void (*set_terminal_modes_hook) P_ ((struct terminal *));
...@@ -442,7 +446,7 @@ struct terminal ...@@ -442,7 +446,7 @@ struct terminal
Set *f to the frame the mouse is in, or zero if the mouse is in no Set *f to the frame the mouse is in, or zero if the mouse is in no
Emacs frame. If it is set to zero, all the other arguments are Emacs frame. If it is set to zero, all the other arguments are
garbage. garbage.
If the motion started in a scroll bar, set *bar_window to the If the motion started in a scroll bar, set *bar_window to the
scroll bar's window, *part to the part the mouse is currently over, scroll bar's window, *part to the part the mouse is currently over,
*x to the position of the mouse along the scroll bar, and *y to the *x to the position of the mouse along the scroll bar, and *y to the
...@@ -452,7 +456,7 @@ struct terminal ...@@ -452,7 +456,7 @@ struct terminal
row of the character cell the mouse is over. row of the character cell the mouse is over.
Set *time to the time the mouse was at the returned position. Set *time to the time the mouse was at the returned position.
This should clear mouse_moved until the next motion This should clear mouse_moved until the next motion
event arrives. */ event arrives. */
void (*mouse_position_hook) P_ ((struct frame **f, int, void (*mouse_position_hook) P_ ((struct frame **f, int,
...@@ -478,7 +482,7 @@ struct terminal ...@@ -478,7 +482,7 @@ struct terminal
hook is zero, that means the terminal we're displaying on doesn't hook is zero, that means the terminal we're displaying on doesn't
support overlapping frames, so there's no need to raise or lower support overlapping frames, so there's no need to raise or lower
anything. anything.
If RAISE is non-zero, F is brought to the front, before all other If RAISE is non-zero, F is brought to the front, before all other
windows. If RAISE is zero, F is sent to the back, behind all other windows. If RAISE is zero, F is sent to the back, behind all other
windows. */ windows. */
...@@ -488,7 +492,7 @@ struct terminal ...@@ -488,7 +492,7 @@ struct terminal
For example, if going from fullscreen to not fullscreen this hook For example, if going from fullscreen to not fullscreen this hook
may do something OS dependent, like extended window manager hints on X11. */ may do something OS dependent, like extended window manager hints on X11. */
void (*fullscreen_hook) P_ ((struct frame *f)); void (*fullscreen_hook) P_ ((struct frame *f));
/* Scroll bar hooks. */ /* Scroll bar hooks. */
...@@ -497,21 +501,21 @@ struct terminal ...@@ -497,21 +501,21 @@ struct terminal
lisp objects. This allows us to place references to them in lisp objects. This allows us to place references to them in
Lisp_Windows without worrying about those references becoming Lisp_Windows without worrying about those references becoming
dangling references when the scroll bar is destroyed. dangling references when the scroll bar is destroyed.
The window-system-independent portion of Emacs just refers to The window-system-independent portion of Emacs just refers to
scroll bars via their windows, and never looks inside the scroll bar scroll bars via their windows, and never looks inside the scroll bar
representation; it always uses hook functions to do all the representation; it always uses hook functions to do all the
scroll bar manipulation it needs. scroll bar manipulation it needs.
The `vertical_scroll_bar' field of a Lisp_Window refers to that The `vertical_scroll_bar' field of a Lisp_Window refers to that
window's scroll bar, or is nil if the window doesn't have a window's scroll bar, or is nil if the window doesn't have a
scroll bar. scroll bar.
The `scroll_bars' and `condemned_scroll_bars' fields of a Lisp_Frame The `scroll_bars' and `condemned_scroll_bars' fields of a Lisp_Frame
are free for use by the scroll bar implementation in any way it sees are free for use by the scroll bar implementation in any way it sees
fit. They are marked by the garbage collector. */ fit. They are marked by the garbage collector. */
/* Set the vertical scroll bar for WINDOW to have its upper left corner /* Set the vertical scroll bar for WINDOW to have its upper left corner
at (TOP, LEFT), and be LENGTH rows high. Set its handle to at (TOP, LEFT), and be LENGTH rows high. Set its handle to
indicate that we are displaying PORTION characters out of a total indicate that we are displaying PORTION characters out of a total
...@@ -529,16 +533,16 @@ struct terminal ...@@ -529,16 +533,16 @@ struct terminal
Instead, we just assert at the beginning of redisplay that *all* Instead, we just assert at the beginning of redisplay that *all*