… | |
… | |
3 | |
3 | |
4 | #include <X11/Xlib.h> |
4 | #include <X11/Xlib.h> |
5 | |
5 | |
6 | struct rxvt_term; |
6 | struct rxvt_term; |
7 | |
7 | |
8 | typedef struct { |
8 | struct scrollBar_t { |
9 | char state; /* scrollbar state */ |
9 | char state; /* scrollbar state */ |
10 | char init; /* scrollbar has been initialised */ |
10 | char init; /* scrollbar has been initialised */ |
11 | unsigned int beg; /* slider sub-window begin height */ |
11 | unsigned int beg; /* slider sub-window begin height */ |
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 */ |
… | |
… | |
26 | |
26 | |
27 | void setIdle() { state = 1 ; } |
27 | void setIdle() { state = 1 ; } |
28 | void setMotion() { state = 'm'; } |
28 | void setMotion() { state = 'm'; } |
29 | void setUp() { state = 'U'; } |
29 | void setUp() { state = 'U'; } |
30 | void setDn() { state = 'D'; } |
30 | void setDn() { state = 'D'; } |
31 | } scrollBar_t; |
31 | }; |
32 | |
32 | |
33 | #define scrollbar_TotalWidth() (scrollBar.width + scrollBar.shadow * 2) |
33 | #define scrollbar_TotalWidth() (scrollBar.width + scrollBar.shadow * 2) |
34 | #define scrollbar_isMotion() (scrollBar.state == 'm') |
34 | #define scrollbar_isMotion() (scrollBar.state == 'm') |
35 | #define scrollbar_isUp() (scrollBar.state == 'U') |
35 | #define scrollbar_isUp() (scrollBar.state == 'U') |
36 | #define scrollbar_isDn() (scrollBar.state == 'D') |
36 | #define scrollbar_isDn() (scrollBar.state == 'D') |