aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xext/shape.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/Xext/shape.c')
-rw-r--r--xorg-server/Xext/shape.c70
1 files changed, 31 insertions, 39 deletions
diff --git a/xorg-server/Xext/shape.c b/xorg-server/Xext/shape.c
index ee635e9c2..3ee9e027e 100644
--- a/xorg-server/Xext/shape.c
+++ b/xorg-server/Xext/shape.c
@@ -152,14 +152,12 @@ RegionOperate (
int xoff, int yoff,
CreateDftPtr create)
{
- 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;
}
@@ -170,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 */
}
@@ -189,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;
@@ -208,21 +206,21 @@ 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);
- (*pScreen->SetShape) (pWin);
+ RegionDestroy(srcRgn);
+ (*pWin->drawable.pScreen->SetShape) (pWin, kind);
SendShapeNotify (pWin, kind);
return Success;
}
@@ -236,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
@@ -248,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
@@ -283,7 +281,6 @@ static int
ProcShapeRectangles (ClientPtr client)
{
WindowPtr pWin;
- ScreenPtr pScreen;
REQUEST(xShapeRectanglesReq);
xRectangle *prects;
int nrects, ctype, rc;
@@ -316,7 +313,6 @@ ProcShapeRectangles (ClientPtr client)
client->errorValue = stuff->ordering;
return BadValue;
}
- pScreen = pWin->drawable.pScreen;
nrects = ((stuff->length << 2) - sizeof(xShapeRectanglesReq));
if (nrects & 4)
return BadLength;
@@ -325,7 +321,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);
@@ -369,7 +365,7 @@ ProcPanoramiXShapeRectangles(
result = ProcShapeRectangles (client);
if (result != Success) break;
}
- return (result);
+ return result;
}
#endif
@@ -421,7 +417,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;
}
@@ -478,7 +474,7 @@ ProcPanoramiXShapeMask(
result = ProcShapeMask (client);
if (result != Success) break;
}
- return (result);
+ return result;
}
#endif
@@ -491,7 +487,6 @@ static int
ProcShapeCombine (ClientPtr client)
{
WindowPtr pSrcWin, pDestWin;
- ScreenPtr pScreen;
REQUEST(xShapeCombineReq);
RegionPtr srcRgn;
RegionPtr *destRgn;
@@ -521,7 +516,6 @@ ProcShapeCombine (ClientPtr client)
client->errorValue = stuff->destKind;
return BadValue;
}
- pScreen = pDestWin->drawable.pScreen;
rc = dixLookupWindow(&pSrcWin, stuff->src, client, DixGetAttrAccess);
if (rc != Success)
@@ -543,14 +537,14 @@ ProcShapeCombine (ClientPtr client)
client->errorValue = stuff->srcKind;
return BadValue;
}
- if (pSrcWin->drawable.pScreen != pScreen)
+ if (pSrcWin->drawable.pScreen != pDestWin->drawable.pScreen)
{
return BadMatch;
}
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);
@@ -604,7 +598,7 @@ ProcPanoramiXShapeCombine(
result = ProcShapeCombine (client);
if (result != Success) break;
}
- return (result);
+ return result;
}
#endif
@@ -616,7 +610,6 @@ static int
ProcShapeOffset (ClientPtr client)
{
WindowPtr pWin;
- ScreenPtr pScreen;
REQUEST(xShapeOffsetReq);
RegionPtr srcRgn;
int rc;
@@ -640,11 +633,10 @@ ProcShapeOffset (ClientPtr client)
client->errorValue = stuff->destKind;
return BadValue;
}
- pScreen = pWin->drawable.pScreen;
if (srcRgn)
{
- REGION_TRANSLATE(pScreen, srcRgn, stuff->xOff, stuff->yOff);
- (*pScreen->SetShape) (pWin);
+ RegionTranslate(srcRgn, stuff->xOff, stuff->yOff);
+ (*pWin->drawable.pScreen->SetShape) (pWin, stuff->destKind);
}
SendShapeNotify (pWin, (int)stuff->destKind);
return Success;
@@ -672,7 +664,7 @@ ProcPanoramiXShapeOffset(
result = ProcShapeOffset (client);
if(result != Success) break;
}
- return (result);
+ return result;
}
#endif
@@ -699,7 +691,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);
@@ -713,7 +705,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;
@@ -901,7 +893,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);
@@ -914,7 +906,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;
@@ -927,7 +919,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);
@@ -1052,8 +1044,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;