… | |
… | |
12 | unsigned int end; /* slider sub-window end height */ |
12 | unsigned int end; /* slider sub-window end height */ |
13 | unsigned int top; /* slider top position */ |
13 | unsigned int top; /* slider top position */ |
14 | unsigned int bot; /* slider bottom position */ |
14 | unsigned int bot; /* slider bottom position */ |
15 | unsigned int style; /* style: rxvt, xterm, next */ |
15 | unsigned int style; /* style: rxvt, xterm, next */ |
16 | unsigned int width; /* scrollbar width */ |
16 | unsigned int width; /* scrollbar width */ |
|
|
17 | int shadow; /* scrollbar shadow width */ |
|
|
18 | int last_bot; /* scrollbar last bottom position */ |
|
|
19 | int last_top; /* scrollbar last top position */ |
|
|
20 | int last_state; /* scrollbar last state */ |
|
|
21 | int len; |
|
|
22 | unsigned char align; |
17 | Window win; |
23 | Window win; |
|
|
24 | Cursor leftptr_cursor; |
18 | int (rxvt_term::*update)(int, int, int, int); |
25 | int (rxvt_term::*update)(int, int, int, int); |
19 | |
26 | |
20 | void setIdle() { state = 1 ; } |
27 | void setIdle() { state = 1 ; } |
21 | void setMotion() { state = 'm'; } |
28 | void setMotion() { state = 'm'; } |
22 | void setUp() { state = 'U'; } |
29 | void setUp() { state = 'U'; } |
23 | void setDn() { state = 'D'; } |
30 | void setDn() { state = 'D'; } |
24 | } scrollBar_t; |
31 | } scrollBar_t; |
25 | |
32 | |
|
|
33 | #define scrollbar_TotalWidth() (scrollBar.width + scrollBar.shadow * 2) |
26 | #define scrollbar_isMotion() (scrollBar.state == 'm') |
34 | #define scrollbar_isMotion() (scrollBar.state == 'm') |
27 | #define scrollbar_isUp() (scrollBar.state == 'U') |
35 | #define scrollbar_isUp() (scrollBar.state == 'U') |
28 | #define scrollbar_isDn() (scrollBar.state == 'D') |
36 | #define scrollbar_isDn() (scrollBar.state == 'D') |
29 | #define scrollbar_isUpDn() isupper (scrollBar.state) |
37 | #define scrollbar_isUpDn() (scrollbar_isUp () || scrollbar_isDn ()) |
30 | #define isScrollbarWindow(w) (scrollBar.state && (w) == scrollBar.win) |
|
|
31 | |
38 | |
32 | #define scrollbarnext_dnval() (scrollBar.end + (scrollBar.width + 1)) |
39 | #define scrollbarnext_dnval() (scrollBar.end + (scrollBar.width + 1)) |
33 | #define scrollbarnext_upButton(y) ((y) > scrollBar.end \ |
40 | #define scrollbarnext_upButton(y) ((y) > scrollBar.end \ |
34 | && (y) <= scrollbarnext_dnval ()) |
41 | && (y) <= scrollbarnext_dnval ()) |
35 | #define scrollbarnext_dnButton(y) ((y) > scrollbarnext_dnval()) |
42 | #define scrollbarnext_dnButton(y) ((y) > scrollbarnext_dnval()) |
36 | #define SCROLLNEXT_MINHEIGHT SB_THUMB_MIN_HEIGHT |
43 | #define SCROLLNEXT_MINHEIGHT SB_THUMB_MIN_HEIGHT |
37 | #define scrollbarrxvt_upButton(y) ((y) < scrollBar.beg) |
44 | #define scrollbarrxvt_upButton(y) ((y) < scrollBar.beg) |
38 | #define scrollbarrxvt_dnButton(y) ((y) > scrollBar.end) |
45 | #define scrollbarrxvt_dnButton(y) ((y) > scrollBar.end) |
39 | #define SCROLLRXVT_MINHEIGHT 10 |
46 | #define SCROLLRXVT_MINHEIGHT 10 |
40 | #define SCROLLXTERM_MINHEIGHT 10 |
|
|
41 | |
47 | |
42 | #define scrollbar_minheight() (scrollBar.style == R_SB_NEXT \ |
48 | #define scrollbar_minheight() (scrollBar.style == R_SB_NEXT \ |
43 | ? SCROLLNEXT_MINHEIGHT \ |
49 | ? SCROLLNEXT_MINHEIGHT \ |
44 | : SCROLLRXVT_MINHEIGHT) |
50 | : SCROLLRXVT_MINHEIGHT) |
45 | #define scrollbar_above_slider(y) ((y) < scrollBar.top) |
51 | #define scrollbar_above_slider(y) ((y) < scrollBar.top) |