Commit 28d7d09f authored by Karoly Lorentey's avatar Karoly Lorentey

Separate frame-local, tty-dependent parameters from tty-local parameters.

src/termchar.h (struct tty_output): Redefined to contain frame-local
tty-dependent parameters.  (Currently there are no such parameters, so
it consists of the tty_display_info pointer.)
(struct tty_display_info): New structure, with reference_count.
(FRAME_TTY): Updated to reflect new termcap frame structure.

src/term.c: Update prototypes. Use tty_display_info instead of tty_output.

src/cm.c (current_tty, cmcheckmagic, cmcostinit, calccost, cmgoto, Wcm_clear)
(Wcm_init): Use tty_display_info instead of tty_output.

src/cm.h: Update prototypes.
src/dispextern.h: Ditto.

src/dispnew.c (window_change_signal, init_display, make_terminal_frame):
Use tty_display_info instead of tty_output.

src/frame.c (Fdelete_frame): Use tty_display_info instead of
tty_output.  Fix delete_tty check.
(make_terminal_frame): Allocate f->output_data.tty.  Increase
reference count of tty device.
(delete_frame): Free f->output_data.tty.  Use reference count to
decide if the tty should be closed.

src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): New,
unconditional definitions.
(struct device): New declaration (at the moment, it is defined as
empty in termhooks.h).
(struct frame): Added display, background_pixel, foreground_pixel member.

src/keyboard.c (read_avail_input): Use tty_display_info instead of tty_output.

src/lisp.h: Declare struct display.  Update prototypes.

src/sysdep.c: Update prototypes.
(discard_tty_input, init_all_sys_modes, init_sys_modes, reset_all_sys_modes)
(reset_sys_modes, hft_init, hft_reset): Use tty_display_info instead
of tty_output.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-29
parent 819b8f00
...@@ -107,7 +107,7 @@ DIARY OF CHANGES ...@@ -107,7 +107,7 @@ DIARY OF CHANGES
-- Implement support for reading from multiple terminals. -- Implement support for reading from multiple terminals.
(Done, read_avail_input tries to read from each terminal, until one (Done, read_avail_input tries to read from each terminal, until one
succeeds. MULTIKBOARD is not used. Secondary terminals don't send succeeds. MULTI_KBOARD is not used. Secondary terminals don't send
SIGIO!) SIGIO!)
(Update: They do, now.) (Update: They do, now.)
...@@ -306,7 +306,7 @@ THINGS TO DO ...@@ -306,7 +306,7 @@ THINGS TO DO
** Fix X support. ** Fix X support.
** Allow simultaneous X and tty frames. (Handling input could be ** Allow simultaneous X and tty frames. (Handling input could be
tricky.) tricky. Or maybe not.)
** Implement support for starting an interactive Emacs session without ** Implement support for starting an interactive Emacs session without
an initial frame. (The user would connect to it and open frames an initial frame. (The user would connect to it and open frames
...@@ -332,8 +332,8 @@ THINGS TO DO ...@@ -332,8 +332,8 @@ THINGS TO DO
** Make sure C-g goes to the right frame. This is hard, as SIGINT ** Make sure C-g goes to the right frame. This is hard, as SIGINT
doesn't have a tty parameter. :-( doesn't have a tty parameter. :-(
** I have seen a case when Emacs with multiple ttys went ate 100% of ** I have seen a case when Emacs with multiple ttys fell into a loop
CPU time. Strace showed this loop: eating 100% of CPU time. Strace showed this loop:
getpid() = 30284 getpid() = 30284
......
...@@ -62,7 +62,7 @@ evalcost (c) ...@@ -62,7 +62,7 @@ evalcost (c)
} }
/* The terminal to use for low-level output. */ /* The terminal to use for low-level output. */
struct tty_output * current_tty; struct tty_display_info *current_tty;
int int
cmputc (c) cmputc (c)
...@@ -135,7 +135,7 @@ addcol (tty, n) { ...@@ -135,7 +135,7 @@ addcol (tty, n) {
* after we reach the last column; this takes us to a known state. * after we reach the last column; this takes us to a known state.
*/ */
void void
cmcheckmagic (struct tty_output *tty) cmcheckmagic (struct tty_display_info *tty)
{ {
if (curX (tty) == FrameCols (tty)) if (curX (tty) == FrameCols (tty))
{ {
...@@ -160,7 +160,7 @@ cmcheckmagic (struct tty_output *tty) ...@@ -160,7 +160,7 @@ cmcheckmagic (struct tty_output *tty)
*/ */
void void
cmcostinit (struct tty_output *tty) cmcostinit (struct tty_display_info *tty)
{ {
char *p; char *p;
...@@ -200,7 +200,8 @@ cmcostinit (struct tty_output *tty) ...@@ -200,7 +200,8 @@ cmcostinit (struct tty_output *tty)
*/ */
static int static int
calccost (struct tty_output *tty, int srcy, int srcx, int dsty, int dstx, int doit) calccost (struct tty_display_info *tty,
int srcy, int srcx, int dsty, int dstx, int doit)
{ {
register int deltay, register int deltay,
deltax, deltax,
...@@ -336,7 +337,7 @@ losecursor () ...@@ -336,7 +337,7 @@ losecursor ()
void void
cmgoto (tty, row, col) cmgoto (tty, row, col)
struct tty_output *tty; struct tty_display_info *tty;
int row, col; int row, col;
{ {
int homecost, int homecost,
...@@ -441,7 +442,7 @@ cmgoto (tty, row, col) ...@@ -441,7 +442,7 @@ cmgoto (tty, row, col)
*/ */
void void
Wcm_clear (struct tty_output *tty) Wcm_clear (struct tty_display_info *tty)
{ {
bzero (tty->Wcm, sizeof (struct cm)); bzero (tty->Wcm, sizeof (struct cm));
UP = 0; UP = 0;
...@@ -456,7 +457,7 @@ Wcm_clear (struct tty_output *tty) ...@@ -456,7 +457,7 @@ Wcm_clear (struct tty_output *tty)
*/ */
int int
Wcm_init (struct tty_output *tty) Wcm_init (struct tty_display_info *tty)
{ {
#if 0 #if 0
if (tty->Wcm->cm_abs && !tty->Wcm->cm_ds) if (tty->Wcm->cm_abs && !tty->Wcm->cm_ds)
......
...@@ -163,13 +163,13 @@ extern int evalcost (); ...@@ -163,13 +163,13 @@ extern int evalcost ();
#define emacs_tputs(tty, str, affcnt, putc) (current_tty = (tty), tputs (str, affcnt, putc)) #define emacs_tputs(tty, str, affcnt, putc) (current_tty = (tty), tputs (str, affcnt, putc))
extern struct tty_output *current_tty; extern struct tty_display_info *current_tty;
extern void cmcheckmagic P_ ((struct tty_output *)); extern void cmcheckmagic P_ ((struct tty_display_info *));
extern int cmputc P_ ((int)); extern int cmputc P_ ((int));
extern void cmcostinit P_ ((struct tty_output *)); extern void cmcostinit P_ ((struct tty_display_info *));
extern void cmgoto P_ ((struct tty_output *, int, int)); extern void cmgoto P_ ((struct tty_display_info *, int, int));
extern void Wcm_clear P_ ((struct tty_output *)); extern void Wcm_clear P_ ((struct tty_display_info *));
extern int Wcm_init P_ ((struct tty_output *)); extern int Wcm_init P_ ((struct tty_display_info *));
/* arch-tag: acc1535a-7136-49d6-b22d-9bc85702251b /* arch-tag: acc1535a-7136-49d6-b22d-9bc85702251b
(do not change this comment) */ (do not change this comment) */
...@@ -2738,25 +2738,25 @@ extern void update_begin P_ ((struct frame *)); ...@@ -2738,25 +2738,25 @@ extern void update_begin P_ ((struct frame *));
extern void update_end P_ ((struct frame *)); extern void update_end P_ ((struct frame *));
extern void set_terminal_window P_ ((int)); extern void set_terminal_window P_ ((int));
extern void set_scroll_region P_ ((int, int)); extern void set_scroll_region P_ ((int, int));
extern void turn_off_insert P_ ((struct tty_output *)); extern void turn_off_insert P_ ((struct tty_display_info *));
extern void turn_off_highlight P_ ((struct tty_output *)); extern void turn_off_highlight P_ ((struct tty_display_info *));
extern void background_highlight P_ ((struct tty_output *)); extern void background_highlight P_ ((struct tty_display_info *));
extern void clear_frame P_ ((void)); extern void clear_frame P_ ((void));
extern void clear_end_of_line P_ ((int)); extern void clear_end_of_line P_ ((int));
extern void clear_end_of_line_raw P_ ((int)); extern void clear_end_of_line_raw P_ ((int));
extern void tty_clear_end_of_line P_ ((struct tty_output *, int)); extern void tty_clear_end_of_line P_ ((struct tty_display_info *, int));
extern void delete_glyphs P_ ((int)); extern void delete_glyphs P_ ((int));
extern void ins_del_lines P_ ((int, int)); extern void ins_del_lines P_ ((int, int));
extern int string_cost P_ ((char *)); extern int string_cost P_ ((char *));
extern int per_line_cost P_ ((char *)); extern int per_line_cost P_ ((char *));
extern void calculate_costs P_ ((struct frame *)); extern void calculate_costs P_ ((struct frame *));
extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object)); extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object));
extern void tty_setup_colors P_ ((struct tty_output *, int)); extern void tty_setup_colors P_ ((struct tty_display_info *, int));
extern struct tty_output *term_init P_ ((Lisp_Object, char *, char *)); extern struct tty_display_info *term_init P_ ((Lisp_Object, char *, char *));
extern struct tty_output *term_dummy_init P_ ((void)); extern struct tty_display_info *term_dummy_init P_ ((void));
extern void fatal P_ ((/* char *, ... */)); extern void fatal P_ ((/* char *, ... */));
void cursor_to P_ ((int, int)); void cursor_to P_ ((int, int));
extern int tty_capable_p P_ ((struct tty_output *, unsigned, unsigned long, unsigned long)); extern int tty_capable_p P_ ((struct tty_display_info *, unsigned, unsigned long, unsigned long));
/* Defined in scroll.c */ /* Defined in scroll.c */
......
...@@ -5916,7 +5916,7 @@ window_change_signal (signalnum) /* If we don't have an argument, */ ...@@ -5916,7 +5916,7 @@ window_change_signal (signalnum) /* If we don't have an argument, */
#endif #endif
int old_errno = errno; int old_errno = errno;
struct tty_output *tty; struct tty_display_info *tty;
/* The frame size change obviously applies to a single /* The frame size change obviously applies to a single
termcap-controlled terminal, but we can't decide which. termcap-controlled terminal, but we can't decide which.
...@@ -6625,7 +6625,7 @@ For types not defined in VMS, use define emacs_term \"TYPE\".\n\ ...@@ -6625,7 +6625,7 @@ For types not defined in VMS, use define emacs_term \"TYPE\".\n\
#endif /* VMS */ #endif /* VMS */
{ {
struct tty_output *tty; struct tty_display_info *tty;
tty = term_init (selected_frame, 0, terminal_type); tty = term_init (selected_frame, 0, terminal_type);
change_frame_size (XFRAME (selected_frame), FrameRows (tty), FrameCols (tty), 0, 0, 0); change_frame_size (XFRAME (selected_frame), FrameRows (tty), FrameCols (tty), 0, 0, 0);
......
...@@ -544,20 +544,27 @@ make_terminal_frame (tty_name, tty_type) ...@@ -544,20 +544,27 @@ make_terminal_frame (tty_name, tty_type)
make_mac_terminal_frame (f); make_mac_terminal_frame (f);
#else #else
{ {
struct tty_output *tty; struct tty_display_info *tty;
f->output_method = output_termcap; f->output_method = output_termcap;
f->output_data.tty = (struct tty_output *) xmalloc (sizeof (struct tty_output));
bzero (f->output_data.tty, sizeof (struct tty_output));
FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
if (initialized) if (initialized)
{ {
/* Note that term_init may signal an error, but then it is its /* Note that term_init may signal an error, but then it is its
responsibility to make sure this frame is deleted. */ responsibility to make sure this frame is deleted. */
f->output_data.tty = term_init (frame, tty_name, tty_type); f->output_data.tty->display_info = term_init (frame, tty_name, tty_type);
} }
else else
{ {
/* init_display() will reinitialize the terminal with correct values after dump. */ /* init_display() will reinitialize the terminal with correct values after dump. */
f->output_data.tty = term_dummy_init (); f->output_data.tty->display_info = term_dummy_init ();
} }
FRAME_TTY (f)->reference_count++;
} }
#ifdef CANNOT_DUMP #ifdef CANNOT_DUMP
...@@ -1390,28 +1397,17 @@ The functions are run with one arg, the frame to be deleted. */) ...@@ -1390,28 +1397,17 @@ The functions are run with one arg, the frame to be deleted. */)
if (FRAME_TERMCAP_P (f)) if (FRAME_TERMCAP_P (f))
{ {
Lisp_Object tail, frame1;
int delete = 1; int delete = 1;
struct tty_output *tty = FRAME_TTY (f); struct tty_display_info *tty = FRAME_TTY (f);
/* delete_tty will call us recursively, so better kill the if (! --tty->reference_count)
frame now. */
f->output_data.nothing = 0;
/* See if the terminal needs to be closed. */
FOR_EACH_FRAME (tail, frame1)
{ {
if (frame1 != frame /* delete_tty would call us recursively if we don't kill the
&& FRAME_LIVE_P (XFRAME (frame1)) frame now. */
&& FRAME_TERMCAP_P (XFRAME (frame1)) xfree (f->output_data.tty);
&& FRAME_TTY (XFRAME (frame1)) == FRAME_TTY (f)) f->output_data.nothing = 0;
{ delete_tty (tty);
delete = 0;
break;
}
} }
if (delete)
delete_tty (tty);
} }
else else
{ {
......
...@@ -65,34 +65,10 @@ enum text_cursor_kinds ...@@ -65,34 +65,10 @@ enum text_cursor_kinds
HBAR_CURSOR HBAR_CURSOR
}; };
#if !defined(MSDOS) && !defined(WINDOWSNT) && !defined(MAC_OS) #define FRAME_FOREGROUND_PIXEL(f) ((f)->foreground_pixel)
#define FRAME_BACKGROUND_PIXEL(f) ((f)->background_pixel)
#if !defined(HAVE_X_WINDOWS) struct device;
#define PIX_TYPE unsigned long
/* A (mostly empty) x_output structure definition for building Emacs
on Unix and GNU/Linux without X support. */
struct x_output
{
PIX_TYPE background_pixel;
PIX_TYPE foreground_pixel;
};
#endif /* ! HAVE_X_WINDOWS */
#define FRAME_FOREGROUND_PIXEL(f) \
(((f)->output_method == output_termcap) \
? ((f)->output_data.tty->foreground_pixel) \
: ((f)->output_data.x->foreground_pixel))
#define FRAME_BACKGROUND_PIXEL(f) \
(((f)->output_method == output_termcap) \
? ((f)->output_data.tty->background_pixel) \
: ((f)->output_data.x->background_pixel))
#endif /* ! MSDOS && ! WINDOWSNT && ! MAC_OS */
struct frame struct frame
{ {
...@@ -280,12 +256,15 @@ struct frame ...@@ -280,12 +256,15 @@ struct frame
/* Canonical Y unit. Height of a line, in pixels. */ /* Canonical Y unit. Height of a line, in pixels. */
int line_height; int line_height;
/* The display hooks to use with this frame. */
struct display *display;
/* The output method says how the contents of this frame /* The output method says how the contents of this frame
are displayed. It could be using termcap, or using an X window. */ are displayed. It could be using termcap, or using an X window. */
enum output_method output_method; enum output_method output_method;
/* A structure of auxiliary data used for displaying the contents. /* A structure of auxiliary data used for displaying the contents.
struct tty_output is used for terminal frames; struct tty_output is used for termcap frames;
it is defined in term.h. it is defined in term.h.
struct x_output is used for X window frames; struct x_output is used for X window frames;
it is defined in xterm.h. it is defined in xterm.h.
...@@ -457,6 +436,10 @@ struct frame ...@@ -457,6 +436,10 @@ struct frame
Clear the frame in clear_garbaged_frames if set. */ Clear the frame in clear_garbaged_frames if set. */
unsigned resized_p : 1; unsigned resized_p : 1;
/* All display backends seem to need these two pixel values. */
unsigned long background_pixel;
unsigned long foreground_pixel;
/* Set to non-zero if the default face for the frame has been /* Set to non-zero if the default face for the frame has been
realized. Reset to zero whenever the default face changes. realized. Reset to zero whenever the default face changes.
Used to see the difference between a font change and face change. */ Used to see the difference between a font change and face change. */
......
...@@ -6612,7 +6612,7 @@ read_avail_input (expected) ...@@ -6612,7 +6612,7 @@ read_avail_input (expected)
of characters on some systems when input is stuffed at us. */ of characters on some systems when input is stuffed at us. */
unsigned char cbuf[KBD_BUFFER_SIZE - 1]; unsigned char cbuf[KBD_BUFFER_SIZE - 1];
int n_to_read; int n_to_read;
struct tty_output *tty; struct tty_display_info *tty;
Lisp_Object frame; Lisp_Object frame;
#ifdef WINDOWSNT #ifdef WINDOWSNT
......
...@@ -2937,7 +2937,10 @@ EXFUN (Fx_popup_dialog, 2); ...@@ -2937,7 +2937,10 @@ EXFUN (Fx_popup_dialog, 2);
extern void syms_of_xmenu P_ ((void)); extern void syms_of_xmenu P_ ((void));
/* defined in termchar.h */ /* defined in termchar.h */
struct tty_output; struct tty_display_info;
/* defined in termhooks.h */
struct display;
/* defined in sysdep.c */ /* defined in sysdep.c */
extern void stuff_char P_ ((char c)); extern void stuff_char P_ ((char c));
...@@ -2945,8 +2948,8 @@ extern void init_sigio P_ ((int)); ...@@ -2945,8 +2948,8 @@ extern void init_sigio P_ ((int));
extern void sys_subshell P_ ((void)); extern void sys_subshell P_ ((void));
extern void sys_suspend P_ ((void)); extern void sys_suspend P_ ((void));
extern void discard_tty_input P_ ((void)); extern void discard_tty_input P_ ((void));
extern void init_sys_modes P_ ((struct tty_output *)); extern void init_sys_modes P_ ((struct tty_display_info *));
extern void reset_sys_modes P_ ((struct tty_output *)); extern void reset_sys_modes P_ ((struct tty_display_info *));
extern void init_all_sys_modes P_ ((void)); extern void init_all_sys_modes P_ ((void));
extern void reset_all_sys_modes P_ ((void)); extern void reset_all_sys_modes P_ ((void));
extern void wait_for_termination P_ ((int)); extern void wait_for_termination P_ ((int));
......
...@@ -252,8 +252,8 @@ int emacs_ospeed; ...@@ -252,8 +252,8 @@ int emacs_ospeed;
void croak P_ ((char *)); void croak P_ ((char *));
#ifdef AIXHFT #ifdef AIXHFT
void hft_init P_ ((struct tty_output *)); void hft_init P_ ((struct tty_display_info *));
void hft_reset P_ ((struct tty_output *)); void hft_reset P_ ((struct tty_display_info *));
#endif #endif
/* Temporary used by `sigblock' when defined in terms of signprocmask. */ /* Temporary used by `sigblock' when defined in terms of signprocmask. */
...@@ -285,7 +285,7 @@ discard_tty_input () ...@@ -285,7 +285,7 @@ discard_tty_input ()
#else /* not VMS */ #else /* not VMS */
#ifdef APOLLO #ifdef APOLLO
{ {
struct tty_output *tty; struct tty_display_info *tty;
for (tty = tty_list; tty; tty = tty->next) for (tty = tty_list; tty; tty = tty->next)
{ {
int zero = 0; int zero = 0;
...@@ -298,7 +298,7 @@ discard_tty_input () ...@@ -298,7 +298,7 @@ discard_tty_input ()
; ;
#else /* not MSDOS */ #else /* not MSDOS */
{ {
struct tty_output *tty; struct tty_display_info *tty;
for (tty = tty_list; tty; tty = tty->next) for (tty = tty_list; tty; tty = tty->next)
{ {
EMACS_GET_TTY (fileno (TTY_INPUT (tty)), &buf); EMACS_GET_TTY (fileno (TTY_INPUT (tty)), &buf);
...@@ -1295,14 +1295,14 @@ static struct tchars new_tchars = {-1,-1,-1,-1,-1,-1}; ...@@ -1295,14 +1295,14 @@ static struct tchars new_tchars = {-1,-1,-1,-1,-1,-1};
void void
init_all_sys_modes (void) init_all_sys_modes (void)
{ {
struct tty_output *tty; struct tty_display_info *tty;
for (tty = tty_list; tty; tty = tty->next) for (tty = tty_list; tty; tty = tty->next)
init_sys_modes (tty); init_sys_modes (tty);
} }
void void
init_sys_modes (tty_out) init_sys_modes (tty_out)
struct tty_output *tty_out; struct tty_display_info *tty_out;
{ {
struct emacs_tty tty; struct emacs_tty tty;
...@@ -1796,7 +1796,7 @@ set_window_size (fd, height, width) ...@@ -1796,7 +1796,7 @@ set_window_size (fd, height, width)
void void
reset_all_sys_modes (void) reset_all_sys_modes (void)
{ {
struct tty_output *tty; struct tty_display_info *tty;
for (tty = tty_list; tty; tty = tty->next) for (tty = tty_list; tty; tty = tty->next)
reset_sys_modes (tty); reset_sys_modes (tty);
} }
...@@ -1805,7 +1805,7 @@ reset_all_sys_modes (void) ...@@ -1805,7 +1805,7 @@ reset_all_sys_modes (void)
bottom of the frame, turn off interrupt-driven I/O, etc. */ bottom of the frame, turn off interrupt-driven I/O, etc. */
void void
reset_sys_modes (tty_out) reset_sys_modes (tty_out)
struct tty_output *tty_out; struct tty_display_info *tty_out;
{ {
if (noninteractive) if (noninteractive)
{ {
...@@ -5110,7 +5110,7 @@ srandom (seed) ...@@ -5110,7 +5110,7 @@ srandom (seed)
/* Called from init_sys_modes. */ /* Called from init_sys_modes. */
void void
hft_init (struct tty_output *tty_out) hft_init (struct tty_display_info *tty_out)
{ {
int junk; int junk;
...@@ -5165,7 +5165,7 @@ hft_init (struct tty_output *tty_out) ...@@ -5165,7 +5165,7 @@ hft_init (struct tty_output *tty_out)
/* Reset the rubout key to backspace. */ /* Reset the rubout key to backspace. */
void void
hft_reset (struct tty_output *tty_out) hft_reset (struct tty_display_info *tty_out)
{ {
struct hfbuf buf; struct hfbuf buf;
struct hfkeymap keymap; struct hfkeymap keymap;
......
...@@ -69,11 +69,11 @@ extern int tgetnum P_ ((char *id)); ...@@ -69,11 +69,11 @@ extern int tgetnum P_ ((char *id));
static void turn_on_face P_ ((struct frame *, int face_id)); static void turn_on_face P_ ((struct frame *, int face_id));
static void turn_off_face P_ ((struct frame *, int face_id)); static void turn_off_face P_ ((struct frame *, int face_id));
static void tty_show_cursor P_ ((struct tty_output *)); static void tty_show_cursor P_ ((struct tty_display_info *));
static void tty_hide_cursor P_ ((struct tty_output *)); static void tty_hide_cursor P_ ((struct tty_display_info *));
void delete_tty P_ ((struct tty_output *)); void delete_tty P_ ((struct tty_display_info *));
static void delete_tty_1 P_ ((struct tty_output *)); static void delete_tty_1 P_ ((struct tty_display_info *));
#define OUTPUT(tty, a) \ #define OUTPUT(tty, a) \
...@@ -102,7 +102,7 @@ Lisp_Object Vring_bell_function; ...@@ -102,7 +102,7 @@ Lisp_Object Vring_bell_function;
/* Terminal characteristics that higher levels want to look at. */ /* Terminal characteristics that higher levels want to look at. */
struct tty_output *tty_list; struct tty_display_info *tty_list;
/* Nonzero means no need to redraw the entire frame on resuming a /* Nonzero means no need to redraw the entire frame on resuming a
suspended Emacs. This is useful on terminals with multiple suspended Emacs. This is useful on terminals with multiple
...@@ -319,12 +319,12 @@ ring_bell () ...@@ -319,12 +319,12 @@ ring_bell ()
else if (!FRAME_TERMCAP_P (f)) else if (!FRAME_TERMCAP_P (f))
(*ring_bell_hook) (); (*ring_bell_hook) ();
else { else {
struct tty_output *tty = FRAME_TTY (f); struct tty_display_info *tty = FRAME_TTY (f);
OUTPUT (tty, tty->TS_visible_bell && visible_bell ? tty->TS_visible_bell : tty->TS_bell); OUTPUT (tty, tty->TS_visible_bell && visible_bell ? tty->TS_visible_bell : tty->TS_bell);
} }
} }
void tty_set_terminal_modes (struct tty_output *tty) void tty_set_terminal_modes (struct tty_display_info *tty)
{ {
OUTPUT_IF (tty, tty->TS_termcap_modes); OUTPUT_IF (tty, tty->TS_termcap_modes);
OUTPUT_IF (tty, tty->TS_cursor_visible); OUTPUT_IF (tty, tty->TS_cursor_visible);
...@@ -342,7 +342,7 @@ set_terminal_modes () ...@@ -342,7 +342,7 @@ set_terminal_modes ()
(*set_terminal_modes_hook) (); (*set_terminal_modes_hook) ();
} }
void tty_reset_terminal_modes (struct tty_output *tty) void tty_reset_terminal_modes (struct tty_display_info *tty)
{ {
turn_off_highlight (tty); turn_off_highlight (tty);
turn_off_insert (tty); turn_off_insert (tty);
...@@ -380,7 +380,7 @@ update_end (f) ...@@ -380,7 +380,7 @@ update_end (f)
{ {
if (FRAME_TERMCAP_P (f)) if (FRAME_TERMCAP_P (f))
{ {
struct tty_output *tty = FRAME_TTY (f); struct tty_display_info *tty = FRAME_TTY (f);
if (!XWINDOW (selected_window)->cursor_off_p) if (!XWINDOW (selected_window)->cursor_off_p)
tty_show_cursor (tty); tty_show_cursor (tty);
turn_off_insert (tty); turn_off_insert (tty);
...@@ -399,7 +399,7 @@ set_terminal_window (size) ...@@ -399,7 +399,7 @@ set_terminal_window (size)
struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame)); struct frame *f = (updating_frame ? updating_frame :