extern struct glyph space_glyph;
-/* Glyph row and area updated by update_window_line. */
-
-extern struct glyph_row *updated_row;
-extern int updated_area;
-
/* Non-zero means last display completed. Zero means it was
preempted. */
/* Write or insert LEN glyphs from STRING at the nominal output
position. */
- void (*write_glyphs) (struct window *w, struct glyph *string, int len);
- void (*insert_glyphs) (struct window *w, struct glyph *start, int len);
+ void (*write_glyphs) (struct window *w, struct glyph_row *row,
+ struct glyph *string, enum glyph_row_area area,
+ int len);
+ void (*insert_glyphs) (struct window *w, struct glyph_row *row,
+ struct glyph *start, enum glyph_row_area area,
+ int len);
/* Clear from nominal output position to X. X < 0 means clear
to right end of display. */
- void (*clear_end_of_line) (struct window *w, int x);
+ void (*clear_end_of_line) (struct window *w, struct glyph_row *row,
+ enum glyph_row_area area, int x);
/* Function to call to scroll the display as described by RUN on
window W. */
int *, int *);
extern void x_produce_glyphs (struct it *);
-extern void x_write_glyphs (struct window *, struct glyph *, int);
-extern void x_insert_glyphs (struct window *, struct glyph *, int len);
-extern void x_clear_end_of_line (struct window *, int);
+extern void x_write_glyphs (struct window *, struct glyph_row *,
+ struct glyph *, enum glyph_row_area, int);
+extern void x_insert_glyphs (struct window *, struct glyph_row *,
+ struct glyph *, enum glyph_row_area, int);
+extern void x_clear_end_of_line (struct window *, struct glyph_row *,
+ enum glyph_row_area, int);
extern struct cursor_pos output_cursor;
static bool delayed_size_change;
-/* Glyph row updated in update_window_line, and area that is updated. */
-
-struct glyph_row *updated_row;
-int updated_area;
-
/* A glyph for a space. */
struct glyph space_glyph;
for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area)
{
- updated_row = row;
- updated_area = area;
FRAME_RIF (f)->cursor_to (w, i, 0, row->y,
area == TEXT_AREA ? row->x : 0);
if (row->used[area])
- FRAME_RIF (f)->write_glyphs (w, row->glyphs[area],
- row->used[area]);
- FRAME_RIF (f)->clear_end_of_line (w, -1);
+ FRAME_RIF (f)->write_glyphs (w, row, row->glyphs[area],
+ area, row->used[area]);
+ FRAME_RIF (f)->clear_end_of_line (w, row, area, -1);
}
row->overlapped_p = 0;
AREA can be either LEFT_MARGIN_AREA or RIGHT_MARGIN_AREA. */
static void
-update_marginal_area (struct window *w, int area, int vpos)
+update_marginal_area (struct window *w, struct glyph_row *updated_row,
+ enum glyph_row_area area, int vpos)
{
struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos);
struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
- /* Let functions in xterm.c know what area subsequent X positions
- will be relative to. */
- updated_area = area;
-
/* Set cursor to start of glyphs, write them, and clear to the end
of the area. I don't think that something more sophisticated is
necessary here, since marginal areas will not be the default. */
rif->cursor_to (w, vpos, 0, desired_row->y, 0);
if (desired_row->used[area])
- rif->write_glyphs (w, desired_row->glyphs[area], desired_row->used[area]);
- rif->clear_end_of_line (w, -1);
+ rif->write_glyphs (w, updated_row, desired_row->glyphs[area],
+ area, desired_row->used[area]);
+ rif->clear_end_of_line (w, updated_row, area, -1);
}
Value is true if display has changed. */
static bool
-update_text_area (struct window *w, int vpos)
+update_text_area (struct window *w, struct glyph_row *updated_row, int vpos)
{
struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos);
struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos);
struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
bool changed_p = 0;
- /* Let functions in xterm.c know what area subsequent X positions
- will be relative to. */
- updated_area = TEXT_AREA;
-
/* If rows are at different X or Y, or rows have different height,
or the current row is marked invalid, write the entire line. */
if (!current_row->enabled_p
rif->cursor_to (w, vpos, 0, desired_row->y, desired_row->x);
if (desired_row->used[TEXT_AREA])
- rif->write_glyphs (w, desired_row->glyphs[TEXT_AREA],
- desired_row->used[TEXT_AREA]);
+ rif->write_glyphs (w, updated_row, desired_row->glyphs[TEXT_AREA],
+ TEXT_AREA, desired_row->used[TEXT_AREA]);
/* Clear to end of window. */
- rif->clear_end_of_line (w, -1);
+ rif->clear_end_of_line (w, updated_row, TEXT_AREA, -1);
changed_p = 1;
/* This erases the cursor. We do this here because
}
rif->cursor_to (w, vpos, start_hpos, desired_row->y, start_x);
- rif->write_glyphs (w, start, i - start_hpos);
+ rif->write_glyphs (w, updated_row, start,
+ TEXT_AREA, i - start_hpos);
changed_p = 1;
}
}
if (i < desired_row->used[TEXT_AREA])
{
rif->cursor_to (w, vpos, i, desired_row->y, x);
- rif->write_glyphs (w, desired_glyph, desired_row->used[TEXT_AREA] - i);
+ rif->write_glyphs (w, updated_row, desired_glyph,
+ TEXT_AREA, desired_row->used[TEXT_AREA] - i);
changed_p = 1;
}
if (i >= desired_row->used[TEXT_AREA])
rif->cursor_to (w, vpos, i, desired_row->y,
desired_row->pixel_width);
- rif->clear_end_of_line (w, -1);
+ rif->clear_end_of_line (w, updated_row, TEXT_AREA, -1);
changed_p = 1;
}
else if (desired_row->pixel_width < current_row->pixel_width)
}
else
xlim = current_row->pixel_width;
- rif->clear_end_of_line (w, xlim);
+ rif->clear_end_of_line (w, updated_row, TEXT_AREA, xlim);
changed_p = 1;
}
}
struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
bool changed_p = 0;
- /* Set the row being updated. This is important to let xterm.c
- know what line height values are in effect. */
- updated_row = desired_row;
-
/* A row can be completely invisible in case a desired matrix was
built with a vscroll and then make_cursor_line_fully_visible shifts
the matrix. Make sure to make such rows current anyway, since
if (!desired_row->full_width_p && w->left_margin_cols > 0)
{
changed_p = 1;
- update_marginal_area (w, LEFT_MARGIN_AREA, vpos);
+ update_marginal_area (w, desired_row, LEFT_MARGIN_AREA, vpos);
/* Setting this flag will ensure the vertical border, if
any, between this window and the one on its left will be
redrawn. This is necessary because updating the left
}
/* Update the display of the text area. */
- if (update_text_area (w, vpos))
+ if (update_text_area (w, desired_row, vpos))
{
changed_p = 1;
if (current_row->mouse_face_p)
if (!desired_row->full_width_p && w->right_margin_cols > 0)
{
changed_p = 1;
- update_marginal_area (w, RIGHT_MARGIN_AREA, vpos);
+ update_marginal_area (w, desired_row, RIGHT_MARGIN_AREA, vpos);
}
/* Draw truncation marks etc. */
/* Update current_row from desired_row. */
make_current (w->desired_matrix, w->current_matrix, vpos);
- updated_row = NULL;
return changed_p;
}
/* EXPORT for RIF:
Output LEN glyphs starting at START at the nominal cursor position.
- Advance the nominal cursor over the text. The global variable
- updated_row is the glyph row being updated, and updated_area is the
- area of that row being updated. */
+ Advance the nominal cursor over the text. UPDATED_ROW is the glyph row
+ being updated, and UPDATED_AREA is the area of that row being updated. */
void
-x_write_glyphs (struct window *w, struct glyph *start, int len)
+x_write_glyphs (struct window *w, struct glyph_row *updated_row,
+ struct glyph *start, enum glyph_row_area updated_area, int len)
{
int x, hpos, chpos = w->phys_cursor.hpos;
Insert LEN glyphs from START at the nominal cursor position. */
void
-x_insert_glyphs (struct window *w, struct glyph *start, int len)
+x_insert_glyphs (struct window *w, struct glyph_row *updated_row,
+ struct glyph *start, enum glyph_row_area updated_area, int len)
{
struct frame *f;
int line_height, shift_by_width, shifted_region_width;
(inclusive) to pixel column TO_X (exclusive). The idea is that
everything from TO_X onward is already erased.
- TO_X is a pixel position relative to updated_area of currently
+ TO_X is a pixel position relative to UPDATED_AREA of currently
updated window W. TO_X == -1 means clear to the end of this area. */
void
-x_clear_end_of_line (struct window *w, int to_x)
+x_clear_end_of_line (struct window *w, struct glyph_row *updated_row,
+ enum glyph_row_area updated_area, int to_x)
{
struct frame *f;
int max_x, min_y, max_y;