1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun Copyright 1993 by Davor Matic
4*4882a593Smuzhiyun
5*4882a593Smuzhiyun Permission to use, copy, modify, distribute, and sell this software
6*4882a593Smuzhiyun and its documentation for any purpose is hereby granted without fee,
7*4882a593Smuzhiyun provided that the above copyright notice appear in all copies and that
8*4882a593Smuzhiyun both that copyright notice and this permission notice appear in
9*4882a593Smuzhiyun supporting documentation. Davor Matic makes no representations about
10*4882a593Smuzhiyun the suitability of this software for any purpose. It is provided "as
11*4882a593Smuzhiyun is" without express or implied warranty.
12*4882a593Smuzhiyun
13*4882a593Smuzhiyun */
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun #ifdef HAVE_XNEST_CONFIG_H
16*4882a593Smuzhiyun #include <xnest-config.h>
17*4882a593Smuzhiyun #endif
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun #include <X11/X.h>
20*4882a593Smuzhiyun #include <X11/Xproto.h>
21*4882a593Smuzhiyun #include "regionstr.h"
22*4882a593Smuzhiyun #include <X11/fonts/fontstruct.h>
23*4882a593Smuzhiyun #include "gcstruct.h"
24*4882a593Smuzhiyun #include "scrnintstr.h"
25*4882a593Smuzhiyun #include "windowstr.h"
26*4882a593Smuzhiyun #include "pixmapstr.h"
27*4882a593Smuzhiyun #include "region.h"
28*4882a593Smuzhiyun #include "servermd.h"
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun #include "Xnest.h"
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun #include "Display.h"
33*4882a593Smuzhiyun #include "Screen.h"
34*4882a593Smuzhiyun #include "XNGC.h"
35*4882a593Smuzhiyun #include "XNFont.h"
36*4882a593Smuzhiyun #include "GCOps.h"
37*4882a593Smuzhiyun #include "Drawable.h"
38*4882a593Smuzhiyun #include "Visual.h"
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun void
xnestFillSpans(DrawablePtr pDrawable,GCPtr pGC,int nSpans,xPoint * pPoints,int * pWidths,int fSorted)41*4882a593Smuzhiyun xnestFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nSpans, xPoint * pPoints,
42*4882a593Smuzhiyun int *pWidths, int fSorted)
43*4882a593Smuzhiyun {
44*4882a593Smuzhiyun ErrorF("xnest warning: function xnestFillSpans not implemented\n");
45*4882a593Smuzhiyun }
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun void
xnestSetSpans(DrawablePtr pDrawable,GCPtr pGC,char * pSrc,xPoint * pPoints,int * pWidths,int nSpans,int fSorted)48*4882a593Smuzhiyun xnestSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *pSrc,
49*4882a593Smuzhiyun xPoint * pPoints, int *pWidths, int nSpans, int fSorted)
50*4882a593Smuzhiyun {
51*4882a593Smuzhiyun ErrorF("xnest warning: function xnestSetSpans not implemented\n");
52*4882a593Smuzhiyun }
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun void
xnestGetSpans(DrawablePtr pDrawable,int maxWidth,DDXPointPtr pPoints,int * pWidths,int nSpans,char * pBuffer)55*4882a593Smuzhiyun xnestGetSpans(DrawablePtr pDrawable, int maxWidth, DDXPointPtr pPoints,
56*4882a593Smuzhiyun int *pWidths, int nSpans, char *pBuffer)
57*4882a593Smuzhiyun {
58*4882a593Smuzhiyun ErrorF("xnest warning: function xnestGetSpans not implemented\n");
59*4882a593Smuzhiyun }
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun void
xnestQueryBestSize(int class,unsigned short * pWidth,unsigned short * pHeight,ScreenPtr pScreen)62*4882a593Smuzhiyun xnestQueryBestSize(int class, unsigned short *pWidth, unsigned short *pHeight,
63*4882a593Smuzhiyun ScreenPtr pScreen)
64*4882a593Smuzhiyun {
65*4882a593Smuzhiyun unsigned int width, height;
66*4882a593Smuzhiyun
67*4882a593Smuzhiyun width = *pWidth;
68*4882a593Smuzhiyun height = *pHeight;
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun XQueryBestSize(xnestDisplay, class,
71*4882a593Smuzhiyun xnestDefaultWindows[pScreen->myNum],
72*4882a593Smuzhiyun width, height, &width, &height);
73*4882a593Smuzhiyun
74*4882a593Smuzhiyun *pWidth = width;
75*4882a593Smuzhiyun *pHeight = height;
76*4882a593Smuzhiyun }
77*4882a593Smuzhiyun
78*4882a593Smuzhiyun void
xnestPutImage(DrawablePtr pDrawable,GCPtr pGC,int depth,int x,int y,int w,int h,int leftPad,int format,char * pImage)79*4882a593Smuzhiyun xnestPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
80*4882a593Smuzhiyun int w, int h, int leftPad, int format, char *pImage)
81*4882a593Smuzhiyun {
82*4882a593Smuzhiyun XImage *ximage;
83*4882a593Smuzhiyun
84*4882a593Smuzhiyun ximage = XCreateImage(xnestDisplay, xnestDefaultVisual(pDrawable->pScreen),
85*4882a593Smuzhiyun depth, format, leftPad, (char *) pImage,
86*4882a593Smuzhiyun w, h, BitmapPad(xnestDisplay),
87*4882a593Smuzhiyun (format == ZPixmap) ?
88*4882a593Smuzhiyun PixmapBytePad(w, depth) : BitmapBytePad(w + leftPad));
89*4882a593Smuzhiyun
90*4882a593Smuzhiyun if (ximage) {
91*4882a593Smuzhiyun XPutImage(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
92*4882a593Smuzhiyun ximage, 0, 0, x, y, w, h);
93*4882a593Smuzhiyun XFree(ximage);
94*4882a593Smuzhiyun }
95*4882a593Smuzhiyun }
96*4882a593Smuzhiyun
97*4882a593Smuzhiyun static int
xnestIgnoreErrorHandler(Display * dpy,XErrorEvent * event)98*4882a593Smuzhiyun xnestIgnoreErrorHandler (Display *dpy,
99*4882a593Smuzhiyun XErrorEvent *event)
100*4882a593Smuzhiyun {
101*4882a593Smuzhiyun return False; /* return value is ignored */
102*4882a593Smuzhiyun }
103*4882a593Smuzhiyun
104*4882a593Smuzhiyun void
xnestGetImage(DrawablePtr pDrawable,int x,int y,int w,int h,unsigned int format,unsigned long planeMask,char * pImage)105*4882a593Smuzhiyun xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
106*4882a593Smuzhiyun unsigned int format, unsigned long planeMask, char *pImage)
107*4882a593Smuzhiyun {
108*4882a593Smuzhiyun XImage *ximage;
109*4882a593Smuzhiyun int length;
110*4882a593Smuzhiyun int (*old_handler)(Display*, XErrorEvent*);
111*4882a593Smuzhiyun
112*4882a593Smuzhiyun /* we may get BadMatch error when xnest window is minimized */
113*4882a593Smuzhiyun XSync(xnestDisplay, False);
114*4882a593Smuzhiyun old_handler = XSetErrorHandler (xnestIgnoreErrorHandler);
115*4882a593Smuzhiyun
116*4882a593Smuzhiyun ximage = XGetImage(xnestDisplay, xnestDrawable(pDrawable),
117*4882a593Smuzhiyun x, y, w, h, planeMask, format);
118*4882a593Smuzhiyun XSetErrorHandler(old_handler);
119*4882a593Smuzhiyun
120*4882a593Smuzhiyun if (ximage) {
121*4882a593Smuzhiyun length = ximage->bytes_per_line * ximage->height;
122*4882a593Smuzhiyun
123*4882a593Smuzhiyun memmove(pImage, ximage->data, length);
124*4882a593Smuzhiyun
125*4882a593Smuzhiyun XDestroyImage(ximage);
126*4882a593Smuzhiyun }
127*4882a593Smuzhiyun }
128*4882a593Smuzhiyun
129*4882a593Smuzhiyun static Bool
xnestBitBlitPredicate(Display * dpy,XEvent * event,char * args)130*4882a593Smuzhiyun xnestBitBlitPredicate(Display * dpy, XEvent * event, char *args)
131*4882a593Smuzhiyun {
132*4882a593Smuzhiyun return event->type == GraphicsExpose || event->type == NoExpose;
133*4882a593Smuzhiyun }
134*4882a593Smuzhiyun
135*4882a593Smuzhiyun static RegionPtr
xnestBitBlitHelper(GCPtr pGC)136*4882a593Smuzhiyun xnestBitBlitHelper(GCPtr pGC)
137*4882a593Smuzhiyun {
138*4882a593Smuzhiyun if (!pGC->graphicsExposures)
139*4882a593Smuzhiyun return NullRegion;
140*4882a593Smuzhiyun else {
141*4882a593Smuzhiyun XEvent event;
142*4882a593Smuzhiyun RegionPtr pReg, pTmpReg;
143*4882a593Smuzhiyun BoxRec Box;
144*4882a593Smuzhiyun Bool pending, overlap;
145*4882a593Smuzhiyun
146*4882a593Smuzhiyun pReg = RegionCreate(NULL, 1);
147*4882a593Smuzhiyun pTmpReg = RegionCreate(NULL, 1);
148*4882a593Smuzhiyun if (!pReg || !pTmpReg)
149*4882a593Smuzhiyun return NullRegion;
150*4882a593Smuzhiyun
151*4882a593Smuzhiyun pending = True;
152*4882a593Smuzhiyun while (pending) {
153*4882a593Smuzhiyun XIfEvent(xnestDisplay, &event, xnestBitBlitPredicate, NULL);
154*4882a593Smuzhiyun
155*4882a593Smuzhiyun switch (event.type) {
156*4882a593Smuzhiyun case NoExpose:
157*4882a593Smuzhiyun pending = False;
158*4882a593Smuzhiyun break;
159*4882a593Smuzhiyun
160*4882a593Smuzhiyun case GraphicsExpose:
161*4882a593Smuzhiyun Box.x1 = event.xgraphicsexpose.x;
162*4882a593Smuzhiyun Box.y1 = event.xgraphicsexpose.y;
163*4882a593Smuzhiyun Box.x2 = event.xgraphicsexpose.x + event.xgraphicsexpose.width;
164*4882a593Smuzhiyun Box.y2 = event.xgraphicsexpose.y + event.xgraphicsexpose.height;
165*4882a593Smuzhiyun RegionReset(pTmpReg, &Box);
166*4882a593Smuzhiyun RegionAppend(pReg, pTmpReg);
167*4882a593Smuzhiyun pending = event.xgraphicsexpose.count;
168*4882a593Smuzhiyun break;
169*4882a593Smuzhiyun }
170*4882a593Smuzhiyun }
171*4882a593Smuzhiyun
172*4882a593Smuzhiyun RegionDestroy(pTmpReg);
173*4882a593Smuzhiyun RegionValidate(pReg, &overlap);
174*4882a593Smuzhiyun return pReg;
175*4882a593Smuzhiyun }
176*4882a593Smuzhiyun }
177*4882a593Smuzhiyun
178*4882a593Smuzhiyun RegionPtr
xnestCopyArea(DrawablePtr pSrcDrawable,DrawablePtr pDstDrawable,GCPtr pGC,int srcx,int srcy,int width,int height,int dstx,int dsty)179*4882a593Smuzhiyun xnestCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
180*4882a593Smuzhiyun GCPtr pGC, int srcx, int srcy, int width, int height,
181*4882a593Smuzhiyun int dstx, int dsty)
182*4882a593Smuzhiyun {
183*4882a593Smuzhiyun XCopyArea(xnestDisplay,
184*4882a593Smuzhiyun xnestDrawable(pSrcDrawable), xnestDrawable(pDstDrawable),
185*4882a593Smuzhiyun xnestGC(pGC), srcx, srcy, width, height, dstx, dsty);
186*4882a593Smuzhiyun
187*4882a593Smuzhiyun return xnestBitBlitHelper(pGC);
188*4882a593Smuzhiyun }
189*4882a593Smuzhiyun
190*4882a593Smuzhiyun RegionPtr
xnestCopyPlane(DrawablePtr pSrcDrawable,DrawablePtr pDstDrawable,GCPtr pGC,int srcx,int srcy,int width,int height,int dstx,int dsty,unsigned long plane)191*4882a593Smuzhiyun xnestCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
192*4882a593Smuzhiyun GCPtr pGC, int srcx, int srcy, int width, int height,
193*4882a593Smuzhiyun int dstx, int dsty, unsigned long plane)
194*4882a593Smuzhiyun {
195*4882a593Smuzhiyun XCopyPlane(xnestDisplay,
196*4882a593Smuzhiyun xnestDrawable(pSrcDrawable), xnestDrawable(pDstDrawable),
197*4882a593Smuzhiyun xnestGC(pGC), srcx, srcy, width, height, dstx, dsty, plane);
198*4882a593Smuzhiyun
199*4882a593Smuzhiyun return xnestBitBlitHelper(pGC);
200*4882a593Smuzhiyun }
201*4882a593Smuzhiyun
202*4882a593Smuzhiyun void
xnestPolyPoint(DrawablePtr pDrawable,GCPtr pGC,int mode,int nPoints,DDXPointPtr pPoints)203*4882a593Smuzhiyun xnestPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
204*4882a593Smuzhiyun DDXPointPtr pPoints)
205*4882a593Smuzhiyun {
206*4882a593Smuzhiyun XDrawPoints(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
207*4882a593Smuzhiyun (XPoint *) pPoints, nPoints, mode);
208*4882a593Smuzhiyun }
209*4882a593Smuzhiyun
210*4882a593Smuzhiyun void
xnestPolylines(DrawablePtr pDrawable,GCPtr pGC,int mode,int nPoints,DDXPointPtr pPoints)211*4882a593Smuzhiyun xnestPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
212*4882a593Smuzhiyun DDXPointPtr pPoints)
213*4882a593Smuzhiyun {
214*4882a593Smuzhiyun XDrawLines(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
215*4882a593Smuzhiyun (XPoint *) pPoints, nPoints, mode);
216*4882a593Smuzhiyun }
217*4882a593Smuzhiyun
218*4882a593Smuzhiyun void
xnestPolySegment(DrawablePtr pDrawable,GCPtr pGC,int nSegments,xSegment * pSegments)219*4882a593Smuzhiyun xnestPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nSegments,
220*4882a593Smuzhiyun xSegment * pSegments)
221*4882a593Smuzhiyun {
222*4882a593Smuzhiyun XDrawSegments(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
223*4882a593Smuzhiyun (XSegment *) pSegments, nSegments);
224*4882a593Smuzhiyun }
225*4882a593Smuzhiyun
226*4882a593Smuzhiyun void
xnestPolyRectangle(DrawablePtr pDrawable,GCPtr pGC,int nRectangles,xRectangle * pRectangles)227*4882a593Smuzhiyun xnestPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nRectangles,
228*4882a593Smuzhiyun xRectangle *pRectangles)
229*4882a593Smuzhiyun {
230*4882a593Smuzhiyun XDrawRectangles(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
231*4882a593Smuzhiyun (XRectangle *) pRectangles, nRectangles);
232*4882a593Smuzhiyun }
233*4882a593Smuzhiyun
234*4882a593Smuzhiyun void
xnestPolyArc(DrawablePtr pDrawable,GCPtr pGC,int nArcs,xArc * pArcs)235*4882a593Smuzhiyun xnestPolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc * pArcs)
236*4882a593Smuzhiyun {
237*4882a593Smuzhiyun XDrawArcs(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
238*4882a593Smuzhiyun (XArc *) pArcs, nArcs);
239*4882a593Smuzhiyun }
240*4882a593Smuzhiyun
241*4882a593Smuzhiyun void
xnestFillPolygon(DrawablePtr pDrawable,GCPtr pGC,int shape,int mode,int nPoints,DDXPointPtr pPoints)242*4882a593Smuzhiyun xnestFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, int mode,
243*4882a593Smuzhiyun int nPoints, DDXPointPtr pPoints)
244*4882a593Smuzhiyun {
245*4882a593Smuzhiyun XFillPolygon(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
246*4882a593Smuzhiyun (XPoint *) pPoints, nPoints, shape, mode);
247*4882a593Smuzhiyun }
248*4882a593Smuzhiyun
249*4882a593Smuzhiyun void
xnestPolyFillRect(DrawablePtr pDrawable,GCPtr pGC,int nRectangles,xRectangle * pRectangles)250*4882a593Smuzhiyun xnestPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nRectangles,
251*4882a593Smuzhiyun xRectangle *pRectangles)
252*4882a593Smuzhiyun {
253*4882a593Smuzhiyun XFillRectangles(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
254*4882a593Smuzhiyun (XRectangle *) pRectangles, nRectangles);
255*4882a593Smuzhiyun }
256*4882a593Smuzhiyun
257*4882a593Smuzhiyun void
xnestPolyFillArc(DrawablePtr pDrawable,GCPtr pGC,int nArcs,xArc * pArcs)258*4882a593Smuzhiyun xnestPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc * pArcs)
259*4882a593Smuzhiyun {
260*4882a593Smuzhiyun XFillArcs(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
261*4882a593Smuzhiyun (XArc *) pArcs, nArcs);
262*4882a593Smuzhiyun }
263*4882a593Smuzhiyun
264*4882a593Smuzhiyun int
xnestPolyText8(DrawablePtr pDrawable,GCPtr pGC,int x,int y,int count,char * string)265*4882a593Smuzhiyun xnestPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
266*4882a593Smuzhiyun char *string)
267*4882a593Smuzhiyun {
268*4882a593Smuzhiyun int width;
269*4882a593Smuzhiyun
270*4882a593Smuzhiyun XDrawString(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
271*4882a593Smuzhiyun x, y, string, count);
272*4882a593Smuzhiyun
273*4882a593Smuzhiyun width = XTextWidth(xnestFontStruct(pGC->font), string, count);
274*4882a593Smuzhiyun
275*4882a593Smuzhiyun return width + x;
276*4882a593Smuzhiyun }
277*4882a593Smuzhiyun
278*4882a593Smuzhiyun int
xnestPolyText16(DrawablePtr pDrawable,GCPtr pGC,int x,int y,int count,unsigned short * string)279*4882a593Smuzhiyun xnestPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
280*4882a593Smuzhiyun unsigned short *string)
281*4882a593Smuzhiyun {
282*4882a593Smuzhiyun int width;
283*4882a593Smuzhiyun
284*4882a593Smuzhiyun XDrawString16(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
285*4882a593Smuzhiyun x, y, (XChar2b *) string, count);
286*4882a593Smuzhiyun
287*4882a593Smuzhiyun width = XTextWidth16(xnestFontStruct(pGC->font), (XChar2b *) string, count);
288*4882a593Smuzhiyun
289*4882a593Smuzhiyun return width + x;
290*4882a593Smuzhiyun }
291*4882a593Smuzhiyun
292*4882a593Smuzhiyun void
xnestImageText8(DrawablePtr pDrawable,GCPtr pGC,int x,int y,int count,char * string)293*4882a593Smuzhiyun xnestImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
294*4882a593Smuzhiyun char *string)
295*4882a593Smuzhiyun {
296*4882a593Smuzhiyun XDrawImageString(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
297*4882a593Smuzhiyun x, y, string, count);
298*4882a593Smuzhiyun }
299*4882a593Smuzhiyun
300*4882a593Smuzhiyun void
xnestImageText16(DrawablePtr pDrawable,GCPtr pGC,int x,int y,int count,unsigned short * string)301*4882a593Smuzhiyun xnestImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
302*4882a593Smuzhiyun unsigned short *string)
303*4882a593Smuzhiyun {
304*4882a593Smuzhiyun XDrawImageString16(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
305*4882a593Smuzhiyun x, y, (XChar2b *) string, count);
306*4882a593Smuzhiyun }
307*4882a593Smuzhiyun
308*4882a593Smuzhiyun void
xnestImageGlyphBlt(DrawablePtr pDrawable,GCPtr pGC,int x,int y,unsigned int nGlyphs,CharInfoPtr * pCharInfo,void * pGlyphBase)309*4882a593Smuzhiyun xnestImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
310*4882a593Smuzhiyun unsigned int nGlyphs, CharInfoPtr * pCharInfo,
311*4882a593Smuzhiyun void *pGlyphBase)
312*4882a593Smuzhiyun {
313*4882a593Smuzhiyun ErrorF("xnest warning: function xnestImageGlyphBlt not implemented\n");
314*4882a593Smuzhiyun }
315*4882a593Smuzhiyun
316*4882a593Smuzhiyun void
xnestPolyGlyphBlt(DrawablePtr pDrawable,GCPtr pGC,int x,int y,unsigned int nGlyphs,CharInfoPtr * pCharInfo,void * pGlyphBase)317*4882a593Smuzhiyun xnestPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
318*4882a593Smuzhiyun unsigned int nGlyphs, CharInfoPtr * pCharInfo,
319*4882a593Smuzhiyun void *pGlyphBase)
320*4882a593Smuzhiyun {
321*4882a593Smuzhiyun ErrorF("xnest warning: function xnestPolyGlyphBlt not implemented\n");
322*4882a593Smuzhiyun }
323*4882a593Smuzhiyun
324*4882a593Smuzhiyun void
xnestPushPixels(GCPtr pGC,PixmapPtr pBitmap,DrawablePtr pDst,int width,int height,int x,int y)325*4882a593Smuzhiyun xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDst,
326*4882a593Smuzhiyun int width, int height, int x, int y)
327*4882a593Smuzhiyun {
328*4882a593Smuzhiyun /* only works for solid bitmaps */
329*4882a593Smuzhiyun if (pGC->fillStyle == FillSolid) {
330*4882a593Smuzhiyun XSetStipple(xnestDisplay, xnestGC(pGC), xnestPixmap(pBitmap));
331*4882a593Smuzhiyun XSetTSOrigin(xnestDisplay, xnestGC(pGC), x, y);
332*4882a593Smuzhiyun XSetFillStyle(xnestDisplay, xnestGC(pGC), FillStippled);
333*4882a593Smuzhiyun XFillRectangle(xnestDisplay, xnestDrawable(pDst),
334*4882a593Smuzhiyun xnestGC(pGC), x, y, width, height);
335*4882a593Smuzhiyun XSetFillStyle(xnestDisplay, xnestGC(pGC), FillSolid);
336*4882a593Smuzhiyun }
337*4882a593Smuzhiyun else
338*4882a593Smuzhiyun ErrorF("xnest warning: function xnestPushPixels not implemented\n");
339*4882a593Smuzhiyun }
340