emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r113846: * window.h (WINDOW_FRINGE_EXTENDED_P): New


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r113846: * window.h (WINDOW_FRINGE_EXTENDED_P): New macro.
Date: Tue, 13 Aug 2013 15:30:19 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113846
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Tue 2013-08-13 19:29:25 +0400
message:
  * window.h (WINDOW_FRINGE_EXTENDED_P): New macro.
  * nsterm.m (ns_set_vertical_scroll_bar): Use it.  Use convenient
  bool instead of BOOL.
  * w32term.h (struct scroll_bar): Convert fringe_extended_p
  from Lisp_Object to bitfield.  Adjust comment.
  * w32term.c (x_scroll_bar_create): Adjust user.
  Use WINDOW_FRINGE_EXTENDED_P and bool for boolean.
  * xterm.c (XTset_vertical_scroll_bar): Likewise.
  Use bool for boolean.
  * xterm.h (struct scroll_bar): Prefer commonly used `unsigned'
  to `unsigned int' when defining a bitfield.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/nsterm.m                   nsterm.m-20091113204419-o5vbwnq5f7feedwu-8747
  src/w32term.c                  w32term.c-20091113204419-o5vbwnq5f7feedwu-950
  src/w32term.h                  w32term.h-20091113204419-o5vbwnq5f7feedwu-954
  src/window.h                   window.h-20091113204419-o5vbwnq5f7feedwu-271
  src/xterm.c                    xterm.c-20091113204419-o5vbwnq5f7feedwu-244
  src/xterm.h                    xterm.h-20091113204419-o5vbwnq5f7feedwu-228
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-08-13 15:00:58 +0000
+++ b/src/ChangeLog     2013-08-13 15:29:25 +0000
@@ -1,3 +1,17 @@
+2013-08-13  Dmitry Antipov  <address@hidden>
+
+       * window.h (WINDOW_FRINGE_EXTENDED_P): New macro.
+       * nsterm.m (ns_set_vertical_scroll_bar): Use it.  Use convenient
+       bool instead of BOOL.
+       * w32term.h (struct scroll_bar): Convert fringe_extended_p
+       from Lisp_Object to bitfield.  Adjust comment.
+       * w32term.c (x_scroll_bar_create): Adjust user.
+       Use WINDOW_FRINGE_EXTENDED_P and bool for boolean.
+       * xterm.c (XTset_vertical_scroll_bar): Likewise.
+       Use bool for boolean.
+       * xterm.h (struct scroll_bar): Prefer commonly used `unsigned'
+       to `unsigned int' when defining a bitfield.
+
 2013-08-13  Paul Eggert  <address@hidden>
 
        * decompress.c (Fzlib_decompress_region): Try to clarify 'avail_out'.

=== modified file 'src/nsterm.m'
--- a/src/nsterm.m      2013-08-11 14:57:12 +0000
+++ b/src/nsterm.m      2013-08-13 15:29:25 +0000
@@ -3703,7 +3703,7 @@
   int window_y, window_height;
   int top, left, height, width, sb_width, sb_left;
   EmacsScroller *bar;
-  BOOL fringe_extended_p;
+  bool fringe_extended_p;
 
   /* optimization; display engine sends WAY too many of these.. */
   if (!NILP (window->vertical_scroll_bar))
@@ -3740,16 +3740,7 @@
   v = [view frame];
   r.origin.y = (v.size.height - r.size.height - r.origin.y);
 
-  if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (window))
-    fringe_extended_p = (WINDOW_LEFTMOST_P (window)
-                        && WINDOW_LEFT_FRINGE_WIDTH (window)
-                        && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (window)
-                            || WINDOW_LEFT_MARGIN_COLS (window) == 0));
-  else
-    fringe_extended_p = (WINDOW_RIGHTMOST_P (window)
-                        && WINDOW_RIGHT_FRINGE_WIDTH (window)
-                        && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (window)
-                            || WINDOW_RIGHT_MARGIN_COLS (window) == 0));
+  fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (w);
 
   XSETWINDOW (win, window);
   block_input ();

=== modified file 'src/w32term.c'
--- a/src/w32term.c     2013-08-08 14:51:07 +0000
+++ b/src/w32term.c     2013-08-13 15:29:25 +0000
@@ -3770,7 +3770,7 @@
   XSETINT (bar->start, 0);
   XSETINT (bar->end, 0);
   bar->dragging = Qnil;
-  bar->fringe_extended_p = Qnil;
+  bar->fringe_extended_p = 0;
 
   /* Requires geometry to be set before call to create the real window */
 
@@ -3834,7 +3834,7 @@
   struct scroll_bar *bar;
   int top, height, left, sb_left, width, sb_width;
   int window_y, window_height;
-  int fringe_extended_p;
+  bool fringe_extended_p;
 
   /* Get window dimensions.  */
   window_box (w, -1, 0, &window_y, 0, &window_height);
@@ -3858,16 +3858,7 @@
   else
     sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width);
 
-  if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
-    fringe_extended_p = (WINDOW_LEFTMOST_P (w)
-                        && WINDOW_LEFT_FRINGE_WIDTH (w)
-                        && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
-                            || WINDOW_LEFT_MARGIN_COLS (w) == 0));
-  else
-    fringe_extended_p = (WINDOW_RIGHTMOST_P (w)
-                        && WINDOW_RIGHT_FRINGE_WIDTH (w)
-                        && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
-                            || WINDOW_RIGHT_MARGIN_COLS (w) == 0));
+  fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (w);
 
   /* Does the scroll bar exist yet?  */
   if (NILP (w->vertical_scroll_bar))
@@ -3896,11 +3887,11 @@
       hwnd = SCROLL_BAR_W32_WINDOW (bar);
 
       /* If already correctly positioned, do nothing.  */
-      if ( XINT (bar->left) == sb_left
-           && XINT (bar->top) == top
-           && XINT (bar->width) ==  sb_width
-           && XINT (bar->height) == height
-          && !NILP (bar->fringe_extended_p) == fringe_extended_p )
+      if (XINT (bar->left) == sb_left
+         && XINT (bar->top) == top
+         && XINT (bar->width) == sb_width
+         && XINT (bar->height) == height
+         && bar->fringe_extended_p == fringe_extended_p)
         {
           /* Redraw after clear_frame. */
           if (!my_show_window (f, hwnd, SW_NORMAL))
@@ -3950,7 +3941,7 @@
           unblock_input ();
         }
     }
-  bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil;
+  bar->fringe_extended_p = fringe_extended_p;
 
   w32_set_scroll_bar_thumb (bar, portion, position, whole);
   XSETVECTOR (barobj, bar);

=== modified file 'src/w32term.h'
--- a/src/w32term.h     2013-08-03 03:29:03 +0000
+++ b/src/w32term.h     2013-08-13 15:29:25 +0000
@@ -451,9 +451,9 @@
      being dragged, this is Qnil.  */
   Lisp_Object dragging;
 
-  /* t if the background of the fringe that is adjacent to a scroll
+  /* 1 if the background of the fringe that is adjacent to a scroll
      bar is extended to the gap between the fringe and the bar.  */
-  Lisp_Object fringe_extended_p;
+  unsigned fringe_extended_p : 1;
 };
 
 /* Turning a lisp vector value into a pointer to a struct scroll_bar.  */

=== modified file 'src/window.h'
--- a/src/window.h      2013-08-13 14:45:58 +0000
+++ b/src/window.h      2013-08-13 15:29:25 +0000
@@ -828,13 +828,25 @@
 #define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X)     \
   (window_box_left ((W), TEXT_AREA) + (X))
 
-/* This is the window in which the terminal's cursor should
-   be left when nothing is being done with it.  This must
-   always be a leaf window, and its buffer is selected by
-   the top level editing loop at the end of each command.
-
-   This value is always the same as
-    FRAME_SELECTED_WINDOW (selected_frame).  */
+/* Nonzero if the background of the window W's fringe that is adjacent to
+   a scroll bar is extended to the gap between the fringe and the bar.  */
+
+#define WINDOW_FRINGE_EXTENDED_P(w)                    \
+  (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)          \
+   ? (WINDOW_LEFTMOST_P (w)                            \
+      && WINDOW_LEFT_FRINGE_WIDTH (w)                  \
+      && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)       \
+         || WINDOW_LEFT_MARGIN_COLS (w) == 0))         \
+   : (WINDOW_RIGHTMOST_P (w)                           \
+      && WINDOW_RIGHT_FRINGE_WIDTH (w)                 \
+      && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)       \
+         || WINDOW_RIGHT_MARGIN_COLS (w) == 0)))
+
+/* This is the window in which the terminal's cursor should be left when
+   nothing is being done with it.  This must always be a leaf window, and its
+   buffer is selected by the top level editing loop at the end of each command.
+
+   This value is always the same as FRAME_SELECTED_WINDOW (selected_frame).  */
 
 extern Lisp_Object selected_window;
 

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2013-08-11 01:30:20 +0000
+++ b/src/xterm.c       2013-08-13 15:29:25 +0000
@@ -5155,7 +5155,7 @@
   int top, height, left, sb_left, width, sb_width;
   int window_y, window_height;
 #ifdef USE_TOOLKIT_SCROLL_BARS
-  int fringe_extended_p;
+  bool fringe_extended_p;
 #endif
 
   /* Get window dimensions.  */
@@ -5188,16 +5188,7 @@
 #endif
 
 #ifdef USE_TOOLKIT_SCROLL_BARS
-  if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
-    fringe_extended_p = (WINDOW_LEFTMOST_P (w)
-                        && WINDOW_LEFT_FRINGE_WIDTH (w)
-                        && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
-                            || WINDOW_LEFT_MARGIN_COLS (w) == 0));
-  else
-    fringe_extended_p = (WINDOW_RIGHTMOST_P (w)
-                        && WINDOW_RIGHT_FRINGE_WIDTH (w)
-                        && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
-                            || WINDOW_RIGHT_MARGIN_COLS (w) == 0));
+  fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (w);
 #endif
 
   /* Does the scroll bar exist yet?  */

=== modified file 'src/xterm.h'
--- a/src/xterm.h       2013-08-02 03:55:24 +0000
+++ b/src/xterm.h       2013-08-13 15:29:25 +0000
@@ -815,7 +815,7 @@
 
   /* 1 if the background of the fringe that is adjacent to a scroll
      bar is extended to the gap between the fringe and the bar.  */
-  unsigned int fringe_extended_p : 1;
+  unsigned fringe_extended_p : 1;
 };
 
 /* Turning a lisp vector value into a pointer to a struct scroll_bar.  */


reply via email to

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