13 #define R_SB_ALIGN_CENTRE 0
14 #define R_SB_ALIGN_TOP 1
15 #define R_SB_ALIGN_BOTTOM 2
17 #define SB_WIDTH_NEXT 19
18 #define SB_WIDTH_XTERM 15
19 #define SB_WIDTH_PLAIN 7
21 # define SB_WIDTH_RXVT 10
25 * NeXT scrollbar defines
28 #define SB_BORDER_WIDTH 1
29 #define SB_BEVEL_WIDTH_UPPER_LEFT 1
30 #define SB_BEVEL_WIDTH_LOWER_RIGHT 2
31 #define SB_LEFT_PADDING (SB_PADDING + SB_BORDER_WIDTH)
32 #define SB_MARGIN_SPACE (SB_PADDING * 2)
33 #define SB_BUTTON_WIDTH (SB_WIDTH_NEXT - SB_MARGIN_SPACE - SB_BORDER_WIDTH)
34 #define SB_BUTTON_HEIGHT (SB_BUTTON_WIDTH)
35 #define SB_BUTTON_SINGLE_HEIGHT (SB_BUTTON_HEIGHT + SB_PADDING)
36 #define SB_BUTTON_BOTH_HEIGHT (SB_BUTTON_SINGLE_HEIGHT * 2)
37 #define SB_BUTTON_TOTAL_HEIGHT (SB_BUTTON_BOTH_HEIGHT + SB_PADDING)
38 #define SB_BUTTON_BEVEL_X (SB_LEFT_PADDING)
39 #define SB_BUTTON_FACE_X (SB_BUTTON_BEVEL_X + SB_BEVEL_WIDTH_UPPER_LEFT)
40 #define SB_THUMB_MIN_HEIGHT (SB_BUTTON_WIDTH - (SB_PADDING * 2))
52 char state; /* scrollbar state */
53 char init; /* scrollbar has been initialised */
54 unsigned int beg; /* slider sub-window begin height */
55 unsigned int end; /* slider sub-window end height */
56 unsigned int top; /* slider top position */
57 unsigned int bot; /* slider bottom position */
58 unsigned int style; /* style: rxvt, xterm, next */
59 unsigned int width; /* scrollbar width */
60 int shadow; /* scrollbar shadow width */
61 int last_bot; /* scrollbar last bottom position */
62 int last_top; /* scrollbar last top position */
63 int last_state; /* scrollbar last state */
66 Cursor leftptr_cursor;
67 int (scrollBar_t::*update)(int);
68 void setup (rxvt_term *);
76 if (style == R_SB_NEXT)
77 return y > end && y <= end + width + 1;
78 if (style == R_SB_RXVT)
84 if (style == R_SB_NEXT)
85 return y > end + width + 1;
86 if (style == R_SB_RXVT)
90 unsigned min_height ()
92 return style == R_SB_NEXT ? SB_THUMB_MIN_HEIGHT : 10;
96 return end - beg - min_height ();
98 unsigned total_width ()
100 return width + shadow * 2;
103 #if defined(NEXT_SCROLLBAR)
116 #if defined(RXVT_SCROLLBAR)
122 #if defined(XTERM_SCROLLBAR)
127 #if defined(PLAIN_SCROLLBAR)
132 // update style dependent data
140 int show_xterm (int);
142 int show_plain (int);
147 #define scrollbar_above_slider(y) ((y) < scrollBar.top)
148 #define scrollbar_below_slider(y) ((y) > scrollBar.bot)
149 #define scrollbar_position(y) ((y) - scrollBar.beg)
153 * | | <---< SB_PADDING
157 * ,,,,,,,,,,,,,,,,,
160 * | +---------------< SB_BEVEL_WIDTH_UPPER_LEFT
162 * | V :::: vv-------< SB_BEVEL_WIDTH_LOWER_RIGHT
169 * | +---------+ | <.........................
170 * | | <---< SB_PADDING :
171 * | +---------+ | <-+.......... :---< SB_BUTTON_TOTAL_HEIGHT
172 * | | ......%%| | | : :
173 * | | ../\..%%| | |---< SB_BUTTON_HEIGHT :
174 * | | %%%%%%%%| | | : :
175 * | +---------+ | <-+ : :
177 * | +---------+ | <-+ :---< SB_BUTTON_BOTH_HEIGHT
178 * | | ......%%| | | : :
179 * | | ..\/..%%| | | : :
180 * | | %%%%%%%%| | |---< SB_BUTTON_SINGLE_HEIGHT
181 * | +---------+ | | : :
183 * +-------------+ <-+.........:............:
186 * || +---< SB_BUTTON_WIDTH
188 * |+------< SB_PADDING
190 * +----< SB_BORDER_WIDTH
194 * +---< SB_WIDTH_NEXT