--- rxvt-unicode/src/scrollbar.C 2004/01/31 00:20:21 1.8 +++ rxvt-unicode/src/scrollbar.C 2004/01/31 04:12:10 1.10 @@ -1,7 +1,6 @@ /*--------------------------------*-C-*---------------------------------* * File: scrollbar.c *----------------------------------------------------------------------* - * $Id: scrollbar.C,v 1.8 2004/01/31 00:20:21 pcg Exp $ * * Copyright (c) 1997,1998 mj olesen * Copyright (c) 1998 Alfredo K. Kojima @@ -70,25 +69,32 @@ #define R_SCROLLEND_RXVT szHint.height - R_SCROLLBEG_RXVT - \ (2 * sb_shadow) +#if defined(PLAIN_SCROLLBAR) + if (scrollBar.style == R_SB_PLAIN) { + scrollBar.beg = R_SCROLLBEG_XTERM; + scrollBar.end = R_SCROLLEND_XTERM; + scrollBar.update = &rxvt_term::scrollbar_show_plain; + } +#endif #if defined(XTERM_SCROLLBAR) if (scrollBar.style == R_SB_XTERM) { scrollBar.beg = R_SCROLLBEG_XTERM; scrollBar.end = R_SCROLLEND_XTERM; - //scrollBar.update = rxvt_scrollbar_show_xterm; + scrollBar.update = &rxvt_term::scrollbar_show_xterm; } #endif #if defined(NEXT_SCROLLBAR) if (scrollBar.style == R_SB_NEXT) { scrollBar.beg = R_SCROLLBEG_NEXT; scrollBar.end = R_SCROLLEND_NEXT; - //scrollBar.update = rxvt_scrollbar_show_next; + scrollBar.update = &rxvt_term::scrollbar_show_next; } #endif #if defined(RXVT_SCROLLBAR) if (scrollBar.style == R_SB_RXVT) { scrollBar.beg = R_SCROLLBEG_RXVT; scrollBar.end = R_SCROLLEND_RXVT; - //scrollBar.update = rxvt_scrollbar_show_rxvt; + scrollBar.update = &rxvt_term::scrollbar_show_rxvt; } #endif @@ -148,7 +154,7 @@ return 0; } - ret = scrollbar_update (update, last_top, last_bot, scrollbar_len); + ret = (this->*scrollBar.update) (update, last_top, last_bot, scrollbar_len); last_top = scrollBar.top; last_bot = scrollBar.bot; @@ -165,17 +171,19 @@ int i; short style, width; -# if defined(RXVT_SCROLLBAR) || !(defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR)) +# if defined(RXVT_SCROLLBAR) style = R_SB_RXVT; -# else -# ifdef NEXT_SCROLLBAR - style = R_SB_NEXT; -# elif defined(XTERM_SCROLLBAR) +# elif defined(XTERM_SCROLLBAR) style = R_SB_XTERM; -# endif +# elif defined(NEXT_SCROLLBAR) + style = R_SB_NEXT; +# elif defined(PLAIN_SCROLLBAR) + style = R_SB_PLAIN; +#else + style = R_SB_RXVT; # endif -# if (defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR)) +# if (defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) || defined(PLAIN_SCROLLBAR)) if (scrollstyle) { # ifdef NEXT_SCROLLBAR if (STRNCASECMP(scrollstyle, "next", 4) == 0) @@ -185,12 +193,18 @@ if (STRNCASECMP(scrollstyle, "xterm", 5) == 0) style = R_SB_XTERM; # endif +# ifdef PLAIN_SCROLLBAR + if (STRNCASECMP(scrollstyle, "plain", 5) == 0) + style = R_SB_XTERM; +# endif } # endif if (style == R_SB_NEXT) width = SB_WIDTH_NEXT; else if (style == R_SB_XTERM) width = SB_WIDTH_XTERM; + else if (style == R_SB_PLAIN) + width = SB_WIDTH_PLAIN; else /* if (style == R_SB_RXVT) */ width = SB_WIDTH_RXVT; @@ -217,3 +231,4 @@ } /*----------------------- end-of-file (C source) -----------------------*/ +