Commit c8ae93b0 authored by Dmitry Antipov's avatar Dmitry Antipov

* 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.
parent 53b64418
2013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
* 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 <eggert@cs.ucla.edu>
* decompress.c (Fzlib_decompress_region): Try to clarify 'avail_out'.
......
......@@ -3703,7 +3703,7 @@ overwriting cursor (usually when cursor on a tab) */
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 @@ overwriting cursor (usually when cursor on a tab) */
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 ();
......
......@@ -3770,7 +3770,7 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
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 @@ w32_set_vertical_scroll_bar (struct window *w,
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 @@ w32_set_vertical_scroll_bar (struct window *w,
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 @@ w32_set_vertical_scroll_bar (struct window *w,
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 @@ w32_set_vertical_scroll_bar (struct window *w,
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);
......
......@@ -451,9 +451,9 @@ struct scroll_bar {
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. */
......
......@@ -828,13 +828,25 @@ wset_next_buffers (struct window *w, Lisp_Object val)
#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;
......
......@@ -5155,7 +5155,7 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
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 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
#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? */
......
......@@ -815,7 +815,7 @@ struct scroll_bar
/* 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. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment