mi: moved core pointer information from miSpriteScreenRec into a
miCursorInfoRec. bugfix in mipointer, semicolon after preprocessor statement
This commit is contained in:
parent
90bea69dfd
commit
7b4b619d4c
10
Changelog
10
Changelog
|
@ -1,4 +1,14 @@
|
||||||
MPX Changelog file
|
MPX Changelog file
|
||||||
|
== 20.11.06 ==
|
||||||
|
|
||||||
|
mi: moved core pointer information from miSpriteScreenRec into a
|
||||||
|
miCursorInfoRec.
|
||||||
|
bugfix in mipointer, semicolon after preprocessor statement
|
||||||
|
|
||||||
|
Files:
|
||||||
|
mi/mispritest.h
|
||||||
|
mi/misprite.c
|
||||||
|
mi/mipointer.c
|
||||||
|
|
||||||
== 17.11.06 ==
|
== 17.11.06 ==
|
||||||
dix: moved isMPdev field to end of _DeviceIntRec structure
|
dix: moved isMPdev field to end of _DeviceIntRec structure
|
||||||
|
|
|
@ -189,7 +189,7 @@ extern int miPointerScreenIndex;
|
||||||
|
|
||||||
#ifdef MPX
|
#ifdef MPX
|
||||||
_X_EXPORT Bool IsMPDev(DeviceIntPtr pDev);
|
_X_EXPORT Bool IsMPDev(DeviceIntPtr pDev);
|
||||||
#endif;
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif /* MIPOINTER_H */
|
#endif /* MIPOINTER_H */
|
||||||
|
|
268
mi/misprite.c
268
mi/misprite.c
|
@ -149,8 +149,8 @@ miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
|
||||||
|
|
||||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||||
|
|
||||||
if (pScreenPriv->isUp &&
|
if (pScreenPriv->cp->isUp &&
|
||||||
RECT_IN_REGION (pScreen, pRegion, &pScreenPriv->saved) != rgnOUT)
|
RECT_IN_REGION (pScreen, pRegion, &pScreenPriv->cp->saved) != rgnOUT)
|
||||||
{
|
{
|
||||||
SPRITE_DEBUG(("Damage remove\n"));
|
SPRITE_DEBUG(("Damage remove\n"));
|
||||||
miSpriteRemoveCursor (pScreen);
|
miSpriteRemoveCursor (pScreen);
|
||||||
|
@ -221,23 +221,25 @@ miSpriteInitialize (pScreen, cursorFuncs, screenFuncs)
|
||||||
|
|
||||||
pScreenPriv->BlockHandler = pScreen->BlockHandler;
|
pScreenPriv->BlockHandler = pScreen->BlockHandler;
|
||||||
|
|
||||||
pScreenPriv->pCursor = NULL;
|
pScreenPriv->cp = (miCursorInfoPtr)xalloc(sizeof(miCursorInfoRec));
|
||||||
pScreenPriv->x = 0;
|
pScreenPriv->cp->pCursor = NULL;
|
||||||
pScreenPriv->y = 0;
|
pScreenPriv->cp->x = 0;
|
||||||
pScreenPriv->isUp = FALSE;
|
pScreenPriv->cp->y = 0;
|
||||||
pScreenPriv->shouldBeUp = FALSE;
|
pScreenPriv->cp->isUp = FALSE;
|
||||||
pScreenPriv->pCacheWin = NullWindow;
|
pScreenPriv->cp->shouldBeUp = FALSE;
|
||||||
pScreenPriv->isInCacheWin = FALSE;
|
pScreenPriv->cp->pCacheWin = NullWindow;
|
||||||
pScreenPriv->checkPixels = TRUE;
|
pScreenPriv->cp->isInCacheWin = FALSE;
|
||||||
pScreenPriv->pInstalledMap = NULL;
|
pScreenPriv->cp->checkPixels = TRUE;
|
||||||
pScreenPriv->pColormap = NULL;
|
pScreenPriv->cp->pInstalledMap = NULL;
|
||||||
|
pScreenPriv->cp->pColormap = NULL;
|
||||||
|
pScreenPriv->cp->colors[SOURCE_COLOR].red = 0;
|
||||||
|
pScreenPriv->cp->colors[SOURCE_COLOR].green = 0;
|
||||||
|
pScreenPriv->cp->colors[SOURCE_COLOR].blue = 0;
|
||||||
|
pScreenPriv->cp->colors[MASK_COLOR].red = 0;
|
||||||
|
pScreenPriv->cp->colors[MASK_COLOR].green = 0;
|
||||||
|
pScreenPriv->cp->colors[MASK_COLOR].blue = 0;
|
||||||
|
|
||||||
pScreenPriv->funcs = cursorFuncs;
|
pScreenPriv->funcs = cursorFuncs;
|
||||||
pScreenPriv->colors[SOURCE_COLOR].red = 0;
|
|
||||||
pScreenPriv->colors[SOURCE_COLOR].green = 0;
|
|
||||||
pScreenPriv->colors[SOURCE_COLOR].blue = 0;
|
|
||||||
pScreenPriv->colors[MASK_COLOR].red = 0;
|
|
||||||
pScreenPriv->colors[MASK_COLOR].green = 0;
|
|
||||||
pScreenPriv->colors[MASK_COLOR].blue = 0;
|
|
||||||
pScreen->devPrivates[miSpriteScreenIndex].ptr = (pointer) pScreenPriv;
|
pScreen->devPrivates[miSpriteScreenIndex].ptr = (pointer) pScreenPriv;
|
||||||
|
|
||||||
pScreen->CloseScreen = miSpriteCloseScreen;
|
pScreen->CloseScreen = miSpriteCloseScreen;
|
||||||
|
@ -267,6 +269,16 @@ miSpriteInitialize (pScreen, cursorFuncs, screenFuncs)
|
||||||
cursor->isUp = FALSE;
|
cursor->isUp = FALSE;
|
||||||
cursor->shouldBeUp = FALSE;
|
cursor->shouldBeUp = FALSE;
|
||||||
cursor->pCacheWin = NullWindow;
|
cursor->pCacheWin = NullWindow;
|
||||||
|
cursor->isInCacheWin = FALSE;
|
||||||
|
cursor->checkPixels = TRUE;
|
||||||
|
cursor->pInstalledMap = NULL;
|
||||||
|
cursor->pColormap = NULL;
|
||||||
|
cursor->colors[SOURCE_COLOR].red = 0;
|
||||||
|
cursor->colors[SOURCE_COLOR].green = 0;
|
||||||
|
cursor->colors[SOURCE_COLOR].blue = 0;
|
||||||
|
cursor->colors[MASK_COLOR].red = 0;
|
||||||
|
cursor->colors[MASK_COLOR].green = 0;
|
||||||
|
cursor->colors[MASK_COLOR].blue = 0;
|
||||||
|
|
||||||
mpCursorIdx++;
|
mpCursorIdx++;
|
||||||
}
|
}
|
||||||
|
@ -326,8 +338,9 @@ miSpriteGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine)
|
||||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||||
|
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW &&
|
if (pDrawable->type == DRAWABLE_WINDOW &&
|
||||||
pScreenPriv->isUp &&
|
pScreenPriv->cp->isUp &&
|
||||||
ORG_OVERLAP(&pScreenPriv->saved,pDrawable->x,pDrawable->y, sx, sy, w, h))
|
ORG_OVERLAP(&pScreenPriv->cp->saved,pDrawable->x,pDrawable->y,
|
||||||
|
sx, sy, w, h))
|
||||||
{
|
{
|
||||||
SPRITE_DEBUG (("GetImage remove\n"));
|
SPRITE_DEBUG (("GetImage remove\n"));
|
||||||
miSpriteRemoveCursor (pScreen);
|
miSpriteRemoveCursor (pScreen);
|
||||||
|
@ -355,7 +368,7 @@ miSpriteGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart)
|
||||||
|
|
||||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||||
|
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->isUp)
|
if (pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->cp->isUp)
|
||||||
{
|
{
|
||||||
register DDXPointPtr pts;
|
register DDXPointPtr pts;
|
||||||
register int *widths;
|
register int *widths;
|
||||||
|
@ -370,7 +383,7 @@ miSpriteGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart)
|
||||||
nPts--;
|
nPts--;
|
||||||
pts++, widths++)
|
pts++, widths++)
|
||||||
{
|
{
|
||||||
if (SPN_OVERLAP(&pScreenPriv->saved,pts->y+yorg,
|
if (SPN_OVERLAP(&pScreenPriv->cp->saved,pts->y+yorg,
|
||||||
pts->x+xorg,*widths))
|
pts->x+xorg,*widths))
|
||||||
{
|
{
|
||||||
SPRITE_DEBUG (("GetSpans remove\n"));
|
SPRITE_DEBUG (("GetSpans remove\n"));
|
||||||
|
@ -397,8 +410,8 @@ miSpriteSourceValidate (pDrawable, x, y, width, height)
|
||||||
|
|
||||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||||
|
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->isUp &&
|
if (pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->cp->isUp &&
|
||||||
ORG_OVERLAP(&pScreenPriv->saved, pDrawable->x, pDrawable->y,
|
ORG_OVERLAP(&pScreenPriv->cp->saved, pDrawable->x, pDrawable->y,
|
||||||
x, y, width, height))
|
x, y, width, height))
|
||||||
{
|
{
|
||||||
SPRITE_DEBUG (("SourceValidate remove\n"));
|
SPRITE_DEBUG (("SourceValidate remove\n"));
|
||||||
|
@ -423,8 +436,8 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
||||||
/*
|
/*
|
||||||
* Damage will take care of destination check
|
* Damage will take care of destination check
|
||||||
*/
|
*/
|
||||||
if (pScreenPriv->isUp &&
|
if (pScreenPriv->cp->isUp &&
|
||||||
RECT_IN_REGION (pScreen, prgnSrc, &pScreenPriv->saved) != rgnOUT)
|
RECT_IN_REGION (pScreen, prgnSrc, &pScreenPriv->cp->saved) != rgnOUT)
|
||||||
{
|
{
|
||||||
SPRITE_DEBUG (("CopyWindow remove\n"));
|
SPRITE_DEBUG (("CopyWindow remove\n"));
|
||||||
miSpriteRemoveCursor (pScreen);
|
miSpriteRemoveCursor (pScreen);
|
||||||
|
@ -452,7 +465,7 @@ miSpriteBlockHandler (i, blockData, pTimeout, pReadmask)
|
||||||
|
|
||||||
SCREEN_EPILOGUE(pScreen, BlockHandler);
|
SCREEN_EPILOGUE(pScreen, BlockHandler);
|
||||||
|
|
||||||
if (!pPriv->isUp && pPriv->shouldBeUp)
|
if (!pPriv->cp->isUp && pPriv->cp->shouldBeUp)
|
||||||
{
|
{
|
||||||
SPRITE_DEBUG (("BlockHandler restore\n"));
|
SPRITE_DEBUG (("BlockHandler restore\n"));
|
||||||
miSpriteRestoreCursor (pScreen);
|
miSpriteRestoreCursor (pScreen);
|
||||||
|
@ -474,11 +487,11 @@ miSpriteInstallColormap (pMap)
|
||||||
|
|
||||||
SCREEN_EPILOGUE(pScreen, InstallColormap);
|
SCREEN_EPILOGUE(pScreen, InstallColormap);
|
||||||
|
|
||||||
pPriv->pInstalledMap = pMap;
|
pPriv->cp->pInstalledMap = pMap;
|
||||||
if (pPriv->pColormap != pMap)
|
if (pPriv->cp->pColormap != pMap)
|
||||||
{
|
{
|
||||||
pPriv->checkPixels = TRUE;
|
pPriv->cp->checkPixels = TRUE;
|
||||||
if (pPriv->isUp)
|
if (pPriv->cp->isUp)
|
||||||
miSpriteRemoveCursor (pScreen);
|
miSpriteRemoveCursor (pScreen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -503,7 +516,7 @@ miSpriteStoreColors (pMap, ndef, pdef)
|
||||||
|
|
||||||
SCREEN_EPILOGUE(pScreen, StoreColors);
|
SCREEN_EPILOGUE(pScreen, StoreColors);
|
||||||
|
|
||||||
if (pPriv->pColormap == pMap)
|
if (pPriv->cp->pColormap == pMap)
|
||||||
{
|
{
|
||||||
updated = 0;
|
updated = 0;
|
||||||
pVisual = pMap->pVisual;
|
pVisual = pMap->pVisual;
|
||||||
|
@ -514,8 +527,8 @@ miSpriteStoreColors (pMap, ndef, pdef)
|
||||||
#define MaskMatch(a,b,mask) (((a) & (pVisual->mask)) == ((b) & (pVisual->mask)))
|
#define MaskMatch(a,b,mask) (((a) & (pVisual->mask)) == ((b) & (pVisual->mask)))
|
||||||
|
|
||||||
#define UpdateDAC(plane,dac,mask) {\
|
#define UpdateDAC(plane,dac,mask) {\
|
||||||
if (MaskMatch (pPriv->colors[plane].pixel,pdef[i].pixel,mask)) {\
|
if (MaskMatch (pPriv->cp->colors[plane].pixel,pdef[i].pixel,mask)) {\
|
||||||
pPriv->colors[plane].dac = pdef[i].dac; \
|
pPriv->cp->colors[plane].dac = pdef[i].dac; \
|
||||||
updated = 1; \
|
updated = 1; \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
@ -536,15 +549,15 @@ miSpriteStoreColors (pMap, ndef, pdef)
|
||||||
/* PseudoColor/GrayScale - match on exact pixel */
|
/* PseudoColor/GrayScale - match on exact pixel */
|
||||||
for (i = 0; i < ndef; i++)
|
for (i = 0; i < ndef; i++)
|
||||||
{
|
{
|
||||||
if (pdef[i].pixel == pPriv->colors[SOURCE_COLOR].pixel)
|
if (pdef[i].pixel == pPriv->cp->colors[SOURCE_COLOR].pixel)
|
||||||
{
|
{
|
||||||
pPriv->colors[SOURCE_COLOR] = pdef[i];
|
pPriv->cp->colors[SOURCE_COLOR] = pdef[i];
|
||||||
if (++updated == 2)
|
if (++updated == 2)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (pdef[i].pixel == pPriv->colors[MASK_COLOR].pixel)
|
if (pdef[i].pixel == pPriv->cp->colors[MASK_COLOR].pixel)
|
||||||
{
|
{
|
||||||
pPriv->colors[MASK_COLOR] = pdef[i];
|
pPriv->cp->colors[MASK_COLOR] = pdef[i];
|
||||||
if (++updated == 2)
|
if (++updated == 2)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -552,8 +565,8 @@ miSpriteStoreColors (pMap, ndef, pdef)
|
||||||
}
|
}
|
||||||
if (updated)
|
if (updated)
|
||||||
{
|
{
|
||||||
pPriv->checkPixels = TRUE;
|
pPriv->cp->checkPixels = TRUE;
|
||||||
if (pPriv->isUp)
|
if (pPriv->cp->isUp)
|
||||||
miSpriteRemoveCursor (pScreen);
|
miSpriteRemoveCursor (pScreen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -567,10 +580,10 @@ miSpriteFindColors (ScreenPtr pScreen)
|
||||||
CursorPtr pCursor;
|
CursorPtr pCursor;
|
||||||
xColorItem *sourceColor, *maskColor;
|
xColorItem *sourceColor, *maskColor;
|
||||||
|
|
||||||
pCursor = pScreenPriv->pCursor;
|
pCursor = pScreenPriv->cp->pCursor;
|
||||||
sourceColor = &pScreenPriv->colors[SOURCE_COLOR];
|
sourceColor = &pScreenPriv->cp->colors[SOURCE_COLOR];
|
||||||
maskColor = &pScreenPriv->colors[MASK_COLOR];
|
maskColor = &pScreenPriv->cp->colors[MASK_COLOR];
|
||||||
if (pScreenPriv->pColormap != pScreenPriv->pInstalledMap ||
|
if (pScreenPriv->cp->pColormap != pScreenPriv->cp->pInstalledMap ||
|
||||||
!(pCursor->foreRed == sourceColor->red &&
|
!(pCursor->foreRed == sourceColor->red &&
|
||||||
pCursor->foreGreen == sourceColor->green &&
|
pCursor->foreGreen == sourceColor->green &&
|
||||||
pCursor->foreBlue == sourceColor->blue &&
|
pCursor->foreBlue == sourceColor->blue &&
|
||||||
|
@ -578,20 +591,20 @@ miSpriteFindColors (ScreenPtr pScreen)
|
||||||
pCursor->backGreen == maskColor->green &&
|
pCursor->backGreen == maskColor->green &&
|
||||||
pCursor->backBlue == maskColor->blue))
|
pCursor->backBlue == maskColor->blue))
|
||||||
{
|
{
|
||||||
pScreenPriv->pColormap = pScreenPriv->pInstalledMap;
|
pScreenPriv->cp->pColormap = pScreenPriv->cp->pInstalledMap;
|
||||||
sourceColor->red = pCursor->foreRed;
|
sourceColor->red = pCursor->foreRed;
|
||||||
sourceColor->green = pCursor->foreGreen;
|
sourceColor->green = pCursor->foreGreen;
|
||||||
sourceColor->blue = pCursor->foreBlue;
|
sourceColor->blue = pCursor->foreBlue;
|
||||||
FakeAllocColor (pScreenPriv->pColormap, sourceColor);
|
FakeAllocColor (pScreenPriv->cp->pColormap, sourceColor);
|
||||||
maskColor->red = pCursor->backRed;
|
maskColor->red = pCursor->backRed;
|
||||||
maskColor->green = pCursor->backGreen;
|
maskColor->green = pCursor->backGreen;
|
||||||
maskColor->blue = pCursor->backBlue;
|
maskColor->blue = pCursor->backBlue;
|
||||||
FakeAllocColor (pScreenPriv->pColormap, maskColor);
|
FakeAllocColor (pScreenPriv->cp->pColormap, maskColor);
|
||||||
/* "free" the pixels right away, don't let this confuse you */
|
/* "free" the pixels right away, don't let this confuse you */
|
||||||
FakeFreeColor(pScreenPriv->pColormap, sourceColor->pixel);
|
FakeFreeColor(pScreenPriv->cp->pColormap, sourceColor->pixel);
|
||||||
FakeFreeColor(pScreenPriv->pColormap, maskColor->pixel);
|
FakeFreeColor(pScreenPriv->cp->pColormap, maskColor->pixel);
|
||||||
}
|
}
|
||||||
pScreenPriv->checkPixels = FALSE;
|
pScreenPriv->cp->checkPixels = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -613,9 +626,9 @@ miSpriteSaveDoomedAreas (pWin, pObscured, dx, dy)
|
||||||
SCREEN_PROLOGUE (pScreen, SaveDoomedAreas);
|
SCREEN_PROLOGUE (pScreen, SaveDoomedAreas);
|
||||||
|
|
||||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||||
if (pScreenPriv->isUp)
|
if (pScreenPriv->cp->isUp)
|
||||||
{
|
{
|
||||||
cursorBox = pScreenPriv->saved;
|
cursorBox = pScreenPriv->cp->saved;
|
||||||
|
|
||||||
if (dx || dy)
|
if (dx || dy)
|
||||||
{
|
{
|
||||||
|
@ -648,8 +661,8 @@ miSpriteRealizeCursor (pDev, pScreen, pCursor)
|
||||||
miSpriteScreenPtr pScreenPriv;
|
miSpriteScreenPtr pScreenPriv;
|
||||||
|
|
||||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||||
if (pCursor == pScreenPriv->pCursor)
|
if (pCursor == pScreenPriv->cp->pCursor)
|
||||||
pScreenPriv->checkPixels = TRUE;
|
pScreenPriv->cp->checkPixels = TRUE;
|
||||||
return (*pScreenPriv->funcs->RealizeCursor) (pScreen, pCursor);
|
return (*pScreenPriv->funcs->RealizeCursor) (pScreen, pCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -678,80 +691,85 @@ miSpriteSetCursor (pDev, pScreen, pCursor, x, y)
|
||||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||||
if (!pCursor)
|
if (!pCursor)
|
||||||
{
|
{
|
||||||
pScreenPriv->shouldBeUp = FALSE;
|
pScreenPriv->cp->shouldBeUp = FALSE;
|
||||||
if (pScreenPriv->isUp)
|
if (pScreenPriv->cp->isUp)
|
||||||
miSpriteRemoveCursor (pScreen);
|
miSpriteRemoveCursor (pScreen);
|
||||||
pScreenPriv->pCursor = 0;
|
pScreenPriv->cp->pCursor = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pScreenPriv->shouldBeUp = TRUE;
|
pScreenPriv->cp->shouldBeUp = TRUE;
|
||||||
if (pScreenPriv->x == x &&
|
if (pScreenPriv->cp->x == x &&
|
||||||
pScreenPriv->y == y &&
|
pScreenPriv->cp->y == y &&
|
||||||
pScreenPriv->pCursor == pCursor &&
|
pScreenPriv->cp->pCursor == pCursor &&
|
||||||
!pScreenPriv->checkPixels)
|
!pScreenPriv->cp->checkPixels)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pScreenPriv->x = x;
|
pScreenPriv->cp->x = x;
|
||||||
pScreenPriv->y = y;
|
pScreenPriv->cp->y = y;
|
||||||
pScreenPriv->pCacheWin = NullWindow;
|
pScreenPriv->cp->pCacheWin = NullWindow;
|
||||||
if (pScreenPriv->checkPixels || pScreenPriv->pCursor != pCursor)
|
if (pScreenPriv->cp->checkPixels || pScreenPriv->cp->pCursor != pCursor)
|
||||||
{
|
{
|
||||||
pScreenPriv->pCursor = pCursor;
|
pScreenPriv->cp->pCursor = pCursor;
|
||||||
miSpriteFindColors (pScreen);
|
miSpriteFindColors (pScreen);
|
||||||
}
|
}
|
||||||
if (pScreenPriv->isUp) {
|
if (pScreenPriv->cp->isUp) {
|
||||||
int sx, sy;
|
int sx, sy;
|
||||||
/*
|
/*
|
||||||
* check to see if the old saved region
|
* check to see if the old saved region
|
||||||
* encloses the new sprite, in which case we use
|
* encloses the new sprite, in which case we use
|
||||||
* the flicker-free MoveCursor primitive.
|
* the flicker-free MoveCursor primitive.
|
||||||
*/
|
*/
|
||||||
sx = pScreenPriv->x - (int)pCursor->bits->xhot;
|
sx = pScreenPriv->cp->x - (int)pCursor->bits->xhot;
|
||||||
sy = pScreenPriv->y - (int)pCursor->bits->yhot;
|
sy = pScreenPriv->cp->y - (int)pCursor->bits->yhot;
|
||||||
if (sx + (int) pCursor->bits->width >= pScreenPriv->saved.x1 &&
|
if (sx + (int) pCursor->bits->width >= pScreenPriv->cp->saved.x1 &&
|
||||||
sx < pScreenPriv->saved.x2 &&
|
sx < pScreenPriv->cp->saved.x2 &&
|
||||||
sy + (int) pCursor->bits->height >= pScreenPriv->saved.y1 &&
|
sy + (int) pCursor->bits->height >= pScreenPriv->cp->saved.y1 &&
|
||||||
sy < pScreenPriv->saved.y2 &&
|
sy < pScreenPriv->cp->saved.y2 &&
|
||||||
(int) pCursor->bits->width + (2 * SPRITE_PAD) ==
|
(int) pCursor->bits->width + (2 * SPRITE_PAD) ==
|
||||||
pScreenPriv->saved.x2 - pScreenPriv->saved.x1 &&
|
pScreenPriv->cp->saved.x2 - pScreenPriv->cp->saved.x1 &&
|
||||||
(int) pCursor->bits->height + (2 * SPRITE_PAD) ==
|
(int) pCursor->bits->height + (2 * SPRITE_PAD) ==
|
||||||
pScreenPriv->saved.y2 - pScreenPriv->saved.y1
|
pScreenPriv->cp->saved.y2 - pScreenPriv->cp->saved.y1
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DamageDrawInternal (pScreen, TRUE);
|
DamageDrawInternal (pScreen, TRUE);
|
||||||
miSpriteIsUpFALSE (pScreen, pScreenPriv);
|
miSpriteIsUpFALSE (pScreen, pScreenPriv);
|
||||||
if (!(sx >= pScreenPriv->saved.x1 &&
|
if (!(sx >= pScreenPriv->cp->saved.x1 &&
|
||||||
sx + (int)pCursor->bits->width < pScreenPriv->saved.x2 &&
|
sx + (int)pCursor->bits->width < pScreenPriv->cp->saved.x2
|
||||||
sy >= pScreenPriv->saved.y1 &&
|
&& sy >= pScreenPriv->cp->saved.y1 &&
|
||||||
sy + (int)pCursor->bits->height < pScreenPriv->saved.y2))
|
sy + (int)pCursor->bits->height <
|
||||||
{
|
pScreenPriv->cp->saved.y2))
|
||||||
|
{
|
||||||
int oldx1, oldy1, dx, dy;
|
int oldx1, oldy1, dx, dy;
|
||||||
|
|
||||||
oldx1 = pScreenPriv->saved.x1;
|
oldx1 = pScreenPriv->cp->saved.x1;
|
||||||
oldy1 = pScreenPriv->saved.y1;
|
oldy1 = pScreenPriv->cp->saved.y1;
|
||||||
dx = oldx1 - (sx - SPRITE_PAD);
|
dx = oldx1 - (sx - SPRITE_PAD);
|
||||||
dy = oldy1 - (sy - SPRITE_PAD);
|
dy = oldy1 - (sy - SPRITE_PAD);
|
||||||
pScreenPriv->saved.x1 -= dx;
|
pScreenPriv->cp->saved.x1 -= dx;
|
||||||
pScreenPriv->saved.y1 -= dy;
|
pScreenPriv->cp->saved.y1 -= dy;
|
||||||
pScreenPriv->saved.x2 -= dx;
|
pScreenPriv->cp->saved.x2 -= dx;
|
||||||
pScreenPriv->saved.y2 -= dy;
|
pScreenPriv->cp->saved.y2 -= dy;
|
||||||
(void) (*pScreenPriv->funcs->ChangeSave) (pScreen,
|
(void) (*pScreenPriv->funcs->ChangeSave) (pScreen,
|
||||||
pScreenPriv->saved.x1,
|
pScreenPriv->cp->saved.x1,
|
||||||
pScreenPriv->saved.y1,
|
pScreenPriv->cp->saved.y1,
|
||||||
pScreenPriv->saved.x2 - pScreenPriv->saved.x1,
|
pScreenPriv->cp->saved.x2 -
|
||||||
pScreenPriv->saved.y2 - pScreenPriv->saved.y1,
|
pScreenPriv->cp->saved.x1,
|
||||||
|
pScreenPriv->cp->saved.y2 -
|
||||||
|
pScreenPriv->cp->saved.y1,
|
||||||
dx, dy);
|
dx, dy);
|
||||||
}
|
}
|
||||||
(void) (*pScreenPriv->funcs->MoveCursor) (pScreen, pCursor,
|
(void) (*pScreenPriv->funcs->MoveCursor) (pScreen, pCursor,
|
||||||
pScreenPriv->saved.x1,
|
pScreenPriv->cp->saved.x1,
|
||||||
pScreenPriv->saved.y1,
|
pScreenPriv->cp->saved.y1,
|
||||||
pScreenPriv->saved.x2 - pScreenPriv->saved.x1,
|
pScreenPriv->cp->saved.x2 -
|
||||||
pScreenPriv->saved.y2 - pScreenPriv->saved.y1,
|
pScreenPriv->cp->saved.x1,
|
||||||
sx - pScreenPriv->saved.x1,
|
pScreenPriv->cp->saved.y2 -
|
||||||
sy - pScreenPriv->saved.y1,
|
pScreenPriv->cp->saved.y1,
|
||||||
pScreenPriv->colors[SOURCE_COLOR].pixel,
|
sx - pScreenPriv->cp->saved.x1,
|
||||||
pScreenPriv->colors[MASK_COLOR].pixel);
|
sy - pScreenPriv->cp->saved.y1,
|
||||||
|
pScreenPriv->cp->colors[SOURCE_COLOR].pixel,
|
||||||
|
pScreenPriv->cp->colors[MASK_COLOR].pixel);
|
||||||
miSpriteIsUpTRUE (pScreen, pScreenPriv);
|
miSpriteIsUpTRUE (pScreen, pScreenPriv);
|
||||||
DamageDrawInternal (pScreen, FALSE);
|
DamageDrawInternal (pScreen, FALSE);
|
||||||
}
|
}
|
||||||
|
@ -761,7 +779,7 @@ miSpriteSetCursor (pDev, pScreen, pCursor, x, y)
|
||||||
miSpriteRemoveCursor (pScreen);
|
miSpriteRemoveCursor (pScreen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!pScreenPriv->isUp && pScreenPriv->pCursor)
|
if (!pScreenPriv->cp->isUp && pScreenPriv->cp->pCursor)
|
||||||
{
|
{
|
||||||
SPRITE_DEBUG (("SetCursor restore\n"));
|
SPRITE_DEBUG (("SetCursor restore\n"));
|
||||||
miSpriteRestoreCursor (pScreen);
|
miSpriteRestoreCursor (pScreen);
|
||||||
|
@ -778,7 +796,7 @@ miSpriteMoveCursor (pDev, pScreen, x, y)
|
||||||
CursorPtr pCursor;
|
CursorPtr pCursor;
|
||||||
|
|
||||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||||
pCursor = pScreenPriv->pCursor;
|
pCursor = pScreenPriv->cp->pCursor;
|
||||||
#ifdef MPX
|
#ifdef MPX
|
||||||
if (IsMPDev(pDev))
|
if (IsMPDev(pDev))
|
||||||
pCursor = pScreenPriv->mpCursors[pDev->id].pCursor;
|
pCursor = pScreenPriv->mpCursors[pDev->id].pCursor;
|
||||||
|
@ -799,12 +817,14 @@ miSpriteRemoveCursor (pScreen)
|
||||||
DamageDrawInternal (pScreen, TRUE);
|
DamageDrawInternal (pScreen, TRUE);
|
||||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||||
miSpriteIsUpFALSE (pScreen, pScreenPriv);
|
miSpriteIsUpFALSE (pScreen, pScreenPriv);
|
||||||
pScreenPriv->pCacheWin = NullWindow;
|
pScreenPriv->cp->pCacheWin = NullWindow;
|
||||||
if (!(*pScreenPriv->funcs->RestoreUnderCursor) (pScreen,
|
if (!(*pScreenPriv->funcs->RestoreUnderCursor) (pScreen,
|
||||||
pScreenPriv->saved.x1,
|
pScreenPriv->cp->saved.x1,
|
||||||
pScreenPriv->saved.y1,
|
pScreenPriv->cp->saved.y1,
|
||||||
pScreenPriv->saved.x2 - pScreenPriv->saved.x1,
|
pScreenPriv->cp->saved.x2 -
|
||||||
pScreenPriv->saved.y2 - pScreenPriv->saved.y1))
|
pScreenPriv->cp->saved.x1,
|
||||||
|
pScreenPriv->cp->saved.y2 -
|
||||||
|
pScreenPriv->cp->saved.y1))
|
||||||
{
|
{
|
||||||
miSpriteIsUpTRUE (pScreen, pScreenPriv);
|
miSpriteIsUpTRUE (pScreen, pScreenPriv);
|
||||||
}
|
}
|
||||||
|
@ -827,20 +847,22 @@ miSpriteRestoreCursor (pScreen)
|
||||||
DamageDrawInternal (pScreen, TRUE);
|
DamageDrawInternal (pScreen, TRUE);
|
||||||
miSpriteComputeSaved (pScreen);
|
miSpriteComputeSaved (pScreen);
|
||||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||||
pCursor = pScreenPriv->pCursor;
|
pCursor = pScreenPriv->cp->pCursor;
|
||||||
x = pScreenPriv->x - (int)pCursor->bits->xhot;
|
x = pScreenPriv->cp->x - (int)pCursor->bits->xhot;
|
||||||
y = pScreenPriv->y - (int)pCursor->bits->yhot;
|
y = pScreenPriv->cp->y - (int)pCursor->bits->yhot;
|
||||||
if ((*pScreenPriv->funcs->SaveUnderCursor) (pScreen,
|
if ((*pScreenPriv->funcs->SaveUnderCursor) (pScreen,
|
||||||
pScreenPriv->saved.x1,
|
pScreenPriv->cp->saved.x1,
|
||||||
pScreenPriv->saved.y1,
|
pScreenPriv->cp->saved.y1,
|
||||||
pScreenPriv->saved.x2 - pScreenPriv->saved.x1,
|
pScreenPriv->cp->saved.x2 -
|
||||||
pScreenPriv->saved.y2 - pScreenPriv->saved.y1))
|
pScreenPriv->cp->saved.x1,
|
||||||
|
pScreenPriv->cp->saved.y2 -
|
||||||
|
pScreenPriv->cp->saved.y1))
|
||||||
{
|
{
|
||||||
if (pScreenPriv->checkPixels)
|
if (pScreenPriv->cp->checkPixels)
|
||||||
miSpriteFindColors (pScreen);
|
miSpriteFindColors (pScreen);
|
||||||
if ((*pScreenPriv->funcs->PutUpCursor) (pScreen, pCursor, x, y,
|
if ((*pScreenPriv->funcs->PutUpCursor) (pScreen, pCursor, x, y,
|
||||||
pScreenPriv->colors[SOURCE_COLOR].pixel,
|
pScreenPriv->cp->colors[SOURCE_COLOR].pixel,
|
||||||
pScreenPriv->colors[MASK_COLOR].pixel))
|
pScreenPriv->cp->colors[MASK_COLOR].pixel))
|
||||||
{
|
{
|
||||||
miSpriteIsUpTRUE (pScreen, pScreenPriv);
|
miSpriteIsUpTRUE (pScreen, pScreenPriv);
|
||||||
}
|
}
|
||||||
|
@ -862,15 +884,15 @@ miSpriteComputeSaved (pScreen)
|
||||||
CursorPtr pCursor;
|
CursorPtr pCursor;
|
||||||
|
|
||||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||||
pCursor = pScreenPriv->pCursor;
|
pCursor = pScreenPriv->cp->pCursor;
|
||||||
x = pScreenPriv->x - (int)pCursor->bits->xhot;
|
x = pScreenPriv->cp->x - (int)pCursor->bits->xhot;
|
||||||
y = pScreenPriv->y - (int)pCursor->bits->yhot;
|
y = pScreenPriv->cp->y - (int)pCursor->bits->yhot;
|
||||||
w = pCursor->bits->width;
|
w = pCursor->bits->width;
|
||||||
h = pCursor->bits->height;
|
h = pCursor->bits->height;
|
||||||
wpad = SPRITE_PAD;
|
wpad = SPRITE_PAD;
|
||||||
hpad = SPRITE_PAD;
|
hpad = SPRITE_PAD;
|
||||||
pScreenPriv->saved.x1 = x - wpad;
|
pScreenPriv->cp->saved.x1 = x - wpad;
|
||||||
pScreenPriv->saved.y1 = y - hpad;
|
pScreenPriv->cp->saved.y1 = y - hpad;
|
||||||
pScreenPriv->saved.x2 = pScreenPriv->saved.x1 + w + wpad * 2;
|
pScreenPriv->cp->saved.x2 = pScreenPriv->cp->saved.x1 + w + wpad * 2;
|
||||||
pScreenPriv->saved.y2 = pScreenPriv->saved.y1 + h + hpad * 2;
|
pScreenPriv->cp->saved.y2 = pScreenPriv->cp->saved.y1 + h + hpad * 2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,6 @@ in this Software without prior written authorization from The Open Group.
|
||||||
#endif
|
#endif
|
||||||
# include "damage.h"
|
# include "damage.h"
|
||||||
|
|
||||||
#ifdef MPX
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
CursorPtr pCursor;
|
CursorPtr pCursor;
|
||||||
int x; /* cursor hotspot */
|
int x; /* cursor hotspot */
|
||||||
|
@ -52,8 +51,12 @@ typedef struct {
|
||||||
Bool isUp; /* cursor in frame buffer */
|
Bool isUp; /* cursor in frame buffer */
|
||||||
Bool shouldBeUp; /* cursor should be displayed */
|
Bool shouldBeUp; /* cursor should be displayed */
|
||||||
WindowPtr pCacheWin; /* window the cursor last seen in */
|
WindowPtr pCacheWin; /* window the cursor last seen in */
|
||||||
|
Bool isInCacheWin;
|
||||||
|
Bool checkPixels; /* check colormap collision */
|
||||||
|
xColorItem colors[2];
|
||||||
|
ColormapPtr pInstalledMap;
|
||||||
|
ColormapPtr pColormap;
|
||||||
} miCursorInfoRec, *miCursorInfoPtr;
|
} miCursorInfoRec, *miCursorInfoPtr;
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* per screen information
|
* per screen information
|
||||||
|
@ -79,18 +82,8 @@ typedef struct {
|
||||||
/* os layer procedures */
|
/* os layer procedures */
|
||||||
ScreenBlockHandlerProcPtr BlockHandler;
|
ScreenBlockHandlerProcPtr BlockHandler;
|
||||||
|
|
||||||
CursorPtr pCursor;
|
miCursorInfoPtr cp; /* core pointer */
|
||||||
int x; /* cursor hotspot */
|
|
||||||
int y;
|
|
||||||
BoxRec saved; /* saved area from the screen */
|
|
||||||
Bool isUp; /* cursor in frame buffer */
|
|
||||||
Bool shouldBeUp; /* cursor should be displayed */
|
|
||||||
WindowPtr pCacheWin; /* window the cursor last seen in */
|
|
||||||
Bool isInCacheWin;
|
|
||||||
Bool checkPixels; /* check colormap collision */
|
|
||||||
xColorItem colors[2];
|
|
||||||
ColormapPtr pInstalledMap;
|
|
||||||
ColormapPtr pColormap;
|
|
||||||
VisualPtr pVisual;
|
VisualPtr pVisual;
|
||||||
miSpriteCursorFuncPtr funcs;
|
miSpriteCursorFuncPtr funcs;
|
||||||
DamagePtr pDamage; /* damage tracking structure */
|
DamagePtr pDamage; /* damage tracking structure */
|
||||||
|
@ -102,14 +95,14 @@ typedef struct {
|
||||||
#define SOURCE_COLOR 0
|
#define SOURCE_COLOR 0
|
||||||
#define MASK_COLOR 1
|
#define MASK_COLOR 1
|
||||||
|
|
||||||
#define miSpriteIsUpTRUE(pScreen, pScreenPriv) if (!pScreenPriv->isUp) { \
|
#define miSpriteIsUpTRUE(pScreen, pScreenPriv) if (!pScreenPriv->cp->isUp) { \
|
||||||
pScreenPriv->isUp = TRUE; \
|
pScreenPriv->cp->isUp = TRUE; \
|
||||||
DamageRegister (&(*pScreen->GetScreenPixmap) (pScreen)->drawable, pScreenPriv->pDamage); \
|
DamageRegister (&(*pScreen->GetScreenPixmap) (pScreen)->drawable, pScreenPriv->pDamage); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define miSpriteIsUpFALSE(pScreen, pScreenPriv) if (pScreenPriv->isUp) { \
|
#define miSpriteIsUpFALSE(pScreen, pScreenPriv) if (pScreenPriv->cp->isUp) { \
|
||||||
DamageUnregister (&(*pScreen->GetScreenPixmap) (pScreen)->drawable, pScreenPriv->pDamage); \
|
DamageUnregister (&(*pScreen->GetScreenPixmap) (pScreen)->drawable, pScreenPriv->pDamage); \
|
||||||
pScreenPriv->isUp = FALSE; \
|
pScreenPriv->cp->isUp = FALSE; \
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue