--- rxvt-unicode/src/scrollbar-xterm.C 2003/11/25 11:52:42 1.3 +++ rxvt-unicode/src/scrollbar-xterm.C 2004/01/31 00:20:21 1.4 @@ -1,7 +1,7 @@ /*--------------------------------*-C-*---------------------------------* * File: scrollbar-xterm.c *----------------------------------------------------------------------* - * $Id: scrollbar-xterm.C,v 1.3 2003/11/25 11:52:42 pcg Exp $ + * $Id: scrollbar-xterm.C,v 1.4 2004/01/31 00:20:21 pcg Exp $ * * Copyright (c) 1997,1998 mj olesen * Copyright (c) 1999-2001 Geoff Wing @@ -32,18 +32,17 @@ #define x_stp_height 2 const unsigned char x_stp_bits[] = { 0xff, 0xff }; -/* EXTPROTO */ int -rxvt_scrollbar_show_xterm(pR_ int update __attribute__((unused)), int last_top, int last_bot, int scrollbar_len) +rxvt_term::scrollbar_show_xterm (int update __attribute__((unused)), int last_top, int last_bot, int scrollbar_len) { int xsb = 0; - int sbwidth = R->scrollBar.width - 1; + int sbwidth = scrollBar.width - 1; - if ((R->scrollBar.init & R_SB_XTERM) == 0) { + if ((scrollBar.init & R_SB_XTERM) == 0) { XGCValues gcvalue; - R->scrollBar.init |= R_SB_XTERM; - gcvalue.stipple = XCreateBitmapFromData(R->Xdisplay, R->scrollBar.win, + scrollBar.init |= R_SB_XTERM; + gcvalue.stipple = XCreateBitmapFromData(Xdisplay, scrollBar.win, (char *)x_stp_bits, x_stp_width, x_stp_height); if (!gcvalue.stipple) { @@ -51,35 +50,35 @@ exit(EXIT_FAILURE); } gcvalue.fill_style = FillOpaqueStippled; - gcvalue.foreground = R->PixColors[Color_fg]; - gcvalue.background = R->PixColors[Color_bg]; + gcvalue.foreground = PixColors[Color_fg]; + gcvalue.background = PixColors[Color_bg]; - R->xscrollbarGC = XCreateGC(R->Xdisplay, R->scrollBar.win, + xscrollbarGC = XCreateGC(Xdisplay, scrollBar.win, GCForeground | GCBackground | GCFillStyle | GCStipple, &gcvalue); - gcvalue.foreground = R->PixColors[Color_border]; - R->ShadowGC = XCreateGC(R->Xdisplay, R->scrollBar.win, GCForeground, + gcvalue.foreground = PixColors[Color_border]; + ShadowGC = XCreateGC(Xdisplay, scrollBar.win, GCForeground, &gcvalue); } -/* instead of XClearWindow (R->Xdisplay, R->scrollBar.win); */ - xsb = (R->Options & Opt_scrollBar_right) ? 1 : 0; - if (last_top < R->scrollBar.top) - XClearArea(R->Xdisplay, R->scrollBar.win, - R->sb_shadow + xsb, last_top, - sbwidth + 1, (R->scrollBar.top - last_top), False); - - if (R->scrollBar.bot < last_bot) - XClearArea(R->Xdisplay, R->scrollBar.win, - R->sb_shadow + xsb, R->scrollBar.bot, - sbwidth + 1, (last_bot - R->scrollBar.bot), False); +/* instead of XClearWindow (Xdisplay, scrollBar.win); */ + xsb = (Options & Opt_scrollBar_right) ? 1 : 0; + if (last_top < scrollBar.top) + XClearArea(Xdisplay, scrollBar.win, + sb_shadow + xsb, last_top, + sbwidth + 1, (scrollBar.top - last_top), False); + + if (scrollBar.bot < last_bot) + XClearArea(Xdisplay, scrollBar.win, + sb_shadow + xsb, scrollBar.bot, + sbwidth + 1, (last_bot - scrollBar.bot), False); /* scrollbar slider */ - XFillRectangle(R->Xdisplay, R->scrollBar.win, R->xscrollbarGC, - xsb + 1, R->scrollBar.top, sbwidth, scrollbar_len); + XFillRectangle(Xdisplay, scrollBar.win, xscrollbarGC, + xsb + 1, scrollBar.top, sbwidth, scrollbar_len); - /*XDrawLine(R->Xdisplay, R->scrollBar.win, R->ShadowGC, - xsb ? 0 : sbwidth, R->scrollBar.beg, - xsb ? 0 : sbwidth, R->scrollBar.end);*/ + /*XDrawLine(Xdisplay, scrollBar.win, ShadowGC, + xsb ? 0 : sbwidth, scrollBar.beg, + xsb ? 0 : sbwidth, scrollBar.end);*/ return 1; } #endif /* XTERM_SCROLLBAR */