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.16 by ayin, Sun Feb 17 12:11:36 2008 UTC vs.
Revision 1.19 by ayin, Tue Feb 19 10:47:03 2008 UTC

64 unsigned char align; 64 unsigned char align;
65 Window win; 65 Window win;
66 Cursor leftptr_cursor; 66 Cursor leftptr_cursor;
67 int (rxvt_term::*update)(int, int, int, int); 67 int (rxvt_term::*update)(int, int, int, int);
68 void setup (rxvt_term *); 68 void setup (rxvt_term *);
69 // update style dependent data
70 void update_data ();
71 void resize ();
72 int map (int);
73 int show (int);
69 74
70 bool upButton (int y) 75 bool upButton (int y)
71 { 76 {
72 if (style == R_SB_NEXT) 77 if (style == R_SB_NEXT)
73 return y > end && y <= end + width + 1; 78 return y > end && y <= end + width + 1;
81 return y > end + width + 1; 86 return y > end + width + 1;
82 if (style == R_SB_RXVT) 87 if (style == R_SB_RXVT)
83 return y > end; 88 return y > end;
84 return false; 89 return false;
85 } 90 }
91 unsigned min_height ()
92 {
93 return style == R_SB_NEXT ? SB_THUMB_MIN_HEIGHT : 10;
94 }
95 unsigned size ()
96 {
97 return end - beg - min_height ();
98 }
86 unsigned total_width () 99 unsigned total_width ()
87 { 100 {
88 return width + shadow * 2; 101 return width + shadow * 2;
89 } 102 }
90}; 103};
91 104
92#define SCROLLNEXT_MINHEIGHT SB_THUMB_MIN_HEIGHT
93#define SCROLLRXVT_MINHEIGHT 10
94
95#define scrollbar_minheight() (scrollBar.style == R_SB_NEXT \
96 ? SCROLLNEXT_MINHEIGHT \
97 : SCROLLRXVT_MINHEIGHT)
98#define scrollbar_above_slider(y) ((y) < scrollBar.top) 105#define scrollbar_above_slider(y) ((y) < scrollBar.top)
99#define scrollbar_below_slider(y) ((y) > scrollBar.bot) 106#define scrollbar_below_slider(y) ((y) > scrollBar.bot)
100#define scrollbar_position(y) ((y) - scrollBar.beg) 107#define scrollbar_position(y) ((y) - scrollBar.beg)
101#define scrollbar_size() (scrollBar.end - scrollBar.beg \
102 - scrollbar_minheight ())
103 108
104 /* 109 /*
105 * +-------------+ 110 * +-------------+
106 * | | <---< SB_PADDING 111 * | | <---< SB_PADDING
107 * | ::::::::::: | 112 * | ::::::::::: |

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines