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.21 by ayin, Tue Feb 19 17:49:16 2008 UTC

58 unsigned int width; /* scrollbar width */ 58 unsigned int width; /* scrollbar width */
59 int shadow; /* scrollbar shadow width */ 59 int shadow; /* scrollbar shadow width */
60 int last_bot; /* scrollbar last bottom position */ 60 int last_bot; /* scrollbar last bottom position */
61 int last_top; /* scrollbar last top position */ 61 int last_top; /* scrollbar last top position */
62 int last_state; /* scrollbar last state */ 62 int last_state; /* scrollbar last state */
63 int len;
64 unsigned char align; 63 unsigned char align;
65 Window win; 64 Window win;
66 Cursor leftptr_cursor; 65 Cursor leftptr_cursor;
67 int (rxvt_term::*update)(int, int, int, int); 66 int (scrollBar_t::*update)(int);
68 void setup (rxvt_term *); 67 void setup (rxvt_term *);
68 // update style dependent data
69 void update_data ();
70 void resize ();
71 int map (int);
72 int show (int);
73 void destroy ();
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 }
103
104#if defined(NEXT_SCROLLBAR)
105 GC blackGC,
106 whiteGC,
107 grayGC,
108 darkGC,
109 stippleGC;
110 Pixmap dimple,
111 upArrow,
112 downArrow,
113 upArrowHi,
114 downArrowHi;
115#endif
116
117#if defined(RXVT_SCROLLBAR)
118 GC scrollbarGC,
119 topShadowGC,
120 botShadowGC;
121#endif
122
123#if defined(XTERM_SCROLLBAR)
124 GC xscrollbarGC,
125 ShadowGC;
126#endif
127
128#if defined(PLAIN_SCROLLBAR)
129 GC pscrollbarGC;
130#endif
131
132 // scrollbar-next.C
133 int show_next (int);
134 // scrollbar-rxvt.C
135 int show_rxvt (int);
136 // scrollbar-xterm.C
137 int show_xterm (int);
138 // scrollbar-plain.C
139 int show_plain (int);
140
141private:
142 void init_next ();
90}; 143};
91 144
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) 145#define scrollbar_above_slider(y) ((y) < scrollBar.top)
99#define scrollbar_below_slider(y) ((y) > scrollBar.bot) 146#define scrollbar_below_slider(y) ((y) > scrollBar.bot)
100#define scrollbar_position(y) ((y) - scrollBar.beg) 147#define scrollbar_position(y) ((y) - scrollBar.beg)
101#define scrollbar_size() (scrollBar.end - scrollBar.beg \
102 - scrollbar_minheight ())
103 148
104 /* 149 /*
105 * +-------------+ 150 * +-------------+
106 * | | <---< SB_PADDING 151 * | | <---< SB_PADDING
107 * | ::::::::::: | 152 * | ::::::::::: |

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines