/* Maximum length of a string of glyphs. XftGlyphExtents limits
this to INT_MAX, and Emacs limits it further. Divide INT_MAX - 1
- by 2 because x_produce_glyphs computes glyph_len * 2 + 1. Divide
+ by 2 because gui_produce_glyphs computes glyph_len * 2 + 1. Divide
the size by MAX_MULTIBYTE_LENGTH because encode_terminal_code
multiplies glyph_len by MAX_MULTIBYTE_LENGTH. */
enum {
extern void dump_glyph_string (struct glyph_string *) EXTERNALLY_VISIBLE;
#endif
-extern void x_get_glyph_overhangs (struct glyph *, struct frame *,
- int *, int *);
+extern void gui_get_glyph_overhangs (struct glyph *, struct frame *,
+ int *, int *);
extern struct font *font_for_underline_metrics (struct glyph_string *);
-extern void x_produce_glyphs (struct it *);
-
-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 void x_fix_overlapping_area (struct window *, struct glyph_row *,
- enum glyph_row_area, int);
+extern void gui_produce_glyphs (struct it *);
+
+extern void gui_write_glyphs (struct window *, struct glyph_row *,
+ struct glyph *, enum glyph_row_area, int);
+extern void gui_insert_glyphs (struct window *, struct glyph_row *,
+ struct glyph *, enum glyph_row_area, int);
+extern void gui_clear_end_of_line (struct window *, struct glyph_row *,
+ enum glyph_row_area, int);
+extern void gui_fix_overlapping_area (struct window *, struct glyph_row *,
+ enum glyph_row_area, int);
extern void draw_phys_cursor_glyph (struct window *,
struct glyph_row *,
enum draw_glyphs_face);
struct glyph *, int *, int *, int *);
extern void erase_phys_cursor (struct window *);
extern void display_and_set_cursor (struct window *, bool, int, int, int, int);
-extern void x_update_cursor (struct frame *, bool);
-extern void x_clear_cursor (struct window *);
-extern void x_draw_vertical_border (struct window *w);
-extern void x_draw_right_divider (struct window *w);
+extern void gui_update_cursor (struct frame *, bool);
+extern void gui_clear_cursor (struct window *);
+extern void gui_draw_vertical_border (struct window *w);
+extern void gui_draw_right_divider (struct window *w);
extern int get_glyph_string_clip_rects (struct glyph_string *,
NativeRectangle *, int);
int, int, bool, int);
extern void expose_frame (struct frame *, int, int, int, int);
-extern bool x_intersect_rectangles (XRectangle *, XRectangle *, XRectangle *);
+extern bool gui_intersect_rectangles (XRectangle *, XRectangle *, XRectangle *);
#endif /* HAVE_WINDOW_SYSTEM */
extern void note_mouse_highlight (struct frame *, int, int);
-extern void x_clear_window_mouse_face (struct window *);
+extern void gui_clear_window_mouse_face (struct window *);
extern void cancel_mouse_face (struct frame *);
extern bool clear_mouse_face (Mouse_HLInfo *);
extern bool cursor_in_mouse_face_p (struct window *w);
if (FRAME_VISIBLE_P (f))
{
- x_update_cursor (f, 0);
- x_update_cursor (f, 1);
+ gui_update_cursor (f, 0);
+ gui_update_cursor (f, 1);
}
update_face_from_frame_parameter (f, Qcursor_color, arg);
unblock_input ();
if (draw_window_fringes (w, 1))
{
if (WINDOW_RIGHT_DIVIDER_WIDTH (w))
- x_draw_right_divider (w);
+ gui_draw_right_divider (w);
else
- x_draw_vertical_border (w);
+ gui_draw_vertical_border (w);
}
unblock_input ();
{
if (old_highlight)
{
- x_update_cursor (old_highlight, 1);
+ gui_update_cursor (old_highlight, 1);
x_set_frame_alpha (old_highlight);
}
if (dpyinfo->x_highlight_frame)
{
- x_update_cursor (dpyinfo->x_highlight_frame, 1);
+ gui_update_cursor (dpyinfo->x_highlight_frame, 1);
x_set_frame_alpha (dpyinfo->x_highlight_frame);
}
}
[[view window] invalidateCursorRectsForView: view];
/* Redisplay assumes this function also draws the changed frame
cursor, but this function doesn't, so do it explicitly. */
- x_update_cursor (f, 1);
+ gui_update_cursor (f, 1);
}
}
block_input ();
- x_clear_cursor (w);
+ gui_clear_cursor (w);
{
NSRect srcRect = NSMakeRect (x, from_y, width, height);
/* This and next define (many of the) public functions in this file. */
-/* x_... are generic versions in xdisp.c that we, and other terms, get away
+/* gui_* are generic versions in xdisp.c that we, and other terms, get away
with using despite presence in the "system dependent" redisplay
interface. In addition, many of the ns_ methods have code that is
shared with all terms, indicating need for further refactoring. */
static struct redisplay_interface ns_redisplay_interface =
{
ns_frame_parm_handlers,
- x_produce_glyphs,
- x_write_glyphs,
- x_insert_glyphs,
- x_clear_end_of_line,
+ gui_produce_glyphs,
+ gui_write_glyphs,
+ gui_insert_glyphs,
+ gui_clear_end_of_line,
ns_scroll_run,
ns_after_update_window_line,
ns_update_window_begin,
ns_update_window_end,
0, /* flush_display */
- x_clear_window_mouse_face,
- x_get_glyph_overhangs,
- x_fix_overlapping_area,
+ gui_clear_window_mouse_face,
+ gui_get_glyph_overhangs,
+ gui_fix_overlapping_area,
ns_draw_fringe_bitmap,
0, /* define_fringe_bitmap */ /* FIXME: simplify ns_draw_fringe_bitmap */
0, /* destroy_fringe_bitmap */
from sole-frame Emacs to get hollow box to show. */
if (!windowClosing && [[self window] isVisible] == YES)
{
- x_update_cursor (emacsframe, 1);
+ gui_update_cursor (emacsframe, 1);
x_set_frame_alpha (emacsframe);
}
if (FRAME_VISIBLE_P (f))
{
- x_update_cursor (f, 0);
- x_update_cursor (f, 1);
+ gui_update_cursor (f, 0);
+ gui_update_cursor (f, 1);
}
}
get_glyph_string_clip_rect (s, &w32_string_clip);
CONVERT_TO_XRECT (string_clip, w32_string_clip);
- if (!x_intersect_rectangles (&wave_clip, &string_clip, &final_clip))
+ if (!gui_intersect_rectangles (&wave_clip, &string_clip, &final_clip))
return;
hp = CreatePen (PS_SOLID, thickness, color);
if (draw_window_fringes (w, true))
{
if (WINDOW_RIGHT_DIVIDER_WIDTH (w))
- x_draw_right_divider (w);
+ gui_draw_right_divider (w);
else
- x_draw_vertical_border (w);
+ gui_draw_vertical_border (w);
}
unblock_input ();
block_input ();
/* Cursor off. Will be switched on again in x_update_window_end. */
- x_clear_cursor (w);
+ gui_clear_cursor (w);
{
RECT from;
static void
frame_highlight (struct frame *f)
{
- x_update_cursor (f, 1);
+ gui_update_cursor (f, 1);
x_set_frame_alpha (f);
}
static void
frame_unhighlight (struct frame *f)
{
- x_update_cursor (f, 1);
+ gui_update_cursor (f, 1);
x_set_frame_alpha (f);
}
static struct redisplay_interface w32_redisplay_interface =
{
w32_frame_parm_handlers,
- x_produce_glyphs,
- x_write_glyphs,
- x_insert_glyphs,
- x_clear_end_of_line,
+ gui_produce_glyphs,
+ gui_write_glyphs,
+ gui_insert_glyphs,
+ gui_clear_end_of_line,
x_scroll_run,
x_after_update_window_line,
x_update_window_begin,
x_update_window_end,
0, /* flush_display */
- x_clear_window_mouse_face,
- x_get_glyph_overhangs,
- x_fix_overlapping_area,
+ gui_clear_window_mouse_face,
+ gui_get_glyph_overhangs,
+ gui_fix_overlapping_area,
w32_draw_fringe_bitmap,
w32_define_fringe_bitmap,
w32_destroy_fringe_bitmap,
wset_update_mode_line (struct window *w)
{
/* If this window is the selected window on its frame, set the
- global variable update_mode_lines, so that x_consider_frame_title
+ global variable update_mode_lines, so that gui_consider_frame_title
will consider this frame's title for redisplay. */
Lisp_Object fselected_window = XFRAME (WINDOW_FRAME (w))->selected_window;
Since the frame title uses the same %-constructs as the mode line
(except %c, %C, and %l), if this variable is non-zero, we also consider
- redisplaying the title of each frame, see x_consider_frame_title.
+ redisplaying the title of each frame, see gui_consider_frame_title.
The `redisplay' bits are the same as those used for
windows_or_buffers_changed, and setting windows_or_buffers_changed also
#ifdef HAVE_WINDOW_SYSTEM
static void update_tool_bar (struct frame *, bool);
-static void x_draw_bottom_divider (struct window *w);
+static void gui_draw_bottom_divider (struct window *w);
static void notice_overwritten_cursor (struct window *,
enum glyph_row_area,
int, int, int, int);
rc.width = s->w->phys_cursor_width;
rc.height = s->w->phys_cursor_height;
- x_intersect_rectangles (&r_save, &rc, &r);
+ gui_intersect_rectangles (&r_save, &rc, &r);
}
}
else
{
XRectangle r_save = r;
- if (! x_intersect_rectangles (&r_save, s->row->clip, &r))
+ if (! gui_intersect_rectangles (&r_save, s->row->clip, &r))
r.width = 0;
}
method symbol. By side-effect, update it->what and
it->glyphless_method. This function is called from
get_next_display_element for each character element, and from
- x_produce_glyphs when no suitable font was found. */
+ gui_produce_glyphs when no suitable font was found. */
Lisp_Object
lookup_glyphless_char_display (int c, struct it *it)
/* When display_line produces a continued line
that ends in a TAB, it skips a tab stop that
is closer than the font's space character
- width (see x_produce_glyphs where it produces
+ width (see gui_produce_glyphs where it produces
the stretch glyph which represents a TAB).
We need to reproduce the same logic here. */
eassert (face_font);
frame_title_format. */
static void
-x_consider_frame_title (Lisp_Object frame)
+gui_consider_frame_title (Lisp_Object frame)
{
struct frame *f = XFRAME (frame);
|| FRAME_VISIBLE_P (f) == 1
/* Exclude TTY frames that are obscured because they
are not the top frame on their console. This is
- because x_consider_frame_title actually switches
+ because gui_consider_frame_title actually switches
to the frame, which for TTY frames means it is
marked as garbaged, and will be completely
redrawn on the next redisplay cycle. This causes
are more than one of them, even though nothing
should be changed on display. */
|| (FRAME_VISIBLE_P (f) == 2 && FRAME_WINDOW_P (f))))
- x_consider_frame_title (frame);
+ gui_consider_frame_title (frame);
}
}
#endif /* HAVE_WINDOW_SYSTEM */
ignore_mouse_drag_p = true;
#endif
}
- x_consider_frame_title (w->frame);
+ gui_consider_frame_title (w->frame);
#endif
}
if (draw_window_fringes (w, true))
{
if (WINDOW_RIGHT_DIVIDER_WIDTH (w))
- x_draw_right_divider (w);
+ gui_draw_right_divider (w);
else
- x_draw_vertical_border (w);
+ gui_draw_vertical_border (w);
}
unblock_input ();
update_end (f);
}
if (WINDOW_BOTTOM_DIVIDER_WIDTH (w))
- x_draw_bottom_divider (w);
+ gui_draw_bottom_divider (w);
#endif /* HAVE_WINDOW_SYSTEM */
/* We go to this label, with fonts_changed set, if it is
+ window_internal_height (w));
#if defined (HAVE_GPM) || defined (MSDOS)
- x_clear_window_mouse_face (w);
+ gui_clear_window_mouse_face (w);
#endif
/* Perform the operation on the screen. */
if (dvpos > 0)
it->object = saved_object; /* get_it_property needs this */
normal_char_ascent_descent (font, -1, &it->ascent, &it->descent);
/* Must do a subset of line height processing from
- x_produce_glyph for newline characters. */
+ gui_produce_glyph for newline characters. */
height = get_it_property (it, Qline_height);
if (CONSP (height)
&& CONSP (XCDR (height))
assumed to be zero. */
void
-x_get_glyph_overhangs (struct glyph *glyph, struct frame *f, int *left, int *right)
+gui_get_glyph_overhangs (struct glyph *glyph, struct frame *f, int *left, int *right)
{
*left = *right = 0;
for (i = first - 1; i >= 0; --i)
{
int left, right;
- x_get_glyph_overhangs (glyphs + i, s->f, &left, &right);
+ gui_get_glyph_overhangs (glyphs + i, s->f, &left, &right);
if (x + right > 0)
k = i;
x -= glyphs[i].pixel_width;
for (i = first; i < end; ++i)
{
int left, right;
- x_get_glyph_overhangs (glyphs + i, s->f, &left, &right);
+ gui_get_glyph_overhangs (glyphs + i, s->f, &left, &right);
if (x - left < 0)
k = i;
x += glyphs[i].pixel_width;
}
/* Store one glyph for IT->char_to_display in IT->glyph_row.
- Called from x_produce_glyphs when IT->glyph_row is non-null. */
+ Called from gui_produce_glyphs when IT->glyph_row is non-null. */
static void
append_glyph (struct it *it)
IT_EXPAND_MATRIX_WIDTH (it, area);
}
-/* Store one glyph for the composition IT->cmp_it.id in
- IT->glyph_row. Called from x_produce_glyphs when IT->glyph_row is
- non-null. */
+/* Store one glyph for the composition IT->cmp_it.id in IT->glyph_row.
+ Called from gui_produce_glyphs when IT->glyph_row is non-null. */
static void
append_composite_glyph (struct it *it)
for an overview of struct it. */
void
-x_produce_glyphs (struct it *it)
+gui_produce_glyphs (struct it *it)
{
int extra_line_spacing = it->extra_line_spacing;
being updated, and UPDATED_AREA is the area of that row being updated. */
void
-x_write_glyphs (struct window *w, struct glyph_row *updated_row,
+gui_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_row *updated_row,
+gui_insert_glyphs (struct window *w, struct glyph_row *updated_row,
struct glyph *start, enum glyph_row_area updated_area, int len)
{
struct frame *f;
updated window W. TO_X == -1 means clear to the end of this area. */
void
-x_clear_end_of_line (struct window *w, struct glyph_row *updated_row,
+gui_clear_end_of_line (struct window *w, struct glyph_row *updated_row,
enum glyph_row_area updated_area, int to_x)
{
struct frame *f;
with respect to the overlapping part OVERLAPS. */
void
-x_fix_overlapping_area (struct window *w, struct glyph_row *row,
+gui_fix_overlapping_area (struct window *w, struct glyph_row *row,
enum glyph_row_area area, int overlaps)
{
int i, x;
if (row > w->current_matrix->rows
&& MATRIX_ROW_OVERLAPS_SUCC_P (row - 1))
- x_fix_overlapping_area (w, row - 1, TEXT_AREA,
+ gui_fix_overlapping_area (w, row - 1, TEXT_AREA,
OVERLAPS_ERASED_CURSOR);
if (MATRIX_ROW_BOTTOM_Y (row) < window_text_bottom_y (w)
&& MATRIX_ROW_OVERLAPS_PRED_P (row + 1))
- x_fix_overlapping_area (w, row + 1, TEXT_AREA,
+ gui_fix_overlapping_area (w, row + 1, TEXT_AREA,
OVERLAPS_ERASED_CURSOR);
}
}
Don't change the cursor's position. */
void
-x_update_cursor (struct frame *f, bool on_p)
+gui_update_cursor (struct frame *f, bool on_p)
{
update_cursor_in_window_tree (XWINDOW (f->root_window), on_p);
}
is about to be rewritten. */
void
-x_clear_cursor (struct window *w)
+gui_clear_cursor (struct window *w)
{
if (FRAME_VISIBLE_P (XFRAME (w->frame)) && w->phys_cursor_on_p)
update_window_cursor (w, false);
functions to ensure the mouse-highlight is off. */
void
-x_clear_window_mouse_face (struct window *w)
+gui_clear_window_mouse_face (struct window *w)
{
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
Lisp_Object window;
row->clip = r;
if (row->used[LEFT_MARGIN_AREA])
- x_fix_overlapping_area (w, row, LEFT_MARGIN_AREA, OVERLAPS_BOTH);
+ gui_fix_overlapping_area (w, row, LEFT_MARGIN_AREA, OVERLAPS_BOTH);
if (row->used[TEXT_AREA])
- x_fix_overlapping_area (w, row, TEXT_AREA, OVERLAPS_BOTH);
+ gui_fix_overlapping_area (w, row, TEXT_AREA, OVERLAPS_BOTH);
if (row->used[RIGHT_MARGIN_AREA])
- x_fix_overlapping_area (w, row, RIGHT_MARGIN_AREA, OVERLAPS_BOTH);
+ gui_fix_overlapping_area (w, row, RIGHT_MARGIN_AREA, OVERLAPS_BOTH);
row->clip = NULL;
}
}
cr.y = row->y;
cr.width = WINDOW_RIGHT_FRINGE_WIDTH (w);
cr.height = row->height;
- return x_intersect_rectangles (&cr, r, &result);
+ return gui_intersect_rectangles (&cr, r, &result);
}
cursor_glyph = get_phys_cursor_glyph (w);
cr.height = w->phys_cursor_height;
/* ++KFS: W32 version used W32-specific IntersectRect here, but
I assume the effect is the same -- and this is portable. */
- return x_intersect_rectangles (&cr, r, &result);
+ return gui_intersect_rectangles (&cr, r, &result);
}
/* If we don't understand the format, pretend we're not in the hot-spot. */
return false;
have vertical scroll bars. */
void
-x_draw_vertical_border (struct window *w)
+gui_draw_vertical_border (struct window *w)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
/* Draw window dividers for window W. */
void
-x_draw_right_divider (struct window *w)
+gui_draw_right_divider (struct window *w)
{
struct frame *f = WINDOW_XFRAME (w);
}
static void
-x_draw_bottom_divider (struct window *w)
+gui_draw_bottom_divider (struct window *w)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
wr.width = WINDOW_PIXEL_WIDTH (w);
wr.height = WINDOW_PIXEL_HEIGHT (w);
- if (x_intersect_rectangles (fr, &wr, &r))
+ if (gui_intersect_rectangles (fr, &wr, &r))
{
int yb = window_text_bottom_y (w);
struct glyph_row *row;
bool cursor_cleared_p = (!w->pseudo_window_p
&& phys_cursor_in_rect_p (w, &r));
if (cursor_cleared_p)
- x_clear_cursor (w);
+ gui_clear_cursor (w);
/* If the row containing the cursor extends face to end of line,
then expose_area might overwrite the cursor outside the
/* Draw border between windows. */
if (WINDOW_RIGHT_DIVIDER_WIDTH (w))
- x_draw_right_divider (w);
+ gui_draw_right_divider (w);
else
- x_draw_vertical_border (w);
+ gui_draw_vertical_border (w);
if (WINDOW_BOTTOM_DIVIDER_WIDTH (w))
- x_draw_bottom_divider (w);
+ gui_draw_bottom_divider (w);
/* Turn the cursor on again. */
if (cursor_cleared_p
empty. */
bool
-x_intersect_rectangles (XRectangle *r1, XRectangle *r2, XRectangle *result)
+gui_intersect_rectangles (XRectangle *r1, XRectangle *r2, XRectangle *result)
{
XRectangle *left, *right;
XRectangle *upper, *lower;
if (FRAME_VISIBLE_P (f))
{
- x_update_cursor (f, false);
- x_update_cursor (f, true);
+ gui_update_cursor (f, false);
+ gui_update_cursor (f, true);
}
}
if (mi->geom.width == 0) continue;
- if (x_intersect_rectangles (&mi->geom, &frect, &res))
+ if (gui_intersect_rectangles (&mi->geom, &frect, &res))
{
a = res.width * res.height;
if (a > area)
if (i == 0 && x_get_net_workarea (dpyinfo, &workarea_r))
{
mi->work = workarea_r;
- if (! x_intersect_rectangles (&mi->geom, &mi->work, &mi->work))
+ if (! gui_intersect_rectangles (&mi->geom, &mi->work, &mi->work))
mi->work = mi->geom;
}
else
if (i == primary && x_get_net_workarea (dpyinfo, &workarea_r))
{
mi->work= workarea_r;
- if (! x_intersect_rectangles (&mi->geom, &mi->work, &mi->work))
+ if (! gui_intersect_rectangles (&mi->geom, &mi->work, &mi->work))
mi->work = mi->geom;
}
else
if (draw_window_fringes (w, true))
{
if (WINDOW_RIGHT_DIVIDER_WIDTH (w))
- x_draw_right_divider (w);
+ gui_draw_right_divider (w);
else
- x_draw_vertical_border (w);
+ gui_draw_vertical_border (w);
}
unblock_input ();
image_rect.y = y;
image_rect.width = s->slice.width;
image_rect.height = s->slice.height;
- if (x_intersect_rectangles (&clip_rect, &image_rect, &r))
+ if (gui_intersect_rectangles (&clip_rect, &image_rect, &r))
x_composite_image (s, FRAME_X_DRAWABLE (s->f),
s->slice.x + r.x - x, s->slice.y + r.y - y,
r.x, r.y, r.width, r.height);
image_rect.y = y;
image_rect.width = s->slice.width;
image_rect.height = s->slice.height;
- if (x_intersect_rectangles (&clip_rect, &image_rect, &r))
+ if (gui_intersect_rectangles (&clip_rect, &image_rect, &r))
x_composite_image (s, FRAME_X_DRAWABLE (s->f), s->slice.x + r.x - x, s->slice.y + r.y - y,
r.x, r.y, r.width, r.height);
wave_clip.height = wave_height;
get_glyph_string_clip_rect (s, &string_clip);
- if (!x_intersect_rectangles (&wave_clip, &string_clip, &final_clip))
+ if (!gui_intersect_rectangles (&wave_clip, &string_clip, &final_clip))
return;
XSetClipRectangles (s->display, s->gc, 0, 0, &final_clip, 1, Unsorted);
block_input ();
/* Cursor off. Will be switched on again in x_update_window_end. */
- x_clear_cursor (w);
+ gui_clear_cursor (w);
#ifdef USE_CAIRO
if (FRAME_CR_CONTEXT (f))
f->output_data.x->border_pixel);
x_uncatch_errors ();
unblock_input ();
- x_update_cursor (f, true);
+ gui_update_cursor (f, true);
x_set_frame_alpha (f);
}
f->output_data.x->border_tile);
x_uncatch_errors ();
unblock_input ();
- x_update_cursor (f, true);
+ gui_update_cursor (f, true);
x_set_frame_alpha (f);
}
static struct redisplay_interface x_redisplay_interface =
{
x_frame_parm_handlers,
- x_produce_glyphs,
- x_write_glyphs,
- x_insert_glyphs,
- x_clear_end_of_line,
+ gui_produce_glyphs,
+ gui_write_glyphs,
+ gui_insert_glyphs,
+ gui_clear_end_of_line,
x_scroll_run,
x_after_update_window_line,
x_update_window_begin,
x_update_window_end,
x_flip_and_flush,
- x_clear_window_mouse_face,
- x_get_glyph_overhangs,
- x_fix_overlapping_area,
+ gui_clear_window_mouse_face,
+ gui_get_glyph_overhangs,
+ gui_fix_overlapping_area,
x_draw_fringe_bitmap,
#ifdef USE_CAIRO
x_cr_define_fringe_bitmap,