Shape extension is built-in and mandatory.

This commit is contained in:
Adam Jackson
2008-07-24 09:00:22 -04:00
parent 990fc643ae
commit d6228cb22a
40 changed files with 2 additions and 201 deletions

View File

@@ -1044,9 +1044,7 @@ ProcTranslateCoords(ClientPtr client)
pWin = pDst->firstChild;
while (pWin)
{
#ifdef SHAPE
BoxRec box;
#endif
if ((pWin->mapped) &&
(x >= pWin->drawable.x - wBorderWidth (pWin)) &&
(x < pWin->drawable.x + (int)pWin->drawable.width +
@@ -1054,7 +1052,6 @@ ProcTranslateCoords(ClientPtr client)
(y >= pWin->drawable.y - wBorderWidth (pWin)) &&
(y < pWin->drawable.y + (int)pWin->drawable.height +
wBorderWidth (pWin))
#ifdef SHAPE
/* When a window is shaped, a further check
* is made to see if the point is inside
* borderSize
@@ -1068,7 +1065,6 @@ ProcTranslateCoords(ClientPtr client)
wInputShape(pWin),
x - pWin->drawable.x,
y - pWin->drawable.y, &box))
#endif
)
{
rep.child = pWin->drawable.id;

View File

@@ -815,7 +815,6 @@ SetCriticalEvent(int event)
criticalEvents[event >> 3] |= 1 << (event & 7);
}
#ifdef SHAPE
void
ConfineToShape(DeviceIntPtr pDev, RegionPtr shape, int *px, int *py)
{
@@ -853,7 +852,6 @@ ConfineToShape(DeviceIntPtr pDev, RegionPtr shape, int *px, int *py)
*px = x;
*py = y;
}
#endif
static void
CheckPhysLimits(
@@ -887,10 +885,8 @@ CheckPhysLimits(
else
if (new.y >= pSprite->physLimits.y2)
new.y = pSprite->physLimits.y2 - 1;
#ifdef SHAPE
if (pSprite->hotShape)
ConfineToShape(pDev, pSprite->hotShape, &new.x, &new.y);
#endif
if ((pScreen != pSprite->hotPhys.pScreen) ||
(new.x != pSprite->hotPhys.x) || (new.y != pSprite->hotPhys.y))
{
@@ -942,11 +938,9 @@ CheckVirtualMotion(
pSprite->hot.y = lims.y1;
else if (pSprite->hot.y >= lims.y2)
pSprite->hot.y = lims.y2 - 1;
#ifdef SHAPE
if (wBoundingShape(pWin))
ConfineToShape(pDev, &pWin->borderSize,
&pSprite->hot.x, &pSprite->hot.y);
#endif
if (qe)
{
qe->pScreen = pSprite->hot.pScreen;
@@ -982,10 +976,8 @@ ConfineCursorToWindow(DeviceIntPtr pDev, WindowPtr pWin, Bool generateEvents, Bo
else
{
pSprite->hotLimits = *REGION_EXTENTS( pScreen, &pWin->borderSize);
#ifdef SHAPE
pSprite->hotShape = wBoundingShape(pWin) ? &pWin->borderSize
: NullRegion;
#endif
CheckPhysLimits(pDev, pSprite->current, generateEvents,
confineToScreen, pScreen);
}
@@ -2628,7 +2620,6 @@ XYToWindow(DeviceIntPtr pDev, int x, int y)
(y >= pWin->drawable.y - wBorderWidth (pWin)) &&
(y < pWin->drawable.y + (int)pWin->drawable.height +
wBorderWidth (pWin))
#ifdef SHAPE
/* When a window is shaped, a further check
* is made to see if the point is inside
* borderSize
@@ -2639,7 +2630,6 @@ XYToWindow(DeviceIntPtr pDev, int x, int y)
wInputShape(pWin),
x - pWin->drawable.x,
y - pWin->drawable.y, &box))
#endif
#ifdef ROOTLESS
/* In rootless mode windows may be offscreen, even when
* they're in X's stack. (E.g. if the native window system
@@ -2732,10 +2722,8 @@ CheckMotion(xEvent *xE, DeviceIntPtr pDev)
pSprite->hot.y = pSprite->physLimits.y1;
else if (pSprite->hot.y >= pSprite->physLimits.y2)
pSprite->hot.y = pSprite->physLimits.y2 - 1;
#ifdef SHAPE
if (pSprite->hotShape)
ConfineToShape(pDev, pSprite->hotShape, &pSprite->hot.x, &pSprite->hot.y);
#endif
#ifdef XEVIE
xeviehot.x = pSprite->hot.x;
xeviehot.y = pSprite->hot.y;
@@ -2970,9 +2958,7 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin)
pSprite->hotLimits.y2 = PanoramiXPixHeight - panoramiXdataPtr[0].y;
pSprite->physLimits = pSprite->hotLimits;
pSprite->confineWin = NullWindow;
#ifdef SHAPE
pSprite->hotShape = NullRegion;
#endif
pSprite->screen = pScreen;
/* gotta UNINIT these someplace */
REGION_NULL(pScreen, &pSprite->Reg1);
@@ -3305,10 +3291,8 @@ ProcWarpPointer(ClientPtr client)
y = pSprite->physLimits.y1;
else if (y >= pSprite->physLimits.y2)
y = pSprite->physLimits.y2 - 1;
#if defined(SHAPE)
if (pSprite->hotShape)
ConfineToShape(PickPointer(client), pSprite->hotShape, &x, &y);
#endif
(*newScreen->SetCursorPosition)(PickPointer(client), newScreen, x, y,
TRUE);
}

View File

@@ -407,11 +407,9 @@ CreateRootWindow(ScreenPtr pScreen)
pWin->optional->userProps = NULL;
pWin->optional->backingBitPlanes = ~0L;
pWin->optional->backingPixel = 0;
#ifdef SHAPE
pWin->optional->boundingShape = NULL;
pWin->optional->clipShape = NULL;
pWin->optional->inputShape = NULL;
#endif
pWin->optional->inputMasks = NULL;
pWin->optional->deviceCursors = NULL;
pWin->optional->geMasks = (GenericClientMasksPtr)xcalloc(1, sizeof(GenericClientMasksRec));
@@ -884,14 +882,12 @@ FreeWindowResources(WindowPtr pWin)
REGION_UNINIT(pScreen, &pWin->winSize);
REGION_UNINIT(pScreen, &pWin->borderClip);
REGION_UNINIT(pScreen, &pWin->borderSize);
#ifdef SHAPE
if (wBoundingShape (pWin))
REGION_DESTROY(pScreen, wBoundingShape (pWin));
if (wClipShape (pWin))
REGION_DESTROY(pScreen, wClipShape (pWin));
if (wInputShape (pWin))
REGION_DESTROY(pScreen, wInputShape (pWin));
#endif
if (pWin->borderIsPixel == FALSE)
(*pScreen->DestroyPixmap)(pWin->border.pixmap);
if (pWin->backgroundState == BackgroundPixmap)
@@ -1679,7 +1675,6 @@ CreateUnclippedWinSize (WindowPtr pWin)
box.x2 = pWin->drawable.x + (int) pWin->drawable.width;
box.y2 = pWin->drawable.y + (int) pWin->drawable.height;
pRgn = REGION_CREATE(pWin->drawable.pScreen, &box, 1);
#ifdef SHAPE
if (wBoundingShape (pWin) || wClipShape (pWin)) {
ScreenPtr pScreen;
pScreen = pWin->drawable.pScreen;
@@ -1692,7 +1687,6 @@ CreateUnclippedWinSize (WindowPtr pWin)
REGION_INTERSECT(pScreen, pRgn, pRgn, wClipShape (pWin));
REGION_TRANSLATE(pScreen, pRgn, pWin->drawable.x, pWin->drawable.y);
}
#endif
return pRgn;
}
@@ -1720,7 +1714,6 @@ SetWinSize (WindowPtr pWin)
pWin->drawable.x, pWin->drawable.y,
(int)pWin->drawable.width,
(int)pWin->drawable.height);
#ifdef SHAPE
if (wBoundingShape (pWin) || wClipShape (pWin)) {
ScreenPtr pScreen;
pScreen = pWin->drawable.pScreen;
@@ -1736,7 +1729,6 @@ SetWinSize (WindowPtr pWin)
REGION_TRANSLATE(pScreen, &pWin->winSize, pWin->drawable.x,
pWin->drawable.y);
}
#endif
}
_X_EXPORT void
@@ -1767,7 +1759,6 @@ SetBorderSize (WindowPtr pWin)
pWin->drawable.x - bw, pWin->drawable.y - bw,
(int)(pWin->drawable.width + (bw<<1)),
(int)(pWin->drawable.height + (bw<<1)));
#ifdef SHAPE
if (wBoundingShape (pWin)) {
ScreenPtr pScreen;
pScreen = pWin->drawable.pScreen;
@@ -1781,7 +1772,6 @@ SetBorderSize (WindowPtr pWin)
REGION_UNION(pScreen, &pWin->borderSize, &pWin->borderSize,
&pWin->winSize);
}
#endif
} else {
REGION_COPY(pWin->drawable.pScreen, &pWin->borderSize,
&pWin->winSize);
@@ -1972,7 +1962,6 @@ WindowExtents(
return(pBox);
}
#ifdef SHAPE
#define IS_SHAPED(pWin) (wBoundingShape (pWin) != (RegionPtr) NULL)
static RegionPtr
@@ -2017,7 +2006,6 @@ ShapeOverlap (
REGION_DESTROY(pScreen, pSibRgn);
return ret;
}
#endif
static Bool
AnyWindowOverlapsMe(
@@ -2035,9 +2023,7 @@ AnyWindowOverlapsMe(
{
sbox = WindowExtents(pSib, &sboxrec);
if (BOXES_OVERLAP(sbox, box)
#ifdef SHAPE
&& ShapeOverlap (pWin, box, pSib, sbox)
#endif
)
return(TRUE);
}
@@ -2060,9 +2046,7 @@ IOverlapAnyWindow(
{
sbox = WindowExtents(pSib, &sboxrec);
if (BOXES_OVERLAP(sbox, box)
#ifdef SHAPE
&& ShapeOverlap (pWin, box, pSib, sbox)
#endif
)
return(TRUE);
}
@@ -3617,14 +3601,12 @@ CheckWindowOptionalNeed (WindowPtr w)
return;
if (optional->backingPixel != 0)
return;
#ifdef SHAPE
if (optional->boundingShape != NULL)
return;
if (optional->clipShape != NULL)
return;
if (optional->inputShape != NULL)
return;
#endif
if (optional->inputMasks != NULL)
return;
if (optional->deviceCursors != NULL)
@@ -3681,11 +3663,9 @@ MakeWindowOptional (WindowPtr pWin)
optional->userProps = NULL;
optional->backingBitPlanes = ~0L;
optional->backingPixel = 0;
#ifdef SHAPE
optional->boundingShape = NULL;
optional->clipShape = NULL;
optional->inputShape = NULL;
#endif
optional->inputMasks = NULL;
optional->deviceCursors = NULL;