aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/xfixes
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/xfixes')
-rw-r--r--xorg-server/xfixes/cursor.c13
-rw-r--r--xorg-server/xfixes/region.c66
-rw-r--r--xorg-server/xfixes/saveset.c6
-rw-r--r--xorg-server/xfixes/select.c2
-rw-r--r--xorg-server/xfixes/xfixes.c6
5 files changed, 47 insertions, 46 deletions
diff --git a/xorg-server/xfixes/cursor.c b/xorg-server/xfixes/cursor.c
index c2c489e3f..bc3b321e0 100644
--- a/xorg-server/xfixes/cursor.c
+++ b/xorg-server/xfixes/cursor.c
@@ -61,8 +61,8 @@ static RESTYPE CursorHideCountType;
static RESTYPE CursorWindowType;
static CursorPtr CursorCurrent[MAXDEVICES];
-static int CursorScreenPrivateKeyIndex;
-static DevPrivateKey CursorScreenPrivateKey = &CursorScreenPrivateKeyIndex;
+static DevPrivateKeyRec CursorScreenPrivateKeyRec;
+#define CursorScreenPrivateKey (&CursorScreenPrivateKeyRec)
static void deleteCursorHideCountsForScreen (ScreenPtr pScreen);
@@ -271,7 +271,7 @@ ProcXFixesSelectCursorInput (ClientPtr client)
if (stuff->eventMask & ~CursorAllEvents)
{
client->errorValue = stuff->eventMask;
- return( BadValue );
+ return BadValue;
}
return XFixesSelectCursorInput (client, pWin, stuff->eventMask);
}
@@ -692,7 +692,7 @@ ReplaceCursor (CursorPtr pCursor,
}
}
/* this "knows" that WindowHasNewCursor doesn't depend on it's argument */
- WindowHasNewCursor (WindowTable[0]);
+ WindowHasNewCursor (screenInfo.screens[0]->root);
}
static Bool
@@ -734,7 +734,7 @@ static Bool
TestForCursorName (CursorPtr pCursor, pointer closure)
{
Atom *pName = closure;
- return (pCursor->name == *pName);
+ return pCursor->name == *pName;
}
int
@@ -1039,6 +1039,9 @@ XFixesCursorInit (void)
if (party_like_its_1989)
CursorVisible = EnableCursor;
+ if (!dixRegisterPrivateKey(&CursorScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+ return FALSE;
+
for (i = 0; i < screenInfo.numScreens; i++)
{
ScreenPtr pScreen = screenInfo.screens[i];
diff --git a/xorg-server/xfixes/region.c b/xorg-server/xfixes/region.c
index 7b1c40b15..0461ded11 100644
--- a/xorg-server/xfixes/region.c
+++ b/xorg-server/xfixes/region.c
@@ -39,20 +39,20 @@ RegionResFree (pointer data, XID id)
{
RegionPtr pRegion = (RegionPtr) data;
- REGION_DESTROY (0, pRegion);
+ RegionDestroy(pRegion);
return Success;
}
RegionPtr
XFixesRegionCopy (RegionPtr pRegion)
{
- RegionPtr pNew = REGION_CREATE (0, REGION_EXTENTS(0, pRegion),
- REGION_NUM_RECTS(pRegion));
+ RegionPtr pNew = RegionCreate(RegionExtents(pRegion),
+ RegionNumRects(pRegion));
if (!pNew)
return 0;
- if (!REGION_COPY (0, pNew, pRegion))
+ if (!RegionCopy(pNew, pRegion))
{
- REGION_DESTROY (0, pNew);
+ RegionDestroy(pNew);
return 0;
}
return pNew;
@@ -63,7 +63,7 @@ XFixesRegionInit (void)
{
RegionResType = CreateNewResourceType(RegionResFree, "XFixesRegion");
- return (RegionResType != 0);
+ return RegionResType != 0;
}
int
@@ -81,7 +81,7 @@ ProcXFixesCreateRegion (ClientPtr client)
return BadLength;
things >>= 3;
- pRegion = RECTS_TO_REGION(0, things, (xRectangle *) (stuff + 1), CT_UNSORTED);
+ pRegion = RegionFromRects(things, (xRectangle *) (stuff + 1), CT_UNSORTED);
if (!pRegion)
return BadAlloc;
if (!AddResource (stuff->region, RegionResType, (pointer) pRegion))
@@ -124,7 +124,7 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client)
if (pPixmap->drawable.depth != 1)
return BadMatch;
- pRegion = BITMAP_TO_REGION(pPixmap->drawable.pScreen, pPixmap);
+ pRegion = BitmapToRegion(pPixmap->drawable.pScreen, pPixmap);
if (!pRegion)
return BadAlloc;
@@ -227,7 +227,7 @@ ProcXFixesCreateRegionFromGC (ClientPtr client)
switch (pGC->clientClipType) {
case CT_PIXMAP:
- pRegion = BITMAP_TO_REGION(pGC->pScreen, (PixmapPtr) pGC->clientClip);
+ pRegion = BitmapToRegion(pGC->pScreen, (PixmapPtr) pGC->clientClip);
if (!pRegion)
return BadAlloc;
break;
@@ -274,7 +274,7 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client)
switch (pPicture->clientClipType) {
case CT_PIXMAP:
- pRegion = BITMAP_TO_REGION(pPicture->pDrawable->pScreen,
+ pRegion = BitmapToRegion(pPicture->pDrawable->pScreen,
(PixmapPtr) pPicture->clientClip);
if (!pRegion)
return BadAlloc;
@@ -346,15 +346,15 @@ ProcXFixesSetRegion (ClientPtr client)
return BadLength;
things >>= 3;
- pNew = RECTS_TO_REGION(0, things, (xRectangle *) (stuff + 1), CT_UNSORTED);
+ pNew = RegionFromRects(things, (xRectangle *) (stuff + 1), CT_UNSORTED);
if (!pNew)
return BadAlloc;
- if (!REGION_COPY (0, pRegion, pNew))
+ if (!RegionCopy(pRegion, pNew))
{
- REGION_DESTROY (0, pNew);
+ RegionDestroy(pNew);
return BadAlloc;
}
- REGION_DESTROY (0, pNew);
+ RegionDestroy(pNew);
return Success;
}
@@ -380,7 +380,7 @@ ProcXFixesCopyRegion (ClientPtr client)
VERIFY_REGION(pSource, stuff->source, client, DixReadAccess);
VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
- if (!REGION_COPY(pScreen, pDestination, pSource))
+ if (!RegionCopy(pDestination, pSource))
return BadAlloc;
return Success;
@@ -412,15 +412,15 @@ ProcXFixesCombineRegion (ClientPtr client)
switch (stuff->xfixesReqType) {
case X_XFixesUnionRegion:
- if (!REGION_UNION (0, pDestination, pSource1, pSource2))
+ if (!RegionUnion(pDestination, pSource1, pSource2))
return BadAlloc;
break;
case X_XFixesIntersectRegion:
- if (!REGION_INTERSECT (0, pDestination, pSource1, pSource2))
+ if (!RegionIntersect(pDestination, pSource1, pSource2))
return BadAlloc;
break;
case X_XFixesSubtractRegion:
- if (!REGION_SUBTRACT (0, pDestination, pSource1, pSource2))
+ if (!RegionSubtract(pDestination, pSource1, pSource2))
return BadAlloc;
break;
}
@@ -466,7 +466,7 @@ ProcXFixesInvertRegion (ClientPtr client)
else
bounds.y2 = stuff->y + stuff->height;
- if (!REGION_INVERSE(0, pDestination, pSource, &bounds))
+ if (!RegionInverse(pDestination, pSource, &bounds))
return BadAlloc;
return Success;
@@ -498,7 +498,7 @@ ProcXFixesTranslateRegion (ClientPtr client)
REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq);
VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess);
- REGION_TRANSLATE(pScreen, pRegion, stuff->dx, stuff->dy);
+ RegionTranslate(pRegion, stuff->dx, stuff->dy);
return Success;
}
@@ -526,7 +526,7 @@ ProcXFixesRegionExtents (ClientPtr client)
VERIFY_REGION(pSource, stuff->source, client, DixReadAccess);
VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
- REGION_RESET (0, pDestination, REGION_EXTENTS (0, pSource));
+ RegionReset(pDestination, RegionExtents(pSource));
return Success;
}
@@ -558,9 +558,9 @@ ProcXFixesFetchRegion (ClientPtr client)
REQUEST_SIZE_MATCH(xXFixesFetchRegionReq);
VERIFY_REGION(pRegion, stuff->region, client, DixReadAccess);
- pExtent = REGION_EXTENTS (0, pRegion);
- pBox = REGION_RECTS (pRegion);
- nBox = REGION_NUM_RECTS (pRegion);
+ pExtent = RegionExtents(pRegion);
+ pBox = RegionRects (pRegion);
+ nBox = RegionNumRects (pRegion);
reply = malloc(sizeof (xXFixesFetchRegionReply) +
nBox * sizeof (xRectangle));
@@ -663,7 +663,6 @@ int
ProcXFixesSetWindowShapeRegion (ClientPtr client)
{
WindowPtr pWin;
- ScreenPtr pScreen;
RegionPtr pRegion;
RegionPtr *pDestRegion;
int rc;
@@ -678,7 +677,6 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client)
return rc;
}
VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixWriteAccess);
- pScreen = pWin->drawable.pScreen;
switch (stuff->destKind) {
case ShapeBounding:
case ShapeClip:
@@ -708,7 +706,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client)
break;
}
if (stuff->xOff || stuff->yOff)
- REGION_TRANSLATE (0, pRegion, stuff->xOff, stuff->yOff);
+ RegionTranslate(pRegion, stuff->xOff, stuff->yOff);
}
else
{
@@ -731,9 +729,9 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client)
pDestRegion = &pRegion; /* a NULL region pointer */
}
if (*pDestRegion)
- REGION_DESTROY(pScreen, *pDestRegion);
+ RegionDestroy(*pDestRegion);
*pDestRegion = pRegion;
- (*pScreen->SetShape) (pWin);
+ (*pWin->drawable.pScreen->SetShape) (pWin, stuff->destKind);
SendShapeNotify (pWin, stuff->destKind);
return Success;
}
@@ -801,8 +799,8 @@ ProcXFixesExpandRegion (ClientPtr client)
VERIFY_REGION(pSource, stuff->source, client, DixReadAccess);
VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
- nBoxes = REGION_NUM_RECTS(pSource);
- pSrc = REGION_RECTS(pSource);
+ nBoxes = RegionNumRects(pSource);
+ pSrc = RegionRects(pSource);
if (nBoxes)
{
pTmp = malloc(nBoxes * sizeof (BoxRec));
@@ -815,12 +813,12 @@ ProcXFixesExpandRegion (ClientPtr client)
pTmp[i].y1 = pSrc[i].y1 - stuff->top;
pTmp[i].y2 = pSrc[i].y2 + stuff->bottom;
}
- REGION_EMPTY (pScreen, pDestination);
+ RegionEmpty(pDestination);
for (i = 0; i < nBoxes; i++)
{
RegionRec r;
- REGION_INIT (pScreen, &r, &pTmp[i], 0);
- REGION_UNION (pScreen, pDestination, pDestination, &r);
+ RegionInit(&r, &pTmp[i], 0);
+ RegionUnion(pDestination, pDestination, &r);
}
free(pTmp);
}
diff --git a/xorg-server/xfixes/saveset.c b/xorg-server/xfixes/saveset.c
index 72bbb4952..dcd66792a 100644
--- a/xorg-server/xfixes/saveset.c
+++ b/xorg-server/xfixes/saveset.c
@@ -43,17 +43,17 @@ ProcXFixesChangeSaveSet(ClientPtr client)
if ((stuff->mode != SetModeInsert) && (stuff->mode != SetModeDelete))
{
client->errorValue = stuff->mode;
- return( BadValue );
+ return BadValue;
}
if ((stuff->target != SaveSetNearest) && (stuff->target != SaveSetRoot))
{
client->errorValue = stuff->target;
- return( BadValue );
+ return BadValue;
}
if ((stuff->map != SaveSetMap) && (stuff->map != SaveSetUnmap))
{
client->errorValue = stuff->map;
- return( BadValue );
+ return BadValue;
}
toRoot = (stuff->target == SaveSetRoot);
map = (stuff->map == SaveSetMap);
diff --git a/xorg-server/xfixes/select.c b/xorg-server/xfixes/select.c
index 00b693f9d..1343ea737 100644
--- a/xorg-server/xfixes/select.c
+++ b/xorg-server/xfixes/select.c
@@ -211,7 +211,7 @@ ProcXFixesSelectSelectionInput (ClientPtr client)
if (stuff->eventMask & ~SelectionAllEvents)
{
client->errorValue = stuff->eventMask;
- return( BadValue );
+ return BadValue;
}
return XFixesSelectSelectionInput (client, stuff->selection,
pWin, stuff->eventMask);
diff --git a/xorg-server/xfixes/xfixes.c b/xorg-server/xfixes/xfixes.c
index 36eda56a5..67e616417 100644
--- a/xorg-server/xfixes/xfixes.c
+++ b/xorg-server/xfixes/xfixes.c
@@ -56,8 +56,8 @@ static unsigned char XFixesReqCode;
int XFixesEventBase;
int XFixesErrorBase;
-static int XFixesClientPrivateKeyIndex;
-static DevPrivateKey XFixesClientPrivateKey = &XFixesClientPrivateKeyIndex;
+static DevPrivateKeyRec XFixesClientPrivateKeyRec;
+#define XFixesClientPrivateKey (&XFixesClientPrivateKeyRec)
static int
ProcXFixesQueryVersion(ClientPtr client)
@@ -241,7 +241,7 @@ XFixesExtensionInit(void)
{
ExtensionEntry *extEntry;
- if (!dixRequestPrivate(XFixesClientPrivateKey, sizeof (XFixesClientRec)))
+ if (!dixRegisterPrivateKey(&XFixesClientPrivateKeyRec, PRIVATE_CLIENT, sizeof (XFixesClientRec)))
return;
if (!AddCallback (&ClientStateCallback, XFixesClientCallback, 0))
return;