summaryrefslogtreecommitdiff
path: root/hw/xwin
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-05-21 15:05:48 -0700
committerKeith Packard <keithp@keithp.com>2010-06-05 18:59:00 -0700
commit2dc138922b7588515d5f2447e4b9dcdc0bef15e0 (patch)
tree004ca1d730f94a78150c30b3fbc0c87af31f2895 /hw/xwin
parentd17e726e89ef644310de77b960b715c2d11088da (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 'hw/xwin')
-rw-r--r--hw/xwin/winfillsp.c6
-rw-r--r--hw/xwin/wingc.c2
-rw-r--r--hw/xwin/winmultiwindowshape.c12
-rw-r--r--hw/xwin/winsetsp.c4
-rw-r--r--hw/xwin/winshaddd.c6
-rw-r--r--hw/xwin/winshadddnl.c6
-rw-r--r--hw/xwin/winshadgdi.c6
-rwxr-xr-xhw/xwin/winvideo.c2
-rwxr-xr-xhw/xwin/winwin32rootless.c4
-rw-r--r--hw/xwin/winwindow.c26
-rwxr-xr-xhw/xwin/winwindowswm.c8
11 files changed, 41 insertions, 41 deletions
diff --git a/hw/xwin/winfillsp.c b/hw/xwin/winfillsp.c
index 702f34f96..1e8e3e6f1 100644
--- a/hw/xwin/winfillsp.c
+++ b/hw/xwin/winfillsp.c
@@ -80,8 +80,8 @@ winFillSpansNativeGDI (DrawablePtr pDrawable,
int fullX1, fullX2, fullY1;
HRGN hrgn = NULL, combined = NULL;
- nbox = REGION_NUM_RECTS (pClip);
- pbox = REGION_RECTS (pClip);
+ nbox = RegionNumRects (pClip);
+ pbox = RegionRects (pClip);
if (!nbox) return;
@@ -97,7 +97,7 @@ winFillSpansNativeGDI (DrawablePtr pDrawable,
pbox++;
}
- pextent = REGION_EXTENTS (pGC->pScreen, pClip);
+ pextent = RegionExtents(pClip);
extentX1 = pextent->x1;
extentY1 = pextent->y1;
extentX2 = pextent->x2;
diff --git a/hw/xwin/wingc.c b/hw/xwin/wingc.c
index 1f3775263..196b5b5dd 100644
--- a/hw/xwin/wingc.c
+++ b/hw/xwin/wingc.c
@@ -210,7 +210,7 @@ winDestroyGCNativeGDI (GCPtr pGC)
winScreenPriv(pGC->pScreen);
if (pGC->freeCompClip)
- REGION_DESTROY (pGC->pScreen, pGC->pCompositeClip);
+ RegionDestroy(pGC->pCompositeClip);
/* Free the memory DC */
if (pGCPriv->hdcMem != NULL)
diff --git a/hw/xwin/winmultiwindowshape.c b/hw/xwin/winmultiwindowshape.c
index 597eab62c..9b4910b9c 100644
--- a/hw/xwin/winmultiwindowshape.c
+++ b/hw/xwin/winmultiwindowshape.c
@@ -117,15 +117,15 @@ winReshapeMultiWindow (WindowPtr pWin)
if (!wBoundingShape (pWin))
return;
- REGION_NULL(pWin->drawable.pScreen, &rrNewShape);
- REGION_COPY(pWin->drawable.pScreen, &rrNewShape, wBoundingShape(pWin));
- REGION_TRANSLATE(pWin->drawable.pScreen,
+ RegionNull(&rrNewShape);
+ RegionCopy(&rrNewShape, wBoundingShape(pWin));
+ RegionTranslate(
&rrNewShape,
pWin->borderWidth,
pWin->borderWidth);
- nRects = REGION_NUM_RECTS(&rrNewShape);
- pShape = REGION_RECTS(&rrNewShape);
+ nRects = RegionNumRects(&rrNewShape);
+ pShape = RegionRects(&rrNewShape);
/* Don't do anything if there are no rectangles in the region */
if (nRects > 0)
@@ -205,7 +205,7 @@ winReshapeMultiWindow (WindowPtr pWin)
pWinPriv->hRgn = hRgn;
}
- REGION_UNINIT(pWin->drawable.pScreen, &rrNewShape);
+ RegionUninit(&rrNewShape);
return;
}
diff --git a/hw/xwin/winsetsp.c b/hw/xwin/winsetsp.c
index f894d6cda..d1bf90b57 100644
--- a/hw/xwin/winsetsp.c
+++ b/hw/xwin/winsetsp.c
@@ -54,8 +54,8 @@ winSetSpansNativeGDI (DrawablePtr pDrawable,
int nbox;
BoxPtr pbox;
- nbox = REGION_NUM_RECTS (pGC->pCompositeClip);
- pbox = REGION_RECTS (pGC->pCompositeClip);
+ nbox = RegionNumRects (pGC->pCompositeClip);
+ pbox = RegionRects (pGC->pCompositeClip);
if (!nbox) return;
diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
index 85dc10f53..8dd1084e6 100644
--- a/hw/xwin/winshaddd.c
+++ b/hw/xwin/winshaddd.c
@@ -525,8 +525,8 @@ winShadowUpdateDD (ScreenPtr pScreen,
HRESULT ddrval = DD_OK;
RECT rcDest, rcSrc;
POINT ptOrigin;
- DWORD dwBox = REGION_NUM_RECTS (damage);
- BoxPtr pBox = REGION_RECTS (damage);
+ DWORD dwBox = RegionNumRects (damage);
+ BoxPtr pBox = RegionRects (damage);
HRGN hrgnTemp = NULL, hrgnCombined = NULL;
/*
@@ -588,7 +588,7 @@ winShadowUpdateDD (ScreenPtr pScreen,
}
else
{
- BoxPtr pBoxExtents = REGION_EXTENTS (pScreen, damage);
+ BoxPtr pBoxExtents = RegionExtents(damage);
/* Compute a GDI region from the damaged region */
hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index e78fbd9e6..5ca3e4f62 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -601,8 +601,8 @@ winShadowUpdateDDNL (ScreenPtr pScreen,
HRESULT ddrval = DD_OK;
RECT rcDest, rcSrc;
POINT ptOrigin;
- DWORD dwBox = REGION_NUM_RECTS (damage);
- BoxPtr pBox = REGION_RECTS (damage);
+ DWORD dwBox = RegionNumRects (damage);
+ BoxPtr pBox = RegionRects (damage);
HRGN hrgnTemp = NULL, hrgnCombined = NULL;
/*
@@ -677,7 +677,7 @@ winShadowUpdateDDNL (ScreenPtr pScreen,
}
else
{
- BoxPtr pBoxExtents = REGION_EXTENTS (pScreen, damage);
+ BoxPtr pBoxExtents = RegionExtents(damage);
/* Compute a GDI region from the damaged region */
hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index d38e4f76b..96d149c2b 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -499,8 +499,8 @@ winShadowUpdateGDI (ScreenPtr pScreen,
winScreenPriv(pScreen);
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
RegionPtr damage = shadowDamage(pBuf);
- DWORD dwBox = REGION_NUM_RECTS (damage);
- BoxPtr pBox = REGION_RECTS (damage);
+ DWORD dwBox = RegionNumRects (damage);
+ BoxPtr pBox = RegionRects (damage);
int x, y, w, h;
HRGN hrgnTemp = NULL, hrgnCombined = NULL;
#ifdef XWIN_UPDATESTATS
@@ -508,7 +508,7 @@ winShadowUpdateGDI (ScreenPtr pScreen,
static DWORD s_dwTotalUpdates = 0;
static DWORD s_dwTotalBoxes = 0;
#endif
- BoxPtr pBoxExtents = REGION_EXTENTS (pScreen, damage);
+ BoxPtr pBoxExtents = RegionExtents(damage);
/*
* Return immediately if the app is not active
diff --git a/hw/xwin/winvideo.c b/hw/xwin/winvideo.c
index 4cdb3c485..0438e5f54 100755
--- a/hw/xwin/winvideo.c
+++ b/hw/xwin/winvideo.c
@@ -185,7 +185,7 @@ winSetupImageVideo (ScreenPtr pScreen)
#if 0
/* gotta uninit this someplace */
- REGION_NULL(pScreen, &pPriv->clip);
+ RegionNull(&pPriv->clip);
#endif
#if 0
diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c
index c225a4495..9749861fd 100755
--- a/hw/xwin/winwin32rootless.c
+++ b/hw/xwin/winwin32rootless.c
@@ -150,8 +150,8 @@ winMWExtWMCreateRgnFromRegion (RegionPtr pShape)
if (pShape == NULL) return NULL;
- nRects = REGION_NUM_RECTS(pShape);
- pRects = REGION_RECTS(pShape);
+ nRects = RegionNumRects(pShape);
+ pRects = RegionRects(pShape);
hRgn = CreateRectRgn (0, 0, 0, 0);
if (hRgn == NULL)
diff --git a/hw/xwin/winwindow.c b/hw/xwin/winwindow.c
index 9348d5c1c..bc0614dc1 100644
--- a/hw/xwin/winwindow.c
+++ b/hw/xwin/winwindow.c
@@ -147,22 +147,22 @@ winCopyWindowNativeGDI (WindowPtr pWin,
pwinRoot = pWin->drawable.pScreen->root;
/* Create a region for the destination */
- prgnDst = REGION_CREATE(pWin->drawable.pScreen, NULL, 1);
+ prgnDst = RegionCreate(NULL, 1);
/* Calculate the shift from the source to the destination */
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
/* Translate the region from the destination to the source? */
- REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
- REGION_INTERSECT(pWin->drawable.pScreen, prgnDst, &pWin->borderClip,
+ RegionTranslate(prgnSrc, -dx, -dy);
+ RegionIntersect(prgnDst, &pWin->borderClip,
prgnSrc);
/* Get a pointer to the first box in the region to be copied */
- pBox = REGION_RECTS(prgnDst);
+ pBox = RegionRects(prgnDst);
/* Get the number of boxes in the region */
- nbox = REGION_NUM_RECTS(prgnDst);
+ nbox = RegionNumRects(prgnDst);
/* Allocate source points for each box */
if(!(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec))))
@@ -179,7 +179,7 @@ winCopyWindowNativeGDI (WindowPtr pWin,
}
/* Setup loop pointers again */
- pBoxDst = REGION_RECTS(prgnDst);
+ pBoxDst = RegionRects(prgnDst);
ppt = pptSrc;
#if 0
@@ -205,7 +205,7 @@ winCopyWindowNativeGDI (WindowPtr pWin,
/* Cleanup the regions, etc. */
free(pptSrc);
- REGION_DESTROY(pWin->drawable.pScreen, prgnDst);
+ RegionDestroy(prgnDst);
}
@@ -593,13 +593,13 @@ winReshapeRootless (WindowPtr pWin)
if (!wBoundingShape (pWin))
return;
- REGION_NULL(pScreen, &rrNewShape);
- REGION_COPY(pScreen, &rrNewShape, wBoundingShape(pWin));
- REGION_TRANSLATE(pScreen, &rrNewShape, pWin->borderWidth,
+ RegionNull(&rrNewShape);
+ RegionCopy(&rrNewShape, wBoundingShape(pWin));
+ RegionTranslate(&rrNewShape, pWin->borderWidth,
pWin->borderWidth);
- nRects = REGION_NUM_RECTS(&rrNewShape);
- pShape = REGION_RECTS(&rrNewShape);
+ nRects = RegionNumRects(&rrNewShape);
+ pShape = RegionRects(&rrNewShape);
if (nRects > 0)
{
@@ -631,7 +631,7 @@ winReshapeRootless (WindowPtr pWin)
pWinPriv->hRgn = hRgn;
}
- REGION_UNINIT(pScreen, &rrNewShape);
+ RegionUninit(&rrNewShape);
return;
}
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index 99329c383..5935ac453 100755
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -495,11 +495,11 @@ ProcWindowsWMFrameDraw (register ClientPtr client)
/* wBoundingShape is relative to *inner* origin of window.
Translate by borderWidth to get the outside-relative position. */
- REGION_NULL(pScreen, &newShape);
- REGION_COPY(pScreen, &newShape, wBoundingShape(pWin));
- REGION_TRANSLATE(pScreen, &newShape, pWin->borderWidth, pWin->borderWidth);
+ RegionNull(&newShape);
+ RegionCopy(&newShape, wBoundingShape(pWin));
+ RegionTranslate(&newShape, pWin->borderWidth, pWin->borderWidth);
winMWExtWMReshapeFrame (pRLWinPriv, &newShape);
- REGION_UNINIT(pScreen, &newShape);
+ RegionUninit(&newShape);
}
#if CYGMULTIWINDOW_DEBUG
ErrorF ("ProcWindowsWMFrameDraw - done\n");