emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/pgtk 19da22e 018/100: Add support for handing the internal borde


From: Yuuki Harano
Subject: feature/pgtk 19da22e 018/100: Add support for handing the internal border
Date: Tue, 24 Nov 2020 08:02:28 -0500 (EST)

branch: feature/pgtk
commit 19da22ed25753d0e90b9cbc2c79b37d0aae67712
Author: Yuuki Harano <masm+github@masm11.me>
Commit: Jeff Walsh <fejfighter@gmail.com>

    Add support for handing the internal border
    
    src/pgtkterm.c (pgtk_clear_under_internal_border): remove #if 0
    src/pgtkfns.c (x_set_internal_border_width): add clear and fill support
    
    internal-border 対応。
---
 src/pgtkfns.c  |  2 --
 src/pgtkterm.c | 29 +++++++++++++++++++++--------
 2 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/src/pgtkfns.c b/src/pgtkfns.c
index b726d1b..3f31c08 100644
--- a/src/pgtkfns.c
+++ b/src/pgtkfns.c
@@ -549,7 +549,6 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, 
Lisp_Object oldval)
 static void
 x_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object 
oldval)
 {
-#if 0
   int old_width = FRAME_INTERNAL_BORDER_WIDTH (f);
 
   CHECK_TYPE_RANGED_INTEGER (int, arg);
@@ -564,7 +563,6 @@ x_set_internal_border_width (struct frame *f, Lisp_Object 
arg, Lisp_Object oldva
     adjust_frame_size (f, -1, -1, 3, 0, Qinternal_border_width);
 
   SET_FRAME_GARBAGED (f);
-#endif
 }
 
 
diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 1c2f0c9..56a05da 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -4734,19 +4734,32 @@ pgtk_clear_under_internal_border (struct frame *f)
 
       block_input ();
 
+      struct {
+       int x, y, w, h;
+      } rects[] = {
+       { 0,              margin,          width,  border },
+       { 0,              0,               border, height },
+       { width - border, 0,               border, height },
+       { 0,              height - border, width,  border },
+      };
+
       if (face)
        {
-         pgtk_fill_rectangle (f, color, 0, margin, width, border);
-         pgtk_fill_rectangle (f, color, 0, 0, border, height);
-         pgtk_fill_rectangle (f, color, width - border, 0, border, height);
-         pgtk_fill_rectangle (f, color, 0, height - border, width, border);
+         for (int i = 0; i < 4; i++) {
+           int x = rects[i].x;
+           int y = rects[i].y;
+           int w = rects[i].w;
+           int h = rects[i].h;
+           cairo_surface_t *bg = create_background_surface_by_face (f, face, 
x, y, w, h);
+           cairo_set_source_surface (cr, bg, x, y);
+           cairo_rectangle (cr, x, y, w, h);
+           cairo_fill (cr);
+         }
        }
       else
        {
-         pgtk_clear_area (f, 0, 0, border, height);
-         pgtk_clear_area (f, 0, margin, width, border);
-         pgtk_clear_area (f, width - border, 0, border, height);
-         pgtk_clear_area (f, 0, height - border, width, border);
+         for (int i = 0; i < 4; i++)
+           pgtk_clear_area (f, rects[i].x, rects[i].y, rects[i].w, rects[i].h);
        }
 
       unblock_input ();



reply via email to

[Prev in Thread] Current Thread [Next in Thread]