summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2004-07-31 07:26:50 +0000
committerEric Anholt <anholt@freebsd.org>2004-07-31 07:26:50 +0000
commit8763cca7f9927bd6c9caf804bf09dcfea929eed0 (patch)
tree84330b1981992c44f2ec6851092418a10a2c1a1f
parent25bd6ff4a622d09fb0c247b7c40281744c61431e (diff)
Update xfixes server code to major version 3 from xserver CVS, and perform
minor diff-reduction versus xserver CVS.
-rwxr-xr-xxfixes/region.c66
-rwxr-xr-xxfixes/xfixes.c5
-rwxr-xr-xxfixes/xfixes.h2
-rwxr-xr-xxfixes/xfixesint.h6
4 files changed, 72 insertions, 7 deletions
diff --git a/xfixes/region.c b/xfixes/region.c
index 6deef4b95..d80776d8c 100755
--- a/xfixes/region.c
+++ b/xfixes/region.c
@@ -34,11 +34,6 @@ extern int RenderErrBase;
#include <regionstr.h>
#include <gcstruct.h>
#include <window.h>
-#ifdef SKK
-#ifdef SHAPE
-#include <shapeint.h>
-#endif
-#endif
RESTYPE RegionResType;
@@ -155,7 +150,6 @@ SProcXFixesCreateRegionFromBitmap (ClientPtr client)
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
-
int
ProcXFixesCreateRegionFromWindow (ClientPtr client)
{
@@ -794,3 +788,63 @@ SProcXFixesSetPictureClipRegion (ClientPtr client)
swaps (&stuff->yOrigin, n);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
+
+int
+ProcXFixesExpandRegion (ClientPtr client)
+{
+ RegionPtr pSource, pDestination;
+ int ret = Success;
+ REQUEST (xXFixesExpandRegionReq);
+ BoxPtr pTmp;
+ BoxPtr pSrc;
+ int nBoxes;
+ int i;
+
+ REQUEST_SIZE_MATCH (xXFixesExpandRegionReq);
+ VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess);
+ VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess);
+
+ nBoxes = REGION_NUM_RECTS(pSource);
+ pSrc = REGION_RECTS(pSource);
+ if (nBoxes)
+ {
+ pTmp = xalloc (nBoxes * sizeof (BoxRec));
+ if (!pTmp)
+ return BadAlloc;
+ for (i = 0; i < nBoxes; i++)
+ {
+ pTmp[i].x1 = pSrc[i].x1 - stuff->left;
+ pTmp[i].x2 = pSrc[i].x2 + stuff->right;
+ pTmp[i].y1 = pSrc[i].y1 - stuff->top;
+ pTmp[i].y2 = pSrc[i].y2 + stuff->bottom;
+ }
+ REGION_EMPTY (pScreen, pDestination);
+ for (i = 0; i < nBoxes; i++)
+ {
+ RegionRec r;
+ REGION_INIT (pScreen, &r, &pTmp[i], 0);
+ REGION_UNION (pScreen, pDestination, pDestination, &r);
+ }
+ }
+ if (ret == Success)
+ ret = client->noClientException;
+ return ret;
+}
+
+int
+SProcXFixesExpandRegion (ClientPtr client)
+{
+ int n;
+ REQUEST (xXFixesExpandRegionReq);
+
+ swaps (&stuff->length, n);
+ REQUEST_SIZE_MATCH (xXFixesExpandRegionReq);
+ swapl (&stuff->source, n);
+ swapl (&stuff->destination, n);
+ swaps (&stuff->left, n);
+ swaps (&stuff->right, n);
+ swaps (&stuff->top, n);
+ swaps (&stuff->bottom, n);
+ return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
+}
+
diff --git a/xfixes/xfixes.c b/xfixes/xfixes.c
index 6aa2007ed..82063d6b3 100755
--- a/xfixes/xfixes.c
+++ b/xfixes/xfixes.c
@@ -72,6 +72,7 @@ static const int version_requests[] = {
X_XFixesQueryVersion, /* before client sends QueryVersion */
X_XFixesGetCursorImage, /* Version 1 */
X_XFixesChangeCursorByName, /* Version 2 */
+ X_XFixesExpandRegion, /* Version 3 */
};
#define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0]))
@@ -107,6 +108,8 @@ int (*ProcXFixesVector[XFixesNumberRequests])(ClientPtr) = {
ProcXFixesGetCursorImageAndName,
ProcXFixesChangeCursor,
ProcXFixesChangeCursorByName,
+/*************** Version 3 ******************/
+ ProcXFixesExpandRegion,
};
static int
@@ -165,6 +168,8 @@ int (*SProcXFixesVector[XFixesNumberRequests])(ClientPtr) = {
SProcXFixesGetCursorImageAndName,
SProcXFixesChangeCursor,
SProcXFixesChangeCursorByName,
+/*************** Version 3 ******************/
+ SProcXFixesExpandRegion,
};
static int
diff --git a/xfixes/xfixes.h b/xfixes/xfixes.h
index d03b57c64..4d329b63a 100755
--- a/xfixes/xfixes.h
+++ b/xfixes/xfixes.h
@@ -44,7 +44,7 @@ extern int XFixesErrorBase;
}
RegionPtr
-XFixesRegionCopy (RegionPtr pRegion);
+XFixesRegionCopy (RegionPtr pRegion);
#endif /* _XFIXES_H_ */
diff --git a/xfixes/xfixesint.h b/xfixes/xfixesint.h
index 565df62a2..5b1786d06 100755
--- a/xfixes/xfixesint.h
+++ b/xfixes/xfixesint.h
@@ -230,4 +230,10 @@ ProcXFixesSetPictureClipRegion (ClientPtr client);
int
SProcXFixesSetPictureClipRegion (ClientPtr client);
+int
+ProcXFixesExpandRegion (ClientPtr client);
+
+int
+SProcXFixesExpandRegion (ClientPtr client);
+
#endif /* _XFIXESINT_H_ */