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.27 by sf-exg, Sun Aug 28 18:48:41 2011 UTC vs.
Revision 1.31 by sf-exg, Fri May 30 19:44:11 2014 UTC

30#define SB_BUTTON_BEVEL_X (SB_LEFT_PADDING) 30#define SB_BUTTON_BEVEL_X (SB_LEFT_PADDING)
31#define SB_BUTTON_FACE_X (SB_BUTTON_BEVEL_X + SB_BEVEL_WIDTH_UPPER_LEFT) 31#define SB_BUTTON_FACE_X (SB_BUTTON_BEVEL_X + SB_BEVEL_WIDTH_UPPER_LEFT)
32#define SB_THUMB_MIN_HEIGHT (SB_BUTTON_WIDTH - (SB_PADDING * 2)) 32#define SB_THUMB_MIN_HEIGHT (SB_BUTTON_WIDTH - (SB_PADDING * 2))
33 33
34enum sb_state { 34enum sb_state {
35 STATE_OFF, 35 SB_STATE_OFF,
36 STATE_IDLE, 36 SB_STATE_IDLE,
37 STATE_MOTION, 37 SB_STATE_MOTION,
38 STATE_UP, 38 SB_STATE_UP,
39 STATE_DOWN, 39 SB_STATE_DOWN,
40}; 40};
41 41
42enum sb_style { 42enum sb_style {
43 R_SB_NEXT = 1, 43 SB_STYLE_NEXT = 1,
44 R_SB_XTERM = 2, 44 SB_STYLE_XTERM = 2,
45 R_SB_PLAIN = 4, 45 SB_STYLE_PLAIN = 4,
46 R_SB_RXVT = 8, 46 SB_STYLE_RXVT = 8,
47}; 47};
48 48
49enum sb_align { 49enum sb_align {
50 R_SB_ALIGN_CENTRE, 50 SB_ALIGN_CENTRE,
51 R_SB_ALIGN_TOP, 51 SB_ALIGN_TOP,
52 R_SB_ALIGN_BOTTOM, 52 SB_ALIGN_BOTTOM,
53}; 53};
54 54
55struct scrollBar_t 55struct scrollBar_t
56{ 56{
57 rxvt_term *term; 57 rxvt_term *term;
74 void setup (rxvt_term *); 74 void setup (rxvt_term *);
75 void resize (); 75 void resize ();
76 void map (int); 76 void map (int);
77 int show (int); 77 int show (int);
78 void destroy (); 78 void destroy ();
79 int color ();
79 80
80 bool upButton (int y) 81 bool upButton (int y)
81 { 82 {
82 if (style == R_SB_NEXT) 83 if (style == SB_STYLE_NEXT)
83 return y > end && y <= end + width + 1; 84 return y > end && y <= end + width + 1;
84 if (style == R_SB_RXVT) 85 if (style == SB_STYLE_RXVT)
85 return y < beg; 86 return y < beg;
86 return false; 87 return false;
87 } 88 }
88 bool dnButton (int y) 89 bool dnButton (int y)
89 { 90 {
90 if (style == R_SB_NEXT) 91 if (style == SB_STYLE_NEXT)
91 return y > end + width + 1; 92 return y > end + width + 1;
92 if (style == R_SB_RXVT) 93 if (style == SB_STYLE_RXVT)
93 return y > end; 94 return y > end;
94 return false; 95 return false;
95 } 96 }
96 int min_height () 97 int min_height ()
97 { 98 {
98 return style == R_SB_NEXT ? SB_THUMB_MIN_HEIGHT : 10; 99 return style == SB_STYLE_NEXT ? SB_THUMB_MIN_HEIGHT : 10;
99 } 100 }
100 int size () 101 int size ()
101 { 102 {
102 return max (end - beg - min_height (), 0); 103 return max (end - beg, 0);
103 } 104 }
104 int total_width () 105 int total_width ()
105 { 106 {
106 return width + shadow * 2; 107 return width + shadow * 2;
107 } 108 }
128 Pixmap dimple, 129 Pixmap dimple,
129 upArrow, 130 upArrow,
130 downArrow, 131 downArrow,
131 upArrowHi, 132 upArrowHi,
132 downArrowHi; 133 downArrowHi;
134 bool last_has_sb;
133#endif 135#endif
134 136
135#if defined(RXVT_SCROLLBAR) 137#if defined(RXVT_SCROLLBAR)
136 GC scrollbarGC, 138 GC scrollbarGC,
137 topShadowGC, 139 topShadowGC,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines