From 63f1fff8fe1e7f94ebc0a72df773c6f77531f7a4 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 16 Mar 2016 11:11:43 +0100 Subject: Rename region macros to eliminate screen argument This is a huge mechanical patch and a few small fixups required to finish the job. They were reviewed separately, but because the server does not build without both pieces, I've merged them together at this time. The mechanical changes were performed by running the included 'fix-region' script over the whole nx-X11/programs/Xserver tree: $ cd nx-X11/programs/Xserver && ( git ls-files | grep -v '^fix-' | xargs ./fix-region; ) And then, the white space errors in the resulting patch were fixed using the provided fix-patch-whitespace script. $ sh ./fix-patch-whitespace Thanks to Jamey Sharp for the mighty fine sed-generating sed script. v1: Keith Packard (X.Org xserver commit: 2dc138922b7588515d5f2447e4b9dcdc0bef15e0) v2: Mike Gabriel (apply fix-region script to nx-libs) --- nx-X11/programs/Xserver/fb/fb.h | 2 +- nx-X11/programs/Xserver/fb/fb24_32.c | 8 +- nx-X11/programs/Xserver/fb/fbarc.c | 2 +- nx-X11/programs/Xserver/fb/fbbits.h | 4 +- nx-X11/programs/Xserver/fb/fbbstore.c | 8 +- nx-X11/programs/Xserver/fb/fbcompose.c | 36 ++++---- nx-X11/programs/Xserver/fb/fbcopy.c | 26 +++--- nx-X11/programs/Xserver/fb/fbfill.c | 2 +- nx-X11/programs/Xserver/fb/fbfillrect.c | 6 +- nx-X11/programs/Xserver/fb/fbfillsp.c | 6 +- nx-X11/programs/Xserver/fb/fbgc.c | 2 +- nx-X11/programs/Xserver/fb/fbglyph.c | 4 +- nx-X11/programs/Xserver/fb/fbimage.c | 8 +- nx-X11/programs/Xserver/fb/fbline.c | 4 +- nx-X11/programs/Xserver/fb/fboverlay.c | 42 +++++----- nx-X11/programs/Xserver/fb/fbpict.c | 6 +- nx-X11/programs/Xserver/fb/fbpixmap.c | 10 +-- nx-X11/programs/Xserver/fb/fbpoint.c | 2 +- nx-X11/programs/Xserver/fb/fbpseudocolor.c | 130 ++++++++++++++--------------- nx-X11/programs/Xserver/fb/fbpush.c | 4 +- nx-X11/programs/Xserver/fb/fbseg.c | 4 +- nx-X11/programs/Xserver/fb/fbsetsp.c | 4 +- nx-X11/programs/Xserver/fb/fbwindow.c | 18 ++-- 23 files changed, 169 insertions(+), 169 deletions(-) (limited to 'nx-X11/programs/Xserver/fb') diff --git a/nx-X11/programs/Xserver/fb/fb.h b/nx-X11/programs/Xserver/fb/fb.h index b64f3a227..1da5d2470 100644 --- a/nx-X11/programs/Xserver/fb/fb.h +++ b/nx-X11/programs/Xserver/fb/fb.h @@ -703,7 +703,7 @@ typedef struct { */ #define fbWindowEnabled(pWin) \ - REGION_NOTEMPTY((pWin)->drawable.pScreen, \ + RegionNotEmpty(\ &WindowTable[(pWin)->drawable.pScreen->myNum]->borderClip) #define fbDrawableEnabled(pDrawable) \ diff --git a/nx-X11/programs/Xserver/fb/fb24_32.c b/nx-X11/programs/Xserver/fb/fb24_32.c index 68e0ef84d..350055c14 100644 --- a/nx-X11/programs/Xserver/fb/fb24_32.c +++ b/nx-X11/programs/Xserver/fb/fb24_32.c @@ -338,8 +338,8 @@ fb24_32SetSpans (DrawablePtr pDrawable, { d = dst + (ppt->y + dstYoff) * dstStride; s = (CARD8 *) src; - n = REGION_NUM_RECTS(pClip); - pbox = REGION_RECTS (pClip); + n = RegionNumRects(pClip); + pbox = RegionRects (pClip); while (n--) { if (pbox->y1 > ppt->y) @@ -400,8 +400,8 @@ fb24_32PutZImage (DrawablePtr pDrawable, dstStride *= sizeof(FbBits); dst = (CARD8 *) dstBits; - for (nbox = REGION_NUM_RECTS (pClip), - pbox = REGION_RECTS(pClip); + for (nbox = RegionNumRects (pClip), + pbox = RegionRects(pClip); nbox--; pbox++) { diff --git a/nx-X11/programs/Xserver/fb/fbarc.c b/nx-X11/programs/Xserver/fb/fbarc.c index 315aa181c..0b386f70e 100644 --- a/nx-X11/programs/Xserver/fb/fbarc.c +++ b/nx-X11/programs/Xserver/fb/fbarc.c @@ -101,7 +101,7 @@ fbPolyArc (DrawablePtr pDrawable, y2 = box.y1 + (int)parcs->height + 1; box.y2 = y2; if ( (x2 <= MAXSHORT) && (y2 <= MAXSHORT) && - (RECT_IN_REGION(pDrawable->pScreen, cclip, &box) == rgnIN) ) + (RegionContainsRect(cclip, &box) == rgnIN) ) (*arc) (dst, dstStride, dstBpp, parcs, pDrawable->x + dstXoff, pDrawable->y + dstYoff, pPriv->and, pPriv->xor); diff --git a/nx-X11/programs/Xserver/fb/fbbits.h b/nx-X11/programs/Xserver/fb/fbbits.h index 7dfff58b4..5cd7ae70f 100644 --- a/nx-X11/programs/Xserver/fb/fbbits.h +++ b/nx-X11/programs/Xserver/fb/fbbits.h @@ -668,7 +668,7 @@ POLYLINE (DrawablePtr pDrawable, int xoff = pDrawable->x; int yoff = pDrawable->y; unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); - BoxPtr pBox = REGION_EXTENTS (pDrawable->pScreen, fbGetCompositeClip (pGC)); + BoxPtr pBox = RegionExtents(fbGetCompositeClip (pGC)); FbBits *dst; int dstStride; @@ -800,7 +800,7 @@ POLYSEGMENT (DrawablePtr pDrawable, int xoff = pDrawable->x; int yoff = pDrawable->y; unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); - BoxPtr pBox = REGION_EXTENTS (pDrawable->pScreen, fbGetCompositeClip (pGC)); + BoxPtr pBox = RegionExtents(fbGetCompositeClip (pGC)); FbBits *dst; int dstStride; diff --git a/nx-X11/programs/Xserver/fb/fbbstore.c b/nx-X11/programs/Xserver/fb/fbbstore.c index 01ec9b7e0..e9eedde5b 100644 --- a/nx-X11/programs/Xserver/fb/fbbstore.c +++ b/nx-X11/programs/Xserver/fb/fbbstore.c @@ -39,8 +39,8 @@ fbSaveAreas(PixmapPtr pPixmap, fbCopyWindowProc (&pWin->drawable, &pPixmap->drawable, 0, - REGION_RECTS(prgnSave), - REGION_NUM_RECTS(prgnSave), + RegionRects(prgnSave), + RegionNumRects(prgnSave), xorg, yorg, FALSE, FALSE, @@ -57,8 +57,8 @@ fbRestoreAreas(PixmapPtr pPixmap, fbCopyWindowProc (&pPixmap->drawable, &pWin->drawable, 0, - REGION_RECTS(prgnRestore), - REGION_NUM_RECTS(prgnRestore), + RegionRects(prgnRestore), + RegionNumRects(prgnRestore), -xorg, -yorg, FALSE, FALSE, diff --git a/nx-X11/programs/Xserver/fb/fbcompose.c b/nx-X11/programs/Xserver/fb/fbcompose.c index f8169995f..07ae9490f 100644 --- a/nx-X11/programs/Xserver/fb/fbcompose.c +++ b/nx-X11/programs/Xserver/fb/fbcompose.c @@ -2896,7 +2896,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 if (pict->filter == PictFilterNearest) { if (pict->repeatType == RepeatNormal) { - if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) { + if (RegionNumRects(pict->pCompositeClip) == 1) { box = pict->pCompositeClip->extents; for (i = 0; i < width; ++i) { if (!v.vector[2]) { @@ -2927,7 +2927,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 y = MOD(v.vector[1]>>16, pict->pDrawable->height); x = MOD(v.vector[0]>>16, pict->pDrawable->width); } - if (POINT_IN_REGION (0, pict->pCompositeClip, x, y, &box)) + if (RegionContainsPoint(pict->pCompositeClip, x, y, &box)) buffer[i] = fetch(bits + (y + pict->pDrawable->y)*stride, x + pict->pDrawable->x, indexed); else buffer[i] = 0; @@ -2938,7 +2938,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 } } } else { - if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) { + if (RegionNumRects(pict->pCompositeClip) == 1) { box = pict->pCompositeClip->extents; for (i = 0; i < width; ++i) { if (!v.vector[2]) { @@ -2970,7 +2970,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 y = v.vector[1]>>16; x = v.vector[0]>>16; } - if (POINT_IN_REGION (0, pict->pCompositeClip, x, y, &box)) + if (RegionContainsPoint(pict->pCompositeClip, x, y, &box)) buffer[i] = fetch(bits + (y + pict->pDrawable->y)*stride, x + pict->pDrawable->x, indexed); else buffer[i] = 0; @@ -2983,7 +2983,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 } } else if (pict->filter == PictFilterBilinear) { if (pict->repeatType == RepeatNormal) { - if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) { + if (RegionNumRects(pict->pCompositeClip) == 1) { box = pict->pCompositeClip->extents; for (i = 0; i < width; ++i) { if (!v.vector[2]) { @@ -3082,14 +3082,14 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 b = bits + (y1 + pict->pDrawable->y)*stride; - tl = POINT_IN_REGION(0, pict->pCompositeClip, x1, y1, &box) + tl = RegionContainsPoint(pict->pCompositeClip, x1, y1, &box) ? fetch(b, x1 + pict->pDrawable->x, indexed) : 0; - tr = POINT_IN_REGION(0, pict->pCompositeClip, x2, y1, &box) + tr = RegionContainsPoint(pict->pCompositeClip, x2, y1, &box) ? fetch(b, x2 + pict->pDrawable->x, indexed) : 0; b = bits + (y2 + pict->pDrawable->y)*stride; - bl = POINT_IN_REGION(0, pict->pCompositeClip, x1, y2, &box) + bl = RegionContainsPoint(pict->pCompositeClip, x1, y2, &box) ? fetch(b, x1 + pict->pDrawable->x, indexed) : 0; - br = POINT_IN_REGION(0, pict->pCompositeClip, x2, y2, &box) + br = RegionContainsPoint(pict->pCompositeClip, x2, y2, &box) ? fetch(b, x2 + pict->pDrawable->x, indexed) : 0; ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx; @@ -3112,7 +3112,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 } } } else { - if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) { + if (RegionNumRects(pict->pCompositeClip) == 1) { box = pict->pCompositeClip->extents; for (i = 0; i < width; ++i) { if (!v.vector[2]) { @@ -3209,14 +3209,14 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 b = bits + (y1 + pict->pDrawable->y)*stride; x_off = x1 + pict->pDrawable->x; - tl = POINT_IN_REGION(0, pict->pCompositeClip, x1, y1, &box) + tl = RegionContainsPoint(pict->pCompositeClip, x1, y1, &box) ? fetch(b, x_off, indexed) : 0; - tr = POINT_IN_REGION(0, pict->pCompositeClip, x2, y1, &box) + tr = RegionContainsPoint(pict->pCompositeClip, x2, y1, &box) ? fetch(b, x_off + 1, indexed) : 0; b += stride; - bl = POINT_IN_REGION(0, pict->pCompositeClip, x1, y2, &box) + bl = RegionContainsPoint(pict->pCompositeClip, x1, y2, &box) ? fetch(b, x_off, indexed) : 0; - br = POINT_IN_REGION(0, pict->pCompositeClip, x2, y2, &box) + br = RegionContainsPoint(pict->pCompositeClip, x2, y2, &box) ? fetch(b, x_off + 1, indexed) : 0; ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx; @@ -3274,7 +3274,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 for (x = x1; x < x2; x++) { if (*p) { int tx = (pict->repeatType == RepeatNormal) ? MOD (x, pict->pDrawable->width) : x; - if (POINT_IN_REGION (0, pict->pCompositeClip, tx, ty, &box)) { + if (RegionContainsPoint(pict->pCompositeClip, tx, ty, &box)) { FbBits *b = bits + (ty + pict->pDrawable->y)*stride; CARD32 c = fetch(b, tx + pict->pDrawable->x, indexed); @@ -3563,8 +3563,8 @@ fbCompositeGeneral (CARD8 op, if (width > SCANLINE_BUFFER_LENGTH) scanline_buffer = (CARD32 *) malloc(width * 3 * sizeof(CARD32)); - n = REGION_NUM_RECTS (®ion); - pbox = REGION_RECTS (®ion); + n = RegionNumRects (®ion); + pbox = RegionRects (®ion); while (n--) { h = pbox->y2 - pbox->y1; @@ -3618,7 +3618,7 @@ fbCompositeGeneral (CARD8 op, } pbox++; } - REGION_UNINIT (pDst->pDrawable->pScreen, ®ion); + RegionUninit(®ion); if (scanline_buffer != _scanline_buffer) free(scanline_buffer); diff --git a/nx-X11/programs/Xserver/fb/fbcopy.c b/nx-X11/programs/Xserver/fb/fbcopy.c index 1e7b93435..f68811ebb 100644 --- a/nx-X11/programs/Xserver/fb/fbcopy.c +++ b/nx-X11/programs/Xserver/fb/fbcopy.c @@ -306,8 +306,8 @@ fbCopyRegion (DrawablePtr pSrcDrawable, int nbox; BoxPtr pboxNew1, pboxNew2, pboxBase, pboxNext, pboxTmp; - pbox = REGION_RECTS(pDstRegion); - nbox = REGION_NUM_RECTS(pDstRegion); + pbox = RegionRects(pDstRegion); + nbox = RegionNumRects(pDstRegion); /* XXX we have to err on the side of safety when both are windows, * because we don't know if IncludeInferiors is being used. @@ -466,7 +466,7 @@ fbDoCopy (DrawablePtr pSrcDrawable, * VT is inactive, make sure the region isn't empty */ if (!((WindowPtr) pSrcDrawable)->parent && - REGION_NOTEMPTY (pSrcDrawable->pScreen, + RegionNotEmpty( &((WindowPtr) pSrcDrawable)->borderClip)) { /* @@ -548,9 +548,9 @@ fbDoCopy (DrawablePtr pSrcDrawable, blown region and call intersect */ cclip = fbGetCompositeClip(pGC); - if (REGION_NUM_RECTS(cclip) == 1) + if (RegionNumRects(cclip) == 1) { - BoxPtr pBox = REGION_RECTS(cclip); + BoxPtr pBox = RegionRects(cclip); if (box_x1 < pBox->x1) box_x1 = pBox->x1; if (box_x2 > pBox->x2) box_x2 = pBox->x2; @@ -563,7 +563,7 @@ fbDoCopy (DrawablePtr pSrcDrawable, /* Check to see if the region is empty */ if (box_x1 >= box_x2 || box_y1 >= box_y2) { - REGION_NULL(pGC->pScreen, &rgnDst); + RegionNull(&rgnDst); } else { @@ -572,25 +572,25 @@ fbDoCopy (DrawablePtr pSrcDrawable, box.y1 = box_y1; box.x2 = box_x2; box.y2 = box_y2; - REGION_INIT(pGC->pScreen, &rgnDst, &box, 1); + RegionInit(&rgnDst, &box, 1); } /* Clip against complex source if needed */ if (!fastSrc) { - REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip); - REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy); + RegionIntersect(&rgnDst, &rgnDst, prgnSrcClip); + RegionTranslate(&rgnDst, -dx, -dy); } /* Clip against complex dest if needed */ if (!fastDst) { - REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, + RegionIntersect(&rgnDst, &rgnDst, fbGetCompositeClip(pGC)); } /* Do bit blitting */ - numRects = REGION_NUM_RECTS(&rgnDst); + numRects = RegionNumRects(&rgnDst); if (numRects && widthSrc && heightSrc) fbCopyRegion (pSrcDrawable, pDstDrawable, pGC, &rgnDst, dx, dy, copyProc, bitPlane, closure); @@ -604,9 +604,9 @@ fbDoCopy (DrawablePtr pSrcDrawable, xOut - pDstDrawable->x, yOut - pDstDrawable->y, (unsigned long) bitPlane); - REGION_UNINIT(pGC->pScreen, &rgnDst); + RegionUninit(&rgnDst); if (freeSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); + RegionDestroy(prgnSrcClip); fbValidateDrawable (pDstDrawable); return prgnExposed; } diff --git a/nx-X11/programs/Xserver/fb/fbfill.c b/nx-X11/programs/Xserver/fb/fbfill.c index c61ff3b4c..be6723c01 100644 --- a/nx-X11/programs/Xserver/fb/fbfill.c +++ b/nx-X11/programs/Xserver/fb/fbfill.c @@ -184,7 +184,7 @@ fbSolidBoxClipped (DrawablePtr pDrawable, fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); - for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip); + for (nbox = RegionNumRects(pClip), pbox = RegionRects(pClip); nbox--; pbox++) { diff --git a/nx-X11/programs/Xserver/fb/fbfillrect.c b/nx-X11/programs/Xserver/fb/fbfillrect.c index 2a60da165..37a7b20f7 100644 --- a/nx-X11/programs/Xserver/fb/fbfillrect.c +++ b/nx-X11/programs/Xserver/fb/fbfillrect.c @@ -47,7 +47,7 @@ fbPolyFillRect(DrawablePtr pDrawable, xorg = pDrawable->x; yorg = pDrawable->y; - pextent = REGION_EXTENTS(pGC->pScreen, pClip); + pextent = RegionExtents(pClip); extentX1 = pextent->x1; extentY1 = pextent->y1; extentX2 = pextent->x2; @@ -74,7 +74,7 @@ fbPolyFillRect(DrawablePtr pDrawable, if ((fullX1 >= fullX2) || (fullY1 >= fullY2)) continue; - n = REGION_NUM_RECTS (pClip); + n = RegionNumRects (pClip); if (n == 1) { fbFill (pDrawable, @@ -83,7 +83,7 @@ fbPolyFillRect(DrawablePtr pDrawable, } else { - pbox = REGION_RECTS(pClip); + pbox = RegionRects(pClip); /* * clip the rectangle to each box in the clip region * this is logically equivalent to calling Intersect() diff --git a/nx-X11/programs/Xserver/fb/fbfillsp.c b/nx-X11/programs/Xserver/fb/fbfillsp.c index e2bb71e3a..5d465482f 100644 --- a/nx-X11/programs/Xserver/fb/fbfillsp.c +++ b/nx-X11/programs/Xserver/fb/fbfillsp.c @@ -44,7 +44,7 @@ fbFillSpans (DrawablePtr pDrawable, int fullX1, fullX2, fullY1; int partX1, partX2; - pextent = REGION_EXTENTS(pGC->pScreen, pClip); + pextent = RegionExtents(pClip); extentX1 = pextent->x1; extentY1 = pextent->y1; extentX2 = pextent->x2; @@ -69,7 +69,7 @@ fbFillSpans (DrawablePtr pDrawable, if (fullX1 >= fullX2) continue; - nbox = REGION_NUM_RECTS (pClip); + nbox = RegionNumRects (pClip); if (nbox == 1) { fbFill (pDrawable, @@ -78,7 +78,7 @@ fbFillSpans (DrawablePtr pDrawable, } else { - pbox = REGION_RECTS(pClip); + pbox = RegionRects(pClip); while(nbox--) { if (pbox->y1 <= fullY1 && fullY1 < pbox->y2) diff --git a/nx-X11/programs/Xserver/fb/fbgc.c b/nx-X11/programs/Xserver/fb/fbgc.c index fdd7a319c..a980023ef 100644 --- a/nx-X11/programs/Xserver/fb/fbgc.c +++ b/nx-X11/programs/Xserver/fb/fbgc.c @@ -211,7 +211,7 @@ fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) ) { miComputeCompositeClip (pGC, pDrawable); - pPriv->oneRect = REGION_NUM_RECTS(fbGetCompositeClip(pGC)) == 1; + pPriv->oneRect = RegionNumRects(fbGetCompositeClip(pGC)) == 1; } #ifdef FB_24_32BIT diff --git a/nx-X11/programs/Xserver/fb/fbglyph.c b/nx-X11/programs/Xserver/fb/fbglyph.c index bb0dda669..3c0913cf8 100644 --- a/nx-X11/programs/Xserver/fb/fbglyph.c +++ b/nx-X11/programs/Xserver/fb/fbglyph.c @@ -41,7 +41,7 @@ fbGlyphIn (RegionPtr pRegion, int height) { BoxRec box; - BoxPtr pExtents = REGION_EXTENTS (dummyScreen, pRegion); + BoxPtr pExtents = RegionExtents(pRegion); /* * Check extents by hand to avoid 16 bit overflows @@ -58,7 +58,7 @@ fbGlyphIn (RegionPtr pRegion, box.x2 = x + width; box.y1 = y; box.y2 = y + height; - return RECT_IN_REGION (dummyScreen, pRegion, &box) == rgnIN; + return RegionContainsRect(pRegion, &box) == rgnIN; } #ifdef FB_24BIT diff --git a/nx-X11/programs/Xserver/fb/fbimage.c b/nx-X11/programs/Xserver/fb/fbimage.c index 96bd8cf95..06b501b41 100644 --- a/nx-X11/programs/Xserver/fb/fbimage.c +++ b/nx-X11/programs/Xserver/fb/fbimage.c @@ -140,8 +140,8 @@ fbPutZImage (DrawablePtr pDrawable, fbGetStipDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); - for (nbox = REGION_NUM_RECTS (pClip), - pbox = REGION_RECTS(pClip); + for (nbox = RegionNumRects (pClip), + pbox = RegionRects(pClip); nbox--; pbox++) { @@ -228,8 +228,8 @@ fbPutXYImage (DrawablePtr pDrawable, } } - for (nbox = REGION_NUM_RECTS (pClip), - pbox = REGION_RECTS(pClip); + for (nbox = RegionNumRects (pClip), + pbox = RegionRects(pClip); nbox--; pbox++) { diff --git a/nx-X11/programs/Xserver/fb/fbline.c b/nx-X11/programs/Xserver/fb/fbline.c index 8e99dd99f..0a9954998 100644 --- a/nx-X11/programs/Xserver/fb/fbline.c +++ b/nx-X11/programs/Xserver/fb/fbline.c @@ -119,7 +119,7 @@ fbPolyLine (DrawablePtr pDrawable, #ifndef FBNOPIXADDR if (pGC->fillStyle == FillSolid && pGC->lineStyle == LineSolid && - REGION_NUM_RECTS (fbGetCompositeClip(pGC)) == 1) + RegionNumRects (fbGetCompositeClip(pGC)) == 1) { switch (pDrawable->bitsPerPixel) { case 8: line = fbPolyline8; break; @@ -156,7 +156,7 @@ fbPolySegment (DrawablePtr pDrawable, #ifndef FBNOPIXADDR if (pGC->fillStyle == FillSolid && pGC->lineStyle == LineSolid && - REGION_NUM_RECTS (fbGetCompositeClip(pGC)) == 1) + RegionNumRects (fbGetCompositeClip(pGC)) == 1) { switch (pDrawable->bitsPerPixel) { case 8: seg = fbPolySegment8; break; diff --git a/nx-X11/programs/Xserver/fb/fboverlay.c b/nx-X11/programs/Xserver/fb/fboverlay.c index 81c54316f..49623ba4f 100644 --- a/nx-X11/programs/Xserver/fb/fboverlay.c +++ b/nx-X11/programs/Xserver/fb/fboverlay.c @@ -74,7 +74,7 @@ fbOverlayCreateWindow(WindowPtr pWin) */ if (!pWin->parent) { - REGION_EMPTY (pWin->drawable.pScreen, + RegionEmpty( &pScrPriv->layer[i].u.run.region); } return TRUE; @@ -92,7 +92,7 @@ fbOverlayCloseScreen (int iScreen, ScreenPtr pScreen) for (i = 0; i < pScrPriv->nlayers; i++) { (*pScreen->DestroyPixmap)(pScrPriv->layer[i].u.run.pixmap); - REGION_UNINIT (pScreen, &pScrPriv->layer[i].u.run.region); + RegionUninit(&pScrPriv->layer[i].u.run.region); } return TRUE; } @@ -146,7 +146,7 @@ fbOverlayCreateScreenResources(ScreenPtr pScreen) pbits)) return FALSE; pScrPriv->layer[i].u.run.pixmap = pPixmap; - REGION_INIT(pScreen, &pScrPriv->layer[i].u.run.region, &box, 0); + RegionInit(&pScrPriv->layer[i].u.run.region, &box, 0); } pScreen->devPrivate = pScrPriv->layer[0].u.run.pixmap; return TRUE; @@ -174,24 +174,24 @@ fbOverlayUpdateLayerRegion (ScreenPtr pScreen, int i; RegionRec rgnNew; - if (!prgn || !REGION_NOTEMPTY(pScreen, prgn)) + if (!prgn || !RegionNotEmpty(prgn)) return; for (i = 0; i < pScrPriv->nlayers; i++) { if (i == layer) { /* add new piece to this fb */ - REGION_UNION (pScreen, + RegionUnion( &pScrPriv->layer[i].u.run.region, &pScrPriv->layer[i].u.run.region, prgn); } - else if (REGION_NOTEMPTY (pScreen, + else if (RegionNotEmpty( &pScrPriv->layer[i].u.run.region)) { /* paint new piece with chroma key */ - REGION_NULL (pScreen, &rgnNew); - REGION_INTERSECT (pScreen, + RegionNull(&rgnNew); + RegionIntersect( &rgnNew, prgn, &pScrPriv->layer[i].u.run.region); @@ -199,9 +199,9 @@ fbOverlayUpdateLayerRegion (ScreenPtr pScreen, &rgnNew, pScrPriv->layer[i].key, i); - REGION_UNINIT(pScreen, &rgnNew); + RegionUninit(&rgnNew); /* remove piece from other fbs */ - REGION_SUBTRACT (pScreen, + RegionSubtract( &pScrPriv->layer[i].u.run.region, &pScrPriv->layer[i].u.run.region, prgn); @@ -231,21 +231,21 @@ fbOverlayCopyWindow(WindowPtr pWin, /* * Clip to existing bits */ - REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy); - REGION_NULL (pScreen, &rgnDst); - REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc); - REGION_TRANSLATE(pScreen, &rgnDst, dx, dy); + RegionTranslate(prgnSrc, -dx, -dy); + RegionNull(&rgnDst); + RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); + RegionTranslate(&rgnDst, dx, dy); /* * Compute the portion of each fb affected by this copy */ for (i = 0; i < pScrPriv->nlayers; i++) { - REGION_NULL (pScreen, &layerRgn[i]); - REGION_INTERSECT(pScreen, &layerRgn[i], &rgnDst, + RegionNull(&layerRgn[i]); + RegionIntersect(&layerRgn[i], &rgnDst, &pScrPriv->layer[i].u.run.region); - if (REGION_NOTEMPTY (pScreen, &layerRgn[i])) + if (RegionNotEmpty(&layerRgn[i])) { - REGION_TRANSLATE(pScreen, &layerRgn[i], -dx, -dy); + RegionTranslate(&layerRgn[i], -dx, -dy); pPixmap = pScrPriv->layer[i].u.run.pixmap; fbCopyRegion (&pPixmap->drawable, &pPixmap->drawable, 0, @@ -258,12 +258,12 @@ fbOverlayCopyWindow(WindowPtr pWin, */ for (i = 0; i < pScrPriv->nlayers; i++) { - if (REGION_NOTEMPTY (pScreen, &layerRgn[i])) + if (RegionNotEmpty(&layerRgn[i])) fbOverlayUpdateLayerRegion (pScreen, i, &layerRgn[i]); - REGION_UNINIT(pScreen, &layerRgn[i]); + RegionUninit(&layerRgn[i]); } - REGION_UNINIT(pScreen, &rgnDst); + RegionUninit(&rgnDst); } void diff --git a/nx-X11/programs/Xserver/fb/fbpict.c b/nx-X11/programs/Xserver/fb/fbpict.c index 5ab3756b9..330c55de3 100644 --- a/nx-X11/programs/Xserver/fb/fbpict.c +++ b/nx-X11/programs/Xserver/fb/fbpict.c @@ -1248,8 +1248,8 @@ fbComposite (CARD8 op, height)) return; - n = REGION_NUM_RECTS (®ion); - pbox = REGION_RECTS (®ion); + n = RegionNumRects (®ion); + pbox = RegionRects (®ion); while (n--) { h = pbox->y2 - pbox->y1; @@ -1309,7 +1309,7 @@ fbComposite (CARD8 op, } pbox++; } - REGION_UNINIT (pDst->pDrawable->pScreen, ®ion); + RegionUninit(®ion); } #endif /* RENDER */ diff --git a/nx-X11/programs/Xserver/fb/fbpixmap.c b/nx-X11/programs/Xserver/fb/fbpixmap.c index 7ea288cb1..6c2cafd94 100644 --- a/nx-X11/programs/Xserver/fb/fbpixmap.c +++ b/nx-X11/programs/Xserver/fb/fbpixmap.c @@ -119,7 +119,7 @@ if (((rx1) < (rx2)) && ((ry1) < (ry2)) && \ if ((reg)->data->numRects == (reg)->data->size) \ { \ miRectAlloc(reg, 1); \ - fr = REGION_BOXPTR(reg); \ + fr = RegionBoxptr(reg); \ r = fr + (reg)->data->numRects; \ } \ r->x1 = (rx1); \ @@ -156,10 +156,10 @@ fbPixmapToRegion(PixmapPtr pPix) FbBits *pwLine; int nWidth; - pReg = REGION_CREATE(pPix->drawable.pScreen, NULL, 1); + pReg = RegionCreate(NULL, 1); if(!pReg) return NullRegion; - FirstRect = REGION_BOXPTR(pReg); + FirstRect = RegionBoxptr(pReg); rects = FirstRect; pwLine = (FbBits *) pPix->devPrivate.ptr; @@ -305,8 +305,8 @@ fbPixmapToRegion(PixmapPtr pPix) pReg->extents.x1 = pReg->extents.x2 = 0; else { - pReg->extents.y1 = REGION_BOXPTR(pReg)->y1; - pReg->extents.y2 = REGION_END(pReg)->y2; + pReg->extents.y1 = RegionBoxptr(pReg)->y1; + pReg->extents.y2 = RegionEnd(pReg)->y2; if (pReg->data->numRects == 1) { xfree(pReg->data); diff --git a/nx-X11/programs/Xserver/fb/fbpoint.c b/nx-X11/programs/Xserver/fb/fbpoint.c index 5229d6970..06d8662ba 100644 --- a/nx-X11/programs/Xserver/fb/fbpoint.c +++ b/nx-X11/programs/Xserver/fb/fbpoint.c @@ -157,7 +157,7 @@ fbPolyPoint (DrawablePtr pDrawable, case 32: dots = fbDots32; break; } #endif - for (nBox = REGION_NUM_RECTS (pClip), pBox = REGION_RECTS (pClip); + for (nBox = RegionNumRects (pClip), pBox = RegionRects (pClip); nBox--; pBox++) (*dots) (dst, dstStride, dstBpp, pBox, pptInit, nptInit, pDrawable->x, pDrawable->y, dstXoff, dstYoff, and, xor); diff --git a/nx-X11/programs/Xserver/fb/fbpseudocolor.c b/nx-X11/programs/Xserver/fb/fbpseudocolor.c index 469f3ea08..51f21ed21 100644 --- a/nx-X11/programs/Xserver/fb/fbpseudocolor.c +++ b/nx-X11/programs/Xserver/fb/fbpseudocolor.c @@ -166,10 +166,10 @@ int xxGeneration; # define PRINT_RECTS(rec) {\ int i;\ BoxPtr box;\ - ErrorF("RECTS: %i\n",REGION_NUM_RECTS(&rec));\ - if (REGION_NUM_RECTS(&rec) > 1) { \ - for (i = 0; i < REGION_NUM_RECTS(&rec); i++ ) {\ - box = REGION_BOX(&rec,i);\ + ErrorF("RECTS: %i\n",RegionNumRects(&rec));\ + if (RegionNumRects(&rec) > 1) { \ + for (i = 0; i < RegionNumRects(&rec); i++ ) {\ + box = RegionBox(&rec,i);\ ErrorF("x1: %hi x2: %hi y1: %hi y2: %hi\n", \ box->x1,box->x2,box->y1,box->y2);\ }\ @@ -308,8 +308,8 @@ xxCreateScreenResources(ScreenPtr pScreen) box.y1 = 0; box.x2 = pScreen->width; box.y2 = pScreen->height; - REGION_NULL(pScreen, &pScrPriv->region); - REGION_INIT(pScreen, &pScrPriv->bRegion, &box, 0); + RegionNull(&pScrPriv->region); + RegionInit(&pScrPriv->bRegion, &box, 0); return TRUE; } @@ -323,7 +323,7 @@ xxCloseScreen (int iScreen, ScreenPtr pScreen) (*pScreen->DestroyPixmap)(pScrPriv->pPixmap); /* We don't need to free the baseColormap as FreeClientResourcess will have taken care of it. */ - REGION_UNINIT (pScreen, &pScrPriv->region); + RegionUninit(&pScrPriv->region); unwrap (pScrPriv,pScreen, CloseScreen); ret = pScreen->CloseScreen(iScreen,pScreen); @@ -678,7 +678,7 @@ xxCreateWindow(WindowPtr pWin) pWin->devPrivates[fbWinPrivateIndex].ptr = (void *) pScrPriv->pPixmap; PRINT_RECTS(pScrPriv->region); if (!pWin->parent) { - REGION_EMPTY (pWin->drawable.pScreen, &pScrPriv->region); + RegionEmpty(&pScrPriv->region); } PRINT_RECTS(pScrPriv->region); @@ -694,11 +694,11 @@ xxWalkChildren(WindowPtr pWin, RegionPtr pReg, PixmapPtr pPixmap) do { if (fbGetWindowPixmap(pCurWin) == pPixmap) { DBG("WalkWindow Add\n"); - REGION_UNION(pWin->drawable.pScreen,pReg,pReg, + RegionUnion(pReg,pReg, &pCurWin->borderClip); } else { DBG("WalkWindow Sub\n"); - REGION_SUBTRACT(pWin->drawable.pScreen,pReg,pReg, + RegionSubtract(pReg,pReg, &pCurWin->borderClip); } if (pCurWin->lastChild) @@ -713,7 +713,7 @@ xxPickMyWindows(WindowPtr pWin, RegionPtr pRgn) xxScrPriv(pScreen); if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) { - REGION_UNION(pWin->drawable.pScreen,pRgn,pRgn,&pWin->borderClip); + RegionUnion(pRgn,pRgn,&pWin->borderClip); } if (pWin->lastChild) xxWalkChildren(pWin->lastChild,pRgn,pScrPriv->pPixmap); @@ -736,11 +736,11 @@ xxCopyWindow(WindowPtr pWin, dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; - REGION_NULL(pScreen, &rgn_new); - REGION_UNION(pScreen, &rgn_new,&rgn_new,prgnSrc); - REGION_TRANSLATE(pScreen,&rgn_new,-dx,-dy); + RegionNull(&rgn_new); + RegionUnion(&rgn_new,&rgn_new,prgnSrc); + RegionTranslate(&rgn_new,-dx,-dy); - REGION_NULL(pScreen, &rgn); + RegionNull(&rgn); xxPickMyWindows(pWin,&rgn); unwrap (pScrPriv, pScreen, CopyWindow); @@ -749,19 +749,19 @@ xxCopyWindow(WindowPtr pWin, pWin->devPrivates[fbWinPrivateIndex].ptr = pPixmap; wrap(pScrPriv, pScreen, CopyWindow, xxCopyWindow); - REGION_INTERSECT(pScreen,&rgn,&rgn,&rgn_new); - if (REGION_NOTEMPTY (pScreen,&rgn)) { + RegionIntersect(&rgn,&rgn,&rgn_new); + if (RegionNotEmpty(&rgn)) { fbCopyRegion(&pScrPriv->pPixmap->drawable,&pScrPriv->pPixmap->drawable, 0,&rgn,dx,dy,fbCopyWindowProc,0,(void*)0); - REGION_TRANSLATE(pScreen,&rgn,dx,dy); - REGION_INTERSECT(pScreen,&rgn_new,&pScrPriv->region,&rgn); - REGION_SUBTRACT(pScreen,&pScrPriv->region,&pScrPriv->region,&rgn); - REGION_TRANSLATE(pScreen,&rgn_new,-dx,-dy); - REGION_UNION(pScreen,&pScrPriv->region,&pScrPriv->region,&rgn_new); + RegionTranslate(&rgn,dx,dy); + RegionIntersect(&rgn_new,&pScrPriv->region,&rgn); + RegionSubtract(&pScrPriv->region,&pScrPriv->region,&rgn); + RegionTranslate(&rgn_new,-dx,-dy); + RegionUnion(&pScrPriv->region,&pScrPriv->region,&rgn_new); } #if 1 - REGION_UNINIT(pScreen,&rgn_new); - REGION_UNINIT(pScreen,&rgn); + RegionUninit(&rgn_new); + RegionUninit(&rgn); #endif } @@ -775,14 +775,14 @@ xxWindowExposures (WindowPtr pWin, if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) { DBG("WindowExposures\n"); PRINT_RECTS(pScrPriv->region); - REGION_UNION(pWin->drawable.pScreen,&pScrPriv->region, + RegionUnion(&pScrPriv->region, &pScrPriv->region, prgn); PRINT_RECTS(pScrPriv->region); } else { DBG("WindowExposures NonPseudo\n"); PRINT_RECTS(pScrPriv->region); - REGION_SUBTRACT(pWin->drawable.pScreen,&pScrPriv->region, + RegionSubtract(&pScrPriv->region, &pScrPriv->region, prgn); PRINT_RECTS(pScrPriv->region); @@ -800,23 +800,23 @@ xxPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) DBG("xxPaintWindow\n"); - REGION_NULL (pWin->drawable.pScreen, &rgni); + RegionNull(&rgni); #if 0 - REGION_UNION (pWin->drawable.pScreen, &rgni, &rgni, &pWin->borderClip); - REGION_INTERSECT(pWin->drawable.pScreen, &rgni, &rgni, pRegion); + RegionUnion(&rgni, &rgni, &pWin->borderClip); + RegionIntersect(&rgni, &rgni, pRegion); #else - REGION_UNION (pWin->drawable.pScreen, &rgni, &rgni, pRegion); + RegionUnion(&rgni, &rgni, pRegion); #endif switch (what) { case PW_BORDER: - REGION_SUBTRACT (pWin->drawable.pScreen, &rgni, &rgni, &pWin->winSize); + RegionSubtract(&rgni, &rgni, &pWin->winSize); if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) { DBG("PaintWindowBorder\n"); - REGION_UNION (pWin->drawable.pScreen, &pScrPriv->region, + RegionUnion(&pScrPriv->region, &pScrPriv->region, &rgni); } else { DBG("PaintWindowBorder NoOverlay\n"); - REGION_SUBTRACT (pWin->drawable.pScreen, &pScrPriv->region, + RegionSubtract(&pScrPriv->region, &pScrPriv->region, &rgni); } unwrap (pScrPriv, pWin->drawable.pScreen, PaintWindowBorder); @@ -829,15 +829,15 @@ xxPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) case None: break; default: - REGION_INTERSECT (pWin->drawable.pScreen, &rgni, + RegionIntersect(&rgni, &rgni,&pWin->winSize); if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) { DBG("PaintWindowBackground\n"); - REGION_UNION (pWin->drawable.pScreen, &pScrPriv->region, + RegionUnion(&pScrPriv->region, &pScrPriv->region, &rgni); } else { DBG("PaintWindowBackground NoOverlay\n"); - REGION_SUBTRACT (pWin->drawable.pScreen, &pScrPriv->region, + RegionSubtract(&pScrPriv->region, &pScrPriv->region, &rgni); } break; @@ -852,7 +852,7 @@ xxPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) PRINT_RECTS(rgni); PRINT_RECTS(pScrPriv->region); #if 1 - REGION_UNINIT(pWin->drawable.pScreen,&rgni); + RegionUninit(&rgni); #endif } @@ -862,8 +862,8 @@ xxCopyPseudocolorRegion(ScreenPtr pScreen, RegionPtr pReg, { xxScrPriv(pScreen); CARD32 mask = (1 << pScrPriv->myDepth) - 1; - int num = REGION_NUM_RECTS(pReg); - BoxPtr pbox = REGION_RECTS(pReg); + int num = RegionNumRects(pReg); + BoxPtr pbox = RegionRects(pReg); int width, height; CARD8 *src; CARD16 *dst, *dst_base; @@ -905,8 +905,8 @@ xxUpdateCmapPseudocolorRegion(ScreenPtr pScreen, RegionPtr pReg, { xxScrPriv(pScreen); CARD32 mask = (1 << pScrPriv->myDepth) - 1; - int num = REGION_NUM_RECTS(pReg); - BoxPtr pbox = REGION_RECTS(pReg); + int num = RegionNumRects(pReg); + BoxPtr pbox = RegionRects(pReg); int width, height; CARD8 *src; CARD16 *dst, *dst_base; @@ -950,14 +950,14 @@ xxUpdateCmapPseudocolorRegion(ScreenPtr pScreen, RegionPtr pReg, static void xxGetWindowRegion(WindowPtr pWin,RegionPtr winreg) { - REGION_NULL(pWin->drawable.pScreen,winreg); + RegionNull(winreg); /* get visible part of the border ...Argh */ - REGION_SUBTRACT(pWin->drawable.pScreen,winreg,&pWin->borderSize, + RegionSubtract(winreg,&pWin->borderSize, &pWin->winSize); - REGION_INTERSECT(pWin->drawable.pScreen,winreg,winreg, + RegionIntersect(winreg,winreg, &pWin->borderClip); /* add window interior excluding children */ - REGION_UNION(pWin->drawable.pScreen,winreg,winreg, + RegionUnion(winreg,winreg, &pWin->clipList); } @@ -985,18 +985,18 @@ xxUpdateRegion(WindowPtr pWin, void * unused) if (!pCmapPriv->dirty) goto CONTINUE; - REGION_NULL (pScreen, &rgni); + RegionNull(&rgni); /* This will be taken care of when damaged regions are updated */ - REGION_SUBTRACT(pScreen, &rgni, &winreg, &pScrPriv->region); - if (REGION_NOTEMPTY (pScreen,&rgni)) + RegionSubtract(&rgni, &winreg, &pScrPriv->region); + if (RegionNotEmpty(&rgni)) xxUpdateCmapPseudocolorRegion(pScreen,&rgni, pCmapPriv); } CONTINUE: - REGION_NULL (pScreen, &rgni); - REGION_INTERSECT (pScreen, &rgni, &winreg, &pScrPriv->region); + RegionNull(&rgni); + RegionIntersect(&rgni, &winreg, &pScrPriv->region); - if (REGION_NOTEMPTY (pScreen,&rgni)) { + if (RegionNotEmpty(&rgni)) { if (pmap == (void *) -1) { pmap = (ColormapPtr)LookupIDByType(wColormap(pWin),RT_COLORMAP); @@ -1008,12 +1008,12 @@ xxUpdateRegion(WindowPtr pWin, void * unused) if (pCmapPriv != (void *)-1) xxCopyPseudocolorRegion(pScreen,&rgni, pCmapPriv); - REGION_SUBTRACT(pScreen, &pScrPriv->region, &pScrPriv->region, + RegionSubtract(&pScrPriv->region, &pScrPriv->region, &rgni); } #if 1 - REGION_UNINIT(pScreen,&rgni); - REGION_UNINIT(pScreen,&winreg); + RegionUninit(&rgni); + RegionUninit(&winreg); #endif } return WT_WALKCHILDREN; @@ -1033,7 +1033,7 @@ xxUpdateFb(ScreenPtr pScreen) WalkTree(pScreen,xxUpdateRegion,NULL); #if 0 - if (REGION_NOTEMPTY (pScreen,&pScrPriv->region)) { + if (RegionNotEmpty(&pScrPriv->region)) { ColormapPtr pmap = (void *) -1; xxCmapPrivPtr pCmapPriv; @@ -1042,7 +1042,7 @@ xxUpdateFb(ScreenPtr pScreen) pCmapPriv = xxGetCmapPriv(pmap); if (pCmapPriv != (void *)-1) xxCopyPseudocolorRegion(pScreen,&pScrPriv->region, pCmapPriv); - REGION_SUBTRACT(pScreen, &pScrPriv->region, &pScrPriv->region, + RegionSubtract(&pScrPriv->region, &pScrPriv->region, &pScrPriv->region); } #endif @@ -1071,7 +1071,7 @@ xxBlockHandler (void * data, ScreenPtr pScreen = (ScreenPtr) data; xxScrPriv(pScreen); - if (REGION_NOTEMPTY (pScreen,&pScrPriv->region) || pScrPriv->colormapDirty) + if (RegionNotEmpty(&pScrPriv->region) || pScrPriv->colormapDirty) xxUpdateFb (pScreen); } @@ -1241,15 +1241,15 @@ GCOps xxGCOps = { if (BOX_NOT_EMPTY(box)) { \ RegionRec region; \ ScreenPtr pScreen = pGC->pScreen;\ - REGION_INIT (pScreen, ®ion, &box, 1); \ - REGION_INTERSECT(pScreen,®ion,®ion,\ + RegionInit(®ion, &box, 1); \ + RegionIntersect(®ion,®ion,\ (pGC)->pCompositeClip);\ - if (REGION_NOTEMPTY(pScreen,®ion)) { \ + if (RegionNotEmpty(®ion)) { \ xxScrPriv(pScreen);\ PRINT_RECTS(pScrPriv->region);\ - REGION_UNION(pScreen,&pScrPriv->region,&pScrPriv->region,®ion);\ + RegionUnion(&pScrPriv->region,&pScrPriv->region,®ion);\ PRINT_RECTS(pScrPriv->region);\ - REGION_UNINIT(pScreen,®ion);\ + RegionUninit(®ion);\ }\ }\ } @@ -2234,11 +2234,11 @@ xxPushPixels( RegionRec region; \ xxScrPriv(pScreen);\ ScreenPtr pScreen = pScreen;\ - REGION_INIT (pScreen, ®ion, &box, 1); \ + RegionInit(®ion, &box, 1); \ PRINT_RECTS(pScrPriv->region);\ - REGION_UNION(pScreen,&pScrPriv->region,&pScrPriv->region,®ion);\ + RegionUnion(&pScrPriv->region,&pScrPriv->region,®ion);\ PRINT_RECTS(pScrPriv->region);\ - REGION_UNINIT(pScreen,®ion);\ + RegionUninit(®ion);\ }\ } diff --git a/nx-X11/programs/Xserver/fb/fbpush.c b/nx-X11/programs/Xserver/fb/fbpush.c index 8f1336963..78d2e450d 100644 --- a/nx-X11/programs/Xserver/fb/fbpush.c +++ b/nx-X11/programs/Xserver/fb/fbpush.c @@ -192,8 +192,8 @@ fbPushImage (DrawablePtr pDrawable, BoxPtr pbox; int x1, y1, x2, y2; - for (nbox = REGION_NUM_RECTS (pClip), - pbox = REGION_RECTS(pClip); + for (nbox = RegionNumRects (pClip), + pbox = RegionRects(pClip); nbox--; pbox++) { diff --git a/nx-X11/programs/Xserver/fb/fbseg.c b/nx-X11/programs/Xserver/fb/fbseg.c index 18a996e0c..2947992a6 100644 --- a/nx-X11/programs/Xserver/fb/fbseg.c +++ b/nx-X11/programs/Xserver/fb/fbseg.c @@ -615,8 +615,8 @@ fbSegment (DrawablePtr pDrawable, unsigned int oc1; /* outcode of point 1 */ unsigned int oc2; /* outcode of point 2 */ - nBox = REGION_NUM_RECTS (pClip); - pBox = REGION_RECTS (pClip); + nBox = RegionNumRects (pClip); + pBox = RegionRects (pClip); bres = fbSelectBres (pDrawable, pGC); diff --git a/nx-X11/programs/Xserver/fb/fbsetsp.c b/nx-X11/programs/Xserver/fb/fbsetsp.c index eefc2da82..c7074f036 100644 --- a/nx-X11/programs/Xserver/fb/fbsetsp.c +++ b/nx-X11/programs/Xserver/fb/fbsetsp.c @@ -63,8 +63,8 @@ fbSetSpans (DrawablePtr pDrawable, xoff = (int) (((long) src) & (FB_MASK >> 3)); s = (FbBits *) (src - xoff); xoff <<= 3; - n = REGION_NUM_RECTS(pClip); - pbox = REGION_RECTS (pClip); + n = RegionNumRects(pClip); + pbox = RegionRects (pClip); while (n--) { if (pbox->y1 > ppt->y) diff --git a/nx-X11/programs/Xserver/fb/fbwindow.c b/nx-X11/programs/Xserver/fb/fbwindow.c index 1269902b9..5ce7ba729 100644 --- a/nx-X11/programs/Xserver/fb/fbwindow.c +++ b/nx-X11/programs/Xserver/fb/fbwindow.c @@ -132,15 +132,15 @@ fbCopyWindow(WindowPtr pWin, dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; - REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); + RegionTranslate(prgnSrc, -dx, -dy); - REGION_NULL (pWin->drawable.pScreen, &rgnDst); + RegionNull(&rgnDst); - REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc); + RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); #ifdef COMPOSITE if (pPixmap->screen_x || pPixmap->screen_y) - REGION_TRANSLATE (pWin->drawable.pScreen, &rgnDst, + RegionTranslate(&rgnDst, -pPixmap->screen_x, -pPixmap->screen_y); #endif @@ -148,7 +148,7 @@ fbCopyWindow(WindowPtr pWin, 0, &rgnDst, dx, dy, fbCopyWindowProc, 0, 0); - REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); + RegionUninit(&rgnDst); fbValidateDrawable (&pWin->drawable); } @@ -215,8 +215,8 @@ fbFillRegionSolid (DrawablePtr pDrawable, FbStride dstStride; int dstBpp; int dstXoff, dstYoff; - int n = REGION_NUM_RECTS(pRegion); - BoxPtr pbox = REGION_RECTS(pRegion); + int n = RegionNumRects(pRegion); + BoxPtr pbox = RegionRects(pRegion); fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); @@ -253,8 +253,8 @@ fbFillRegionTiled (DrawablePtr pDrawable, int tileBpp; int tileXoff, tileYoff; /* XXX assumed to be zero */ int tileWidth, tileHeight; - int n = REGION_NUM_RECTS(pRegion); - BoxPtr pbox = REGION_RECTS(pRegion); + int n = RegionNumRects(pRegion); + BoxPtr pbox = RegionRects(pRegion); int xRot = pDrawable->x; int yRot = pDrawable->y; -- cgit v1.2.3 From d9e7f6ae42b30e32619e1d0979598c2ba2288a3e Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 18 Mar 2016 05:13:43 +0100 Subject: pixman-devel: Build against shared library pkg-config(pixman-1). --- debian/control | 1 + nx-X11/programs/Xserver/GL/glx/Imakefile | 3 ++- nx-X11/programs/Xserver/GL/mesa/X/Imakefile | 3 ++- nx-X11/programs/Xserver/Imakefile | 15 +++++++-------- nx-X11/programs/Xserver/XTrap/Imakefile | 2 +- nx-X11/programs/Xserver/Xext/Imakefile | 3 ++- nx-X11/programs/Xserver/Xi/Imakefile | 2 +- nx-X11/programs/Xserver/composite/Imakefile | 3 ++- nx-X11/programs/Xserver/damageext/Imakefile | 3 ++- nx-X11/programs/Xserver/dbe/Imakefile | 2 +- nx-X11/programs/Xserver/dix/Imakefile | 3 ++- nx-X11/programs/Xserver/fb/Imakefile | 3 ++- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 5 ++++- nx-X11/programs/Xserver/include/scrnintstr.h | 4 ++++ nx-X11/programs/Xserver/mi/Imakefile | 3 ++- nx-X11/programs/Xserver/miext/cw/Imakefile | 3 ++- nx-X11/programs/Xserver/miext/damage/Imakefile | 3 ++- nx-X11/programs/Xserver/os/Imakefile | 3 ++- nx-X11/programs/Xserver/randr/Imakefile | 4 +++- nx-X11/programs/Xserver/record/Imakefile | 2 +- nx-X11/programs/Xserver/render/Imakefile | 3 ++- nx-X11/programs/Xserver/xfixes/Imakefile | 3 ++- nx-X11/programs/Xserver/xkb/Imakefile | 3 ++- nx-libs.spec | 3 +++ nxcompext/configure.in | 2 ++ 25 files changed, 56 insertions(+), 28 deletions(-) (limited to 'nx-X11/programs/Xserver/fb') diff --git a/debian/control b/debian/control index 83aee8e58..3e1f45e5d 100644 --- a/debian/control +++ b/debian/control @@ -28,6 +28,7 @@ Build-Depends: pkg-config, x11proto-core-dev, expat, + libpixman-1-dev, Standards-Version: 3.9.6 Homepage: http://code.x2go.org/gitweb?p=nx-libs.git;a=summary Vcs-Git: git://code.x2go.org/nx-libs.git diff --git a/nx-X11/programs/Xserver/GL/glx/Imakefile b/nx-X11/programs/Xserver/GL/glx/Imakefile index 506ef5539..bf2d760a0 100644 --- a/nx-X11/programs/Xserver/GL/glx/Imakefile +++ b/nx-X11/programs/Xserver/GL/glx/Imakefile @@ -43,7 +43,8 @@ LinkSourceFile(indirect_size.h, $(MESASRCDIR)/src/glx/x11) INCLUDES = -I$(SERVERSRC)/GL/glx -I$(SERVERSRC)/GL/include -I$(SERVERSRC)/include -I$(INCLUDESRC) -I$(MESASRCDIR)/include \ -I$(XINCLUDESRC) -I$(SERVERSRC)/mi \ -I$(EXTINCSRC) -I$(LIBSRC)/GL/include \ - -I$(XF86SRC) + -I$(XF86SRC) \ + `pkg-config --cflags-only-I pixman-1` #if defined(DarwinArchitecture) && ((OSMajorVersion == 6 && OSMinorVersion < 3) || OSMajorVersion < 6) NO_EXT_DEFS = -DMISSING_GL_EXTS diff --git a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile index ee728b556..9fb00ef73 100644 --- a/nx-X11/programs/Xserver/GL/mesa/X/Imakefile +++ b/nx-X11/programs/Xserver/GL/mesa/X/Imakefile @@ -39,7 +39,8 @@ LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11) -I$(SERVERSRC)/include -I$(SERVERSRC)/GL/include \ -I$(SERVERSRC)/GL/glx \ -I$(XF86OSSRC) \ - -I$(DRMSRCDIR)/shared-core + -I$(DRMSRCDIR)/shared-core \ + `pkg-config --cflags-only-I pixman-1` DEFINES = $(GLX_DEFINES) $(GLXSRV_DEFINES) -DNXAGENT_SERVER /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/ diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index c7e1af550..a2a3f7ced 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -384,10 +384,12 @@ NXAGENTOBJS = hw/nxagent/miinitext.o \ dix/main.o #endif -XPMLIB = -lXpm +XPMLIB = -lXpm +XMLLIB = `pkg-config --libs libxml-2.0` +PIXMANLIB = `pkg-config --libs pixman-1` NXAGENT = hw/nxagent/LibraryTargetName(nxagent) NXAGENTLIBS = PreFbLibs $(NXAGENT) FbPostFbLibs $(NXAGENT) $(MI) -NXAGENTSYSLIBS = $(LDPRELIBS) $(XLIB) $(SYSLIBS) $(XPMLIB) +NXAGENTSYSLIBS = $(LDPRELIBS) $(XLIB) $(SYSLIBS) $(XPMLIB) $(XMLLIB) $(PIXMANLIB) #if HasParallelMake MakeMutex($(NXAGENTDIRS) $(NXAGENTOBJS) $(NXAGENTLIBS) $(NXAGENTSYSLIBS)) #endif @@ -403,18 +405,15 @@ $(NXAGENTOBJS) $(NXAGENTLIBS) $(NXAGENTSYSLIBS):: $(NXAGENTDIRS) #if defined(SunArchitecture) NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ -lXcomp -lXcompext -lXcompshad -lrt -L/usr/sfw/lib -lXrender -lXfixes -lXfont \ - -L../../../nx-X11/exports/lib -lXtst -lXrandr -lXcomposite -lXdmcp \ -`pkg-config --libs libxml-2.0` + -L../../../nx-X11/exports/lib -lXtst -lXrandr -lXcomposite -lXdmcp #elif defined(cygwinArchitecture) NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext \ -lXcomp -lXcompext -lXrender -lX11 -lNX_Xext -lXcomposite -lXfixes -lXfont \ - -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lXtst -lXdmcp \ -`pkg-config --libs libxml-2.0` + -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lXtst -lXdmcp #else NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \ -lXcomp -lXcompext -lXcompshad -lXrender -lNX_X11 -lNX_Xext -lXfixes -lXfont \ - -L../../../nx-X11/exports/lib -lXtst -lXrandr -lXcomposite -lXinerama -lXdmcp \ -`pkg-config --libs libxml-2.0` + -L../../../nx-X11/exports/lib -lXtst -lXrandr -lXcomposite -lXinerama -lXdmcp #endif #endif diff --git a/nx-X11/programs/Xserver/XTrap/Imakefile b/nx-X11/programs/Xserver/XTrap/Imakefile index 2362634c7..c61712f1d 100644 --- a/nx-X11/programs/Xserver/XTrap/Imakefile +++ b/nx-X11/programs/Xserver/XTrap/Imakefile @@ -11,7 +11,7 @@ XCOMM $XFree86: xc/programs/Xserver/XTrap/Imakefile,v 1.1 2001/11/02 23:29:29 da #endif SRCS = xtrapddmi.c xtrapdi.c xtrapdiswp.c xtrapditbl.c OBJS = xtrapddmi.o xtrapdi.o xtrapdiswp.o xtrapditbl.o - INCLUDES = -I../include -I$(EXTINCSRC) -I$(XINCLUDESRC) -I$(SERVERSRC)/Xext + INCLUDES = -I../include -I$(EXTINCSRC) -I$(XINCLUDESRC) -I$(SERVERSRC)/Xext `pkg-config --cflags-only-I pixman-1` NormalLibraryTarget(xtrap,$(OBJS)) LintLibraryTarget(xtrap,$(SRCS)) diff --git a/nx-X11/programs/Xserver/Xext/Imakefile b/nx-X11/programs/Xserver/Xext/Imakefile index eb4588e37..199e59f1d 100644 --- a/nx-X11/programs/Xserver/Xext/Imakefile +++ b/nx-X11/programs/Xserver/Xext/Imakefile @@ -161,7 +161,8 @@ XF86INCLUDES = -I$(XF86COMSRC) #endif INCLUDES = -I. -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \ $(PNRXINCLUDES) $(XF86INCLUDES) \ - $(FONTCACHEINCLUDES) $(DMXINCLUDES) + $(FONTCACHEINCLUDES) $(DMXINCLUDES) \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln #if defined(NXAgentServer) && NXAgentServer diff --git a/nx-X11/programs/Xserver/Xi/Imakefile b/nx-X11/programs/Xserver/Xi/Imakefile index 27e1f5df0..29190b711 100644 --- a/nx-X11/programs/Xserver/Xi/Imakefile +++ b/nx-X11/programs/Xserver/Xi/Imakefile @@ -83,7 +83,7 @@ XCOMM $XFree86: xc/programs/Xserver/Xi/Imakefile,v 3.2 1999/04/17 09:08:22 dawes ungrdev.o \ ungrdevb.o \ ungrdevk.o - INCLUDES = -I../include -I$(EXTINCSRC) -I$(XINCLUDESRC) + INCLUDES = -I../include -I$(EXTINCSRC) -I$(XINCLUDESRC) `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln NormalLibraryTarget(xinput,$(OBJS)) diff --git a/nx-X11/programs/Xserver/composite/Imakefile b/nx-X11/programs/Xserver/composite/Imakefile index c45aa7f6a..f121e0bbe 100644 --- a/nx-X11/programs/Xserver/composite/Imakefile +++ b/nx-X11/programs/Xserver/composite/Imakefile @@ -6,7 +6,8 @@ INCLUDES = -I../include -I../mi -I../Xext -I../render -I../xfixes \ -I../damageext -I../miext/damage -I$(EXTINCSRC) \ - -I$(XINCLUDESRC) + -I$(XINCLUDESRC) \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln diff --git a/nx-X11/programs/Xserver/damageext/Imakefile b/nx-X11/programs/Xserver/damageext/Imakefile index f7ce4573b..24dcee85c 100644 --- a/nx-X11/programs/Xserver/damageext/Imakefile +++ b/nx-X11/programs/Xserver/damageext/Imakefile @@ -5,7 +5,8 @@ OBJS = damageext.o INCLUDES = -I../include -I../Xext -I../render -I../xfixes -I../miext/damage \ - -I$(EXTINCSRC) -I$(XINCLUDESRC) + -I$(EXTINCSRC) -I$(XINCLUDESRC) \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln diff --git a/nx-X11/programs/Xserver/dbe/Imakefile b/nx-X11/programs/Xserver/dbe/Imakefile index 9d9c3fd67..5e5eac4a1 100644 --- a/nx-X11/programs/Xserver/dbe/Imakefile +++ b/nx-X11/programs/Xserver/dbe/Imakefile @@ -17,7 +17,7 @@ XCOMM $XFree86: xc/programs/Xserver/dbe/Imakefile,v 3.10 2001/01/17 22:36:41 daw SRCS = dbe.c midbe.c OBJS = dbe.o midbe.o - INCLUDES = -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(EXTINCSRC) $(EXTRAINCLUDES) + INCLUDES = -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(EXTINCSRC) $(EXTRAINCLUDES) `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln NormalLibraryObjectRule() diff --git a/nx-X11/programs/Xserver/dix/Imakefile b/nx-X11/programs/Xserver/dix/Imakefile index 47e617718..22b21eb95 100644 --- a/nx-X11/programs/Xserver/dix/Imakefile +++ b/nx-X11/programs/Xserver/dix/Imakefile @@ -25,7 +25,8 @@ OBJS = atom.o colormap.o cursor.o devices.o dispatch.o dixutils.o events.o \ tables.o window.o initatoms.o dixfonts.o privates.o pixmap.o $(FFS_OBJ) INCLUDES = -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \ - -I$(SERVERSRC)/Xext -I$(SERVERSRC)/lbx + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/lbx \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../os/llib-los.ln /* diff --git a/nx-X11/programs/Xserver/fb/Imakefile b/nx-X11/programs/Xserver/fb/Imakefile index 489d6a201..662a70717 100644 --- a/nx-X11/programs/Xserver/fb/Imakefile +++ b/nx-X11/programs/Xserver/fb/Imakefile @@ -123,7 +123,8 @@ OBJS = $(XFMODOBJ) \ INCLUDES = -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ -I$(XINCLUDESRC) \ -I$(XF86SRC)/common $(EXTRAINCLUDES) \ - -I$(SERVERSRC)/render -I$(EXTINCSRC) -I$(SERVERSRC)/Xext + -I$(SERVERSRC)/render -I$(EXTINCSRC) -I$(SERVERSRC)/Xext \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = $(SERVERSRC)/dix/llib-ldix.ln $(SERVERSRC)/os/llib-los.ln \ $(SERVERSRC)/mi/llib-lmi.ln diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index 160d01e60..b0aff4b07 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -141,7 +141,8 @@ INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../ -I../../GL/glx -I../../GL/include -I../../../../lib/GL/include -I../../Xext \ -I$(EXTINCSRC) -I$(XINCLUDESRC) \ $(VFBINCLUDES) \ - `pkg-config --cflags-only-I libxml-2.0` + `pkg-config --cflags-only-I libxml-2.0` \ + `pkg-config --cflags-only-I pixman-1` #ifdef SunArchitecture INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../../nxcompshad \ -I../../../../extras/Mesa/include \ @@ -153,6 +154,7 @@ INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../ -I$(EXTINCSRC) -I$(XINCLUDESRC) \ $(VFBINCLUDES) \ `pkg-config --cflags-only-I libxml-2.0` + `pkg-config --cflags-only-I pixman-1` #else #ifdef cygwinArchitecture INCLUDES = -I. -I$(XBUILDINCDIR) \ @@ -164,6 +166,7 @@ INCLUDES = -I. -I$(XBUILDINCDIR) \ -I$(EXTINCSRC) -I$(XINCLUDESRC) \ $(VFBINCLUDES) \ `pkg-config --cflags-only-I libxml-2.0` + `pkg-config --cflags-only-I pixman-1` #endif #endif diff --git a/nx-X11/programs/Xserver/include/scrnintstr.h b/nx-X11/programs/Xserver/include/scrnintstr.h index 0539ca516..2597d6b67 100644 --- a/nx-X11/programs/Xserver/include/scrnintstr.h +++ b/nx-X11/programs/Xserver/include/scrnintstr.h @@ -709,6 +709,10 @@ typedef struct _Screen { } ScreenRec; +static inline RegionPtr BitmapToRegion(ScreenPtr _pScreen, PixmapPtr pPix) { + return (*(_pScreen)->BitmapToRegion)(pPix); /* no mi version?! */ +} + typedef struct _ScreenInfo { int imageByteOrder; int bitmapScanlineUnit; diff --git a/nx-X11/programs/Xserver/mi/Imakefile b/nx-X11/programs/Xserver/mi/Imakefile index e62fb0005..290f85790 100644 --- a/nx-X11/programs/Xserver/mi/Imakefile +++ b/nx-X11/programs/Xserver/mi/Imakefile @@ -90,7 +90,8 @@ EXT_DEFINES = ExtensionDefines -UXINPUT -UXF86VIDMODE -UXFreeXDGA -UXF86MISC \ INCLUDES = -I. -I../include -I../render \ -I../xfixes -I../damageext -I../miext/damage \ - -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext + -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln DEFINES = $(FFS_DEFINES) diff --git a/nx-X11/programs/Xserver/miext/cw/Imakefile b/nx-X11/programs/Xserver/miext/cw/Imakefile index 39106ac13..795ed1987 100755 --- a/nx-X11/programs/Xserver/miext/cw/Imakefile +++ b/nx-X11/programs/Xserver/miext/cw/Imakefile @@ -7,7 +7,8 @@ OBJS = cw.o cw_ops.o cw_render.o INCLUDES = -I../../mi -I../../fb -I../../render -I../../composite \ -I../../include -I$(XINCLUDESRC) $(EXTRAINCLUDES) \ - -I$(EXTINCSRC) + -I$(EXTINCSRC) \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../../dix/llib-ldix.ln ../../os/llib-los.ln \ ../../mi/llib-lmi.ln diff --git a/nx-X11/programs/Xserver/miext/damage/Imakefile b/nx-X11/programs/Xserver/miext/damage/Imakefile index 7fa745b65..a28786203 100755 --- a/nx-X11/programs/Xserver/miext/damage/Imakefile +++ b/nx-X11/programs/Xserver/miext/damage/Imakefile @@ -11,7 +11,8 @@ OBJS = damage.o INCLUDES = -I. -I../shadow -I../../mi -I../../fb -I../../include -I$(XINCLUDESRC) \ -I$(XF86SRC)/common $(EXTRAINCLUDES) \ - -I../../render -I../cw -I$(EXTINCSRC) + -I../../render -I../cw -I$(EXTINCSRC) \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../../dix/llib-ldix.ln ../../os/llib-los.ln \ ../../mi/llib-lmi.ln diff --git a/nx-X11/programs/Xserver/os/Imakefile b/nx-X11/programs/Xserver/os/Imakefile index 18bb9804d..5245b7841 100644 --- a/nx-X11/programs/Xserver/os/Imakefile +++ b/nx-X11/programs/Xserver/os/Imakefile @@ -158,7 +158,8 @@ BOOTSTRAPCFLAGS = $(RANDOM_DEFINES) $(BUGMSG) $(XTRANS_FAILDEFINES) $(NX_DEFINES) INCLUDES = -I. -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ - -I$(TOP)/lib/Xau Krb5Includes $(NX_INCLUDES) + -I$(TOP)/lib/Xau Krb5Includes $(NX_INCLUDES) \ + `pkg-config --cflags-only-I pixman-1` DEPEND_DEFINES = $(DBM_DEFINES) $(XDMCP_DEFINES) $(EXT_DEFINES) \ $(TRANS_INCLUDES) $(CONNECTION_FLAGS) $(GETPEER_DEFINES) \ DependDefines diff --git a/nx-X11/programs/Xserver/randr/Imakefile b/nx-X11/programs/Xserver/randr/Imakefile index 19f8143e4..7f920aece 100644 --- a/nx-X11/programs/Xserver/randr/Imakefile +++ b/nx-X11/programs/Xserver/randr/Imakefile @@ -23,7 +23,9 @@ XCOMM $XFree86: xc/programs/Xserver/randr/Imakefile,v 1.1 2001/05/23 03:29:44 ke INCLUDES = -I../include -I../mi \ -I../fb -I../hw/kdrive -I$(EXTINCSRC) -I$(XINCLUDESRC) \ - -I../render + -I../render \ + `pkg-config --cflags-only-I pixman-1` + LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln DEFINES = -DNXAGENT_SERVER diff --git a/nx-X11/programs/Xserver/record/Imakefile b/nx-X11/programs/Xserver/record/Imakefile index 4d4bf6a73..c24cbb0d9 100644 --- a/nx-X11/programs/Xserver/record/Imakefile +++ b/nx-X11/programs/Xserver/record/Imakefile @@ -16,7 +16,7 @@ XCOMM $XFree86: xc/programs/Xserver/record/Imakefile,v 1.12 2001/11/02 23:29:34 #endif SRCS = record.c set.c OBJS = record.o set.o - INCLUDES = -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext + INCLUDES = -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln DEFINES = -DNDEBUG diff --git a/nx-X11/programs/Xserver/render/Imakefile b/nx-X11/programs/Xserver/render/Imakefile index 1331b1fb4..23f9476ea 100644 --- a/nx-X11/programs/Xserver/render/Imakefile +++ b/nx-X11/programs/Xserver/render/Imakefile @@ -29,7 +29,8 @@ XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15 INCLUDES = -I. -I../include -I../mi \ -I../fb -I../hw/kdrive -I$(EXTINCSRC) -I$(XINCLUDESRC) \ - -I../Xext + -I../Xext \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln NormalLibraryTarget(render,$(OBJS)) diff --git a/nx-X11/programs/Xserver/xfixes/Imakefile b/nx-X11/programs/Xserver/xfixes/Imakefile index e467ed149..84f7c6f16 100755 --- a/nx-X11/programs/Xserver/xfixes/Imakefile +++ b/nx-X11/programs/Xserver/xfixes/Imakefile @@ -5,7 +5,8 @@ OBJS = cursor.o region.o saveset.o select.o xfixes.o INCLUDES = -I. -I../include -I../Xext -I../fixes -I../render \ - -I$(EXTINCSRC) -I$(XINCLUDESRC) + -I$(EXTINCSRC) -I$(XINCLUDESRC) \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln diff --git a/nx-X11/programs/Xserver/xkb/Imakefile b/nx-X11/programs/Xserver/xkb/Imakefile index 2ac6fe32d..e63ca4462 100644 --- a/nx-X11/programs/Xserver/xkb/Imakefile +++ b/nx-X11/programs/Xserver/xkb/Imakefile @@ -51,7 +51,8 @@ XF86INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) XKBMisc.o XKBMAlloc.o XKBAlloc.o XKBGAlloc.o \ $(XKBXI_OBJS) $(DDX_OBJS) INCLUDES = -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext \ - -I$(SERVERSRC)/mi $(XF86INCLUDES) + -I$(SERVERSRC)/mi $(XF86INCLUDES) \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln DEFINES = -DXKB_IN_SERVER $(EXTRA_ALLOC_DEFINES) $(XKB_DDXDEFS) $(NX_DEFINES) diff --git a/nx-libs.spec b/nx-libs.spec index 24287f178..98cee6926 100644 --- a/nx-libs.spec +++ b/nx-libs.spec @@ -29,6 +29,7 @@ BuildRequires: fdupes BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(pixman-1) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xext) BuildRequires: pkgconfig(xpm) @@ -44,6 +45,7 @@ BuildRequires: pkgconfig(xinerama) BuildRequires: libexpat-devel BuildRequires: libpng-devel BuildRequires: libxml2-devel +BuildRequires: pixman-devel BuildRequires: xorg-x11-libX11-devel BuildRequires: xorg-x11-libXext-devel BuildRequires: xorg-x11-libXpm-devel @@ -63,6 +65,7 @@ BuildRequires: xorg-x11-util-devel BuildRequires: expat-devel BuildRequires: libpng-devel BuildRequires: libxml2-devel +BuildRequires: pixman-devel BuildRequires: libX11-devel BuildRequires: libXext-devel BuildRequires: libXpm-devel diff --git a/nxcompext/configure.in b/nxcompext/configure.in index eb6604dba..5b9ccc4da 100644 --- a/nxcompext/configure.in +++ b/nxcompext/configure.in @@ -28,6 +28,8 @@ if test -d "../nx-X11/include" ; then LDFLAGS="$LDFLAGS -L../nx-X11/exports/lib" fi +X_CFLAGS=`pkg-config --cflags-only-I pixman-1` + dnl Check for programs. AC_PROG_CXX -- cgit v1.2.3 From b0e69fe350d9ede82b1c2238df2d43028c868204 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 18 Mar 2016 13:05:05 +0100 Subject: Change region implementation names to eliminate the 'mi' prefix This prepares the file to be moved from mi to dix. This patch was done mechanically with the included scripts 'fix-miregion' run over the entire X server and 'fix-miregion-private' run over include/regionstr.h and mi/miregion.c. v1: Keith Packard v2: Mike Gabriel (backported to nx-libs) --- nx-X11/programs/Xserver/dix/region.c | 978 ++------------------------ nx-X11/programs/Xserver/dix/window.c | 4 +- nx-X11/programs/Xserver/fb/fbpixmap.c | 4 +- nx-X11/programs/Xserver/fix-miregion | 29 + nx-X11/programs/Xserver/fix-miregion-private | 14 + nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 4 +- nx-X11/programs/Xserver/include/regionstr.h | 60 +- nx-X11/programs/Xserver/mi/mi.h | 11 +- nx-X11/programs/Xserver/mi/migc.c | 1 + nx-X11/programs/Xserver/mi/miscrinit.c | 44 +- nx-X11/programs/Xserver/mi/mispans.h | 2 +- 11 files changed, 178 insertions(+), 973 deletions(-) create mode 100755 nx-X11/programs/Xserver/fix-miregion create mode 100755 nx-X11/programs/Xserver/fix-miregion-private (limited to 'nx-X11/programs/Xserver/fb') diff --git a/nx-X11/programs/Xserver/dix/region.c b/nx-X11/programs/Xserver/dix/region.c index 410772ff8..e927b9fde 100644 --- a/nx-X11/programs/Xserver/dix/region.c +++ b/nx-X11/programs/Xserver/dix/region.c @@ -86,8 +86,6 @@ Equipment Corporation. #include "regionstr.h" #include #include "gc.h" -#include "mi.h" -#include "mispans.h" #if defined (__GNUC__) && !defined (NO_INLINES) #define INLINE __inline @@ -104,7 +102,7 @@ Equipment Corporation. #define assert(expr) #endif -#define good(reg) assert(miValidRegion(reg)) +#define good(reg) assert(RegionIsValid(reg)) /* * The functions in this file implement the Region abstraction used extensively @@ -147,7 +145,7 @@ Equipment Corporation. * * Adam de Boor wrote most of the original region code. Joel McCormack * substantially modified or rewrote most of the core arithmetic routines, - * and added miRegionValidate in order to support several speed improvements + * and added RegionValidate in order to support several speed improvements * to miValidateTree. Bob Scheifler changed the representation to be more * compact when empty or a single rectangle, and did a bunch of gratuitous * reformatting. @@ -178,11 +176,11 @@ Equipment Corporation. #define RECTALLOC_BAIL(pReg,n,bail) \ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \ - if (!miRectAlloc(pReg, n)) { goto bail; } + if (!RegionRectAlloc(pReg, n)) { goto bail; } #define RECTALLOC(pReg,n) \ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \ - if (!miRectAlloc(pReg, n)) { return FALSE; } + if (!RegionRectAlloc(pReg, n)) { return FALSE; } #define ADDRECT(pNextRect,nx1,ny1,nx2,ny2) \ { \ @@ -197,7 +195,7 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \ { \ if (!(pReg)->data || ((pReg)->data->numRects == (pReg)->data->size))\ { \ - if (!miRectAlloc(pReg, 1)) \ + if (!RegionRectAlloc(pReg, 1)) \ return FALSE; \ pNextRect = RegionTop(pReg); \ } \ @@ -221,15 +219,15 @@ if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \ } -pixman_box16_t miEmptyBox = {0, 0, 0, 0}; -RegDataRec miEmptyData = {0, 0}; +pixman_box16_t RegionEmptyBox = {0, 0, 0, 0}; +RegDataRec RegionEmptyData = {0, 0}; -RegDataRec miBrokenData = {0, 0}; -RegionRec miBrokenRegion = { { 0, 0, 0, 0 }, &miBrokenData }; +RegDataRec RegionBrokenData = {0, 0}; +RegionRec RegionBrokenRegion = { { 0, 0, 0, 0 }, &RegionBrokenData }; #ifdef DEBUG int -miPrintRegion(rgn) +RegionPrint(rgn) RegionPtr rgn; { int num, size; @@ -250,36 +248,9 @@ miPrintRegion(rgn) } #endif /* DEBUG */ -Bool -miRegionEqual(reg1, reg2) - RegionPtr reg1; - RegionPtr reg2; -{ - int i, num; - BoxPtr rects1, rects2; - - if (reg1->extents.x1 != reg2->extents.x1) return FALSE; - if (reg1->extents.x2 != reg2->extents.x2) return FALSE; - if (reg1->extents.y1 != reg2->extents.y1) return FALSE; - if (reg1->extents.y2 != reg2->extents.y2) return FALSE; - - num = RegionNumRects(reg1); - if (num != RegionNumRects(reg2)) return FALSE; - - rects1 = RegionRects(reg1); - rects2 = RegionRects(reg2); - for (i = 0; i != num; i++) { - if (rects1[i].x1 != rects2[i].x1) return FALSE; - if (rects1[i].x2 != rects2[i].x2) return FALSE; - if (rects1[i].y1 != rects2[i].y1) return FALSE; - if (rects1[i].y2 != rects2[i].y2) return FALSE; - } - return TRUE; -} - #ifdef DEBUG Bool -miValidRegion(reg) +RegionIsValid(reg) RegionPtr reg; { register int i, numRects; @@ -291,7 +262,7 @@ miValidRegion(reg) if (!numRects) return ((reg->extents.x1 == reg->extents.x2) && (reg->extents.y1 == reg->extents.y2) && - (reg->data->size || (reg->data == &miEmptyData))); + (reg->data->size || (reg->data == &RegionEmptyData))); else if (numRects == 1) return (!reg->data); else @@ -334,7 +305,7 @@ miValidRegion(reg) *****************************************************************/ RegionPtr -miRegionCreate(rect, size) +RegionCreate(rect, size) BoxPtr rect; int size; { @@ -342,7 +313,7 @@ miRegionCreate(rect, size) size_t newSize; pReg = (RegionPtr)xalloc(sizeof(RegionRec)); if (!pReg) - return &miBrokenRegion; + return &RegionBrokenRegion; if (rect) { pReg->extents = *rect; @@ -350,7 +321,7 @@ miRegionCreate(rect, size) } else { - pReg->extents = miEmptyBox; + pReg->extents = RegionEmptyBox; newSize = RegionSizeof(size); if ((size > 1) && (newSize > 0) && (pReg->data = xalloc(newSize))) @@ -359,74 +330,33 @@ miRegionCreate(rect, size) pReg->data->numRects = 0; } else - pReg->data = &miEmptyData; + pReg->data = &RegionEmptyData; } return(pReg); } -/***************************************************************** - * RegionInit(pReg, rect, size) - * Outer region rect is statically allocated. - *****************************************************************/ - void -miRegionInit(pReg, rect, size) - RegionPtr pReg; - BoxPtr rect; - int size; -{ - size_t newSize; - - if (rect) - { - pReg->extents = *rect; - pReg->data = (RegDataPtr)NULL; - } - else - { - pReg->extents = miEmptyBox; - newSize = RegionSizeof(size); - if ((size > 1) && (newSize > 0) && - (pReg->data = xalloc(newSize))) - { - pReg->data->size = size; - pReg->data->numRects = 0; - } - else - pReg->data = &miEmptyData; - } -} - -void -miRegionDestroy(pReg) +RegionDestroy(pReg) RegionPtr pReg; { good(pReg); xfreeData(pReg); - if (pReg != &miBrokenRegion) + if (pReg != &RegionBrokenRegion) xfree(pReg); } -void -miRegionUninit(pReg) - RegionPtr pReg; -{ - good(pReg); - xfreeData(pReg); -} - Bool -miRegionBreak (pReg) +RegionBreak (pReg) RegionPtr pReg; { xfreeData (pReg); - pReg->extents = miEmptyBox; - pReg->data = &miBrokenData; + pReg->extents = RegionEmptyBox; + pReg->data = &RegionBrokenData; return FALSE; } Bool -miRectAlloc( +RegionRectAlloc( register RegionPtr pRgn, int n) { @@ -439,7 +369,7 @@ miRectAlloc( rgnSize = RegionSizeof(n); pRgn->data = (rgnSize > 0) ? xalloc(rgnSize) : NULL; if (!pRgn->data) - return miRegionBreak (pRgn); + return RegionBreak (pRgn); pRgn->data->numRects = 1; *RegionBoxptr(pRgn) = pRgn->extents; } @@ -448,7 +378,7 @@ miRectAlloc( rgnSize = RegionSizeof(n); pRgn->data = (rgnSize > 0) ? xalloc(rgnSize) : NULL; if (!pRgn->data) - return miRegionBreak (pRgn); + return RegionBreak (pRgn); pRgn->data->numRects = 0; } else @@ -463,44 +393,13 @@ miRectAlloc( rgnSize = RegionSizeof(n); data = (rgnSize > 0) ? xrealloc(pRgn->data, rgnSize) : NULL; if (!data) - return miRegionBreak (pRgn); + return RegionBreak (pRgn); pRgn->data = data; } pRgn->data->size = n; return TRUE; } -Bool -miRegionCopy(dst, src) - register RegionPtr dst; - register RegionPtr src; -{ - good(dst); - good(src); - if (dst == src) - return TRUE; - dst->extents = src->extents; - if (!src->data || !src->data->size) - { - xfreeData(dst); - dst->data = src->data; - return TRUE; - } - if (!dst->data || (dst->data->size < src->data->numRects)) - { - size_t newSize = RegionSizeof(src->data->numRects); - xfreeData(dst); - - dst->data = newSize > 0 ? xalloc(newSize) : NULL; - if (!dst->data) - return miRegionBreak (dst); - dst->data->size = src->data->numRects; - } - dst->data->numRects = src->data->numRects; - memmove((char *)RegionBoxptr(dst),(char *)RegionBoxptr(src), - dst->data->numRects * sizeof(BoxRec)); - return TRUE; -} /*====================================================================== @@ -509,10 +408,10 @@ miRegionCopy(dst, src) /*- *----------------------------------------------------------------------- - * miCoalesce -- + * RegionCoalesce -- * Attempt to merge the boxes in the current band with those in the * previous one. We are guaranteed that the current band extends to - * the end of the rects array. Used only by miRegionOp. + * the end of the rects array. Used only by RegionOp. * * Results: * The new index for the previous band. @@ -526,7 +425,7 @@ miRegionCopy(dst, src) *----------------------------------------------------------------------- */ INLINE static int -miCoalesce ( +RegionCoalesce ( register RegionPtr pReg, /* Region to coalesce */ int prevStart, /* Index of start of previous band */ int curStart) /* Index of start of current band */ @@ -583,18 +482,18 @@ miCoalesce ( } -/* Quicky macro to avoid trivial reject procedure calls to miCoalesce */ +/* Quicky macro to avoid trivial reject procedure calls to RegionCoalesce */ #define Coalesce(newReg, prevBand, curBand) \ if (curBand - prevBand == newReg->data->numRects - curBand) { \ - prevBand = miCoalesce(newReg, prevBand, curBand); \ + prevBand = RegionCoalesce(newReg, prevBand, curBand); \ } else { \ prevBand = curBand; \ } /*- *----------------------------------------------------------------------- - * miAppendNonO -- + * RegionAppendNonO -- * Handle a non-overlapping band for the union and subtract operations. * Just adds the (top/bottom-clipped) rectangles into the region. * Doesn't have to check for subsumption or anything. @@ -610,7 +509,7 @@ miCoalesce ( */ INLINE static Bool -miAppendNonO ( +RegionAppendNonO ( register RegionPtr pReg, register BoxPtr r, BoxPtr rEnd, @@ -660,9 +559,9 @@ miAppendNonO ( /*- *----------------------------------------------------------------------- - * miRegionOp -- - * Apply an operation to two regions. Called by miUnion, miInverse, - * miSubtract, miIntersect.... Both regions MUST have at least one + * RegionOp -- + * Apply an operation to two regions. Called by RegionUnion, RegionInverse, + * RegionSubtract, RegionIntersect.... Both regions MUST have at least one * rectangle, and cannot be the same object. * * Results: @@ -698,7 +597,7 @@ typedef Bool (*OverlapProcPtr)( Bool *pOverlap); static Bool -miRegionOp( +RegionOp( RegionPtr newReg, /* Place to store result */ RegionPtr reg1, /* First region in operation */ RegionPtr reg2, /* 2d region in operation */ @@ -734,7 +633,7 @@ miRegionOp( * Break any region computed from a broken region */ if (RegionNar (reg1) || RegionNar(reg2)) - return miRegionBreak (newReg); + return RegionBreak (newReg); /* * Initialization: @@ -758,18 +657,18 @@ miRegionOp( ((newReg == reg2) && (numRects > 1))) { oldData = newReg->data; - newReg->data = &miEmptyData; + newReg->data = &RegionEmptyData; } /* guess at new size */ if (numRects > newSize) newSize = numRects; newSize <<= 1; if (!newReg->data) - newReg->data = &miEmptyData; + newReg->data = &RegionEmptyData; else if (newReg->data->size) newReg->data->numRects = 0; if (newSize > newReg->data->size) - if (!miRectAlloc(newReg, newSize)) + if (!RegionRectAlloc(newReg, newSize)) return FALSE; /* @@ -790,7 +689,7 @@ miRegionOp( /* * prevBand serves to mark the start of the previous band so rectangles - * can be coalesced into larger rectangles. qv. miCoalesce, above. + * can be coalesced into larger rectangles. qv. RegionCoalesce, above. * In the beginning, there is no previous band, so prevBand == curBand * (curBand is set later on, of course, but the first band will always * start at index 0). prevBand and curBand must be indices because of @@ -827,7 +726,7 @@ miRegionOp( bot = min(r1->y2, r2y1); if (top != bot) { curBand = newReg->data->numRects; - miAppendNonO(newReg, r1, r1BandEnd, top, bot); + RegionAppendNonO(newReg, r1, r1BandEnd, top, bot); Coalesce(newReg, prevBand, curBand); } } @@ -838,7 +737,7 @@ miRegionOp( bot = min(r2->y2, r1y1); if (top != bot) { curBand = newReg->data->numRects; - miAppendNonO(newReg, r2, r2BandEnd, top, bot); + RegionAppendNonO(newReg, r2, r2BandEnd, top, bot); Coalesce(newReg, prevBand, curBand); } } @@ -880,7 +779,7 @@ miRegionOp( /* Do first nonOverlap1Func call, which may be able to coalesce */ FindBand(r1, r1BandEnd, r1End, r1y1); curBand = newReg->data->numRects; - miAppendNonO(newReg, r1, r1BandEnd, max(r1y1, ybot), r1->y2); + RegionAppendNonO(newReg, r1, r1BandEnd, max(r1y1, ybot), r1->y2); Coalesce(newReg, prevBand, curBand); /* Just append the rest of the boxes */ AppendRegions(newReg, r1BandEnd, r1End); @@ -889,7 +788,7 @@ miRegionOp( /* Do first nonOverlap2Func call, which may be able to coalesce */ FindBand(r2, r2BandEnd, r2End, r2y1); curBand = newReg->data->numRects; - miAppendNonO(newReg, r2, r2BandEnd, max(r2y1, ybot), r2->y2); + RegionAppendNonO(newReg, r2, r2BandEnd, max(r2y1, ybot), r2->y2); Coalesce(newReg, prevBand, curBand); /* Append rest of boxes */ AppendRegions(newReg, r2BandEnd, r2End); @@ -901,7 +800,7 @@ miRegionOp( if (!(numRects = newReg->data->numRects)) { xfreeData(newReg); - newReg->data = &miEmptyData; + newReg->data = &RegionEmptyData; } else if (numRects == 1) { @@ -919,10 +818,10 @@ miRegionOp( /*- *----------------------------------------------------------------------- - * miSetExtents -- + * RegionSetExtents -- * Reset the extents of a region to what they should be. Called by - * miSubtract and miIntersect as they can't figure it out along the - * way or do so easily, as miUnion can. + * RegionSubtract and RegionIntersect as they can't figure it out along the + * way or do so easily, as RegionUnion can. * * Results: * None. @@ -933,7 +832,7 @@ miRegionOp( *----------------------------------------------------------------------- */ void -miSetExtents (pReg) +RegionSetExtents (pReg) register RegionPtr pReg; { register BoxPtr pBox, pBoxEnd; @@ -974,132 +873,6 @@ miSetExtents (pReg) assert(pReg->extents.x1 < pReg->extents.x2); } -/*====================================================================== - * Region Intersection - *====================================================================*/ -/*- - *----------------------------------------------------------------------- - * miIntersectO -- - * Handle an overlapping band for miIntersect. - * - * Results: - * TRUE if successful. - * - * Side Effects: - * Rectangles may be added to the region. - * - *----------------------------------------------------------------------- - */ -/*ARGSUSED*/ -static Bool -miIntersectO ( - register RegionPtr pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - short y1, - short y2, - Bool *pOverlap) -{ - register int x1; - register int x2; - register BoxPtr pNextRect; - - pNextRect = RegionTop(pReg); - - assert(y1 < y2); - assert(r1 != r1End && r2 != r2End); - - do { - x1 = max(r1->x1, r2->x1); - x2 = min(r1->x2, r2->x2); - - /* - * If there's any overlap between the two rectangles, add that - * overlap to the new region. - */ - if (x1 < x2) - NEWRECT(pReg, pNextRect, x1, y1, x2, y2); - - /* - * Advance the pointer(s) with the leftmost right side, since the next - * rectangle on that list may still overlap the other region's - * current rectangle. - */ - if (r1->x2 == x2) { - r1++; - } - if (r2->x2 == x2) { - r2++; - } - } while ((r1 != r1End) && (r2 != r2End)); - - return TRUE; -} - - -Bool -miIntersect(newReg, reg1, reg2) - register RegionPtr newReg; /* destination Region */ - register RegionPtr reg1; - register RegionPtr reg2; /* source regions */ -{ - good(reg1); - good(reg2); - good(newReg); - /* check for trivial reject */ - if (RegionNil(reg1) || RegionNil(reg2) || - !EXTENTCHECK(®1->extents, ®2->extents)) - { - /* Covers about 20% of all cases */ - xfreeData(newReg); - newReg->extents.x2 = newReg->extents.x1; - newReg->extents.y2 = newReg->extents.y1; - if (RegionNar(reg1) || RegionNar(reg2)) - { - newReg->data = &miBrokenData; - return FALSE; - } - else - newReg->data = &miEmptyData; - } - else if (!reg1->data && !reg2->data) - { - /* Covers about 80% of cases that aren't trivially rejected */ - newReg->extents.x1 = max(reg1->extents.x1, reg2->extents.x1); - newReg->extents.y1 = max(reg1->extents.y1, reg2->extents.y1); - newReg->extents.x2 = min(reg1->extents.x2, reg2->extents.x2); - newReg->extents.y2 = min(reg1->extents.y2, reg2->extents.y2); - xfreeData(newReg); - newReg->data = (RegDataPtr)NULL; - } - else if (!reg2->data && SUBSUMES(®2->extents, ®1->extents)) - { - return miRegionCopy(newReg, reg1); - } - else if (!reg1->data && SUBSUMES(®1->extents, ®2->extents)) - { - return miRegionCopy(newReg, reg2); - } - else if (reg1 == reg2) - { - return miRegionCopy(newReg, reg1); - } - else - { - /* General purpose intersection */ - Bool overlap; /* result ignored */ - if (!miRegionOp(newReg, reg1, reg2, miIntersectO, FALSE, FALSE, - &overlap)) - return FALSE; - miSetExtents(newReg); - } - - good(newReg); - return(TRUE); -} - #define MERGERECT(r) \ { \ if (r->x1 <= x2) { \ @@ -1121,7 +894,7 @@ miIntersect(newReg, reg1, reg2) /*- *----------------------------------------------------------------------- - * miUnionO -- + * RegionUnionO -- * Handle an overlapping band for the union operation. Picks the * left-most rectangle each time and merges it into the region. * @@ -1135,7 +908,7 @@ miIntersect(newReg, reg1, reg2) *----------------------------------------------------------------------- */ static Bool -miUnionO ( +RegionUnionO ( register RegionPtr pReg, register BoxPtr r1, BoxPtr r1End, @@ -1194,97 +967,19 @@ miUnionO ( return TRUE; } -Bool -miUnion(newReg, reg1, reg2) - RegionPtr newReg; /* destination Region */ - register RegionPtr reg1; - register RegionPtr reg2; /* source regions */ -{ - Bool overlap; /* result ignored */ - - /* Return TRUE if some overlap between reg1, reg2 */ - good(reg1); - good(reg2); - good(newReg); - /* checks all the simple cases */ - - /* - * Region 1 and 2 are the same - */ - if (reg1 == reg2) - { - return miRegionCopy(newReg, reg1); - } - - /* - * Region 1 is empty - */ - if (RegionNil(reg1)) - { - if (RegionNar(reg1)) - return miRegionBreak (newReg); - if (newReg != reg2) - return miRegionCopy(newReg, reg2); - return TRUE; - } - - /* - * Region 2 is empty - */ - if (RegionNil(reg2)) - { - if (RegionNar(reg2)) - return miRegionBreak (newReg); - if (newReg != reg1) - return miRegionCopy(newReg, reg1); - return TRUE; - } - - /* - * Region 1 completely subsumes region 2 - */ - if (!reg1->data && SUBSUMES(®1->extents, ®2->extents)) - { - if (newReg != reg1) - return miRegionCopy(newReg, reg1); - return TRUE; - } - - /* - * Region 2 completely subsumes region 1 - */ - if (!reg2->data && SUBSUMES(®2->extents, ®1->extents)) - { - if (newReg != reg2) - return miRegionCopy(newReg, reg2); - return TRUE; - } - - if (!miRegionOp(newReg, reg1, reg2, miUnionO, TRUE, TRUE, &overlap)) - return FALSE; - - newReg->extents.x1 = min(reg1->extents.x1, reg2->extents.x1); - newReg->extents.y1 = min(reg1->extents.y1, reg2->extents.y1); - newReg->extents.x2 = max(reg1->extents.x2, reg2->extents.x2); - newReg->extents.y2 = max(reg1->extents.y2, reg2->extents.y2); - good(newReg); - return TRUE; -} - - /*====================================================================== * Batch Rectangle Union *====================================================================*/ /*- *----------------------------------------------------------------------- - * miRegionAppend -- + * RegionAppend -- * * "Append" the rgn rectangles onto the end of dstrgn, maintaining * knowledge of YX-banding when it's easy. Otherwise, dstrgn just * becomes a non-y-x-banded random collection of rectangles, and not * yet a true region. After a sequence of appends, the caller must - * call miRegionValidate to ensure that a valid region is constructed. + * call RegionValidate to ensure that a valid region is constructed. * * Results: * TRUE if successful. @@ -1294,7 +989,7 @@ miUnion(newReg, reg1, reg2) * */ Bool -miRegionAppend(dstrgn, rgn) +RegionAppend(dstrgn, rgn) register RegionPtr dstrgn; register RegionPtr rgn; { @@ -1303,9 +998,9 @@ miRegionAppend(dstrgn, rgn) Bool prepend; if (RegionNar(rgn)) - return miRegionBreak (dstrgn); + return RegionBreak (dstrgn); - if (!rgn->data && (dstrgn->data == &miEmptyData)) + if (!rgn->data && (dstrgn->data == &RegionEmptyData)) { dstrgn->extents = rgn->extents; dstrgn->data = (RegDataPtr)NULL; @@ -1449,7 +1144,7 @@ QuickSortRects( /*- *----------------------------------------------------------------------- - * miRegionValidate -- + * RegionValidate -- * * Take a ``region'' which is a non-y-x-banded random collection of * rectangles, and compute a nice region which is the union of all the @@ -1473,14 +1168,14 @@ QuickSortRects( * or a coalescing into 1 box (ala Menus). * * Step 3. Merge the separate regions down to a single region by calling - * miUnion. Maximize the work each miUnion call does by using + * RegionUnion. Maximize the work each RegionUnion call does by using * a binary merge. * *----------------------------------------------------------------------- */ Bool -miRegionValidate(badreg, pOverlap) +RegionValidate(badreg, pOverlap) RegionPtr badreg; Bool *pOverlap; { @@ -1542,7 +1237,7 @@ miRegionValidate(badreg, pOverlap) /* Note that step 2 code will never overflow the ri[0].reg rects array */ ri = (RegionInfo *) xalloc(4 * sizeof(RegionInfo)); if (!ri) - return miRegionBreak (badreg); + return RegionBreak (badreg); sizeRI = 4; numRI = 1; ri[0].prevBand = 0; @@ -1615,7 +1310,7 @@ miRegionValidate(badreg, pOverlap) rit->curBand = 0; rit->reg.extents = *box; rit->reg.data = (RegDataPtr)NULL; - if (!miRectAlloc(&rit->reg, (i+numRI) / numRI)) /* MUST force allocation */ + if (!RegionRectAlloc(&rit->reg, (i+numRI) / numRI)) /* MUST force allocation */ goto bail; NextRect: ; } /* for i */ @@ -1645,7 +1340,7 @@ NextRect: ; { reg = &ri[j].reg; hreg = &ri[j+half].reg; - if (!miRegionOp(reg, reg, hreg, miUnionO, TRUE, TRUE, pOverlap)) + if (!RegionOp(reg, reg, hreg, RegionUnionO, TRUE, TRUE, pOverlap)) ret = FALSE; if (hreg->extents.x1 < reg->extents.x1) reg->extents.x1 = hreg->extents.x1; @@ -1667,11 +1362,11 @@ bail: for (i = 0; i < numRI; i++) xfreeData(&ri[i].reg); xfree (ri); - return miRegionBreak (badreg); + return RegionBreak (badreg); } RegionPtr -miRectsToRegion(nrects, prect, ctype) +RegionFromRects(nrects, prect, ctype) int nrects; register xRectangle *prect; int ctype; @@ -1683,7 +1378,7 @@ miRectsToRegion(nrects, prect, ctype) int x1, y1, x2, y2; size_t newSize; - pRgn = miRegionCreate(NullBox, 0); + pRgn = RegionCreate(NullBox, 0); if (RegionNar (pRgn)) return pRgn; if (!nrects) @@ -1710,7 +1405,7 @@ miRectsToRegion(nrects, prect, ctype) pData = newSize > 0 ? xalloc(newSize) : NULL; if (!pData) { - miRegionBreak (pRgn); + RegionBreak (pRgn); return pRgn; } pBox = (BoxPtr) (pData + 1); @@ -1740,10 +1435,10 @@ miRectsToRegion(nrects, prect, ctype) { Bool overlap; /* result ignored */ pRgn->extents.x1 = pRgn->extents.x2 = 0; - miRegionValidate(pRgn, &overlap); + RegionValidate(pRgn, &overlap); } else - miSetExtents(pRgn); + RegionSetExtents(pRgn); good(pRgn); } else @@ -1753,456 +1448,6 @@ miRectsToRegion(nrects, prect, ctype) return pRgn; } -/*====================================================================== - * Region Subtraction - *====================================================================*/ - - -/*- - *----------------------------------------------------------------------- - * miSubtractO -- - * Overlapping band subtraction. x1 is the left-most point not yet - * checked. - * - * Results: - * TRUE if successful. - * - * Side Effects: - * pReg may have rectangles added to it. - * - *----------------------------------------------------------------------- - */ -/*ARGSUSED*/ -static Bool -miSubtractO ( - register RegionPtr pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - register short y1, - short y2, - Bool *pOverlap) -{ - register BoxPtr pNextRect; - register int x1; - - x1 = r1->x1; - - assert(y1x2 <= x1) - { - /* - * Subtrahend entirely to left of minuend: go to next subtrahend. - */ - r2++; - } - else if (r2->x1 <= x1) - { - /* - * Subtrahend preceeds minuend: nuke left edge of minuend. - */ - x1 = r2->x2; - if (x1 >= r1->x2) - { - /* - * Minuend completely covered: advance to next minuend and - * reset left fence to edge of new minuend. - */ - r1++; - if (r1 != r1End) - x1 = r1->x1; - } - else - { - /* - * Subtrahend now used up since it doesn't extend beyond - * minuend - */ - r2++; - } - } - else if (r2->x1 < r1->x2) - { - /* - * Left part of subtrahend covers part of minuend: add uncovered - * part of minuend to region and skip to next subtrahend. - */ - assert(x1x1); - NEWRECT(pReg, pNextRect, x1, y1, r2->x1, y2); - - x1 = r2->x2; - if (x1 >= r1->x2) - { - /* - * Minuend used up: advance to new... - */ - r1++; - if (r1 != r1End) - x1 = r1->x1; - } - else - { - /* - * Subtrahend used up - */ - r2++; - } - } - else - { - /* - * Minuend used up: add any remaining piece before advancing. - */ - if (r1->x2 > x1) - NEWRECT(pReg, pNextRect, x1, y1, r1->x2, y2); - r1++; - if (r1 != r1End) - x1 = r1->x1; - } - } while ((r1 != r1End) && (r2 != r2End)); - - - /* - * Add remaining minuend rectangles to region. - */ - while (r1 != r1End) - { - assert(x1x2); - NEWRECT(pReg, pNextRect, x1, y1, r1->x2, y2); - r1++; - if (r1 != r1End) - x1 = r1->x1; - } - return TRUE; -} - -/*- - *----------------------------------------------------------------------- - * miSubtract -- - * Subtract regS from regM and leave the result in regD. - * S stands for subtrahend, M for minuend and D for difference. - * - * Results: - * TRUE if successful. - * - * Side Effects: - * regD is overwritten. - * - *----------------------------------------------------------------------- - */ -Bool -miSubtract(regD, regM, regS) - register RegionPtr regD; - register RegionPtr regM; - register RegionPtr regS; -{ - Bool overlap; /* result ignored */ - - good(regM); - good(regS); - good(regD); - /* check for trivial rejects */ - if (RegionNil(regM) || RegionNil(regS) || - !EXTENTCHECK(®M->extents, ®S->extents)) - { - if (RegionNar (regS)) - return miRegionBreak (regD); - return miRegionCopy(regD, regM); - } - else if (regM == regS) - { - xfreeData(regD); - regD->extents.x2 = regD->extents.x1; - regD->extents.y2 = regD->extents.y1; - regD->data = &miEmptyData; - return TRUE; - } - - /* Add those rectangles in region 1 that aren't in region 2, - do yucky substraction for overlaps, and - just throw away rectangles in region 2 that aren't in region 1 */ - if (!miRegionOp(regD, regM, regS, miSubtractO, TRUE, FALSE, &overlap)) - return FALSE; - - /* - * Can't alter RegD's extents before we call miRegionOp because - * it might be one of the source regions and miRegionOp depends - * on the extents of those regions being unaltered. Besides, this - * way there's no checking against rectangles that will be nuked - * due to coalescing, so we have to examine fewer rectangles. - */ - miSetExtents(regD); - good(regD); - return TRUE; -} - -/*====================================================================== - * Region Inversion - *====================================================================*/ - -/*- - *----------------------------------------------------------------------- - * miInverse -- - * Take a region and a box and return a region that is everything - * in the box but not in the region. The careful reader will note - * that this is the same as subtracting the region from the box... - * - * Results: - * TRUE. - * - * Side Effects: - * newReg is overwritten. - * - *----------------------------------------------------------------------- - */ -Bool -miInverse(newReg, reg1, invRect) - RegionPtr newReg; /* Destination region */ - RegionPtr reg1; /* Region to invert */ - BoxPtr invRect; /* Bounding box for inversion */ -{ - RegionRec invReg; /* Quick and dirty region made from the - * bounding box */ - Bool overlap; /* result ignored */ - - good(reg1); - good(newReg); - /* check for trivial rejects */ - if (RegionNil(reg1) || !EXTENTCHECK(invRect, ®1->extents)) - { - if (RegionNar(reg1)) - return miRegionBreak (newReg); - newReg->extents = *invRect; - xfreeData(newReg); - newReg->data = (RegDataPtr)NULL; - return TRUE; - } - - /* Add those rectangles in region 1 that aren't in region 2, - do yucky substraction for overlaps, and - just throw away rectangles in region 2 that aren't in region 1 */ - invReg.extents = *invRect; - invReg.data = (RegDataPtr)NULL; - if (!miRegionOp(newReg, &invReg, reg1, miSubtractO, TRUE, FALSE, &overlap)) - return FALSE; - - /* - * Can't alter newReg's extents before we call miRegionOp because - * it might be one of the source regions and miRegionOp depends - * on the extents of those regions being unaltered. Besides, this - * way there's no checking against rectangles that will be nuked - * due to coalescing, so we have to examine fewer rectangles. - */ - miSetExtents(newReg); - good(newReg); - return TRUE; -} - -/* - * RectIn(region, rect) - * This routine takes a pointer to a region and a pointer to a box - * and determines if the box is outside/inside/partly inside the region. - * - * The idea is to travel through the list of rectangles trying to cover the - * passed box with them. Anytime a piece of the rectangle isn't covered - * by a band of rectangles, partOut is set TRUE. Any time a rectangle in - * the region covers part of the box, partIn is set TRUE. The process ends - * when either the box has been completely covered (we reached a band that - * doesn't overlap the box, partIn is TRUE and partOut is false), the - * box has been partially covered (partIn == partOut == TRUE -- because of - * the banding, the first time this is true we know the box is only - * partially in the region) or is outside the region (we reached a band - * that doesn't overlap the box at all and partIn is false) - */ - -int -miRectIn(region, prect) - register RegionPtr region; - register BoxPtr prect; -{ - register int x; - register int y; - register BoxPtr pbox; - register BoxPtr pboxEnd; - int partIn, partOut; - int numRects; - - good(region); - numRects = RegionNumRects(region); - /* useful optimization */ - if (!numRects || !EXTENTCHECK(®ion->extents, prect)) - return(rgnOUT); - - if (numRects == 1) - { - /* We know that it must be rgnIN or rgnPART */ - if (SUBSUMES(®ion->extents, prect)) - return(rgnIN); - else - return(rgnPART); - } - - partOut = FALSE; - partIn = FALSE; - - /* (x,y) starts at upper left of rect, moving to the right and down */ - x = prect->x1; - y = prect->y1; - - /* can stop when both partOut and partIn are TRUE, or we reach prect->y2 */ - for (pbox = RegionBoxptr(region), pboxEnd = pbox + numRects; - pbox != pboxEnd; - pbox++) - { - - if (pbox->y2 <= y) - continue; /* getting up to speed or skipping remainder of band */ - - if (pbox->y1 > y) - { - partOut = TRUE; /* missed part of rectangle above */ - if (partIn || (pbox->y1 >= prect->y2)) - break; - y = pbox->y1; /* x guaranteed to be == prect->x1 */ - } - - if (pbox->x2 <= x) - continue; /* not far enough over yet */ - - if (pbox->x1 > x) - { - partOut = TRUE; /* missed part of rectangle to left */ - if (partIn) - break; - } - - if (pbox->x1 < prect->x2) - { - partIn = TRUE; /* definitely overlap */ - if (partOut) - break; - } - - if (pbox->x2 >= prect->x2) - { - y = pbox->y2; /* finished with this band */ - if (y >= prect->y2) - break; - x = prect->x1; /* reset x out to left again */ - } - else - { - /* - * Because boxes in a band are maximal width, if the first box - * to overlap the rectangle doesn't completely cover it in that - * band, the rectangle must be partially out, since some of it - * will be uncovered in that band. partIn will have been set true - * by now... - */ - partOut = TRUE; - break; - } - } - - return(partIn ? ((y < prect->y2) ? rgnPART : rgnIN) : rgnOUT); -} - -/* TranslateRegion(pReg, x, y) - translates in place -*/ - -void -miTranslateRegion(pReg, x, y) - register RegionPtr pReg; - register int x; - register int y; -{ - int x1, x2, y1, y2; - register int nbox; - register BoxPtr pbox; - - good(pReg); - pReg->extents.x1 = x1 = pReg->extents.x1 + x; - pReg->extents.y1 = y1 = pReg->extents.y1 + y; - pReg->extents.x2 = x2 = pReg->extents.x2 + x; - pReg->extents.y2 = y2 = pReg->extents.y2 + y; - if (((x1 - MINSHORT)|(y1 - MINSHORT)|(MAXSHORT - x2)|(MAXSHORT - y2)) >= 0) - { - if (pReg->data && (nbox = pReg->data->numRects)) - { - for (pbox = RegionBoxptr(pReg); nbox--; pbox++) - { - pbox->x1 += x; - pbox->y1 += y; - pbox->x2 += x; - pbox->y2 += y; - } - } - return; - } - if (((x2 - MINSHORT)|(y2 - MINSHORT)|(MAXSHORT - x1)|(MAXSHORT - y1)) <= 0) - { - pReg->extents.x2 = pReg->extents.x1; - pReg->extents.y2 = pReg->extents.y1; - xfreeData(pReg); - pReg->data = &miEmptyData; - return; - } - if (x1 < MINSHORT) - pReg->extents.x1 = MINSHORT; - else if (x2 > MAXSHORT) - pReg->extents.x2 = MAXSHORT; - if (y1 < MINSHORT) - pReg->extents.y1 = MINSHORT; - else if (y2 > MAXSHORT) - pReg->extents.y2 = MAXSHORT; - if (pReg->data && (nbox = pReg->data->numRects)) - { - register BoxPtr pboxout; - - for (pboxout = pbox = RegionBoxptr(pReg); nbox--; pbox++) - { - pboxout->x1 = x1 = pbox->x1 + x; - pboxout->y1 = y1 = pbox->y1 + y; - pboxout->x2 = x2 = pbox->x2 + x; - pboxout->y2 = y2 = pbox->y2 + y; - if (((x2 - MINSHORT)|(y2 - MINSHORT)| - (MAXSHORT - x1)|(MAXSHORT - y1)) <= 0) - { - pReg->data->numRects--; - continue; - } - if (x1 < MINSHORT) - pboxout->x1 = MINSHORT; - else if (x2 > MAXSHORT) - pboxout->x2 = MAXSHORT; - if (y1 < MINSHORT) - pboxout->y1 = MINSHORT; - else if (y2 > MAXSHORT) - pboxout->y2 = MAXSHORT; - pboxout++; - } - if (pboxout != pbox) - { - if (pReg->data->numRects == 1) - { - pReg->extents = *RegionBoxptr(pReg); - xfreeData(pReg); - pReg->data = (RegDataPtr)NULL; - } - else - miSetExtents(pReg); - } - } -} - Bool miRegionDataCopy( register RegionPtr dst, @@ -2226,94 +1471,13 @@ miRegionDataCopy( xfreeData(dst); dst->data = newSize > 0 ? xalloc(newSize) : NULL; if (!dst->data) - return miRegionBreak (dst); + return RegionBreak (dst); } dst->data->size = src->data->size; dst->data->numRects = src->data->numRects; return TRUE; } -void -miRegionReset(pReg, pBox) - RegionPtr pReg; - BoxPtr pBox; -{ - good(pReg); - assert(pBox->x1<=pBox->x2); - assert(pBox->y1<=pBox->y2); - pReg->extents = *pBox; - xfreeData(pReg); - pReg->data = (RegDataPtr)NULL; -} - -Bool -miPointInRegion(pReg, x, y, box) - register RegionPtr pReg; - register int x, y; - BoxPtr box; /* "return" value */ -{ - register BoxPtr pbox, pboxEnd; - int numRects; - - good(pReg); - numRects = RegionNumRects(pReg); - if (!numRects || !INBOX(&pReg->extents, x, y)) - return(FALSE); - if (numRects == 1) - { - *box = pReg->extents; - return(TRUE); - } - for (pbox = RegionBoxptr(pReg), pboxEnd = pbox + numRects; - pbox != pboxEnd; - pbox++) - { - if (y >= pbox->y2) - continue; /* not there yet */ - if ((y < pbox->y1) || (x < pbox->x1)) - break; /* missed it */ - if (x >= pbox->x2) - continue; /* not there yet */ - *box = *pbox; - return(TRUE); - } - return(FALSE); -} - -Bool -miRegionNotEmpty(pReg) - RegionPtr pReg; -{ - good(pReg); - return(!RegionNil(pReg)); -} - -Bool -miRegionBroken(RegionPtr pReg) -{ - good(pReg); - return (RegionNar(pReg)); -} - -void -miRegionEmpty(pReg) - RegionPtr pReg; -{ - good(pReg); - xfreeData(pReg); - pReg->extents.x2 = pReg->extents.x1; - pReg->extents.y2 = pReg->extents.y1; - pReg->data = &miEmptyData; -} - -BoxPtr -miRegionExtents(pReg) - RegionPtr pReg; -{ - good(pReg); - return(&pReg->extents); -} - #define ExchangeSpans(a, b) \ { \ DDXPointRec tpt; \ @@ -2433,7 +1597,7 @@ static void QuickSortSpans( */ int -miClipSpans( +RegionClipSpans( RegionPtr prgnDst, register DDXPointPtr ppt, register int *pwidth, diff --git a/nx-X11/programs/Xserver/dix/window.c b/nx-X11/programs/Xserver/dix/window.c index ce94dc8a5..916d7e276 100644 --- a/nx-X11/programs/Xserver/dix/window.c +++ b/nx-X11/programs/Xserver/dix/window.c @@ -180,7 +180,7 @@ PrintChildren(WindowPtr p1, int indent) p2 = p1->firstChild; for (i=0; idrawable.id); - miPrintRegion(&p1->clipList); + RegionPrint(&p1->clipList); PrintChildren(p2, indent+4); p1 = p1->nextSib; } @@ -195,7 +195,7 @@ PrintWindowTree() { ErrorF( "WINDOW %d\n", i); pWin = WindowTable[i]; - miPrintRegion(&pWin->clipList); + RegionPrint(&pWin->clipList); p1 = pWin->firstChild; PrintChildren(p1, 4); } diff --git a/nx-X11/programs/Xserver/fb/fbpixmap.c b/nx-X11/programs/Xserver/fb/fbpixmap.c index 6c2cafd94..99c03862b 100644 --- a/nx-X11/programs/Xserver/fb/fbpixmap.c +++ b/nx-X11/programs/Xserver/fb/fbpixmap.c @@ -118,7 +118,7 @@ if (((rx1) < (rx2)) && ((ry1) < (ry2)) && \ { \ if ((reg)->data->numRects == (reg)->data->size) \ { \ - miRectAlloc(reg, 1); \ + RegionRectAlloc(reg, 1); \ fr = RegionBoxptr(reg); \ r = fr + (reg)->data->numRects; \ } \ @@ -314,7 +314,7 @@ fbPixmapToRegion(PixmapPtr pPix) } } #ifdef DEBUG - if (!miValidRegion(pReg)) + if (!RegionIsValid(pReg)) FatalError("Assertion failed file %s, line %d: expr\n", __FILE__, __LINE__); #endif return(pReg); diff --git a/nx-X11/programs/Xserver/fix-miregion b/nx-X11/programs/Xserver/fix-miregion new file mode 100755 index 000000000..fc502bbfd --- /dev/null +++ b/nx-X11/programs/Xserver/fix-miregion @@ -0,0 +1,29 @@ +#!/bin/sh +sed -i \ +-e 's/miRegionCreate\b/RegionCreate/g' \ +-e 's/miRegionInit\b/RegionInit/g' \ +-e 's/miRegionDestroy\b/RegionDestroy/g' \ +-e 's/miRegionUninit\b/RegionUninit/g' \ +-e 's/miRegionCopy\b/RegionCopy/g' \ +-e 's/miIntersect\b/RegionIntersect/g' \ +-e 's/miUnion\b/RegionUnion/g' \ +-e 's/miRegionAppend\b/RegionAppend/g' \ +-e 's/miRegionValidate\b/RegionValidate/g' \ +-e 's/miRectsToRegion\b/RegionFromRects/g' \ +-e 's/miSubtract\b/RegionSubtract/g' \ +-e 's/miInverse\b/RegionInverse/g' \ +-e 's/miRectIn\b/RegionContainsRect/g' \ +-e 's/miTranslateRegion\b/RegionTranslate/g' \ +-e 's/miRegionReset\b/RegionReset/g' \ +-e 's/miRegionBreak\b/RegionBreak/g' \ +-e 's/miPointInRegion\b/RegionContainsPoint/g' \ +-e 's/miRegionEqual\b/RegionEqual/g' \ +-e 's/miRegionNotEmpty\b/RegionNotEmpty/g' \ +-e 's/miRegionEmpty\b/RegionEmpty/g' \ +-e 's/miRegionExtents\b/RegionExtents/g' \ +-e 's/miPrintRegion\b/RegionPrint/g' \ +-e 's/miRectAlloc\b/RegionRectAlloc/g' \ +-e 's/miValidRegion\b/RegionIsValid/g' \ +-e 's/miRegionBroken\b/RegionBroken/g' \ +-e 's/miClipSpans\b/RegionClipSpans/g' \ +"$@" diff --git a/nx-X11/programs/Xserver/fix-miregion-private b/nx-X11/programs/Xserver/fix-miregion-private new file mode 100755 index 000000000..ebc24fac0 --- /dev/null +++ b/nx-X11/programs/Xserver/fix-miregion-private @@ -0,0 +1,14 @@ +#!/bin/sh +sed -i \ +-e 's/miEmptyBox\b/RegionEmptyBox/g' \ +-e 's/miEmptyData\b/RegionEmptyData/g' \ +-e 's/miBrokenData\b/RegionBrokenData/g' \ +-e 's/miBrokenRegion\b/RegionBrokenRegion/g' \ +-e 's/miCoalesce\b/RegionCoalesce/g' \ +-e 's/miAppendNonO\b/RegionAppendNonO/g' \ +-e 's/miRegionOp\b/RegionOp/g' \ +-e 's/miSetExtents\b/RegionSetExtents/g' \ +-e 's/miIntersectO\b/RegionIntersectO/g' \ +-e 's/miUnionO\b/RegionUnionO/g' \ +-e 's/miSubtractO\b/RegionSubtractO/g' \ +"$@" diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index a3d791ff8..89b7c617c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -226,7 +226,7 @@ PrintChildren(WindowPtr p1, int indent) p2 = p1->firstChild; for (i=0; idrawable.id); - miPrintRegion(&p1->clipList); + RegionPrint(&p1->clipList); PrintChildren(p2, indent+4); p1 = p1->nextSib; } @@ -241,7 +241,7 @@ PrintWindowTree() { ErrorF( "WINDOW %d\n", i); pWin = WindowTable[i]; - miPrintRegion(&pWin->clipList); + RegionPrint(&pWin->clipList); p1 = pWin->firstChild; PrintChildren(p1, 4); } diff --git a/nx-X11/programs/Xserver/include/regionstr.h b/nx-X11/programs/Xserver/include/regionstr.h index c61acc003..8ddc62af2 100644 --- a/nx-X11/programs/Xserver/include/regionstr.h +++ b/nx-X11/programs/Xserver/include/regionstr.h @@ -74,16 +74,16 @@ typedef struct pixman_region16 RegionRec, *RegionPtr; typedef struct pixman_region16_data RegDataRec, *RegDataPtr; -extern BoxRec miEmptyBox; -extern RegDataRec miEmptyData; -extern RegDataRec miBrokenData; +extern BoxRec RegionEmptyBox; +extern RegDataRec RegionEmptyData; +extern RegDataRec RegionBrokenData; static inline Bool RegionNil(RegionPtr reg) { return ((reg)->data && !(reg)->data->numRects); } static inline Bool RegionNar(RegionPtr reg) { - return ((reg)->data == &miBrokenData); + return ((reg)->data == &RegionBrokenData); } static inline int RegionNumRects(RegionPtr reg) { @@ -127,7 +127,7 @@ static inline void RegionInit(RegionPtr _pReg, BoxPtr _rect, int _size) } else { - (_pReg)->extents = miEmptyBox; + (_pReg)->extents = RegionEmptyBox; if (((_size) > 1) && ((_pReg)->data = (RegDataPtr)malloc(RegionSizeof(_size)))) { @@ -135,7 +135,7 @@ static inline void RegionInit(RegionPtr _pReg, BoxPtr _rect, int _size) (_pReg)->data->numRects = 0; } else - (_pReg)->data = &miEmptyData; + (_pReg)->data = &RegionEmptyData; } } @@ -167,7 +167,7 @@ static inline void RegionEmpty(RegionPtr _pReg) RegionUninit(_pReg); (_pReg)->extents.x2 = (_pReg)->extents.x1; (_pReg)->extents.y2 = (_pReg)->extents.y1; - (_pReg)->data = &miEmptyData; + (_pReg)->data = &RegionEmptyData; } static inline BoxPtr RegionExtents(RegionPtr _pReg) @@ -177,8 +177,8 @@ static inline BoxPtr RegionExtents(RegionPtr _pReg) static inline void RegionNull(RegionPtr _pReg) { - (_pReg)->extents = miEmptyBox; - (_pReg)->data = &miEmptyData; + (_pReg)->extents = RegionEmptyBox; + (_pReg)->data = &RegionEmptyData; } static inline Bool @@ -285,91 +285,91 @@ RegionEqual(RegionPtr reg1, RegionPtr reg2) return pixman_region_equal (reg1, reg2); } -extern RegionPtr miRegionCreate( +extern RegionPtr RegionCreate( BoxPtr /*rect*/, int /*size*/); -extern void miRegionInit( +extern void RegionInit( RegionPtr /*pReg*/, BoxPtr /*rect*/, int /*size*/); -extern void miRegionDestroy( +extern void RegionDestroy( RegionPtr /*pReg*/); -extern void miRegionUninit( +extern void RegionUninit( RegionPtr /*pReg*/); -extern Bool miRegionCopy( +extern Bool RegionCopy( RegionPtr /*dst*/, RegionPtr /*src*/); -extern Bool miIntersect( +extern Bool RegionIntersect( RegionPtr /*newReg*/, RegionPtr /*reg1*/, RegionPtr /*reg2*/); -extern Bool miUnion( +extern Bool RegionUnion( RegionPtr /*newReg*/, RegionPtr /*reg1*/, RegionPtr /*reg2*/); -extern Bool miRegionAppend( +extern Bool RegionAppend( RegionPtr /*dstrgn*/, RegionPtr /*rgn*/); -extern Bool miRegionValidate( +extern Bool RegionValidate( RegionPtr /*badreg*/, Bool * /*pOverlap*/); -extern RegionPtr miRectsToRegion( +extern RegionPtr RegionFromRects( int /*nrects*/, xRectanglePtr /*prect*/, int /*ctype*/); -extern Bool miSubtract( +extern Bool RegionSubtract( RegionPtr /*regD*/, RegionPtr /*regM*/, RegionPtr /*regS*/); -extern Bool miInverse( +extern Bool RegionInverse( RegionPtr /*newReg*/, RegionPtr /*reg1*/, BoxPtr /*invRect*/); -extern int miRectIn( +extern int RegionContainsRect( RegionPtr /*region*/, BoxPtr /*prect*/); -extern void miTranslateRegion( +extern void RegionTranslate( RegionPtr /*pReg*/, int /*x*/, int /*y*/); -extern void miRegionReset( +extern void RegionReset( RegionPtr /*pReg*/, BoxPtr /*pBox*/); -extern Bool miRegionBreak( +extern Bool RegionBreak( RegionPtr /*pReg*/); -extern Bool miPointInRegion( +extern Bool RegionContainsPoint( RegionPtr /*pReg*/, int /*x*/, int /*y*/, BoxPtr /*box*/); -extern Bool miRegionEqual( +extern Bool RegionEqual( RegionPtr /*pReg1*/, RegionPtr /*pReg2*/); -extern Bool miRegionNotEmpty( +extern Bool RegionNotEmpty( RegionPtr /*pReg*/); -extern void miRegionEmpty( +extern void RegionEmpty( RegionPtr /*pReg*/); -extern BoxPtr miRegionExtents( +extern BoxPtr RegionExtents( RegionPtr /*pReg*/); #endif /* REGIONSTRUCT_H */ diff --git a/nx-X11/programs/Xserver/mi/mi.h b/nx-X11/programs/Xserver/mi/mi.h index 6eea34b6c..86db39ad8 100644 --- a/nx-X11/programs/Xserver/mi/mi.h +++ b/nx-X11/programs/Xserver/mi/mi.h @@ -403,16 +403,14 @@ extern void miPushPixels( int /*yOrg*/ ); -/* miregion.c */ - /* see also region.h */ -extern Bool miRectAlloc( +extern Bool RegionRectAlloc( RegionPtr /*pRgn*/, int /*n*/ ); -extern void miSetExtents( +extern void RegionSetExtents( RegionPtr /*pReg*/ ); @@ -421,13 +419,12 @@ extern int miFindMaxBand( ); #ifdef DEBUG -extern Bool miValidRegion( +extern Bool RegionIsValid( RegionPtr /*prgn*/ ); #endif -extern Bool miRegionDataCopy(RegionPtr dst, RegionPtr src); -extern Bool miRegionBroken(RegionPtr pReg); +extern Bool RegionBroken(RegionPtr pReg); /* miscrinit.c */ diff --git a/nx-X11/programs/Xserver/mi/migc.c b/nx-X11/programs/Xserver/mi/migc.c index 167e63d0a..167163686 100644 --- a/nx-X11/programs/Xserver/mi/migc.c +++ b/nx-X11/programs/Xserver/mi/migc.c @@ -33,6 +33,7 @@ from The Open Group. #include #endif +#include "regionstr.h" #include "scrnintstr.h" #include "gcstruct.h" #include "pixmapstr.h" diff --git a/nx-X11/programs/Xserver/mi/miscrinit.c b/nx-X11/programs/Xserver/mi/miscrinit.c index 4950eaa93..addd5dd64 100644 --- a/nx-X11/programs/Xserver/mi/miscrinit.c +++ b/nx-X11/programs/Xserver/mi/miscrinit.c @@ -267,31 +267,31 @@ miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, /* CreateColormap, DestroyColormap, InstallColormap, UninstallColormap */ /* ListInstalledColormaps, StoreColors, ResolveColor */ #ifdef NEED_SCREEN_REGIONS - pScreen->RegionCreate = miRegionCreate; - pScreen->RegionInit = miRegionInit; - pScreen->RegionCopy = miRegionCopy; - pScreen->RegionDestroy = miRegionDestroy; - pScreen->RegionUninit = miRegionUninit; - pScreen->Intersect = miIntersect; - pScreen->Union = miUnion; - pScreen->Subtract = miSubtract; - pScreen->Inverse = miInverse; - pScreen->RegionReset = miRegionReset; - pScreen->TranslateRegion = miTranslateRegion; - pScreen->RectIn = miRectIn; - pScreen->PointInRegion = miPointInRegion; - pScreen->RegionNotEmpty = miRegionNotEmpty; - pScreen->RegionEqual = miRegionEqual; - pScreen->RegionBroken = miRegionBroken; - pScreen->RegionBreak = miRegionBreak; - pScreen->RegionEmpty = miRegionEmpty; - pScreen->RegionExtents = miRegionExtents; - pScreen->RegionAppend = miRegionAppend; - pScreen->RegionValidate = miRegionValidate; + pScreen->RegionCreate = RegionCreate; + pScreen->RegionInit = RegionInit; + pScreen->RegionCopy = RegionCopy; + pScreen->RegionDestroy = RegionDestroy; + pScreen->RegionUninit = RegionUninit; + pScreen->Intersect = RegionIntersect; + pScreen->Union = RegionUnion; + pScreen->Subtract = RegionSubtract; + pScreen->Inverse = RegionInverse; + pScreen->RegionReset = RegionReset; + pScreen->TranslateRegion = RegionTranslate; + pScreen->RectIn = RegionContainsRect; + pScreen->PointInRegion = RegionContainsPoint; + pScreen->RegionNotEmpty = RegionNotEmpty; + pScreen->RegionEqual = RegionEqual; + pScreen->RegionBroken = RegionBroken; + pScreen->RegionBreak = RegionBreak; + pScreen->RegionEmpty = RegionEmpty; + pScreen->RegionExtents = RegionExtents; + pScreen->RegionAppend = RegionAppend; + pScreen->RegionValidate = RegionValidate; #endif /* NEED_SCREEN_REGIONS */ /* BitmapToRegion */ #ifdef NEED_SCREEN_REGIONS - pScreen->RectsToRegion = miRectsToRegion; + pScreen->RectsToRegion = RegionFromRects; #endif /* NEED_SCREEN_REGIONS */ pScreen->SendGraphicsExpose = miSendGraphicsExpose; pScreen->BlockHandler = (ScreenBlockHandlerProcPtr)NoopDDA; diff --git a/nx-X11/programs/Xserver/mi/mispans.h b/nx-X11/programs/Xserver/mi/mispans.h index b6e97e2b4..0db0afc1c 100644 --- a/nx-X11/programs/Xserver/mi/mispans.h +++ b/nx-X11/programs/Xserver/mi/mispans.h @@ -101,7 +101,7 @@ extern void miDisposeSpanGroup( SpanGroup * /*spanGroup*/ ); -extern int miClipSpans( +extern int RegionClipSpans( RegionPtr /*prgnDst*/, DDXPointPtr /*ppt*/, int * /*pwidth*/, -- cgit v1.2.3