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.8 by pcg, Sat Jan 31 00:20:21 2004 UTC vs.
Revision 1.11 by pcg, Sat Jan 31 04:16:15 2004 UTC

1/*--------------------------------*-C-*---------------------------------* 1/*--------------------------------*-C-*---------------------------------*
2 * File: scrollbar.c 2 * File: scrollbar.c
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * $Id: scrollbar.C,v 1.8 2004/01/31 00:20:21 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_scrollbar_show_xterm; 83 scrollBar.update = &rxvt_term::scrollbar_show_xterm;
78 } 84 }
79#endif 85#endif
80#if defined(NEXT_SCROLLBAR) 86#if defined(NEXT_SCROLLBAR)
81 if (scrollBar.style == R_SB_NEXT) { 87 if (scrollBar.style == R_SB_NEXT) {
82 scrollBar.beg = R_SCROLLBEG_NEXT; 88 scrollBar.beg = R_SCROLLBEG_NEXT;
83 scrollBar.end = R_SCROLLEND_NEXT; 89 scrollBar.end = R_SCROLLEND_NEXT;
84 //scrollBar.update = rxvt_scrollbar_show_next; 90 scrollBar.update = &rxvt_term::scrollbar_show_next;
85 } 91 }
86#endif 92#endif
87#if defined(RXVT_SCROLLBAR) 93#if defined(RXVT_SCROLLBAR)
88 if (scrollBar.style == R_SB_RXVT) { 94 if (scrollBar.style == R_SB_RXVT) {
89 scrollBar.beg = R_SCROLLBEG_RXVT; 95 scrollBar.beg = R_SCROLLBEG_RXVT;
90 scrollBar.end = R_SCROLLEND_RXVT; 96 scrollBar.end = R_SCROLLEND_RXVT;
91 //scrollBar.update = rxvt_scrollbar_show_rxvt; 97 scrollBar.update = &rxvt_term::scrollbar_show_rxvt;
92 } 98 }
93#endif 99#endif
94 100
95 if (!scrollBar.win) { 101 if (!scrollBar.win) {
96/* create the scrollbar window */ 102/* create the scrollbar window */
146 && scrollBar.bot == last_bot 152 && scrollBar.bot == last_bot
147 && (scrollBar.state == last_state || !scrollbar_isUpDn())) 153 && (scrollBar.state == last_state || !scrollbar_isUpDn()))
148 return 0; 154 return 0;
149 } 155 }
150 156
151 ret = scrollbar_update (update, last_top, last_bot, scrollbar_len); 157 ret = (this->*scrollBar.update) (update, last_top, last_bot, scrollbar_len);
152 158
153 last_top = scrollBar.top; 159 last_top = scrollBar.top;
154 last_bot = scrollBar.bot; 160 last_bot = scrollBar.bot;
155 last_state = scrollBar.state; 161 last_state = scrollBar.state;
156#endif 162#endif
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_PLAIN;
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