--- rxvt-unicode/src/scrollbar-next.C 2006/01/25 21:03:04 1.21 +++ rxvt-unicode/src/scrollbar-next.C 2008/02/06 01:29:42 1.28 @@ -1,4 +1,4 @@ -/*--------------------------------*-C-*---------------------------------* +/*----------------------------------------------------------------------* * File: scrollbar-next.C *----------------------------------------------------------------------* * @@ -6,7 +6,7 @@ * Copyright (c) 1998 Alfredo K. Kojima * - N*XTstep like scrollbars * Copyright (c) 1999-2001 Geoff Wing - * Copyright (c) 2004 Marc Lehmann + * Copyright (c) 2004-2006 Marc Lehmann * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -123,7 +123,7 @@ Pixmap d; GC pointcolour; - d = XCreatePixmap (display->display, scrollBar.win, width, height, depth); + d = XCreatePixmap (dpy, scrollBar.win, width, height, depth); for (y = 0; y < height; y++) { @@ -138,7 +138,7 @@ else /* if (a == '#' || a == 'b' || a) */ pointcolour = blackGC; - XDrawPoint (display->display, d, pointcolour, x, y); + XDrawPoint (dpy, d, pointcolour, x, y); } } return d; @@ -155,11 +155,11 @@ gcvalue.graphics_exposures = False; gcvalue.foreground = pix_colors_focused[Color_Black]; - blackGC = XCreateGC (xdisp, scrollBar.win, + blackGC = XCreateGC (dpy, scrollBar.win, GCForeground | GCGraphicsExposures, &gcvalue); gcvalue.foreground = pix_colors_focused[Color_White]; - whiteGC = XCreateGC (xdisp, scrollBar.win, + whiteGC = XCreateGC (dpy, scrollBar.win, GCForeground | GCGraphicsExposures, &gcvalue); xcol.red = 0xaeba; @@ -167,7 +167,7 @@ xcol.blue = 0xaeba; xcol.pixel = pix_colors_focused[Color_scroll]; light = gcvalue.foreground = xcol.pixel; - grayGC = XCreateGC (xdisp, scrollBar.win, + grayGC = XCreateGC (dpy, scrollBar.win, GCForeground | GCGraphicsExposures, &gcvalue); xcol.red = 0x51aa; @@ -176,10 +176,10 @@ //if (!rXAllocColor (&xcol, "dark gray"))//TODO//D// xcol.pixel = pix_colors_focused[Color_Grey25]; dark = gcvalue.foreground = xcol.pixel; - darkGC = XCreateGC (xdisp, scrollBar.win, + darkGC = XCreateGC (dpy, scrollBar.win, GCForeground | GCGraphicsExposures, &gcvalue); - stipple = XCreateBitmapFromData (xdisp, scrollBar.win, + stipple = XCreateBitmapFromData (dpy, scrollBar.win, (char *)n_stp_bits, n_stp_width, n_stp_height); @@ -188,9 +188,9 @@ gcvalue.fill_style = FillOpaqueStippled; gcvalue.stipple = stipple; - /* XSetWindowBackground (xdisp, scrollBar.win, pix_colors_focused[Color_Red]); */ + /* XSetWindowBackground (dpy, scrollBar.win, pix_colors_focused[Color_Red]); */ - stippleGC = XCreateGC (xdisp, scrollBar.win, + stippleGC = XCreateGC (dpy, scrollBar.win, GCForeground | GCBackground | GCStipple | GCFillStyle | GCGraphicsExposures, &gcvalue); @@ -216,22 +216,22 @@ x2 = x1 + w - 1; /* right point */ y2 = y1 + h - 1; /* bottom point */ /* white top and left */ - XDrawLine (xdisp, d, whiteGC, x1, y1, x2, y1); - XDrawLine (xdisp, d, whiteGC, x1, y1, x1, y2); + XDrawLine (dpy, d, whiteGC, x1, y1, x2, y1); + XDrawLine (dpy, d, whiteGC, x1, y1, x1, y2); /* black bottom and right */ - XDrawLine (xdisp, d, blackGC, x1, y2, x2, y2); - XDrawLine (xdisp, d, blackGC, x2, y1, x2, y2); + XDrawLine (dpy, d, blackGC, x1, y2, x2, y2); + XDrawLine (dpy, d, blackGC, x2, y1, x2, y2); /* dark inside bottom and right */ x1++, y1++, x2--, y2--; /* move in one point */ - XDrawLine (xdisp, d, darkGC, x1, y2, x2, y2); - XDrawLine (xdisp, d, darkGC, x2, y1, x2, y2); + XDrawLine (dpy, d, darkGC, x1, y2, x2, y2); + XDrawLine (dpy, d, darkGC, x2, y1, x2, y2); } int rxvt_term::scrollbar_show_next (int update, int last_top, int last_bot, int scrollbar_len) { int height = scrollBar.end + SB_BUTTON_TOTAL_HEIGHT + SB_PADDING; - Drawable s; + Drawable src; if ((scrollBar.init & R_SB_NEXT) == 0) { @@ -241,32 +241,32 @@ if (top_row == 0 || !update) { - XFillRectangle (xdisp, scrollBar.win, grayGC, 0, 0, + XFillRectangle (dpy, scrollBar.win, grayGC, 0, 0, SB_WIDTH_NEXT + 1, height); - XDrawRectangle (xdisp, scrollBar.win, blackGC, 0, + XDrawRectangle (dpy, scrollBar.win, blackGC, 0, -SB_BORDER_WIDTH, SB_WIDTH_NEXT, height + SB_BORDER_WIDTH); - XFillRectangle (xdisp, scrollBar.win, stippleGC, + XFillRectangle (dpy, scrollBar.win, stippleGC, SB_LEFT_PADDING, 0, SB_BUTTON_WIDTH, height); } if (top_row) { if (last_top < scrollBar.top || !update) - XFillRectangle (xdisp, scrollBar.win, stippleGC, + XFillRectangle (dpy, scrollBar.win, stippleGC, SB_LEFT_PADDING, SB_PADDING + last_top, SB_BUTTON_WIDTH, scrollBar.top - last_top); if (scrollBar.bot < last_bot || !update) - XFillRectangle (xdisp, scrollBar.win, stippleGC, + XFillRectangle (dpy, scrollBar.win, stippleGC, SB_LEFT_PADDING, scrollBar.bot + SB_PADDING, SB_BUTTON_WIDTH, (last_bot - scrollBar.bot)); - XFillRectangle (xdisp, scrollBar.win, grayGC, + XFillRectangle (dpy, scrollBar.win, grayGC, SB_LEFT_PADDING, scrollBar.top + SB_PADDING, SB_BUTTON_WIDTH, scrollbar_len); - XCopyArea (xdisp, dimple, scrollBar.win, whiteGC, 0, 0, + XCopyArea (dpy, dimple, scrollBar.win, whiteGC, 0, 0, SCROLLER_DIMPLE_WIDTH, SCROLLER_DIMPLE_HEIGHT, (SB_WIDTH_NEXT - SCROLLER_DIMPLE_WIDTH) / 2, scrollBar.top + SB_BEVEL_WIDTH_UPPER_LEFT + @@ -282,18 +282,18 @@ height - SB_BUTTON_SINGLE_HEIGHT, SB_BUTTON_WIDTH, SB_BUTTON_HEIGHT); - s = (scrollbar_isUp ()) ? upArrowHi : upArrow; - XCopyArea (xdisp, s, scrollBar.win, whiteGC, 0, 0, + src = scrollBar.state == STATE_UP ? upArrowHi : upArrow; + XCopyArea (dpy, src, scrollBar.win, whiteGC, 0, 0, ARROW_WIDTH, ARROW_HEIGHT, SB_BUTTON_FACE_X, height - SB_BUTTON_BOTH_HEIGHT + SB_BEVEL_WIDTH_UPPER_LEFT); - s = (scrollbar_isDn ()) ? downArrowHi : downArrow; - XCopyArea (xdisp, s, scrollBar.win, whiteGC, 0, 0, + src = scrollBar.state == STATE_DOWN ? downArrowHi : downArrow; + XCopyArea (dpy, src, scrollBar.win, whiteGC, 0, 0, ARROW_WIDTH, ARROW_HEIGHT, SB_BUTTON_FACE_X, height - SB_BUTTON_SINGLE_HEIGHT + SB_BEVEL_WIDTH_UPPER_LEFT); } return 1; } -#endif /* NEXT_SCROLLBAR */ +#endif /* NEXT_SCROLLBAR */ /*----------------------- end-of-file (C source) -----------------------*/