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.20 by ayin, Tue Feb 19 13:01:33 2008 UTC

62 int last_state; /* scrollbar last state */ 62 int last_state; /* scrollbar last state */
63 int len; 63 int len;
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 (scrollBar_t::*update)(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);
74 void destroy ();
69 75
70 bool upButton (int y) 76 bool upButton (int y)
71 { 77 {
72 if (style == R_SB_NEXT) 78 if (style == R_SB_NEXT)
73 return y > end && y <= end + width + 1; 79 return y > end && y <= end + width + 1;
81 return y > end + width + 1; 87 return y > end + width + 1;
82 if (style == R_SB_RXVT) 88 if (style == R_SB_RXVT)
83 return y > end; 89 return y > end;
84 return false; 90 return false;
85 } 91 }
92 unsigned min_height ()
93 {
94 return style == R_SB_NEXT ? SB_THUMB_MIN_HEIGHT : 10;
95 }
96 unsigned size ()
97 {
98 return end - beg - min_height ();
99 }
86 unsigned total_width () 100 unsigned total_width ()
87 { 101 {
88 return width + shadow * 2; 102 return width + shadow * 2;
89 } 103 }
104
105#if defined(NEXT_SCROLLBAR)
106 GC blackGC,
107 whiteGC,
108 grayGC,
109 darkGC,
110 stippleGC;
111 Pixmap dimple,
112 upArrow,
113 downArrow,
114 upArrowHi,
115 downArrowHi;
116#endif
117
118#if defined(RXVT_SCROLLBAR)
119 GC scrollbarGC,
120 topShadowGC,
121 botShadowGC;
122#endif
123
124#if defined(XTERM_SCROLLBAR)
125 GC xscrollbarGC,
126 ShadowGC;
127#endif
128
129#if defined(PLAIN_SCROLLBAR)
130 GC pscrollbarGC;
131#endif
132
133 // scrollbar-next.C
134 int show_next (int);
135 // scrollbar-rxvt.C
136 int show_rxvt (int);
137 // scrollbar-xterm.C
138 int show_xterm (int);
139 // scrollbar-plain.C
140 int show_plain (int);
141
142private:
143 void init_next ();
90}; 144};
91 145
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) 146#define scrollbar_above_slider(y) ((y) < scrollBar.top)
99#define scrollbar_below_slider(y) ((y) > scrollBar.bot) 147#define scrollbar_below_slider(y) ((y) > scrollBar.bot)
100#define scrollbar_position(y) ((y) - scrollBar.beg) 148#define scrollbar_position(y) ((y) - scrollBar.beg)
101#define scrollbar_size() (scrollBar.end - scrollBar.beg \
102 - scrollbar_minheight ())
103 149
104 /* 150 /*
105 * +-------------+ 151 * +-------------+
106 * | | <---< SB_PADDING 152 * | | <---< SB_PADDING
107 * | ::::::::::: | 153 * | ::::::::::: |

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines