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.9 by pcg, Sat Jan 31 02:15:02 2004 UTC vs.
Revision 1.10 by pcg, Sat Jan 31 04:12:10 2004 UTC

1/*--------------------------------*-C-*---------------------------------* 1/*--------------------------------*-C-*---------------------------------*
2 * File: scrollbar.c 2 * File: scrollbar.c
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * $Id: scrollbar.C,v 1.9 2004/01/31 02:15:02 pcg Exp $
5 * 4 *
6 * Copyright (c) 1997,1998 mj olesen <olesen@me.QueensU.CA> 5 * Copyright (c) 1997,1998 mj olesen <olesen@me.QueensU.CA>
7 * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> 6 * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org>
8 * - N*XTstep like scrollbars 7 * - N*XTstep like scrollbars
9 * Copyright (c) 1999-2001 Geoff Wing <gcw@pobox.com> 8 * Copyright (c) 1999-2001 Geoff Wing <gcw@pobox.com>
68 SB_PADDING) 67 SB_PADDING)
69#define R_SCROLLBEG_RXVT (scrollBar.width + 1) + sb_shadow 68#define R_SCROLLBEG_RXVT (scrollBar.width + 1) + sb_shadow
70#define R_SCROLLEND_RXVT szHint.height - R_SCROLLBEG_RXVT - \ 69#define R_SCROLLEND_RXVT szHint.height - R_SCROLLBEG_RXVT - \
71 (2 * sb_shadow) 70 (2 * sb_shadow)
72 71
72#if defined(PLAIN_SCROLLBAR)
73 if (scrollBar.style == R_SB_PLAIN) {
74 scrollBar.beg = R_SCROLLBEG_XTERM;
75 scrollBar.end = R_SCROLLEND_XTERM;
76 scrollBar.update = &rxvt_term::scrollbar_show_plain;
77 }
78#endif
73#if defined(XTERM_SCROLLBAR) 79#if defined(XTERM_SCROLLBAR)
74 if (scrollBar.style == R_SB_XTERM) { 80 if (scrollBar.style == R_SB_XTERM) {
75 scrollBar.beg = R_SCROLLBEG_XTERM; 81 scrollBar.beg = R_SCROLLBEG_XTERM;
76 scrollBar.end = R_SCROLLEND_XTERM; 82 scrollBar.end = R_SCROLLEND_XTERM;
77 scrollBar.update = &rxvt_term::scrollbar_show_xterm; 83 scrollBar.update = &rxvt_term::scrollbar_show_xterm;
163{ 169{
164#ifdef HAVE_SCROLLBARS 170#ifdef HAVE_SCROLLBARS
165 int i; 171 int i;
166 short style, width; 172 short style, width;
167 173
168# if defined(RXVT_SCROLLBAR) || !(defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR)) 174# if defined(RXVT_SCROLLBAR)
169 style = R_SB_RXVT; 175 style = R_SB_RXVT;
170# else 176# elif defined(XTERM_SCROLLBAR)
177 style = R_SB_XTERM;
171# ifdef NEXT_SCROLLBAR 178# elif defined(NEXT_SCROLLBAR)
172 style = R_SB_NEXT; 179 style = R_SB_NEXT;
173# elif defined(XTERM_SCROLLBAR) 180# elif defined(PLAIN_SCROLLBAR)
181 style = R_SB_PLAIN;
182#else
174 style = R_SB_XTERM; 183 style = R_SB_RXVT;
175# endif
176# endif 184# endif
177 185
178# if (defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR)) 186# if (defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) || defined(PLAIN_SCROLLBAR))
179 if (scrollstyle) { 187 if (scrollstyle) {
180# ifdef NEXT_SCROLLBAR 188# ifdef NEXT_SCROLLBAR
181 if (STRNCASECMP(scrollstyle, "next", 4) == 0) 189 if (STRNCASECMP(scrollstyle, "next", 4) == 0)
182 style = R_SB_NEXT; 190 style = R_SB_NEXT;
183# endif 191# endif
184# ifdef XTERM_SCROLLBAR 192# ifdef XTERM_SCROLLBAR
185 if (STRNCASECMP(scrollstyle, "xterm", 5) == 0) 193 if (STRNCASECMP(scrollstyle, "xterm", 5) == 0)
186 style = R_SB_XTERM; 194 style = R_SB_XTERM;
187# endif 195# endif
196# ifdef PLAIN_SCROLLBAR
197 if (STRNCASECMP(scrollstyle, "plain", 5) == 0)
198 style = R_SB_XTERM;
199# endif
188 } 200 }
189# endif 201# endif
190 if (style == R_SB_NEXT) 202 if (style == R_SB_NEXT)
191 width = SB_WIDTH_NEXT; 203 width = SB_WIDTH_NEXT;
192 else if (style == R_SB_XTERM) 204 else if (style == R_SB_XTERM)
193 width = SB_WIDTH_XTERM; 205 width = SB_WIDTH_XTERM;
206 else if (style == R_SB_PLAIN)
207 width = SB_WIDTH_PLAIN;
194 else /* if (style == R_SB_RXVT) */ 208 else /* if (style == R_SB_RXVT) */
195 width = SB_WIDTH_RXVT; 209 width = SB_WIDTH_RXVT;
196 210
197 if (style != R_SB_NEXT) /* dishonour request - for now */ 211 if (style != R_SB_NEXT) /* dishonour request - for now */
198 if (thickness && (i = atoi(thickness)) >= SB_WIDTH_MINIMUM) 212 if (thickness && (i = atoi(thickness)) >= SB_WIDTH_MINIMUM)
215 } 229 }
216#endif 230#endif
217} 231}
218 232
219/*----------------------- end-of-file (C source) -----------------------*/ 233/*----------------------- end-of-file (C source) -----------------------*/
234

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines