static void allocate_matrices_for_window_redisplay (struct window *);
static int realloc_glyph_pool (struct glyph_pool *, struct dim);
static void adjust_frame_glyphs (struct frame *);
-struct glyph_matrix *new_glyph_matrix (struct glyph_pool *);
+static struct glyph_matrix *new_glyph_matrix (struct glyph_pool *);
static void free_glyph_matrix (struct glyph_matrix *);
static void adjust_glyph_matrix (struct window *, struct glyph_matrix *,
int, int, struct dim);
static void change_frame_size_1 (struct frame *, int, int, int, int, int);
+static void increment_row_positions (struct glyph_row *, EMACS_INT, EMACS_INT);
static void swap_glyph_pointers (struct glyph_row *, struct glyph_row *);
#if GLYPH_DEBUG
static int glyph_row_slice_p (struct glyph_row *, struct glyph_row *);
static void make_current (struct glyph_matrix *, struct glyph_matrix *,
int);
static void mirror_make_current (struct window *, int);
-void check_window_matrix_pointers (struct window *);
#if GLYPH_DEBUG
static void check_matrix_pointers (struct glyph_matrix *,
struct glyph_matrix *);
static int update_window_tree (struct window *, int);
static int update_window (struct window *, int);
static int update_frame_1 (struct frame *, int, int);
+static int scrolling (struct frame *);
static void set_window_cursor_after_update (struct window *);
static void adjust_frame_glyphs_for_window_redisplay (struct frame *);
static void adjust_frame_glyphs_for_frame_redisplay (struct frame *);
/* 1 means SIGWINCH happened when not safe. */
-int delayed_size_change;
+static int delayed_size_change;
/* 1 means glyph initialization has been completed at startup. */
/* Counts of allocated structures. These counts serve to diagnose
memory leaks and double frees. */
-int glyph_matrix_count;
-int glyph_pool_count;
+static int glyph_matrix_count;
+static int glyph_pool_count;
/* If non-null, the frame whose frame matrices are manipulated. If
null, window matrices are worked on. */
static unsigned history_tick;
static void add_frame_display_history (struct frame *, int);
-static void add_window_display_history (struct window *, char *, int);
\f
/* Add to the redisplay history how window W has been displayed.
MSG is a trace containing the information how W's glyph matrix
has been interrupted for pending input. */
static void
-add_window_display_history (struct window *w, char *msg, int paused_p)
+add_window_display_history (struct window *w, const char *msg, int paused_p)
{
char *buf;
history_tick++,
w,
((BUFFERP (w->buffer)
- && STRINGP (XBUFFER (w->buffer)->name))
- ? SSDATA (XBUFFER (w->buffer)->name)
+ && STRINGP (BVAR (XBUFFER (w->buffer), name)))
+ ? SSDATA (BVAR (XBUFFER (w->buffer), name))
: "???"),
paused_p ? " ***paused***" : "");
strcat (buf, msg);
member `pool' of the glyph matrix structure returned is set to
POOL, the structure is otherwise zeroed. */
-struct glyph_matrix *
+static struct glyph_matrix *
new_glyph_matrix (struct glyph_pool *pool)
{
struct glyph_matrix *result;
row->visible_height -= min_y - row->y;
if (row->y + row->height > max_y)
row->visible_height -= row->y + row->height - max_y;
+ if (row->fringe_bitmap_periodic_p)
+ row->redraw_fringe_bitmaps_p = 1;
}
}
the used count of the text area is zero. Such rows display line
ends. */
-void
+static void
increment_row_positions (struct glyph_row *row,
EMACS_INT delta, EMACS_INT delta_bytes)
{
/* Exchange pointers to glyph memory between glyph rows A and B. */
-static INLINE void
+static inline void
swap_glyph_pointers (struct glyph_row *a, struct glyph_row *b)
{
int i;
/* Copy glyph row structure FROM to glyph row structure TO, except
that glyph pointers in the structures are left unchanged. */
-static INLINE void
+static inline void
copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from)
{
struct glyph *pointers[1 + LAST_AREA];
exchanged between TO and FROM. Pointers must be exchanged to avoid
a memory leak. */
-static INLINE void
+static inline void
assign_row (struct glyph_row *to, struct glyph_row *from)
{
swap_glyph_pointers (to, from);
and B have equal contents. MOUSE_FACE_P non-zero means compare the
mouse_face_p flags of A and B, too. */
-static INLINE int
+static inline int
row_equal_p (struct glyph_row *a, struct glyph_row *b, int mouse_face_p)
{
if (a == b)
|| a->cursor_in_fringe_p != b->cursor_in_fringe_p
|| a->left_fringe_bitmap != b->left_fringe_bitmap
|| a->left_fringe_face_id != b->left_fringe_face_id
+ || a->left_fringe_offset != b->left_fringe_offset
|| a->right_fringe_bitmap != b->right_fringe_bitmap
|| a->right_fringe_face_id != b->right_fringe_face_id
+ || a->right_fringe_offset != b->right_fringe_offset
+ || a->fringe_bitmap_periodic_p != b->fringe_bitmap_periodic_p
|| a->overlay_arrow_bitmap != b->overlay_arrow_bitmap
|| a->exact_window_width_line_p != b->exact_window_width_line_p
|| a->overlapped_p != b->overlapped_p
stdout.
*/
+void flush_stdout (void) EXTERNALLY_VISIBLE;
+
void
flush_stdout (void)
{
/* Do it for the root window. */
XSETFASTINT (root->top_line, top_margin);
+ XSETFASTINT (root->total_lines, frame_lines - 1 - top_margin);
XSETFASTINT (root->total_cols, frame_cols);
- set_window_height (sf->root_window, frame_lines - 1 - top_margin, 0);
/* Do it for the mini-buffer window. */
XSETFASTINT (mini->top_line, frame_lines - 1);
+ XSETFASTINT (mini->total_lines, 1);
XSETFASTINT (mini->total_cols, frame_cols);
- set_window_height (root->next, 1, 0);
adjust_frame_glyphs (sf);
glyphs_initialized_initially_p = 1;
function must be called before updates to make explicit that we are
working on frame matrices or not. */
-static INLINE void
+static inline void
set_frame_matrix_frame (struct frame *f)
{
frame_matrix_frame = f;
done in frame matrices, and that we have to perform analogous
operations in window matrices of frame_matrix_frame. */
-static INLINE void
+static inline void
make_current (struct glyph_matrix *desired_matrix, struct glyph_matrix *current_matrix, int row)
{
struct glyph_row *current_row = MATRIX_ROW (current_matrix, row);
matrices of leaf window agree with their frame matrices about
glyph pointers. */
-void
+static void
check_window_matrix_pointers (struct window *w)
{
while (w)
static int
window_to_frame_vpos (struct window *w, int vpos)
{
- struct frame *f = XFRAME (w->frame);
-
- xassert (!FRAME_WINDOW_P (f));
+ xassert (!FRAME_WINDOW_P (XFRAME (w->frame)));
xassert (vpos >= 0 && vpos <= w->desired_matrix->nrows);
vpos += WINDOW_TOP_EDGE_LINE (w);
- xassert (vpos >= 0 && vpos <= FRAME_LINES (f));
+ xassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (w->frame)));
return vpos;
}
}
-/* This is used when frame_garbaged is set. Call Fredraw_frame on all
- visible frames marked as garbaged. */
-
-void
-redraw_garbaged_frames (void)
-{
- Lisp_Object tail, frame;
-
- FOR_EACH_FRAME (tail, frame)
- if (FRAME_VISIBLE_P (XFRAME (frame))
- && FRAME_GARBAGED_P (XFRAME (frame)))
- Fredraw_frame (frame);
-}
-
-
\f
/***********************************************************************
Frame Update
/* Add glyph row ROW to the scrolling hash table. */
-static INLINE struct row_entry *
+static inline struct row_entry *
add_row_entry (struct glyph_row *row)
{
struct row_entry *entry;
first_old = first_new = i;
- /* Set last_new to the index + 1 of the last enabled row in the
- desired matrix. */
+ /* Set last_new to the index + 1 of the row that reaches the
+ bottom boundary in the desired matrix. Give up if we find a
+ disabled row before we reach the bottom boundary. */
i = first_new + 1;
- while (i < desired_matrix->nrows - 1
- && MATRIX_ROW (desired_matrix, i)->enabled_p
- && MATRIX_ROW_BOTTOM_Y (MATRIX_ROW (desired_matrix, i)) <= yb)
- ++i;
+ while (i < desired_matrix->nrows - 1)
+ {
+ int bottom;
- if (!MATRIX_ROW (desired_matrix, i)->enabled_p)
- return 0;
+ if (!MATRIX_ROW (desired_matrix, i)->enabled_p)
+ return 0;
+ bottom = MATRIX_ROW_BOTTOM_Y (MATRIX_ROW (desired_matrix, i));
+ if (bottom <= yb)
+ ++i;
+ if (bottom >= yb)
+ break;
+ }
last_new = i;
- /* Set last_old to the index + 1 of the last enabled row in the
- current matrix. We don't look at the enabled flag here because
- we plan to reuse part of the display even if other parts are
- disabled. */
+ /* Set last_old to the index + 1 of the row that reaches the bottom
+ boundary in the current matrix. We don't look at the enabled
+ flag here because we plan to reuse part of the display even if
+ other parts are disabled. */
i = first_old + 1;
while (i < current_matrix->nrows - 1)
{
/* Copy on the display. */
if (r->current_y != r->desired_y)
{
+ rif->clear_window_mouse_face (w);
rif->scroll_run_hook (w, r);
/* Invalidate runs that copy from where we copied to. */
to = MATRIX_ROW (current_matrix, r->desired_vpos + j);
from = MATRIX_ROW (desired_matrix, r->desired_vpos + j);
to_overlapped_p = to->overlapped_p;
- if (!from->mode_line_p && !w->pseudo_window_p
- && (to->left_fringe_bitmap != from->left_fringe_bitmap
- || to->right_fringe_bitmap != from->right_fringe_bitmap
- || to->left_fringe_face_id != from->left_fringe_face_id
- || to->right_fringe_face_id != from->right_fringe_face_id
- || to->overlay_arrow_bitmap != from->overlay_arrow_bitmap))
- from->redraw_fringe_bitmaps_p = 1;
+ from->redraw_fringe_bitmaps_p = from->fringe_bitmap_periodic_p;
assign_row (to, from);
to->enabled_p = 1, from->enabled_p = 0;
to->overlapped_p = to_overlapped_p;
for (i = 0; i < row_entry_idx; ++i)
row_table[row_entry_pool[i].bucket] = NULL;
- /* Value is > 0 to indicate that we scrolled the display. */
- return nruns;
+ /* Value is 1 to indicate that we scrolled the display. */
+ return 0 < nruns;
}
/* Do line insertions/deletions on frame F for frame-based redisplay. */
-int
+static int
scrolling (struct frame *frame)
{
int unchanged_at_top, unchanged_at_bottom;
if (newheight != FRAME_LINES (f))
{
- if (FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f))
- {
- /* Frame has both root and mini-buffer. */
- XSETFASTINT (XWINDOW (FRAME_ROOT_WINDOW (f))->top_line,
- FRAME_TOP_MARGIN (f));
- set_window_height (FRAME_ROOT_WINDOW (f),
- (newheight
- - 1
- - FRAME_TOP_MARGIN (f)),
- 2);
- XSETFASTINT (XWINDOW (FRAME_MINIBUF_WINDOW (f))->top_line,
- newheight - 1);
- set_window_height (FRAME_MINIBUF_WINDOW (f), 1, 0);
- }
- else
- /* Frame has just one top-level window. */
- set_window_height (FRAME_ROOT_WINDOW (f),
- newheight - FRAME_TOP_MARGIN (f), 2);
+ resize_frame_windows (f, newheight, 0);
/* MSDOS frames cannot PRETEND, as they change frame size by
manipulating video hardware. */
if (new_frame_total_cols != FRAME_TOTAL_COLS (f))
{
- set_window_width (FRAME_ROOT_WINDOW (f), new_frame_total_cols, 2);
- if (FRAME_HAS_MINIBUF_P (f))
- set_window_width (FRAME_MINIBUF_WINDOW (f), new_frame_total_cols, 0);
+ resize_frame_windows (f, new_frame_total_cols, 1);
/* MSDOS frames cannot PRETEND, as they change frame size by
manipulating video hardware. */
state = frame_and_buffer_state;
vecp = XVECTOR (state)->contents;
- end = vecp + XVECTOR (state)->size;
+ end = vecp + ASIZE (state);
FOR_EACH_FRAME (tail, frame)
{
/* Reallocate the vector if data has grown to need it,
or if it has shrunk a lot. */
if (! VECTORP (state)
- || n > XVECTOR (state)->size
- || n + 20 < XVECTOR (state)->size / 2)
+ || n > ASIZE (state)
+ || n + 20 < ASIZE (state) / 2)
/* Add 20 extra so we grow it less often. */
{
state = Fmake_vector (make_number (n + 20), Qlambda);
/* Fill up the vector with lambdas (always at least one). */
*vecp++ = Qlambda;
while (vecp - XVECTOR (state)->contents
- < XVECTOR (state)->size)
+ < ASIZE (state))
*vecp++ = Qlambda;
/* Make sure we didn't overflow the vector. */
if (vecp - XVECTOR (state)->contents
- > XVECTOR (state)->size)
+ > ASIZE (state))
abort ();
return Qt;
}
}
}
- if (!inhibit_window_system && display_arg
-#ifndef CANNOT_DUMP
- && initialized
-#endif
- )
+ if (!inhibit_window_system && display_arg)
{
Vinitial_window_system = Qx;
#ifdef HAVE_X11
frame_and_buffer_state = Fmake_vector (make_number (20), Qlambda);
staticpro (&frame_and_buffer_state);
- Qdisplay_table = intern_c_string ("display-table");
- staticpro (&Qdisplay_table);
- Qredisplay_dont_pause = intern_c_string ("redisplay-dont-pause");
- staticpro (&Qredisplay_dont_pause);
+ DEFSYM (Qdisplay_table, "display-table");
+ DEFSYM (Qredisplay_dont_pause, "redisplay-dont-pause");
DEFVAR_INT ("baud-rate", baud_rate,
doc: /* *The output baud rate of the terminal.