| 48 |
|
ZPixmap,0,data,width,height,bm_pad,0); |
| 49 |
|
xr->gc = XCreateGC(disp, RootWindow(disp,scrn), 0, 0); |
| 50 |
|
XSetState(disp, xr->gc, BlackPixel(disp,scrn), WhitePixel(disp,scrn), |
| 51 |
< |
GXcopy, ~0L); |
| 51 |
> |
GXcopy, AllPlanes); |
| 52 |
|
return(xr); |
| 53 |
|
} |
| 54 |
|
|
| 157 |
|
return(0); |
| 158 |
|
put_raster(pm, 0, 0, xr); |
| 159 |
|
return(xr->pm = pm); |
| 160 |
+ |
} |
| 161 |
+ |
|
| 162 |
+ |
|
| 163 |
+ |
patch_raster(d, xsrc, ysrc, xdst, ydst, width, height, xr) /* redraw */ |
| 164 |
+ |
Drawable d; |
| 165 |
+ |
int xsrc, ysrc, xdst, ydst; |
| 166 |
+ |
int width, height; |
| 167 |
+ |
register XRASTER *xr; |
| 168 |
+ |
{ |
| 169 |
+ |
if (xsrc >= xr->image->width || ysrc >= xr->image->height) |
| 170 |
+ |
return; |
| 171 |
+ |
if (xsrc < 0) { |
| 172 |
+ |
xdst -= xsrc; width += xsrc; |
| 173 |
+ |
xsrc = 0; |
| 174 |
+ |
} |
| 175 |
+ |
if (ysrc < 0) { |
| 176 |
+ |
ydst -= ysrc; height += ysrc; |
| 177 |
+ |
ysrc = 0; |
| 178 |
+ |
} |
| 179 |
+ |
if (width <= 0 || height <= 0) |
| 180 |
+ |
return; |
| 181 |
+ |
if (xsrc + width > xr->image->width) |
| 182 |
+ |
width = xr->image->width - xsrc; |
| 183 |
+ |
if (ysrc + height > xr->image->height) |
| 184 |
+ |
height = xr->image->height - ysrc; |
| 185 |
+ |
|
| 186 |
+ |
if (xr->pm == 0) |
| 187 |
+ |
XPutImage(xr->disp, d, xr->gc, xr->image, xsrc, ysrc, |
| 188 |
+ |
xdst, ydst, width, height); |
| 189 |
+ |
else |
| 190 |
+ |
XCopyArea(xr->disp, xr->pm, d, xr->gc, xsrc, ysrc, |
| 191 |
+ |
width, height, xdst, ydst); |
| 192 |
|
} |
| 193 |
|
|
| 194 |
|
|