extern struct glyph space_glyph;
-/* Frame being updated by update_window/update_frame. */
-
-extern struct frame *updating_frame;
-
/* Window being updated by update_window. This is non-null as long as
update_window has not finished, and null otherwise. It's role is
analogous to updating_frame. */
void prepare_desired_row P_ ((struct glyph_row *));
int line_hash_code P_ ((struct glyph_row *));
void set_window_update_flags P_ ((struct window *, int));
-void write_glyphs P_ ((struct glyph *, int));
-void insert_glyphs P_ ((struct glyph *, int));
+void write_glyphs P_ ((struct frame *, struct glyph *, int));
+void insert_glyphs P_ ((struct frame *, struct glyph *, int));
void redraw_frame P_ ((struct frame *));
void redraw_garbaged_frames P_ ((void));
int scroll_cost P_ ((struct frame *, int, int, int));
/* Defined in term.c */
-extern void ring_bell P_ ((void));
+extern void ring_bell P_ ((struct frame *));
extern void update_begin P_ ((struct frame *));
extern void update_end P_ ((struct frame *));
-extern void set_terminal_window P_ ((int));
-extern void set_scroll_region P_ ((int, int));
+extern void set_terminal_window P_ ((struct frame *, int));
+extern void set_scroll_region P_ ((struct frame *, int, int));
extern void turn_off_insert P_ ((struct tty_display_info *));
extern void turn_off_highlight P_ ((struct tty_display_info *));
extern void background_highlight P_ ((struct tty_display_info *));
-extern void clear_frame P_ ((void));
-extern void clear_end_of_line P_ ((int));
-extern void clear_end_of_line_raw P_ ((int));
-extern void tty_clear_end_of_line P_ ((int));
-extern void delete_glyphs P_ ((int));
-extern void ins_del_lines P_ ((int, int));
+extern void clear_frame P_ ((struct frame *));
+extern void clear_end_of_line P_ ((struct frame *, int));
+extern void clear_end_of_line_raw P_ ((struct frame *, int));
+extern void tty_clear_end_of_line P_ ((struct frame *, int));
+extern void delete_glyphs P_ ((struct frame *, int));
+extern void ins_del_lines P_ ((struct frame *, int, int));
extern int string_cost P_ ((char *));
extern int per_line_cost P_ ((char *));
extern void calculate_costs P_ ((struct frame *));
extern struct display *term_init P_ ((char *, char *, int));
extern void delete_tty P_ ((struct display *));
extern void fatal P_ ((/* char *, ... */));
-extern void cursor_to P_ ((int, int));
+extern void cursor_to P_ ((struct frame *, int, int));
extern int tty_capable_p P_ ((struct tty_display_info *, unsigned, unsigned long, unsigned long));
extern void tty_set_terminal_modes P_ ((struct display *));
extern void tty_reset_terminal_modes P_ ((struct display *));
if (FRAME_MSDOS_P (f))
set_terminal_modes (FRAME_DISPLAY (f));
#endif
- clear_frame ();
+ clear_frame (f);
clear_current_matrices (f);
update_end (f);
if (FRAME_TERMCAP_P (f))
else
{
if (glyphs == end - n)
- write_glyphs (glyphs, n);
+ write_glyphs (f, glyphs, n);
else
- insert_glyphs (glyphs, n);
+ insert_glyphs (f, glyphs, n);
}
w->cursor.hpos += n;
? XFASTINT (w->left_margin_cols)
: 0));
y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos);
- cursor_to (y, x);
+ cursor_to (f, y, x);
}
#ifdef HAVE_WINDOW_SYSTEM
? XFASTINT (w->left_margin_cols)
: 0));
y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos);
- cursor_to (y, x);
+ cursor_to (f, y, x);
}
if (FRAME_TERMCAP_P (f))
}
}
- cursor_to (row, col);
+ cursor_to (f, row, col);
}
else
{
x += XFASTINT (w->left_margin_cols);
/* x = max (min (x, FRAME_TOTAL_COLS (f) - 1), 0); */
- cursor_to (y, x);
+ cursor_to (f, y, x);
}
}
}
/* Write the contents of the desired line. */
if (nlen)
{
- cursor_to (vpos, 0);
- write_glyphs (nbody, nlen);
+ cursor_to (f, vpos, 0);
+ write_glyphs (f, nbody, nlen);
}
/* Don't call clear_end_of_line if we already wrote the whole
case but in the line below. */
if (nlen < FRAME_TOTAL_COLS (f))
{
- cursor_to (vpos, nlen);
- clear_end_of_line (FRAME_TOTAL_COLS (f));
+ cursor_to (f, vpos, nlen);
+ clear_end_of_line (f, FRAME_TOTAL_COLS (f));
}
else
/* Make sure we are in the right row, otherwise cursor movement
with cmgoto might use `ch' in the wrong row. */
- cursor_to (vpos, 0);
+ cursor_to (f, vpos, 0);
make_current (desired_matrix, current_matrix, vpos);
return;
++j;
/* Output this run of non-matching chars. */
- cursor_to (vpos, i);
- write_glyphs (nbody + i, j - i);
+ cursor_to (f, vpos, i);
+ write_glyphs (f, nbody + i, j - i);
i = j - 1;
/* Now find the next non-match. */
/* Clear the rest of the line, or the non-clear part of it. */
if (olen > nlen)
{
- cursor_to (vpos, nlen);
- clear_end_of_line (olen);
+ cursor_to (f, vpos, nlen);
+ clear_end_of_line (f, olen);
}
/* Make current row = desired row. */
if (nlen > nsp)
{
- cursor_to (vpos, nsp);
- write_glyphs (nbody + nsp, nlen - nsp);
+ cursor_to (f, vpos, nsp);
+ write_glyphs (f, nbody + nsp, nlen - nsp);
}
/* Exchange contents between current_frame and new_frame. */
if (osp > nsp)
{
- cursor_to (vpos, nsp);
- delete_glyphs (osp - nsp);
+ cursor_to (f, vpos, nsp);
+ delete_glyphs (f, osp - nsp);
}
else if (nsp > osp)
{
must delete first to avoid losing data in the insert */
if (endmatch && nlen < olen + nsp - osp)
{
- cursor_to (vpos, nlen - endmatch + osp - nsp);
- delete_glyphs (olen + nsp - osp - nlen);
+ cursor_to (f, vpos, nlen - endmatch + osp - nsp);
+ delete_glyphs (f, olen + nsp - osp - nlen);
olen = nlen - (nsp - osp);
}
- cursor_to (vpos, osp);
- insert_glyphs (0, nsp - osp);
+ cursor_to (f, vpos, osp);
+ insert_glyphs (f, 0, nsp - osp);
}
olen += nsp - osp;
unnecessary cursor movement. */
if (nlen - tem > 0)
{
- cursor_to (vpos, nsp + begmatch);
- write_glyphs (nbody + nsp + begmatch, nlen - tem);
+ cursor_to (f, vpos, nsp + begmatch);
+ write_glyphs (f, nbody + nsp + begmatch, nlen - tem);
}
}
else if (nlen > olen)
int out = olen - tem; /* Columns to be overwritten originally. */
int del;
- cursor_to (vpos, nsp + begmatch);
+ cursor_to (f, vpos, nsp + begmatch);
/* Calculate columns we can actually overwrite. */
while (CHAR_GLYPH_PADDING_P (nbody[nsp + begmatch + out]))
out--;
- write_glyphs (nbody + nsp + begmatch, out);
+ write_glyphs (f, nbody + nsp + begmatch, out);
/* If we left columns to be overwritten, we must delete them. */
del = olen - tem - out;
if (del > 0)
- delete_glyphs (del);
+ delete_glyphs (f, del);
/* At last, we insert columns not yet written out. */
- insert_glyphs (nbody + nsp + begmatch + out, nlen - olen + del);
+ insert_glyphs (f, nbody + nsp + begmatch + out, nlen - olen + del);
olen = nlen;
}
else if (olen > nlen)
{
- cursor_to (vpos, nsp + begmatch);
- write_glyphs (nbody + nsp + begmatch, nlen - tem);
- delete_glyphs (olen - nlen);
+ cursor_to (f, vpos, nsp + begmatch);
+ write_glyphs (f, nbody + nsp + begmatch, nlen - tem);
+ delete_glyphs (f, olen - nlen);
olen = nlen;
}
}
/* If any unerased characters remain after the new line, erase them. */
if (olen > nlen)
{
- cursor_to (vpos, nlen);
- clear_end_of_line (olen);
+ cursor_to (f, vpos, nlen);
+ clear_end_of_line (f, olen);
}
/* Exchange contents between current_frame and new_frame. */
if (noninteractive)
putchar (07);
else
- ring_bell ();
- if (FRAME_TERMCAP_P (XFRAME (selected_frame)))
- fflush (CURTTY ()->output);
+ ring_bell (XFRAME (selected_frame));
}
else
bitch_at_user ();
else if (!INTERACTIVE) /* Stop executing a keyboard macro. */
error ("Keyboard macro terminated by a command ringing the bell");
else
- ring_bell ();
- if (FRAME_TERMCAP_P (XFRAME (selected_frame)))
- fflush (CURTTY ()->output);
+ ring_bell (XFRAME (selected_frame));
}
#include "charset.h"
#include "coding.h"
#include "window.h"
+#include "frame.h"
+#include "dispextern.h"
#ifdef WINDOWSNT
#define NOMINMAX 1
int i, nbytes;
struct gcpro gcpro1;
- ring_bell ();
+ ring_bell (XFRAME (selected_frame));
args[0] = build_string ("Auto-saving %s: %s");
args[1] = current_buffer->name;
unsigned char writecount;
};
-static void do_direct_scrolling P_ ((struct glyph_matrix *,
+static void do_direct_scrolling P_ ((struct frame *,
+ struct glyph_matrix *,
struct matrix_elt *,
int, int));
-static void do_scrolling P_ ((struct glyph_matrix *,
+static void do_scrolling P_ ((struct frame *,
+ struct glyph_matrix *,
struct matrix_elt *,
int, int));
of lines. */
static void
-do_scrolling (current_matrix, matrix, window_size, unchanged_at_top)
+do_scrolling (frame, current_matrix, matrix, window_size, unchanged_at_top)
+ struct frame *frame;
struct glyph_matrix *current_matrix;
struct matrix_elt *matrix;
int window_size;
/* Set the terminal window, if not done already. */
if (! terminal_window_p)
{
- set_terminal_window (window_size + unchanged_at_top);
+ set_terminal_window (frame, window_size + unchanged_at_top);
terminal_window_p = 1;
}
/* Delete lines on the terminal. */
- ins_del_lines (j + unchanged_at_top, - p->deletecount);
+ ins_del_lines (frame, j + unchanged_at_top, - p->deletecount);
}
else
{
/* Set the terminal window if not yet done. */
if (!terminal_window_p)
{
- set_terminal_window (window_size + unchanged_at_top);
+ set_terminal_window (frame, window_size + unchanged_at_top);
terminal_window_p = 1;
}
--queue;
/* Do the deletion on the terminal. */
- ins_del_lines (queue->pos, queue->count);
+ ins_del_lines (frame, queue->pos, queue->count);
/* All lines in the range deleted become empty in the glyph
matrix. Assign to them glyph rows that are not retained.
CHECK_MATRIX (current_matrix);
if (terminal_window_p)
- set_terminal_window (0);
+ set_terminal_window (frame, 0);
}
\f
the cost matrix for this approach is constructed. */
static void
-do_direct_scrolling (current_matrix, cost_matrix, window_size,
- unchanged_at_top)
+do_direct_scrolling (frame, current_matrix, cost_matrix,
+ window_size, unchanged_at_top)
+ struct frame *frame;
struct glyph_matrix *current_matrix;
struct matrix_elt *cost_matrix;
int window_size;
if (i > j)
{
/* Immediately insert lines */
- set_terminal_window (i + unchanged_at_top);
+ set_terminal_window (frame, i + unchanged_at_top);
terminal_window_p = 1;
- ins_del_lines (j - n_to_write + unchanged_at_top, i - j);
+ ins_del_lines (frame, j - n_to_write + unchanged_at_top, i - j);
}
else if (i < j)
{
--queue;
if (queue->count)
{
- set_terminal_window (queue->window);
+ set_terminal_window (frame, queue->window);
terminal_window_p = 1;
- ins_del_lines (queue->pos, queue->count);
+ ins_del_lines (frame, queue->pos, queue->count);
}
else
{
copy_from, retained_p);
if (terminal_window_p)
- set_terminal_window (0);
+ set_terminal_window (frame, 0);
}
unchanged_at_bottom,
draw_cost, old_draw_cost,
old_hash, new_hash, free_at_end);
- do_direct_scrolling (frame->current_matrix,
+ do_direct_scrolling (frame, frame->current_matrix,
matrix, window_size, unchanged_at_top);
}
else
calculate_scrolling (frame, matrix, window_size, unchanged_at_bottom,
draw_cost, old_hash, new_hash,
free_at_end);
- do_scrolling (frame->current_matrix, matrix, window_size,
+ do_scrolling (frame,
+ frame->current_matrix, matrix, window_size,
unchanged_at_top);
}
}
int max_frame_lines;
-/* Frame currently being redisplayed; 0 if not currently redisplaying.
- (Direct output does not count). */
-
-FRAME_PTR updating_frame;
-
/* Non-zero if we have dropped our controlling tty and therefore
should not open a frame on stdout. */
static int no_controlling_tty;
#endif /* WINDOWSNT */
void
-ring_bell ()
+ring_bell (struct frame *f)
{
- struct frame *f = XFRAME (selected_frame);
-
if (!NILP (Vring_bell_function))
{
Lisp_Object function;
Vring_bell_function = function;
}
else if (FRAME_DISPLAY (f)->ring_bell_hook)
- (*FRAME_DISPLAY (f)->ring_bell_hook) ();
+ (*FRAME_DISPLAY (f)->ring_bell_hook) (f);
}
/* Ring the bell on a tty. */
void
-tty_ring_bell ()
+tty_ring_bell (struct frame *f)
{
- struct frame *f = XFRAME (selected_frame);
struct tty_display_info *tty = FRAME_TTY (f);
OUTPUT (tty, (tty->TS_visible_bell && visible_bell
? tty->TS_visible_bell
: tty->TS_bell));
+ fflush (tty->output);
}
/* Set up termcap modes for Emacs. */
update_begin (f)
struct frame *f;
{
- updating_frame = f;
if (FRAME_DISPLAY (f)->update_begin_hook)
(*FRAME_DISPLAY (f)->update_begin_hook) (f);
}
{
if (FRAME_DISPLAY (f)->update_end_hook)
(*FRAME_DISPLAY (f)->update_end_hook) (f);
- updating_frame = NULL;
}
/* Flag the end of a display update on a termcap display. */
that is bounded by calls to update_begin and update_end. */
void
-set_terminal_window (size)
+set_terminal_window (f, size)
+ struct frame *f;
int size;
{
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
-
if (FRAME_DISPLAY (f)->set_terminal_window_hook)
- (*FRAME_DISPLAY (f)->set_terminal_window_hook) (size);
+ (*FRAME_DISPLAY (f)->set_terminal_window_hook) (f, size);
}
/* The implementation of set_terminal_window for termcap frames. */
void
-tty_set_terminal_window (int size)
+tty_set_terminal_window (struct frame *f, int size)
{
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
-
struct tty_display_info *tty = FRAME_TTY (f);
tty->specified_window = size ? size : FRAME_LINES (f);
if (FRAME_SCROLL_REGION_OK (f))
- set_scroll_region (0, tty->specified_window);
+ set_scroll_region (f, 0, tty->specified_window);
}
void
-set_scroll_region (start, stop)
+set_scroll_region (f, start, stop)
+ struct frame *f;
int start, stop;
{
char *buf;
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
-
struct tty_display_info *tty = FRAME_TTY (f);
if (tty->TS_set_scroll_region)
frame-relative coordinates. */
void
-cursor_to (vpos, hpos)
+cursor_to (f, vpos, hpos)
+ struct frame *f;
int vpos, hpos;
{
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
-
if (FRAME_DISPLAY (f)->cursor_to_hook)
- (*FRAME_DISPLAY (f)->cursor_to_hook) (vpos, hpos);
+ (*FRAME_DISPLAY (f)->cursor_to_hook) (f, vpos, hpos);
}
void
-tty_cursor_to (int vpos, int hpos)
+tty_cursor_to (struct frame *f, int vpos, int hpos)
{
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
-
struct tty_display_info *tty = FRAME_TTY (f);
/* Detect the case where we are called from reset_sys_modes
/* Similar but don't take any account of the wasted characters. */
void
-raw_cursor_to (row, col)
+raw_cursor_to (f, row, col)
+ struct frame *f;
int row, col;
{
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
-
if (FRAME_DISPLAY (f)->raw_cursor_to_hook)
- (*FRAME_DISPLAY (f)->raw_cursor_to_hook) (row, col);
+ (*FRAME_DISPLAY (f)->raw_cursor_to_hook) (f, row, col);
}
void
-tty_raw_cursor_to (int row, int col)
+tty_raw_cursor_to (struct frame *f, int row, int col)
{
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
-
struct tty_display_info *tty = FRAME_TTY (f);
if (curY (tty) == row
/* Clear from cursor to end of frame. */
void
-clear_to_end ()
+clear_to_end (struct frame *f)
{
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
-
if (FRAME_DISPLAY (f)->clear_to_end_hook)
- (*FRAME_DISPLAY (f)->clear_to_end_hook) ();
+ (*FRAME_DISPLAY (f)->clear_to_end_hook) (f);
}
/* Clear from cursor to end of frame on a termcap device. */
void
-tty_clear_to_end (void)
+tty_clear_to_end (struct frame *f)
{
register int i;
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
struct tty_display_info *tty = FRAME_TTY (f);
if (tty->TS_clr_to_bottom)
{
for (i = curY (tty); i < FRAME_LINES (f); i++)
{
- cursor_to (i, 0);
- clear_end_of_line (FRAME_COLS (f));
+ cursor_to (f, i, 0);
+ clear_end_of_line (f, FRAME_COLS (f));
}
}
}
/* Clear entire frame */
void
-clear_frame ()
+clear_frame (struct frame *f)
{
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
-
if (FRAME_DISPLAY (f)->clear_frame_hook)
- (*FRAME_DISPLAY (f)->clear_frame_hook) ();
+ (*FRAME_DISPLAY (f)->clear_frame_hook) (f);
}
/* Clear an entire termcap frame. */
void
-tty_clear_frame ()
+tty_clear_frame (struct frame *f)
{
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
-
struct tty_display_info *tty = FRAME_TTY (f);
if (tty->TS_clr_frame)
}
else
{
- cursor_to (0, 0);
- clear_to_end ();
+ cursor_to (f, 0, 0);
+ clear_to_end (f);
}
}
Note that the cursor may be moved, on terminals lacking a `ce' string. */
void
-clear_end_of_line (first_unused_hpos)
+clear_end_of_line (f, first_unused_hpos)
+ struct frame *f;
int first_unused_hpos;
{
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
-
if (FRAME_DISPLAY (f)->clear_end_of_line_hook)
- (*FRAME_DISPLAY (f)->clear_end_of_line_hook) (first_unused_hpos);
+ (*FRAME_DISPLAY (f)->clear_end_of_line_hook) (f, first_unused_hpos);
}
/* An implementation of clear_end_of_line for termcap frames.
Note that the cursor may be moved, on terminals lacking a `ce' string. */
void
-tty_clear_end_of_line (int first_unused_hpos)
+tty_clear_end_of_line (struct frame *f, int first_unused_hpos)
{
register int i;
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
struct tty_display_info *tty = FRAME_TTY (f);
/* Detect the case where we are called from reset_sys_modes
Advance the nominal cursor over the text. */
void
-write_glyphs (string, len)
+write_glyphs (f, string, len)
+ struct frame *f;
register struct glyph *string;
register int len;
{
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
-
if (FRAME_DISPLAY (f)->write_glyphs_hook)
- (*FRAME_DISPLAY (f)->write_glyphs_hook) (string, len);
+ (*FRAME_DISPLAY (f)->write_glyphs_hook) (f, string, len);
}
/* An implementation of write_glyphs for termcap frames. */
void
-tty_write_glyphs (struct glyph *string, int len)
+tty_write_glyphs (struct frame *f, struct glyph *string, int len)
{
int produced, consumed;
unsigned char conversion_buffer[1024];
int conversion_buffer_size = sizeof conversion_buffer;
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
-
struct tty_display_info *tty = FRAME_TTY (f);
turn_off_insert (tty);
If start is zero, insert blanks instead of a string at start */
void
-insert_glyphs (start, len)
+insert_glyphs (f, start, len)
+ struct frame *f;
register struct glyph *start;
register int len;
{
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
-
if (len <= 0)
return;
if (FRAME_DISPLAY (f)->insert_glyphs_hook)
- (*FRAME_DISPLAY (f)->insert_glyphs_hook) (start, len);
+ (*FRAME_DISPLAY (f)->insert_glyphs_hook) (f, start, len);
}
/* An implementation of insert_glyphs for termcap frames. */
void
-tty_insert_glyphs (struct glyph *start, int len)
+tty_insert_glyphs (struct frame *f, struct glyph *start, int len)
{
char *buf;
struct glyph *glyph = NULL;
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
struct tty_display_info *tty = FRAME_TTY (f);
OUTPUT1 (tty, buf);
xfree (buf);
if (start)
- write_glyphs (start, len);
+ write_glyphs (f, start, len);
return;
}
/* Delete N glyphs at the nominal cursor position. */
void
-delete_glyphs (n)
+delete_glyphs (f, n)
+ struct frame *f;
register int n;
{
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
-
if (FRAME_DISPLAY (f)->delete_glyphs_hook)
- (*FRAME_DISPLAY (f)->delete_glyphs_hook) (n);
+ (*FRAME_DISPLAY (f)->delete_glyphs_hook) (f, n);
}
/* An implementation of delete_glyphs for termcap frames. */
void
-tty_delete_glyphs (int n)
+tty_delete_glyphs (struct frame *f, int n)
{
char *buf;
register int i;
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
struct tty_display_info *tty = FRAME_TTY (f);
/* Insert N lines at vpos VPOS. If N is negative, delete -N lines. */
void
-ins_del_lines (vpos, n)
+ins_del_lines (f, vpos, n)
+ struct frame *f;
int vpos, n;
{
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
-
if (FRAME_DISPLAY (f)->ins_del_lines_hook)
- (*FRAME_DISPLAY (f)->ins_del_lines_hook) (vpos, n);
+ (*FRAME_DISPLAY (f)->ins_del_lines_hook) (f, vpos, n);
}
/* An implementation of ins_del_lines for termcap frames. */
void
-tty_ins_del_lines (int vpos, int n)
+tty_ins_del_lines (struct frame *f, int vpos, int n)
{
- struct frame *f = (updating_frame ? updating_frame : XFRAME (selected_frame));
-
struct tty_display_info *tty = FRAME_TTY (f);
char *multi = n > 0 ? tty->TS_ins_multi_lines : tty->TS_del_multi_lines;
char *single = n > 0 ? tty->TS_ins_line : tty->TS_del_line;
}
else
{
- set_scroll_region (vpos, tty->specified_window);
+ set_scroll_region (f, vpos, tty->specified_window);
if (n < 0)
raw_cursor_to (tty->specified_window - 1, 0);
else
background_highlight (tty);
while (--i >= 0)
OUTPUTL (tty, scroll, tty->specified_window - vpos);
- set_scroll_region (0, tty->specified_window);
+ set_scroll_region (f, 0, tty->specified_window);
}
if (!FRAME_SCROLL_REGION_OK (f)
&& FRAME_MEMORY_BELOW_FRAME (f)
&& n < 0)
{
- cursor_to (FRAME_LINES (f) + n, 0);
- clear_to_end ();
+ cursor_to (f, FRAME_LINES (f) + n, 0);
+ clear_to_end (f);
}
}
\f
/* Text display hooks. */
- void (*cursor_to_hook) P_ ((int vpos, int hpos));
- void (*raw_cursor_to_hook) P_ ((int, int));
+ void (*cursor_to_hook) P_ ((struct frame *f, int vpos, int hpos));
+ void (*raw_cursor_to_hook) P_ ((struct frame *, int, int));
- void (*clear_to_end_hook) P_ ((void));
- void (*clear_frame_hook) P_ ((void));
- void (*clear_end_of_line_hook) P_ ((int));
+ void (*clear_to_end_hook) P_ ((struct frame *));
+ void (*clear_frame_hook) P_ ((struct frame *));
+ void (*clear_end_of_line_hook) P_ ((struct frame *, int));
- void (*ins_del_lines_hook) P_ ((int, int));
+ void (*ins_del_lines_hook) P_ ((struct frame *f, int, int));
- void (*insert_glyphs_hook) P_ ((struct glyph *s, int n));
- void (*write_glyphs_hook) P_ ((struct glyph *s, int n));
- void (*delete_glyphs_hook) P_ ((int));
+ 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 (*delete_glyphs_hook) P_ ((struct frame *, int));
- void (*ring_bell_hook) P_ ((void));
+ void (*ring_bell_hook) P_ ((struct frame *f));
void (*reset_terminal_modes_hook) P_ ((struct display *));
void (*set_terminal_modes_hook) P_ ((struct display *));
+
void (*update_begin_hook) P_ ((struct frame *));
void (*update_end_hook) P_ ((struct frame *));
- void (*set_terminal_window_hook) P_ ((int));
+ void (*set_terminal_window_hook) P_ ((struct frame *, int));
/* Multi-frame and mouse support hooks. */
#define FRAME_WINDOW_P(f) (0)
#endif
-
extern struct display *create_display P_ ((void));
extern void delete_display P_ ((struct display *));
{
/* Scroll last_unchanged_at_beg_row to the end of the
window down dvpos lines. */
- set_terminal_window (end);
+ set_terminal_window (f, end);
/* On dumb terminals delete dvpos lines at the end
before inserting dvpos empty lines. */
if (!FRAME_SCROLL_REGION_OK (f))
- ins_del_lines (end - dvpos, -dvpos);
+ ins_del_lines (f, end - dvpos, -dvpos);
/* Insert dvpos empty lines in front of
last_unchanged_at_beg_row. */
- ins_del_lines (from, dvpos);
+ ins_del_lines (f, from, dvpos);
}
else if (dvpos < 0)
{
/* Scroll up last_unchanged_at_beg_vpos to the end of
the window to last_unchanged_at_beg_vpos - |dvpos|. */
- set_terminal_window (end);
+ set_terminal_window (f, end);
/* Delete dvpos lines in front of
last_unchanged_at_beg_vpos. ins_del_lines will set
the cursor to the given vpos and emit |dvpos| delete
line sequences. */
- ins_del_lines (from + dvpos, dvpos);
+ ins_del_lines (f, from + dvpos, dvpos);
/* On a dumb terminal insert dvpos empty lines at the
end. */
if (!FRAME_SCROLL_REGION_OK (f))
- ins_del_lines (end + dvpos, -dvpos);
+ ins_del_lines (f, end + dvpos, -dvpos);
}
- set_terminal_window (0);
+ set_terminal_window (f, 0);
}
update_end (f);
below the menu bar. */
if (FRAME_X_WINDOW (f) && FRAME_TOOL_BAR_LINES (f) == 0)
{
- updating_frame = f;
- clear_frame ();
+ clear_frame (f);
clear_current_matrices (f);
- updating_frame = NULL;
}
/* If the tool bar gets smaller, the internal border below it
static void XTframe_up_to_date P_ ((struct frame *));
static void XTset_terminal_modes P_ ((struct display *));
static void XTreset_terminal_modes P_ ((struct display *));
-static void x_clear_frame P_ ((void));
+static void x_clear_frame P_ ((struct frame *));
static void frame_highlight P_ ((struct frame *));
static void frame_unhighlight P_ ((struct frame *));
static void x_new_focus_frame P_ ((struct x_display_info *, struct frame *));
for X frames. */
static void
-x_delete_glyphs (n)
+x_delete_glyphs (f, n)
+ struct frame *f;
register int n;
{
abort ();
frame. Otherwise clear the selected frame. */
static void
-x_clear_frame ()
+x_clear_frame (struct frame *f)
{
- struct frame *f;
-
- if (updating_frame)
- f = updating_frame;
- else
- f = SELECTED_FRAME ();
-
/* Clearing the frame will erase any cursor, so mark them all as no
longer visible. */
mark_window_cursors_off (XWINDOW (FRAME_ROOT_WINDOW (f)));
lines or deleting -N lines at vertical position VPOS. */
static void
-x_ins_del_lines (vpos, n)
+x_ins_del_lines (f, vpos, n)
+ struct frame *f;
int vpos, n;
{
abort ();