--- rxvt-unicode/src/xpm.C 2005/01/26 07:08:15 1.20 +++ rxvt-unicode/src/xpm.C 2005/12/18 00:59:42 1.24 @@ -24,10 +24,11 @@ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ -#include "xpm.intpro" /* PROTOS for internal routines */ #ifdef XPM_BACKGROUND +static void rxvt_pixmap_incr (unsigned int *wh, unsigned int *xy, float *incr, float *p, unsigned int widthheight, unsigned int xpmwidthheight); + /* * These GEOM strings indicate absolute size/position: * @ `WxH+X+Y' @@ -163,23 +164,24 @@ GC gc; unsigned int width = TermWin_TotalWidth (); unsigned int height = TermWin_TotalHeight (); + dDisp; - if (TermWin.pixmap != None) - XFreePixmap (display->display, TermWin.pixmap); + if (pixmap != None) + XFreePixmap (disp, pixmap); if (bgPixmap.pixmap == None) { /* So be it: I'm not using pixmaps */ - TermWin.pixmap = None; + pixmap = None; if (!(options & Opt_transparent) || !am_transparent) - XSetWindowBackground (display->display, TermWin.vt, + XSetWindowBackground (disp, vt, pix_colors[Color_bg]); return; } gcvalue.foreground = pix_colors[Color_bg]; - gc = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); + gc = XCreateGC (disp, vt, GCForeground, &gcvalue); if (bgPixmap.pixmap != None) { /* we have a specified pixmap */ @@ -200,10 +202,10 @@ if (w == 0) { /* basic X tiling - let the X server do it */ - TermWin.pixmap = XCreatePixmap (display->display, TermWin.vt, + pixmap = XCreatePixmap (disp, vt, xpmw, xpmh, (unsigned int)display->depth); - XCopyArea (display->display, bgPixmap.pixmap, TermWin.pixmap, gc, + XCopyArea (disp, bgPixmap.pixmap, pixmap, gc, 0, 0, xpmw, xpmh, 0, 0); } else @@ -211,7 +213,7 @@ float incr, p; Pixmap tmp; - TermWin.pixmap = XCreatePixmap (display->display, TermWin.vt, + pixmap = XCreatePixmap (disp, vt, width, height, (unsigned int)display->depth); /* @@ -219,9 +221,9 @@ */ rxvt_pixmap_incr (&w, &x, &incr, &p, width, xpmw); - tmp = XCreatePixmap (display->display, TermWin.vt, + tmp = XCreatePixmap (disp, vt, width, xpmh, (unsigned int)display->depth); - XFillRectangle (display->display, tmp, gc, 0, 0, width, + XFillRectangle (disp, tmp, gc, 0, 0, width, xpmh); for ( /*nil */ ; x < w; x++, p += incr) @@ -229,7 +231,7 @@ if (p >= xpmw) p = 0; /* copy one column from the original pixmap to the tmp pixmap */ - XCopyArea (display->display, bgPixmap.pixmap, tmp, gc, + XCopyArea (disp, bgPixmap.pixmap, tmp, gc, (int)p, 0, 1, xpmh, (int)x, 0); } @@ -239,10 +241,10 @@ rxvt_pixmap_incr (&h, &y, &incr, &p, height, xpmh); if (y > 0) - XFillRectangle (display->display, TermWin.pixmap, gc, 0, 0, width, y); + XFillRectangle (disp, pixmap, gc, 0, 0, width, y); if (h < height) - XFillRectangle (display->display, TermWin.pixmap, gc, 0, (int)h, width, height - h + 1); + XFillRectangle (disp, pixmap, gc, 0, (int)h, width, height - h + 1); for ( /*nil */ ; y < h; y++, p += incr) { @@ -250,16 +252,16 @@ p = 0; /* copy one row from the tmp pixmap to the main pixmap */ - XCopyArea (display->display, tmp, TermWin.pixmap, gc, + XCopyArea (disp, tmp, pixmap, gc, 0, (int)p, width, 1, 0, (int)y); } - XFreePixmap (display->display, tmp); + XFreePixmap (disp, tmp); } } - XSetWindowBackgroundPixmap (display->display, TermWin.vt, TermWin.pixmap); - XFreeGC (display->display, gc); + XSetWindowBackgroundPixmap (disp, vt, pixmap); + XFreeGC (disp, gc); am_transparent = 0; } @@ -267,7 +269,6 @@ * Calculate tiling sizes and increments * At start, p == 0, incr == xpmwidthheight */ -/* INTPROTO */ static void rxvt_pixmap_incr (unsigned int *wh, unsigned int *xy, float *incr, float *p, unsigned int widthheight, unsigned int xpmwidthheight) { @@ -343,7 +344,7 @@ Pixmap rxvt_term::set_bgPixmap (const char *file) { - char *f; + char *f; assert (file != NULL); @@ -353,7 +354,7 @@ bgPixmap.pixmap = None; } - XSetWindowBackground (display->display, TermWin.vt, pix_colors[Color_bg]); + XSetWindowBackground (display->display, vt, pix_colors[Color_bg]); if (*file != '\0') { @@ -362,7 +363,7 @@ /* * we already have the required attributes */ - /* XGetWindowAttributes (display->display, TermWin.vt, &attr); */ + /* XGetWindowAttributes (display->display, vt, &attr); */ xpmAttr.closeness = 30000; xpmAttr.colormap = display->cmap;