From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Newsgroups: gmane.emacs.devel Subject: Re: Renaming non-X x_* procedures in xdisp.c (and elsewhere) Date: Sat, 23 Mar 2019 11:39:49 -0600 Message-ID: <87imw94hi2.fsf@gmail.com> References: <87wokp4okn.fsf@gmail.com> <83ef6xpo6b.fsf@gnu.org> <0f4be9a6-6e09-f55d-9f58-2a15aef264cd@cs.ucla.edu> <837ecpplw8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="47523"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: Paul Eggert , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 23 18:42:09 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h7kek-000C9A-IF for ged-emacs-devel@m.gmane.org; Sat, 23 Mar 2019 18:42:06 +0100 Original-Received: from localhost ([127.0.0.1]:46082 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7kej-0005BK-Gk for ged-emacs-devel@m.gmane.org; Sat, 23 Mar 2019 13:42:05 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7keS-0005Aq-8r for emacs-devel@gnu.org; Sat, 23 Mar 2019 13:41:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h7kcl-00029I-Qm for emacs-devel@gnu.org; Sat, 23 Mar 2019 13:40:07 -0400 Original-Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:34143) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h7kcj-00022x-Se; Sat, 23 Mar 2019 13:40:02 -0400 Original-Received: by mail-pg1-x52e.google.com with SMTP id v12so3648403pgq.1; Sat, 23 Mar 2019 10:39:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=WojWz7MM/KQv7TWImgh44TbuxkHxSBYnstY9dqqnp7o=; b=B2b3HwRikRuUEMCj2JWBM9LnEJaoljTCx8S0s0gHw39ZM5dD9bba2APmkQhgeAhMGW qwBpjvOI2Xe5sfsoZ7EgXg+fSqCPlQBRhxTz533bbwjLbJ5P5+x07zQ1oPQN+jvFV4L0 X5vazl7qvcxa/XzO51tgOQ5sOIJwDnp1nqVp1foQY3nNNjQUC6NcUoUpN9u4ftNRujJj cEPdJePVsE9PG15IblUW1NYbPY26XHlFd/wpRPO3YMCErKkVJMaXOXycsnefBOES0WLh Z3/INyp8BQ2JJvgxHPGwc0PgmzPSBkd/B07oVaf0KFRp9MFVj132Kwr6j9hZqvJUQwJW sQng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=WojWz7MM/KQv7TWImgh44TbuxkHxSBYnstY9dqqnp7o=; b=UjDhojey0hVITL+2aPhnwsxXmcNk/e6O2BFklCfqjk74Zuo4zW8SuBBJTdWL0qEFcp D8aanYPO9Lpt5gWq0tbopemHNvxb9wDKIXaNGtdwvHlhQsFOb4oQO3bBtJ6yDtNyJBO1 ADf7QDdEhl/wamYPRBqsRITx7WpNOMSTT71WMg2J/HsX4eAncAZlFe/xQoPjbpPTl2vK 2B/f0SSLOACAigk3ld/UR2DBMZ8LAz48oKTwCGuSBr+CEEJ6Q+jd9DVsfRs93c+gE732 N3lB0dBP/sutRkbORxJ1n+WfW8f8tmJwGzPzpAEkpH3YJFiTLOMdgCa+3rc4aOumMd6D qwnQ== X-Gm-Message-State: APjAAAUID8OX1D0CWyyUiMAWmcsJsv15CW1PW1MOJsbrNdL8Zo9f1Q0r sjg1XypO21aW1ns9HRRoptYfvC8G X-Google-Smtp-Source: APXvYqwls//vqnA+ceQDnyN9NNLC2z6NyjS8cE4MiDr/OHlMxworF9HP5uFOsemY0Bu9W9PLmslAqQ== X-Received: by 2002:a63:df12:: with SMTP id u18mr14659423pgg.135.1553362793106; Sat, 23 Mar 2019 10:39:53 -0700 (PDT) Original-Received: from lylat ([2604:3d09:e380:2255:962f:b96:2aaf:c3d5]) by smtp.gmail.com with ESMTPSA id e15sm13573342pgk.30.2019.03.23.10.39.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Mar 2019 10:39:52 -0700 (PDT) In-Reply-To: <837ecpplw8.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Mar 2019 18:59:19 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:234656 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > As a rule of thumb that is 99% true, everything in xdisp.c is generic, > i.e. independent of the terminal-specific implementation. The > terminal-dependent stuff is in xterm.c/xfns.c (for X), > w32term.c/w32fns.c (for w32), nsterm.m/nsfns.m (for NS), and term.c > (for TTY). Which the naming scheme should reflect, IMO. This includes the presence of x_* procedures in the NS/W32 code that Stefan mentioned. > Although I personally fail to see how such renaming will help anyone > or anything. For example, the comment in ns_redisplay_interface that feels the need to mention that the procedures aren't tied to X. The part that made me make this thread was that there is no visual distinction between the generic and X-dependent procedures in the definition of x_redisplay_interface. It's not a huge deal, but it's not ideal. > The original long-term plan, to remind us, was not just to rename the > functions, but also to extract the common code from them so that we > have only one copy of that. Right, but that work can be separate from the renaming of the generic RIF procedures in xdisp.c. If it's going to happen, then IMO it should happen sooner rather than later. How about the attached patch? I can mention each rename individually in the commit message if you agree. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Rename-non-X-x_-procedures-in-xdisp.c.patch Content-Description: Rename >From 7bb19b2cee31b19c359778877c024690a97d587c Mon Sep 17 00:00:00 2001 From: Alexander Gramiak Date: Sat, 23 Mar 2019 11:19:40 -0600 Subject: [PATCH] Rename non-X x_* procedures in xdisp.c --- src/composite.c | 2 +- src/dispextern.h | 36 ++++++++++----------- src/nsfns.m | 4 +-- src/nsterm.m | 30 +++++++++--------- src/w32fns.c | 4 +-- src/w32term.c | 26 ++++++++-------- src/xdisp.c | 81 ++++++++++++++++++++++++------------------------ src/xfns.c | 10 +++--- src/xterm.c | 30 +++++++++--------- 9 files changed, 111 insertions(+), 112 deletions(-) diff --git a/src/composite.c b/src/composite.c index c426cbb124..839dc3dc71 100644 --- a/src/composite.c +++ b/src/composite.c @@ -176,7 +176,7 @@ get_composition_id (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t nchars, /* 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 { diff --git a/src/dispextern.h b/src/dispextern.h index 7947dc2dba..32049114c9 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3275,19 +3275,19 @@ extern void get_font_ascent_descent (struct font *, int *, int *); 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); @@ -3295,10 +3295,10 @@ extern void get_phys_cursor_geometry (struct window *, struct glyph_row *, 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); @@ -3310,11 +3310,11 @@ extern void handle_tool_bar_click (struct frame *, 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); diff --git a/src/nsfns.m b/src/nsfns.m index f8a316a437..0b8316c5a5 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -342,8 +342,8 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side. 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 (); diff --git a/src/nsterm.m b/src/nsterm.m index 81d36be6cc..15316e23ed 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1183,9 +1183,9 @@ static NSRect constrain_frame_rect(NSRect frameRect, bool isFullscreen) 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 (); @@ -1528,12 +1528,12 @@ -(void)remove { 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); } } @@ -2607,7 +2607,7 @@ so some key presses (TAB) are swallowed by the system. */ [[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); } } @@ -2885,7 +2885,7 @@ so some key presses (TAB) are swallowed by the system. */ block_input (); - x_clear_cursor (w); + gui_clear_cursor (w); { NSRect srcRect = NSMakeRect (x, from_y, width, height); @@ -5099,7 +5099,7 @@ static Lisp_Object ns_string_to_lispmod (const char *s) /* 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. */ @@ -5107,18 +5107,18 @@ static Lisp_Object ns_string_to_lispmod (const char *s) 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 */ @@ -7249,7 +7249,7 @@ - (void)windowDidResignKey: (NSNotification *)notification 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); } diff --git a/src/w32fns.c b/src/w32fns.c index e4794308ef..873fbaa6e0 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -1515,8 +1515,8 @@ x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 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); } } diff --git a/src/w32term.c b/src/w32term.c index 0f0d6482fc..4f34a1b274 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -363,7 +363,7 @@ w32_draw_underwave (struct glyph_string *s, COLORREF color) 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); @@ -713,9 +713,9 @@ x_update_window_end (struct window *w, bool cursor_on_p, 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 (); @@ -2845,7 +2845,7 @@ x_scroll_run (struct window *w, struct run *run) block_input (); /* Cursor off. Will be switched on again in x_update_window_end. */ - x_clear_cursor (w); + gui_clear_cursor (w); { RECT from; @@ -2888,14 +2888,14 @@ x_scroll_run (struct window *w, struct run *run) 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); } @@ -7074,18 +7074,18 @@ extern frame_parm_handler w32_frame_parm_handlers[]; 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, diff --git a/src/xdisp.c b/src/xdisp.c index a88fc698b8..285d9e91f2 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -900,7 +900,7 @@ static int underlying_face_id (struct it *); #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); @@ -2133,7 +2133,7 @@ get_glyph_string_clip_rects (struct glyph_string *s, NativeRectangle *rects, 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 @@ -2194,7 +2194,7 @@ get_glyph_string_clip_rects (struct glyph_string *s, NativeRectangle *rects, int { 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; } @@ -6926,7 +6926,7 @@ static next_element_function const get_next_element[NUM_IT_METHODS] = 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) @@ -9624,7 +9624,7 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos /* 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); @@ -11999,7 +11999,7 @@ store_mode_line_noprop (const char *string, int field_width, int precision) frame_title_format. */ static void -x_consider_frame_title (Lisp_Object frame) +gui_consider_frame_title (Lisp_Object frame) { struct frame *f = XFRAME (frame); @@ -17697,16 +17697,16 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) 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 @@ -20174,7 +20174,7 @@ append_space_for_newline (struct it *it, bool default_face_p) 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)) @@ -26260,7 +26260,7 @@ normal_char_height (struct font *font, int c) 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; @@ -26350,7 +26350,7 @@ left_overwriting (struct glyph_string *s) 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; @@ -26405,7 +26405,7 @@ right_overwriting (struct glyph_string *s) 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; @@ -27067,7 +27067,7 @@ font_for_underline_metrics (struct glyph_string *s) } /* 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) @@ -27149,9 +27149,8 @@ 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) @@ -28227,7 +28226,7 @@ produce_glyphless_glyph (struct it *it, bool for_no_font, Lisp_Object acronym) 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; @@ -28995,7 +28994,7 @@ x_produce_glyphs (struct it *it) 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; @@ -29039,7 +29038,7 @@ x_write_glyphs (struct window *w, struct glyph_row *updated_row, 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; @@ -29096,7 +29095,7 @@ x_insert_glyphs (struct window *w, struct glyph_row *updated_row, 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; @@ -29483,7 +29482,7 @@ notice_overwritten_cursor (struct window *w, enum glyph_row_area area, 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; @@ -29562,12 +29561,12 @@ draw_phys_cursor_glyph (struct window *w, struct glyph_row *row, 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); } } @@ -29857,7 +29856,7 @@ update_cursor_in_window_tree (struct window *w, bool on_p) 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); } @@ -29869,7 +29868,7 @@ x_update_cursor (struct frame *f, bool 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); @@ -31897,7 +31896,7 @@ note_mouse_highlight (struct frame *f, int x, int y) 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; @@ -32041,13 +32040,13 @@ expose_overlaps (struct window *w, 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; } } @@ -32076,7 +32075,7 @@ phys_cursor_in_rect_p (struct window *w, XRectangle *r) 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); @@ -32090,7 +32089,7 @@ phys_cursor_in_rect_p (struct window *w, XRectangle *r) 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; @@ -32102,7 +32101,7 @@ phys_cursor_in_rect_p (struct window *w, XRectangle *r) 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)); @@ -32153,7 +32152,7 @@ x_draw_vertical_border (struct window *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); @@ -32179,7 +32178,7 @@ x_draw_right_divider (struct window *w) } static void -x_draw_bottom_divider (struct window *w) +gui_draw_bottom_divider (struct window *w) { struct frame *f = XFRAME (WINDOW_FRAME (w)); @@ -32244,7 +32243,7 @@ expose_window (struct window *w, XRectangle *fr) 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; @@ -32261,7 +32260,7 @@ expose_window (struct window *w, XRectangle *fr) 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 @@ -32354,12 +32353,12 @@ expose_window (struct window *w, XRectangle *fr) /* 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 @@ -32493,7 +32492,7 @@ expose_frame (struct frame *f, int x, int y, int w, int h) 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; diff --git a/src/xfns.c b/src/xfns.c index 7234d02f4e..cca15b0467 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -1389,8 +1389,8 @@ x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 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); } } @@ -4584,7 +4584,7 @@ x_get_monitor_for_frame (struct frame *f, 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) @@ -4713,7 +4713,7 @@ x_get_monitor_attributes_xinerama (struct x_display_info *dpyinfo) 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 @@ -4817,7 +4817,7 @@ x_get_monitor_attributes_xrandr (struct x_display_info *dpyinfo) 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 diff --git a/src/xterm.c b/src/xterm.c index 1b0c2f5ec5..968ff165c5 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1161,9 +1161,9 @@ x_update_window_end (struct window *w, bool cursor_on_p, 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 (); @@ -3069,7 +3069,7 @@ x_draw_image_foreground (struct glyph_string *s) 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); @@ -3083,7 +3083,7 @@ x_draw_image_foreground (struct glyph_string *s) 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); @@ -3579,7 +3579,7 @@ x_draw_underwave (struct glyph_string *s) 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); @@ -4310,7 +4310,7 @@ x_scroll_run (struct window *w, struct run *run) 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)) @@ -4372,7 +4372,7 @@ frame_highlight (struct frame *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); } @@ -4390,7 +4390,7 @@ frame_unhighlight (struct frame *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); } @@ -13079,18 +13079,18 @@ x_activate_timeout_atimer (void) 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, -- 2.21.0 --=-=-= Content-Type: text/plain P.S. Should x_clear_window_mouse_face instead be renamed to clear_window_mouse_face since it doesn't depend on HAVE_WINDOW_SYSTEM like the others do? --=-=-=--