--- rxvt-unicode/src/scrollbar.h 2008/02/17 12:11:36 1.16 +++ rxvt-unicode/src/scrollbar.h 2008/02/19 13:01:33 1.20 @@ -64,8 +64,14 @@ unsigned char align; Window win; Cursor leftptr_cursor; - int (rxvt_term::*update)(int, int, int, int); + int (scrollBar_t::*update)(int); void setup (rxvt_term *); + // update style dependent data + void update_data (); + void resize (); + int map (int); + int show (int); + void destroy (); bool upButton (int y) { @@ -83,23 +89,63 @@ return y > end; return false; } + unsigned min_height () + { + return style == R_SB_NEXT ? SB_THUMB_MIN_HEIGHT : 10; + } + unsigned size () + { + return end - beg - min_height (); + } unsigned total_width () { return width + shadow * 2; } -}; -#define SCROLLNEXT_MINHEIGHT SB_THUMB_MIN_HEIGHT -#define SCROLLRXVT_MINHEIGHT 10 +#if defined(NEXT_SCROLLBAR) + GC blackGC, + whiteGC, + grayGC, + darkGC, + stippleGC; + Pixmap dimple, + upArrow, + downArrow, + upArrowHi, + downArrowHi; +#endif + +#if defined(RXVT_SCROLLBAR) + GC scrollbarGC, + topShadowGC, + botShadowGC; +#endif + +#if defined(XTERM_SCROLLBAR) + GC xscrollbarGC, + ShadowGC; +#endif + +#if defined(PLAIN_SCROLLBAR) + GC pscrollbarGC; +#endif + + // scrollbar-next.C + int show_next (int); + // scrollbar-rxvt.C + int show_rxvt (int); + // scrollbar-xterm.C + int show_xterm (int); + // scrollbar-plain.C + int show_plain (int); + +private: + void init_next (); +}; -#define scrollbar_minheight() (scrollBar.style == R_SB_NEXT \ - ? SCROLLNEXT_MINHEIGHT \ - : SCROLLRXVT_MINHEIGHT) #define scrollbar_above_slider(y) ((y) < scrollBar.top) #define scrollbar_below_slider(y) ((y) > scrollBar.bot) #define scrollbar_position(y) ((y) - scrollBar.beg) -#define scrollbar_size() (scrollBar.end - scrollBar.beg \ - - scrollbar_minheight ()) /* * +-------------+