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

Comparing rxvt-unicode/src/scrollbar.C (file contents):
Revision 1.60 by ayin, Tue Feb 19 10:47:03 2008 UTC vs.
Revision 1.62 by ayin, Tue Feb 19 17:49:16 2008 UTC

119 int sb_bot = sb_top + (term->nrow - 1); 119 int sb_bot = sb_top + (term->nrow - 1);
120 int sb_len = max (term->nrow - 1 - term->top_row, 1); 120 int sb_len = max (term->nrow - 1 - term->top_row, 1);
121 int sb_size = (sb_bot - sb_top) * size (); 121 int sb_size = (sb_bot - sb_top) * size ();
122 122
123 top = beg + (sb_top * size ()) / sb_len; 123 top = beg + (sb_top * size ()) / sb_len;
124 len = sb_size / sb_len + min_height () + (sb_size % sb_len > 0); 124 bot = top + sb_size / sb_len + min_height () + (sb_size % sb_len > 0);
125 bot = top + len;
126 /* no change */ 125 /* no change */
127 if (top == last_top 126 if (top == last_top
128 && bot == last_bot 127 && bot == last_bot
129 && (state == last_state 128 && (state == last_state
130 || !(state == STATE_UP || state == STATE_DOWN))) 129 || !(state == STATE_UP || state == STATE_DOWN)))
131 return 0; 130 return 0;
132 } 131 }
133 132
134 ret = (term->*update) (refresh, last_top, last_bot, len); 133 ret = (this->*update) (refresh);
135 134
136 last_top = top; 135 last_top = top;
137 last_bot = bot; 136 last_bot = bot;
138 last_state = state; 137 last_state = state;
139 138
215 /* cursor scrollBar: Black-on-White */ 214 /* cursor scrollBar: Black-on-White */
216 leftptr_cursor = XCreateFontCursor (term->dpy, XC_left_ptr); 215 leftptr_cursor = XCreateFontCursor (term->dpy, XC_left_ptr);
217} 216}
218 217
219void 218void
219scrollBar_t::destroy ()
220{
221#ifdef XTERM_SCROLLBAR
222 if (xscrollbarGC) XFreeGC (term->dpy, xscrollbarGC);
223 if (ShadowGC) XFreeGC (term->dpy, ShadowGC);
224#endif
225#ifdef PLAIN_SCROLLBAR
226 if (pscrollbarGC) XFreeGC (term->dpy, pscrollbarGC);
227#endif
228#ifdef NEXT_SCROLLBAR
229 if (blackGC) XFreeGC (term->dpy, blackGC);
230 if (whiteGC) XFreeGC (term->dpy, whiteGC);
231 if (grayGC) XFreeGC (term->dpy, grayGC);
232 if (darkGC) XFreeGC (term->dpy, darkGC);
233 if (stippleGC) XFreeGC (term->dpy, stippleGC);
234 if (dimple) XFreePixmap (term->dpy, dimple);
235 if (upArrow) XFreePixmap (term->dpy, upArrow);
236 if (downArrow) XFreePixmap (term->dpy, downArrow);
237 if (upArrowHi) XFreePixmap (term->dpy, upArrowHi);
238 if (downArrowHi) XFreePixmap (term->dpy, downArrowHi);
239#endif
240#ifdef RXVT_SCROLLBAR
241 if (topShadowGC) XFreeGC (term->dpy, topShadowGC);
242 if (botShadowGC) XFreeGC (term->dpy, botShadowGC);
243 if (scrollbarGC) XFreeGC (term->dpy, scrollbarGC);
244#endif
245}
246
247void
220scrollBar_t::update_data () 248scrollBar_t::update_data ()
221{ 249{
222#if defined(PLAIN_SCROLLBAR) 250#if defined(PLAIN_SCROLLBAR)
223 if (style == R_SB_PLAIN) 251 if (style == R_SB_PLAIN)
224 { 252 {
225 beg = 0; 253 beg = 0;
226 end = term->szHint.height; 254 end = term->szHint.height;
227 update = &rxvt_term::scrollbar_show_plain; 255 update = &scrollBar_t::show_plain;
228 } 256 }
229#endif 257#endif
230#if defined(XTERM_SCROLLBAR) 258#if defined(XTERM_SCROLLBAR)
231 if (style == R_SB_XTERM) 259 if (style == R_SB_XTERM)
232 { 260 {
233 beg = 0; 261 beg = 0;
234 end = term->szHint.height; 262 end = term->szHint.height;
235 update = &rxvt_term::scrollbar_show_xterm; 263 update = &scrollBar_t::show_xterm;
236 } 264 }
237#endif 265#endif
238#if defined(NEXT_SCROLLBAR) 266#if defined(NEXT_SCROLLBAR)
239 if (style == R_SB_NEXT) 267 if (style == R_SB_NEXT)
240 { 268 {
241 beg = 0; 269 beg = 0;
242 end = term->szHint.height - (SB_BUTTON_TOTAL_HEIGHT + SB_PADDING); 270 end = term->szHint.height - (SB_BUTTON_TOTAL_HEIGHT + SB_PADDING);
243 update = &rxvt_term::scrollbar_show_next; 271 update = &scrollBar_t::show_next;
244 } 272 }
245#endif 273#endif
246#if defined(RXVT_SCROLLBAR) 274#if defined(RXVT_SCROLLBAR)
247 if (style == R_SB_RXVT) 275 if (style == R_SB_RXVT)
248 { 276 {
249 beg = (width + 1) + shadow; 277 beg = (width + 1) + shadow;
250 end = term->szHint.height - beg - (2 * shadow); 278 end = term->szHint.height - beg - (2 * shadow);
251 update = &rxvt_term::scrollbar_show_rxvt; 279 update = &scrollBar_t::show_rxvt;
252 } 280 }
253#endif 281#endif
254} 282}
255 283
256/*----------------------- end-of-file (C source) -----------------------*/ 284/*----------------------- end-of-file (C source) -----------------------*/

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines