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/miext/cw/cw.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'nx-X11/programs/Xserver/miext/cw/cw.c') diff --git a/nx-X11/programs/Xserver/miext/cw/cw.c b/nx-X11/programs/Xserver/miext/cw/cw.c index 8079a0009..9f39b9650 100644 --- a/nx-X11/programs/Xserver/miext/cw/cw.c +++ b/nx-X11/programs/Xserver/miext/cw/cw.c @@ -190,8 +190,8 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable) XID vals[2]; RegionPtr pCompositeClip; - pCompositeClip = REGION_CREATE (pScreen, NULL, 0); - REGION_COPY (pScreen, pCompositeClip, pGC->pCompositeClip); + pCompositeClip = RegionCreate(NULL, 0); + RegionCopy(pCompositeClip, pGC->pCompositeClip); /* Either the drawable has changed, or the clip list in the drawable has * changed. Copy the new clip list over and set the new translated @@ -397,8 +397,8 @@ cwFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, unsigned long pixel) NULL, v); ValidateGC(pDrawable, pGC); - pBox = REGION_RECTS(pRegion); - nbox = REGION_NUM_RECTS(pRegion); + pBox = RegionRects(pRegion); + nbox = RegionNumRects(pRegion); for (i = 0; i < nbox; i++, pBox++) { xRectangle rect; @@ -433,8 +433,8 @@ cwFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, ValidateGC(pDrawable, pGC); - pBox = REGION_RECTS(pRegion); - nbox = REGION_NUM_RECTS(pRegion); + pBox = RegionRects(pRegion); + nbox = RegionNumRects(pRegion); for (i = 0; i < nbox; i++, pBox++) { xRectangle rect; @@ -473,7 +473,7 @@ cwPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what) if (pWin && (pWin->backgroundState == BackgroundPixel || pWin->backgroundState == BackgroundPixmap)) { - REGION_TRANSLATE(pScreen, pRegion, x_screen, y_screen); + RegionTranslate(pRegion, x_screen, y_screen); if (pWin->backgroundState == BackgroundPixel) { cwFillRegionSolid(pBackingDrawable, pRegion, @@ -483,7 +483,7 @@ cwPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what) pWin->background.pixmap, x_off, y_off); } - REGION_TRANSLATE(pScreen, pRegion, -x_screen, -y_screen); + RegionTranslate(pRegion, -x_screen, -y_screen); } } @@ -509,7 +509,7 @@ cwPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what) x_screen = x_off - pWin->drawable.x; y_screen = y_off - pWin->drawable.y; - REGION_TRANSLATE(pScreen, pRegion, x_screen, y_screen); + RegionTranslate(pRegion, x_screen, y_screen); if (pWin->borderIsPixel) { cwFillRegionSolid(pBackingDrawable, pRegion, pWin->border.pixel); @@ -518,7 +518,7 @@ cwPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what) x_off, y_off); } - REGION_TRANSLATE(pScreen, pRegion, -x_screen, -y_screen); + RegionTranslate(pRegion, -x_screen, -y_screen); } SCREEN_EPILOGUE(pScreen, PaintWindowBorder, cwPaintWindowBorder); @@ -545,7 +545,7 @@ cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; - pExtents = REGION_EXTENTS(pScreen, prgnSrc); + pExtents = RegionExtents(prgnSrc); pBackingPixmap = (PixmapPtr) cwGetBackingDrawable((DrawablePtr)pWin, &x_off, &y_off); @@ -558,15 +558,15 @@ cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) dst_y = src_y - dy; /* Translate region (as required by API) */ - REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy); + RegionTranslate(prgnSrc, -dx, -dy); pGC = GetScratchGC(pBackingPixmap->drawable.depth, pScreen); /* * Copy region to GC as clip, aligning as dest clip */ - pClip = REGION_CREATE (pScreen, NULL, 0); - REGION_INTERSECT(pScreen, pClip, &pWin->borderClip, prgnSrc); - REGION_TRANSLATE(pScreen, pClip, + pClip = RegionCreate(NULL, 0); + RegionIntersect(pClip, &pWin->borderClip, prgnSrc); + RegionTranslate(pClip, -pBackingPixmap->screen_x, -pBackingPixmap->screen_y); -- cgit v1.2.3