ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/scrollbar.h
(Generate patch)

Comparing rxvt-unicode/src/scrollbar.h (file contents):
Revision 1.6 by ayin, Sun Dec 30 23:45:42 2007 UTC vs.
Revision 1.11 by ayin, Sat Jan 5 12:19:34 2008 UTC

3 3
4#include <X11/Xlib.h> 4#include <X11/Xlib.h>
5 5
6struct rxvt_term; 6struct rxvt_term;
7 7
8typedef struct { 8struct 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 */
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 */ 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;
18 unsigned char align; 22 unsigned char align;
19 Window win; 23 Window win;
24 Cursor leftptr_cursor;
20 int (rxvt_term::*update)(int, int, int, int); 25 int (rxvt_term::*update)(int, int, int, int);
21 26
22 void setIdle() { state = 1 ; } 27 void setIdle() { state = 1 ; }
23 void setMotion() { state = 'm'; } 28 void setMotion() { state = 'm'; }
24 void setUp() { state = 'U'; } 29 void setUp() { state = 'U'; }
25 void setDn() { state = 'D'; } 30 void setDn() { state = 'D'; }
26} scrollBar_t; 31};
27 32
28#define scrollbar_TotalWidth() (scrollBar.width + scrollBar.shadow * 2) 33#define scrollbar_TotalWidth() (scrollBar.width + scrollBar.shadow * 2)
29#define scrollbar_isMotion() (scrollBar.state == 'm') 34#define scrollbar_isMotion() (scrollBar.state == 'm')
30#define scrollbar_isUp() (scrollBar.state == 'U') 35#define scrollbar_isUp() (scrollBar.state == 'U')
31#define scrollbar_isDn() (scrollBar.state == 'D') 36#define scrollbar_isDn() (scrollBar.state == 'D')
32#define scrollbar_isUpDn() (scrollbar_isUp () || scrollbar_isDn ()) 37#define scrollbar_isUpDn() (scrollbar_isUp () || scrollbar_isDn ())
33#define isScrollbarWindow(w) (scrollBar.state && (w) == scrollBar.win)
34 38
35#define scrollbarnext_dnval() (scrollBar.end + (scrollBar.width + 1)) 39#define scrollbarnext_dnval() (scrollBar.end + (scrollBar.width + 1))
36#define scrollbarnext_upButton(y) ((y) > scrollBar.end \ 40#define scrollbarnext_upButton(y) ((y) > scrollBar.end \
37 && (y) <= scrollbarnext_dnval ()) 41 && (y) <= scrollbarnext_dnval ())
38#define scrollbarnext_dnButton(y) ((y) > scrollbarnext_dnval()) 42#define scrollbarnext_dnButton(y) ((y) > scrollbarnext_dnval())

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines