Commit 385ed61f authored by Karoly Lorentey's avatar Karoly Lorentey

Eliminated updating_frame.

src/termhooks.h (cursor_to_hook, raw_cursor_to_hook)
(clear_to_end_hook, clear_end_of_line_hook, clear_frame_hook)
(ins_del_lines_hook, insert_glyphs_hook, write_glyphs_hook)
(delete_glyphs_hook, ring_bell_hook, set_terminal_window_hook):
Added frame parameter.

src/term.c (ring_bell, tty_ring_bell, set_terminal_window)
(tty_set_terminal_window, set_scroll_region, cursor_to)
(tty_cursor_to, raw_cursor_to, tty_raw_cursor_to, clear_to_end)
(tty_clear_to_end, clear_frame, tty_clear_frame, clear_end_of_line)
(tty_clear_end_of_line, write_glyphs, tty_write_glyphs, insert_glyphs)
(tty_insert_glyphs, delete_glyphs, tty_delete_glyphs, ins_del_lines)
(tty_ins_del_lines): Added frame parameter.

src/xterm.c (x_delete_glyphs, x_clear_frame, x_ins_del_lines):
Added frame parameter.

src/scroll.c (do_direct_scrolling, do_scrolling): Added frame parameter.

src/term.c (update_begin, update_end): Don't set updating_frame.

src/xfns.c (x_set_tool_bar_lines): Ditto.

src/term.c (updating_frame): Removed.

src/dispextern.h: Updated prototypes.

src/dispnew.c (Fredraw_frame, direct_output_for_insert)
(direct_output_forward_char, update_frame_1, update_frame_line)
(ding, bitch_at_user): Added frame parameter to calls to redisplay.

src/xdisp.c (try_window_id): Ditto.

src/scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): Ditto.
src/fileio.c (auto_save_error): Ditto.

src/term.c (tty_ring_bell): Flush the output stream after beeping.
src/dispnew.c (ding, bitch_at_user): Don't fflush CURTTY.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-140
parent 5ffa0039
......@@ -968,10 +968,6 @@ extern int fonts_changed_p;
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. */
......@@ -2777,8 +2773,8 @@ void clear_glyph_row P_ ((struct glyph_row *));
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));
......@@ -2797,20 +2793,20 @@ extern Lisp_Object Qredisplay_dont_pause;
/* 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 *));
......@@ -2822,7 +2818,7 @@ extern struct display *init_initial_display P_ ((void));
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 *));
......
......@@ -3312,7 +3312,7 @@ DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 1, 1, 0,
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))
......@@ -3622,9 +3622,9 @@ direct_output_for_insert (g)
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;
......@@ -3647,7 +3647,7 @@ direct_output_for_insert (g)
? 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
......@@ -3747,7 +3747,7 @@ direct_output_forward_char (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);
}
if (FRAME_TERMCAP_P (f))
......@@ -5234,7 +5234,7 @@ update_frame_1 (f, force_p, inhibit_id_p)
}
}
cursor_to (row, col);
cursor_to (f, row, col);
}
else
{
......@@ -5256,7 +5256,7 @@ update_frame_1 (f, force_p, inhibit_id_p)
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);
}
}
}
......@@ -5472,8 +5472,8 @@ update_frame_line (f, vpos)
/* 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
......@@ -5481,13 +5481,13 @@ update_frame_line (f, vpos)
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;
......@@ -5519,8 +5519,8 @@ update_frame_line (f, vpos)
++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. */
......@@ -5530,8 +5530,8 @@ update_frame_line (f, vpos)
/* 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. */
......@@ -5553,8 +5553,8 @@ update_frame_line (f, vpos)
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. */
......@@ -5626,8 +5626,8 @@ update_frame_line (f, vpos)
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)
{
......@@ -5636,12 +5636,12 @@ update_frame_line (f, vpos)
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;
......@@ -5662,8 +5662,8 @@ update_frame_line (f, vpos)
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)
......@@ -5678,27 +5678,27 @@ update_frame_line (f, vpos)
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;
}
}
......@@ -5707,8 +5707,8 @@ update_frame_line (f, vpos)
/* 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. */
......@@ -6275,9 +6275,7 @@ terminate any keyboard macro currently executing. */)
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 ();
......@@ -6293,9 +6291,7 @@ 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));
}
......
......@@ -78,6 +78,8 @@ extern int errno;
#include "charset.h"
#include "coding.h"
#include "window.h"
#include "frame.h"
#include "dispextern.h"
#ifdef WINDOWSNT
#define NOMINMAX 1
......@@ -5619,7 +5621,7 @@ auto_save_error (error)
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;
......
......@@ -58,10 +58,12 @@ struct matrix_elt
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));
......@@ -242,7 +244,8 @@ calculate_scrolling (frame, matrix, window_size, lines_below,
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;
......@@ -309,12 +312,12 @@ do_scrolling (current_matrix, matrix, window_size, unchanged_at_top)
/* 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
{
......@@ -339,7 +342,7 @@ do_scrolling (current_matrix, matrix, window_size, unchanged_at_top)
/* 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;
}
......@@ -348,7 +351,7 @@ do_scrolling (current_matrix, matrix, window_size, unchanged_at_top)
--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.
......@@ -381,7 +384,7 @@ do_scrolling (current_matrix, matrix, window_size, unchanged_at_top)
CHECK_MATRIX (current_matrix);
if (terminal_window_p)
set_terminal_window (0);
set_terminal_window (frame, 0);
}
......@@ -652,8 +655,9 @@ calculate_direct_scrolling (frame, matrix, window_size, lines_below,
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;
......@@ -744,9 +748,9 @@ do_direct_scrolling (current_matrix, cost_matrix, 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)
{
......@@ -776,9 +780,9 @@ do_direct_scrolling (current_matrix, cost_matrix, window_size,
--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
{
......@@ -801,7 +805,7 @@ do_direct_scrolling (current_matrix, cost_matrix, window_size,
copy_from, retained_p);
if (terminal_window_p)
set_terminal_window (0);
set_terminal_window (frame, 0);
}
......@@ -827,7 +831,7 @@ scrolling_1 (frame, window_size, unchanged_at_top, unchanged_at_bottom,
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
......@@ -835,7 +839,8 @@ scrolling_1 (frame, window_size, unchanged_at_top, unchanged_at_bottom,
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);
}
}
......
This diff is collapsed.
......@@ -329,26 +329,27 @@ struct display
/* 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. */
......@@ -548,7 +549,6 @@ extern struct display *display_list;
#define FRAME_WINDOW_P(f) (0)
#endif
extern struct display *create_display P_ ((void));
extern void delete_display P_ ((struct display *));
......
......@@ -13347,36 +13347,36 @@ try_window_id (w)
{
/* 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);
......
......@@ -1370,10 +1370,8 @@ x_set_tool_bar_lines (f, value, oldval)
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
......
......@@ -344,7 +344,7 @@ static void x_update_end P_ ((struct frame *));
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 *));
......@@ -2747,7 +2747,8 @@ x_shift_glyphs_for_insert (f, x, y, width, height, shift_by)
for X frames. */
static void
x_delete_glyphs (n)
x_delete_glyphs (f, n)
struct frame *f;
register int n;
{
abort ();
......@@ -2774,15 +2775,8 @@ x_clear_area (dpy, window, x, y, width, height, exposures)
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)));
......@@ -3032,7 +3026,8 @@ XTset_terminal_window (n)
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 ();
......
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