… | |
… | |
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 | void resize (); |
|
|
69 | int map (int); |
|
|
70 | int show (int); |
|
|
71 | void destroy (); |
69 | |
72 | |
70 | bool upButton (int y) |
73 | bool upButton (int y) |
71 | { |
74 | { |
72 | if (style == R_SB_NEXT) |
75 | if (style == R_SB_NEXT) |
73 | return y > end && y <= end + width + 1; |
76 | return y > end && y <= end + width + 1; |
… | |
… | |
81 | return y > end + width + 1; |
84 | return y > end + width + 1; |
82 | if (style == R_SB_RXVT) |
85 | if (style == R_SB_RXVT) |
83 | return y > end; |
86 | return y > end; |
84 | return false; |
87 | return false; |
85 | } |
88 | } |
|
|
89 | unsigned min_height () |
|
|
90 | { |
|
|
91 | return style == R_SB_NEXT ? SB_THUMB_MIN_HEIGHT : 10; |
|
|
92 | } |
|
|
93 | unsigned size () |
|
|
94 | { |
|
|
95 | return end - beg - min_height (); |
|
|
96 | } |
86 | unsigned total_width () |
97 | unsigned total_width () |
87 | { |
98 | { |
88 | return width + shadow * 2; |
99 | return width + shadow * 2; |
89 | } |
100 | } |
|
|
101 | |
|
|
102 | #if defined(NEXT_SCROLLBAR) |
|
|
103 | GC blackGC, |
|
|
104 | whiteGC, |
|
|
105 | grayGC, |
|
|
106 | darkGC, |
|
|
107 | stippleGC; |
|
|
108 | Pixmap dimple, |
|
|
109 | upArrow, |
|
|
110 | downArrow, |
|
|
111 | upArrowHi, |
|
|
112 | downArrowHi; |
|
|
113 | #endif |
|
|
114 | |
|
|
115 | #if defined(RXVT_SCROLLBAR) |
|
|
116 | GC scrollbarGC, |
|
|
117 | topShadowGC, |
|
|
118 | botShadowGC; |
|
|
119 | #endif |
|
|
120 | |
|
|
121 | #if defined(XTERM_SCROLLBAR) |
|
|
122 | GC xscrollbarGC, |
|
|
123 | ShadowGC; |
|
|
124 | #endif |
|
|
125 | |
|
|
126 | #if defined(PLAIN_SCROLLBAR) |
|
|
127 | GC pscrollbarGC; |
|
|
128 | #endif |
|
|
129 | |
|
|
130 | private: |
|
|
131 | // update style dependent data |
|
|
132 | void update_data (); |
|
|
133 | |
|
|
134 | // scrollbar-next.C |
|
|
135 | int show_next (int); |
|
|
136 | // scrollbar-rxvt.C |
|
|
137 | int show_rxvt (int); |
|
|
138 | // scrollbar-xterm.C |
|
|
139 | int show_xterm (int); |
|
|
140 | // scrollbar-plain.C |
|
|
141 | int show_plain (int); |
|
|
142 | |
|
|
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 | * | ::::::::::: | |