diff options
author | Keith Packard <keithp@keithp.com> | 2010-05-21 15:05:48 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-06-05 18:59:00 -0700 |
commit | 2dc138922b7588515d5f2447e4b9dcdc0bef15e0 (patch) | |
tree | 004ca1d730f94a78150c30b3fbc0c87af31f2895 /Xext | |
parent | d17e726e89ef644310de77b960b715c2d11088da (diff) |
Rename region macros to eliminate screen argument
This is a combination of 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 tree:
$ 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.
The hand-done changes involve removing functions from dix/region.c
that duplicate inline functions in include/regionstr.h, along with
their declarations in regionstr.h, mi.h and mispans.h.
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'Xext')
-rw-r--r-- | Xext/panoramiX.c | 36 | ||||
-rw-r--r-- | Xext/panoramiXprocs.c | 24 | ||||
-rw-r--r-- | Xext/shape.c | 48 | ||||
-rw-r--r-- | Xext/xace.c | 14 |
4 files changed, 61 insertions, 61 deletions
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index 14e06e160..670cf504a 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -152,7 +152,7 @@ XineramaCloseScreen (int i, ScreenPtr pScreen) pScreen->CreateGC = pScreenPriv->CreateGC; if (pScreen->myNum == 0) - REGION_UNINIT(pScreen, &PanoramiXScreenRegion); + RegionUninit(&PanoramiXScreenRegion); free((pointer) pScreenPriv); @@ -386,7 +386,7 @@ static void XineramaInitData(ScreenPtr pScreen) { int i, w, h; - REGION_NULL(pScreen, &PanoramiXScreenRegion) + RegionNull(&PanoramiXScreenRegion) for (i = 0; i < PanoramiXNumScreens; i++) { BoxRec TheBox; RegionRec ScreenRegion; @@ -398,10 +398,10 @@ static void XineramaInitData(ScreenPtr pScreen) TheBox.y1 = pScreen->y; TheBox.y2 = TheBox.y1 + pScreen->height; - REGION_INIT(pScreen, &ScreenRegion, &TheBox, 1); - REGION_UNION(pScreen, &PanoramiXScreenRegion, &PanoramiXScreenRegion, + RegionInit(&ScreenRegion, &TheBox, 1); + RegionUnion(&PanoramiXScreenRegion, &PanoramiXScreenRegion, &ScreenRegion); - REGION_UNINIT(pScreen, &ScreenRegion); + RegionUninit(&ScreenRegion); } PanoramiXPixWidth = screenInfo.screens[0]->x + screenInfo.screens[0]->width; @@ -421,7 +421,7 @@ static void XineramaInitData(ScreenPtr pScreen) void XineramaReinitData(ScreenPtr pScreen) { - REGION_UNINIT(pScreen, &PanoramiXScreenRegion); + RegionUninit(&PanoramiXScreenRegion); XineramaInitData(pScreen); } @@ -1153,8 +1153,8 @@ XineramaGetImageData( SrcBox.x2 = SrcBox.x1 + width; SrcBox.y2 = SrcBox.y1 + height; - REGION_INIT(pScreen, &SrcRegion, &SrcBox, 1); - REGION_NULL(pScreen, &GrabRegion); + RegionInit(&SrcRegion, &SrcBox, 1); + RegionNull(&GrabRegion); depth = (format == XYPixmap) ? 1 : pDraw->depth; @@ -1169,11 +1169,11 @@ XineramaGetImageData( TheBox.y1 = pScreen->y; TheBox.y2 = TheBox.y1 + pScreen->height; - REGION_INIT(pScreen, &ScreenRegion, &TheBox, 1); - inOut = RECT_IN_REGION(pScreen, &ScreenRegion, &SrcBox); + RegionInit(&ScreenRegion, &TheBox, 1); + inOut = RegionContainsRect(&ScreenRegion, &SrcBox); if(inOut == rgnPART) - REGION_INTERSECT(pScreen, &GrabRegion, &SrcRegion, &ScreenRegion); - REGION_UNINIT(pScreen, &ScreenRegion); + RegionIntersect(&GrabRegion, &SrcRegion, &ScreenRegion); + RegionUninit(&ScreenRegion); if(inOut == rgnIN) { (*pScreen->GetImage)(pDraw, @@ -1184,10 +1184,10 @@ XineramaGetImageData( } else if (inOut == rgnOUT) continue; - nbox = REGION_NUM_RECTS(&GrabRegion); + nbox = RegionNumRects(&GrabRegion); if(nbox) { - pbox = REGION_RECTS(&GrabRegion); + pbox = RegionRects(&GrabRegion); while(nbox--) { w = pbox->x2 - pbox->x1; @@ -1264,8 +1264,8 @@ XineramaGetImageData( pbox++; } - REGION_SUBTRACT(pScreen, &SrcRegion, &SrcRegion, &GrabRegion); - if(!REGION_NOTEMPTY(pScreen, &SrcRegion)) + RegionSubtract(&SrcRegion, &SrcRegion, &GrabRegion); + if(!RegionNotEmpty(&SrcRegion)) break; } @@ -1274,6 +1274,6 @@ XineramaGetImageData( if(ScratchMem) free(ScratchMem); - REGION_UNINIT(pScreen, &SrcRegion); - REGION_UNINIT(pScreen, &GrabRegion); + RegionUninit(&SrcRegion); + RegionUninit(&GrabRegion); } diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c index 5ccbe27c8..457e071a1 100644 --- a/Xext/panoramiXprocs.c +++ b/Xext/panoramiXprocs.c @@ -620,7 +620,7 @@ int PanoramiXTranslateCoords(ClientPtr client) * borderSize */ && (!wBoundingShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, + RegionContainsPoint( wBoundingShape(pWin), x - pWin->drawable.x, y - pWin->drawable.y, &box)) @@ -1087,7 +1087,7 @@ int PanoramiXCopyArea(ClientPtr client) RegionRec totalReg; int rc; - REGION_NULL(unusedScreen, &totalReg); + RegionNull(&totalReg); FOR_NSCREENS_BACKWARD(j) { RegionPtr pRgn; stuff->dstDrawable = dst->info[j].id; @@ -1124,11 +1124,11 @@ int PanoramiXCopyArea(ClientPtr client) stuff->dstX, stuff->dstY); if(pGC->graphicsExposures && pRgn) { if(srcIsRoot) { - REGION_TRANSLATE(unusedScreen, pRgn, + RegionTranslate(pRgn, screenInfo.screens[j]->x, screenInfo.screens[j]->y); } - REGION_APPEND(unusedScreen, &totalReg, pRgn); - REGION_DESTROY(unusedScreen, pRgn); + RegionAppend(&totalReg, pRgn); + RegionDestroy(pRgn); } if(dstShared) @@ -1138,10 +1138,10 @@ int PanoramiXCopyArea(ClientPtr client) if(pGC->graphicsExposures) { ScreenPtr pScreen = pDst->pScreen; Bool overlap; - REGION_VALIDATE(unusedScreen, &totalReg, &overlap); + RegionValidate(&totalReg, &overlap); (*pScreen->SendGraphicsExpose)( client, &totalReg, stuff->dstDrawable, X_CopyArea, 0); - REGION_UNINIT(unusedScreen, &totalReg); + RegionUninit(&totalReg); } } @@ -1193,7 +1193,7 @@ int PanoramiXCopyPlane(ClientPtr client) srcx = stuff->srcX; srcy = stuff->srcY; dstx = stuff->dstX; dsty = stuff->dstY; - REGION_NULL(unusedScreen, &totalReg); + RegionNull(&totalReg); FOR_NSCREENS_BACKWARD(j) { RegionPtr pRgn; stuff->dstDrawable = dst->info[j].id; @@ -1233,8 +1233,8 @@ int PanoramiXCopyPlane(ClientPtr client) stuff->width, stuff->height, stuff->dstX, stuff->dstY, stuff->bitPlane); if(pGC->graphicsExposures && pRgn) { - REGION_APPEND(unusedScreen, &totalReg, pRgn); - REGION_DESTROY(unusedScreen, pRgn); + RegionAppend(&totalReg, pRgn); + RegionDestroy(pRgn); } if(dstShared) @@ -1244,10 +1244,10 @@ int PanoramiXCopyPlane(ClientPtr client) if(pGC->graphicsExposures) { ScreenPtr pScreen = pdstDraw->pScreen; Bool overlap; - REGION_VALIDATE(unusedScreen, &totalReg, &overlap); + RegionValidate(&totalReg, &overlap); (*pScreen->SendGraphicsExpose)( client, &totalReg, stuff->dstDrawable, X_CopyPlane, 0); - REGION_UNINIT(unusedScreen, &totalReg); + RegionUninit(&totalReg); } return Success; diff --git a/Xext/shape.c b/Xext/shape.c index 86b0bc0ec..fb5b9a76c 100644 --- a/Xext/shape.c +++ b/Xext/shape.c @@ -153,11 +153,11 @@ RegionOperate ( ScreenPtr pScreen = pWin->drawable.pScreen; if (srcRgn && (xoff || yoff)) - REGION_TRANSLATE(pScreen, srcRgn, xoff, yoff); + RegionTranslate(srcRgn, xoff, yoff); if (!pWin->parent) { if (srcRgn) - REGION_DESTROY(pScreen, srcRgn); + RegionDestroy(srcRgn); return Success; } @@ -168,7 +168,7 @@ RegionOperate ( */ if (srcRgn == NULL) { if (*destRgnp != NULL) { - REGION_DESTROY (pScreen, *destRgnp); + RegionDestroy(*destRgnp); *destRgnp = 0; /* go on to remove shape and generate ShapeNotify */ } @@ -187,17 +187,17 @@ RegionOperate ( else switch (op) { case ShapeSet: if (*destRgnp) - REGION_DESTROY(pScreen, *destRgnp); + RegionDestroy(*destRgnp); *destRgnp = srcRgn; srcRgn = 0; break; case ShapeUnion: if (*destRgnp) - REGION_UNION(pScreen, *destRgnp, *destRgnp, srcRgn); + RegionUnion(*destRgnp, *destRgnp, srcRgn); break; case ShapeIntersect: if (*destRgnp) - REGION_INTERSECT(pScreen, *destRgnp, *destRgnp, srcRgn); + RegionIntersect(*destRgnp, *destRgnp, srcRgn); else { *destRgnp = srcRgn; srcRgn = 0; @@ -206,20 +206,20 @@ RegionOperate ( case ShapeSubtract: if (!*destRgnp) *destRgnp = (*create)(pWin); - REGION_SUBTRACT(pScreen, *destRgnp, *destRgnp, srcRgn); + RegionSubtract(*destRgnp, *destRgnp, srcRgn); break; case ShapeInvert: if (!*destRgnp) - *destRgnp = REGION_CREATE(pScreen, (BoxPtr) 0, 0); + *destRgnp = RegionCreate((BoxPtr) 0, 0); else - REGION_SUBTRACT(pScreen, *destRgnp, srcRgn, *destRgnp); + RegionSubtract(*destRgnp, srcRgn, *destRgnp); break; default: client->errorValue = op; return BadValue; } if (srcRgn) - REGION_DESTROY(pScreen, srcRgn); + RegionDestroy(srcRgn); (*pScreen->SetShape) (pWin, kind); SendShapeNotify (pWin, kind); return Success; @@ -234,7 +234,7 @@ CreateBoundingShape (WindowPtr pWin) extents.y1 = -wBorderWidth (pWin); extents.x2 = pWin->drawable.width + wBorderWidth (pWin); extents.y2 = pWin->drawable.height + wBorderWidth (pWin); - return REGION_CREATE(pWin->drawable.pScreen, &extents, 1); + return RegionCreate(&extents, 1); } RegionPtr @@ -246,7 +246,7 @@ CreateClipShape (WindowPtr pWin) extents.y1 = 0; extents.x2 = pWin->drawable.width; extents.y2 = pWin->drawable.height; - return REGION_CREATE(pWin->drawable.pScreen, &extents, 1); + return RegionCreate(&extents, 1); } static int @@ -323,7 +323,7 @@ ProcShapeRectangles (ClientPtr client) ctype = VerifyRectOrder(nrects, prects, (int)stuff->ordering); if (ctype < 0) return BadMatch; - srcRgn = RECTS_TO_REGION(pScreen, nrects, prects, ctype); + srcRgn = RegionFromRects(nrects, prects, ctype); if (!pWin->optional) MakeWindowOptional (pWin); @@ -419,7 +419,7 @@ ProcShapeMask (ClientPtr client) if (pPixmap->drawable.pScreen != pScreen || pPixmap->drawable.depth != 1) return BadMatch; - srcRgn = BITMAP_TO_REGION(pScreen, pPixmap); + srcRgn = BitmapToRegion(pScreen, pPixmap); if (!srcRgn) return BadAlloc; } @@ -547,8 +547,8 @@ ProcShapeCombine (ClientPtr client) } if (srcRgn) { - tmp = REGION_CREATE(pScreen, (BoxPtr) 0, 0); - REGION_COPY(pScreen, tmp, srcRgn); + tmp = RegionCreate((BoxPtr) 0, 0); + RegionCopy(tmp, srcRgn); srcRgn = tmp; } else srcRgn = (*createSrc) (pSrcWin); @@ -641,7 +641,7 @@ ProcShapeOffset (ClientPtr client) pScreen = pWin->drawable.pScreen; if (srcRgn) { - REGION_TRANSLATE(pScreen, srcRgn, stuff->xOff, stuff->yOff); + RegionTranslate(srcRgn, stuff->xOff, stuff->yOff); (*pScreen->SetShape) (pWin, stuff->destKind); } SendShapeNotify (pWin, (int)stuff->destKind); @@ -697,7 +697,7 @@ ProcShapeQueryExtents (ClientPtr client) rep.clipShaped = (wClipShape(pWin) != 0); if ((region = wBoundingShape(pWin))) { /* this is done in two steps because of a compiler bug on SunOS 4.1.3 */ - pExtents = REGION_EXTENTS(pWin->drawable.pScreen, region); + pExtents = RegionExtents(region); extents = *pExtents; } else { extents.x1 = -wBorderWidth (pWin); @@ -711,7 +711,7 @@ ProcShapeQueryExtents (ClientPtr client) rep.heightBoundingShape = extents.y2 - extents.y1; if ((region = wClipShape(pWin))) { /* this is done in two steps because of a compiler bug on SunOS 4.1.3 */ - pExtents = REGION_EXTENTS(pWin->drawable.pScreen, region); + pExtents = RegionExtents(region); extents = *pExtents; } else { extents.x1 = 0; @@ -899,7 +899,7 @@ SendShapeNotify (WindowPtr pWin, int which) case ShapeBounding: region = wBoundingShape(pWin); if (region) { - extents = *REGION_EXTENTS(pWin->drawable.pScreen, region); + extents = *RegionExtents(region); shaped = xTrue; } else { extents.x1 = -wBorderWidth (pWin); @@ -912,7 +912,7 @@ SendShapeNotify (WindowPtr pWin, int which) case ShapeClip: region = wClipShape(pWin); if (region) { - extents = *REGION_EXTENTS(pWin->drawable.pScreen, region); + extents = *RegionExtents(region); shaped = xTrue; } else { extents.x1 = 0; @@ -925,7 +925,7 @@ SendShapeNotify (WindowPtr pWin, int which) case ShapeInput: region = wInputShape(pWin); if (region) { - extents = *REGION_EXTENTS(pWin->drawable.pScreen, region); + extents = *RegionExtents(region); shaped = xTrue; } else { extents.x1 = -wBorderWidth (pWin); @@ -1050,8 +1050,8 @@ ProcShapeGetRectangles (ClientPtr client) } } else { BoxPtr box; - nrects = REGION_NUM_RECTS(region); - box = REGION_RECTS(region); + nrects = RegionNumRects(region); + box = RegionRects(region); rects = malloc(nrects * sizeof (xRectangle)); if (!rects && nrects) return BadAlloc; diff --git a/Xext/xace.c b/Xext/xace.c index 53f4b4dee..07e3da516 100644 --- a/Xext/xace.c +++ b/Xext/xace.c @@ -255,12 +255,12 @@ XaceCensorImage( imageBox.y1 = y; imageBox.x2 = x + w; imageBox.y2 = y + h; - REGION_INIT(pScreen, &imageRegion, &imageBox, 1); - REGION_NULL(pScreen, &censorRegion); + RegionInit(&imageRegion, &imageBox, 1); + RegionNull(&censorRegion); /* censorRegion = imageRegion - visibleRegion */ - REGION_SUBTRACT(pScreen, &censorRegion, &imageRegion, pVisibleRegion); - nRects = REGION_NUM_RECTS(&censorRegion); + RegionSubtract(&censorRegion, &imageRegion, pVisibleRegion); + nRects = RegionNumRects(&censorRegion); if (nRects > 0) { /* we have something to censor */ GCPtr pScratchGC = NULL; @@ -280,7 +280,7 @@ XaceCensorImage( failed = TRUE; goto failSafe; } - for (pBox = REGION_RECTS(&censorRegion), i = 0; + for (pBox = RegionRects(&censorRegion), i = 0; i < nRects; i++, pBox++) { @@ -330,8 +330,8 @@ XaceCensorImage( if (pScratchGC) FreeScratchGC(pScratchGC); if (pPix) FreeScratchPixmapHeader(pPix); } - REGION_UNINIT(pScreen, &imageRegion); - REGION_UNINIT(pScreen, &censorRegion); + RegionUninit(&imageRegion); + RegionUninit(&censorRegion); } /* XaceCensorImage */ /* |