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.15 by pcg, Thu Apr 8 20:31:45 2004 UTC vs.
Revision 1.24 by root, Mon Aug 23 19:47:03 2004 UTC

23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 *----------------------------------------------------------------------*/ 24 *----------------------------------------------------------------------*/
25 25
26#include "../config.h" /* NECESSARY */ 26#include "../config.h" /* NECESSARY */
27#include "rxvt.h" /* NECESSARY */ 27#include "rxvt.h" /* NECESSARY */
28#include "scrollbar.intpro" /* PROTOS for internal routines */
29 28
30/*----------------------------------------------------------------------*/ 29/*----------------------------------------------------------------------*/
31 30
32/* 31/*
33 * Map or unmap a scrollbar. Returns non-zero upon change of state 32 * Map or unmap a scrollbar. Returns non-zero upon change of state
36rxvt_term::scrollbar_mapping (int map) 35rxvt_term::scrollbar_mapping (int map)
37{ 36{
38 int change = 0; 37 int change = 0;
39 38
40#ifdef HAVE_SCROLLBARS 39#ifdef HAVE_SCROLLBARS
41 if (map && !scrollbar_visible ()) 40 if (map)
42 { 41 {
43 scrollBar.setIdle (); 42 scrollBar.setIdle ();
43
44 if (!scrollBar.win) 44 if (!scrollBar.win)
45 resize_scrollbar (); 45 resize_scrollbar ();
46
46 if (scrollBar.win) 47 if (scrollBar.win)
47 { 48 {
48 XMapWindow (display->display, scrollBar.win); 49 XMapWindow (display->display, scrollBar.win);
49 change = 1; 50 change = 1;
50 } 51 }
51 } 52 }
52 else if (!map && scrollbar_visible ()) 53 else
53 { 54 {
54 scrollBar.state = 0; 55 scrollBar.state = 0;
55 XUnmapWindow (display->display, scrollBar.win); 56 XUnmapWindow (display->display, scrollBar.win);
56 change = 1; 57 change = 1;
57 } 58 }
114 TermWin.parent[0], 115 TermWin.parent[0],
115 window_sb_x, 0, 116 window_sb_x, 0,
116 scrollbar_TotalWidth (), 117 scrollbar_TotalWidth (),
117 szHint.height, 118 szHint.height,
118 0, 119 0,
119 PixColors[Color_fg], 120 pix_colors[Color_fg],
120 PixColors[Color_bg]); 121 pix_colors[Color_border]);
121#ifdef DEBUG_X 122#ifdef DEBUG_X
122 XStoreName (display->display, scrollBar.win, "scrollbar"); 123 XStoreName (display->display, scrollBar.win, "scrollbar");
123#endif 124#endif
124 XDefineCursor (display->display, scrollBar.win, leftptr_cursor); 125 XDefineCursor (display->display, scrollBar.win, leftptr_cursor);
125 126
201 202
202# if (defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) || defined(PLAIN_SCROLLBAR)) 203# if (defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) || defined(PLAIN_SCROLLBAR))
203 if (scrollstyle) 204 if (scrollstyle)
204 { 205 {
205# ifdef NEXT_SCROLLBAR 206# ifdef NEXT_SCROLLBAR
206 if (STRNCASECMP (scrollstyle, "next", 4) == 0) 207 if (strncasecmp (scrollstyle, "next", 4) == 0)
207 style = R_SB_NEXT; 208 style = R_SB_NEXT;
208# endif 209# endif
209# ifdef XTERM_SCROLLBAR 210# ifdef XTERM_SCROLLBAR
210 if (STRNCASECMP (scrollstyle, "xterm", 5) == 0) 211 if (strncasecmp (scrollstyle, "xterm", 5) == 0)
211 style = R_SB_XTERM; 212 style = R_SB_XTERM;
212# endif 213# endif
213# ifdef PLAIN_SCROLLBAR 214# ifdef PLAIN_SCROLLBAR
214 if (STRNCASECMP (scrollstyle, "plain", 5) == 0) 215 if (strncasecmp (scrollstyle, "plain", 5) == 0)
215 style = R_SB_PLAIN; 216 style = R_SB_PLAIN;
216# endif 217# endif
217 218
218 } 219 }
219# endif 220# endif
229 if (style != R_SB_NEXT) /* dishonour request - for now */ 230 if (style != R_SB_NEXT) /* dishonour request - for now */
230 if (thickness && (i = atoi (thickness)) >= SB_WIDTH_MINIMUM) 231 if (thickness && (i = atoi (thickness)) >= SB_WIDTH_MINIMUM)
231 width = min (i, SB_WIDTH_MAXIMUM); 232 width = min (i, SB_WIDTH_MAXIMUM);
232 233
233# if defined(RXVT_SCROLLBAR) 234# if defined(RXVT_SCROLLBAR)
234 if (! (Options & Opt_scrollBar_floating) && style == R_SB_RXVT) 235 if (! (options & Opt_scrollBar_floating) && style == R_SB_RXVT)
235 sb_shadow = SHADOW; 236 sb_shadow = SHADOW;
236# endif 237# endif
237 238
238 scrollBar.style = style; 239 scrollBar.style = style;
239 scrollBar.width = width; 240 scrollBar.width = width;
240 241
241 /* scrollbar_align = R_SB_ALIGN_CENTRE; */ 242 /* scrollbar_align = R_SB_ALIGN_CENTRE; */
242 if (scrollalign) 243 if (scrollalign)
243 { 244 {
244 if (STRNCASECMP (scrollalign, "top", 3) == 0) 245 if (strncasecmp (scrollalign, "top", 3) == 0)
245 scrollbar_align = R_SB_ALIGN_TOP; 246 scrollbar_align = R_SB_ALIGN_TOP;
246 else if (STRNCASECMP (scrollalign, "bottom", 6) == 0) 247 else if (strncasecmp (scrollalign, "bottom", 6) == 0)
247 scrollbar_align = R_SB_ALIGN_BOTTOM; 248 scrollbar_align = R_SB_ALIGN_BOTTOM;
248 } 249 }
249#endif 250#endif
250} 251}
251 252

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines