mi: removing MPX ifdefs
global sprite renaming in mipointer and misprite fixed: multiple remove cursor call in miSpriteInstallColormap fixed: wrong core pointer usage in miSpriteStoreColors dix: bugfix in CheckCursorConfinement removing MPX ifdefs removing MPX event generation (using Xi solely now)
This commit is contained in:
parent
ae3c24da34
commit
a96788058e
20
Changelog
20
Changelog
|
@ -1,4 +1,22 @@
|
|||
MPX Changelog file
|
||||
== 14.12.06 ==
|
||||
mi: removing MPX ifdefs
|
||||
global sprite renaming in mipointer and misprite
|
||||
fixed: multiple remove cursor call in miSpriteInstallColormap
|
||||
fixed: wrong core pointer usage in miSpriteStoreColors
|
||||
|
||||
dix: bugfix in CheckCursorConfinement
|
||||
removing MPX ifdefs
|
||||
removing MPX event generation (using Xi solely now)
|
||||
|
||||
Files:
|
||||
mi/midispcur.c
|
||||
mi/misprite.c
|
||||
mi/mispritest.h
|
||||
mi/mipointer.c
|
||||
dix/getevents.c
|
||||
dix/events.c
|
||||
dix/cursor.c
|
||||
|
||||
== 12.12.06 ==
|
||||
dix: Moving SpriteRec into DeviceIntRec
|
||||
removing global sprite structure
|
||||
|
|
37
dix/cursor.c
37
dix/cursor.c
|
@ -128,16 +128,11 @@ FreeCursor(pointer value, XID cid)
|
|||
for (nscr = 0; nscr < screenInfo.numScreens; nscr++)
|
||||
{
|
||||
pscr = screenInfo.screens[nscr];
|
||||
#ifdef MPX
|
||||
pDev = inputInfo.devices;
|
||||
while(pDev)
|
||||
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
#endif
|
||||
(void)( *pscr->UnrealizeCursor)(pDev, pscr, pCurs);
|
||||
#ifdef MPX
|
||||
pDev = pDev->next;
|
||||
if (MPHasCursor(pDev))
|
||||
(void)( *pscr->UnrealizeCursor)(pDev, pscr, pCurs);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
FreeCursorBits(pCurs->bits);
|
||||
xfree( pCurs);
|
||||
|
@ -231,16 +226,12 @@ AllocCursorARGB(unsigned char *psrcbits, unsigned char *pmaskbits, CARD32 *argb,
|
|||
for (nscr = 0; nscr < screenInfo.numScreens; nscr++)
|
||||
{
|
||||
pscr = screenInfo.screens[nscr];
|
||||
#ifdef MPX
|
||||
pDev = inputInfo.devices;
|
||||
while(pDev)
|
||||
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
if (MPHasCursor(pDev))
|
||||
{
|
||||
#endif
|
||||
if (!( *pscr->RealizeCursor)(pDev, pscr, pCurs))
|
||||
{
|
||||
#ifdef MPX
|
||||
/* Realize failed for device pDev on screen pscr.
|
||||
* We have to assume that for all devices before, realize
|
||||
* worked. We need to rollback all devices so far on the
|
||||
|
@ -254,11 +245,9 @@ AllocCursorARGB(unsigned char *psrcbits, unsigned char *pmaskbits, CARD32 *argb,
|
|||
( *pscr->UnrealizeCursor)(pDevIt, pscr, pCurs);
|
||||
pDevIt = pDevIt->next;
|
||||
}
|
||||
#endif
|
||||
while (--nscr >= 0)
|
||||
{
|
||||
pscr = screenInfo.screens[nscr];
|
||||
#ifdef MPX
|
||||
/* now unrealize all devices on previous screens */
|
||||
pDevIt = inputInfo.devices;
|
||||
while (pDevIt)
|
||||
|
@ -267,19 +256,14 @@ AllocCursorARGB(unsigned char *psrcbits, unsigned char *pmaskbits, CARD32 *argb,
|
|||
( *pscr->UnrealizeCursor)(pDevIt, pscr, pCurs);
|
||||
pDevIt = pDevIt->next;
|
||||
}
|
||||
#else
|
||||
( *pscr->UnrealizeCursor)(pDev, pscr, pCurs);
|
||||
#endif
|
||||
}
|
||||
FreeCursorBits(bits);
|
||||
xfree(pCurs);
|
||||
return (CursorPtr)NULL;
|
||||
}
|
||||
#ifdef MPX
|
||||
}
|
||||
pDev = pDev->next;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return pCurs;
|
||||
}
|
||||
|
@ -462,16 +446,12 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
|
|||
for (nscr = 0; nscr < screenInfo.numScreens; nscr++)
|
||||
{
|
||||
pscr = screenInfo.screens[nscr];
|
||||
#ifdef MPX
|
||||
pDev = inputInfo.devices;
|
||||
while(pDev)
|
||||
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
if (MPHasCursor(pDev))
|
||||
{
|
||||
#endif
|
||||
if (!( *pscr->RealizeCursor)(pDev, pscr, pCurs))
|
||||
{
|
||||
#ifdef MPX
|
||||
/* Realize failed for device pDev on screen pscr.
|
||||
* We have to assume that for all devices before, realize
|
||||
* worked. We need to rollback all devices so far on the
|
||||
|
@ -485,11 +465,9 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
|
|||
( *pscr->UnrealizeCursor)(pDevIt, pscr, pCurs);
|
||||
pDevIt = pDevIt->next;
|
||||
}
|
||||
#endif
|
||||
while (--nscr >= 0)
|
||||
{
|
||||
pscr = screenInfo.screens[nscr];
|
||||
#ifdef MPX
|
||||
/* now unrealize all devices on previous screens */
|
||||
pDevIt = inputInfo.devices;
|
||||
while (pDevIt)
|
||||
|
@ -498,19 +476,14 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
|
|||
( *pscr->UnrealizeCursor)(pDevIt, pscr, pCurs);
|
||||
pDevIt = pDevIt->next;
|
||||
}
|
||||
#else
|
||||
( *pscr->UnrealizeCursor)(pDev, pscr, pCurs);
|
||||
#endif
|
||||
}
|
||||
FreeCursorBits(bits);
|
||||
xfree(pCurs);
|
||||
return BadAlloc;
|
||||
}
|
||||
#ifdef MPX
|
||||
}
|
||||
pDev = pDev->next;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
*ppCurs = pCurs;
|
||||
return Success;
|
||||
|
|
15
dix/events.c
15
dix/events.c
|
@ -4589,13 +4589,16 @@ CheckCursorConfinement(WindowPtr pWin)
|
|||
|
||||
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
grab = pDev->grab;
|
||||
if (grab && (confineTo = grab->confineTo))
|
||||
if (MPHasCursor(pDev))
|
||||
{
|
||||
if (!BorderSizeNotEmpty(pDev, confineTo))
|
||||
(*inputInfo.pointer->DeactivateGrab)(pDev);
|
||||
else if ((pWin == confineTo) || IsParent(pWin, confineTo))
|
||||
ConfineCursorToWindow(pDev, confineTo, TRUE, TRUE);
|
||||
grab = pDev->grab;
|
||||
if (grab && (confineTo = grab->confineTo))
|
||||
{
|
||||
if (!BorderSizeNotEmpty(pDev, confineTo))
|
||||
(*inputInfo.pointer->DeactivateGrab)(pDev);
|
||||
else if ((pWin == confineTo) || IsParent(pWin, confineTo))
|
||||
ConfineCursorToWindow(pDev, confineTo, TRUE, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,12 +66,6 @@ extern Bool XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies);
|
|||
#include "exglobals.h"
|
||||
#include "extnsionst.h"
|
||||
|
||||
#ifdef MPX
|
||||
#include <X11/extensions/MPXconst.h>
|
||||
#include <X11/extensions/MPXproto.h>
|
||||
#include "mpxglobals.h"
|
||||
#endif
|
||||
|
||||
/* Maximum number of valuators, divided by six, rounded up, to get number
|
||||
* of events. */
|
||||
#define MAX_VALUATOR_EVENTS 6
|
||||
|
@ -505,12 +499,8 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
|
|||
|
||||
if ((type == ButtonPress || type == ButtonRelease) && !pDev->button)
|
||||
return 0;
|
||||
#ifdef MPX
|
||||
if (pDev->isMPDev)
|
||||
num_events = 3;
|
||||
else
|
||||
#endif
|
||||
if (pDev->coreEvents)
|
||||
|
||||
if (pDev->coreEvents || pDev->isMPDev)
|
||||
num_events = 2;
|
||||
else
|
||||
num_events = 1;
|
||||
|
@ -537,15 +527,10 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
|
|||
kbp->time = ms;
|
||||
kbp->deviceid = pDev->id;
|
||||
|
||||
#ifdef MPX
|
||||
if (pDev->isMPDev)
|
||||
if (!pDev->coreEvents || pDev->isMPDev)
|
||||
pointer = pDev;
|
||||
else
|
||||
#endif
|
||||
if (pDev->coreEvents)
|
||||
else
|
||||
pointer = inputInfo.pointer;
|
||||
else
|
||||
pointer = pDev;
|
||||
|
||||
/* Set x and y based on whether this is absolute or relative, and
|
||||
* accelerate if we need to. */
|
||||
|
@ -598,16 +583,10 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
|
|||
|
||||
updateMotionHistory(pDev, ms, first_valuator, num_valuators, valuators);
|
||||
|
||||
#ifdef MPX
|
||||
if (pDev->isMPDev)
|
||||
{
|
||||
// noop, just less intrusive to fit MPX in like that
|
||||
} else
|
||||
#endif
|
||||
if (pDev->coreEvents) {
|
||||
if (pDev->coreEvents && !pDev->isMPDev) {
|
||||
/* set the virtual core pointer's coordinates */
|
||||
pointer->valuator->lastx = x;
|
||||
pointer->valuator->lasty = y;
|
||||
inputInfo.pointer->valuator->lastx = x;
|
||||
inputInfo.pointer->valuator->lasty = y;
|
||||
}
|
||||
pDev->valuator->lastx = x;
|
||||
pDev->valuator->lasty = y;
|
||||
|
@ -634,31 +613,8 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
|
|||
num_valuators, valuators);
|
||||
}
|
||||
|
||||
#ifdef MPX
|
||||
if (pDev->isMPDev)
|
||||
{
|
||||
/* MPX events are the same as XI events but without valuators. */
|
||||
memcpy(events, kbp, sizeof(deviceKeyButtonPointer));
|
||||
switch(type)
|
||||
{
|
||||
case ButtonPress:
|
||||
events->u.u.type = MPXButtonPress;
|
||||
break;
|
||||
case ButtonRelease:
|
||||
events->u.u.type = MPXButtonRelease;
|
||||
break;
|
||||
case MotionNotify:
|
||||
events->u.u.type = MPXMotionNotify;
|
||||
break;
|
||||
}
|
||||
events++;
|
||||
}
|
||||
|
||||
/* MPX devices always send core events */
|
||||
if (pDev->coreEvents || pDev->isMPDev) {
|
||||
#else
|
||||
if (pDev->coreEvents) {
|
||||
#endif
|
||||
events->u.u.type = type;
|
||||
events->u.keyButtonPointer.time = ms;
|
||||
events->u.keyButtonPointer.rootX = x;
|
||||
|
|
141
mi/midispcur.c
141
mi/midispcur.c
|
@ -58,11 +58,7 @@ in this Software without prior written authorization from The Open Group.
|
|||
# include "picturestr.h"
|
||||
#endif
|
||||
|
||||
#ifdef MPX
|
||||
# include "inputstr.h"
|
||||
|
||||
#define SaneID(a) (a >= 0 && a < MAX_DEVICES)
|
||||
#endif
|
||||
# include "inputstr.h" /* for MAX_DEVICES */
|
||||
|
||||
/* per-screen private data */
|
||||
|
||||
|
@ -83,11 +79,13 @@ typedef struct {
|
|||
#endif
|
||||
} miDCBufferRec, *miDCBufferPtr;
|
||||
|
||||
/*
|
||||
* The core pointer buffer will point to the index of the virtual core pointer
|
||||
* in the pCursorBuffers array.
|
||||
*/
|
||||
typedef struct {
|
||||
miDCBufferPtr pCoreBuffer; /* for core pointer */
|
||||
#ifdef MPX
|
||||
miDCBufferPtr pMPBuffers; /* for MPX pointers */
|
||||
#endif
|
||||
miDCBufferPtr pCursorBuffers; /* one for each device */
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
} miDCScreenRec, *miDCScreenPtr;
|
||||
|
||||
|
@ -140,6 +138,7 @@ miDCInitialize (pScreen, screenFuncs)
|
|||
{
|
||||
miDCScreenPtr pScreenPriv;
|
||||
miDCBufferPtr pBuffer;
|
||||
int mpBufferIdx;
|
||||
|
||||
if (miDCGeneration != serverGeneration)
|
||||
{
|
||||
|
@ -155,52 +154,37 @@ miDCInitialize (pScreen, screenFuncs)
|
|||
/*
|
||||
* initialize the entire private structure to zeros
|
||||
*/
|
||||
#if !defined MPX
|
||||
pScreenPriv->pCoreBuffer = (miDCBufferPtr)xalloc(sizeof(miDCBufferRec));
|
||||
if (!pScreenPriv->pCoreBuffer)
|
||||
|
||||
pScreenPriv->pCursorBuffers = (miDCBufferPtr)xalloc(MAX_DEVICES *
|
||||
sizeof(miDCBufferRec));
|
||||
if (!pScreenPriv->pCursorBuffers)
|
||||
{
|
||||
xfree((pointer)pScreenPriv);
|
||||
return FALSE;
|
||||
}
|
||||
pBuffer = pScreenPriv->pCoreBuffer;
|
||||
#else /* ifdef MPX */
|
||||
|
||||
/* virtual core pointer ID is 1 */
|
||||
pScreenPriv->pCoreBuffer = &pScreenPriv->pCursorBuffers[1];
|
||||
|
||||
mpBufferIdx = 0;
|
||||
while(mpBufferIdx < MAX_DEVICES)
|
||||
{
|
||||
int mpBufferIdx = 0;
|
||||
|
||||
pScreenPriv->pMPBuffers = (miDCBufferPtr)xalloc(MAX_DEVICES *
|
||||
sizeof(miDCBufferRec));
|
||||
if (!pScreenPriv->pMPBuffers)
|
||||
{
|
||||
xfree((pointer)pScreenPriv);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* virtual core pointer ID is 1 */
|
||||
pScreenPriv->pCoreBuffer = &pScreenPriv->pMPBuffers[1];
|
||||
|
||||
while(mpBufferIdx < MAX_DEVICES)
|
||||
{
|
||||
pBuffer = &pScreenPriv->pMPBuffers[mpBufferIdx];
|
||||
#endif
|
||||
pBuffer->pSourceGC =
|
||||
pBuffer->pMaskGC =
|
||||
pBuffer->pSaveGC =
|
||||
pBuffer->pRestoreGC =
|
||||
pBuffer->pMoveGC =
|
||||
pBuffer->pPixSourceGC =
|
||||
pBuffer->pPixMaskGC = NULL;
|
||||
pBuffer = &pScreenPriv->pCursorBuffers[mpBufferIdx];
|
||||
pBuffer->pSourceGC =
|
||||
pBuffer->pMaskGC =
|
||||
pBuffer->pSaveGC =
|
||||
pBuffer->pRestoreGC =
|
||||
pBuffer->pMoveGC =
|
||||
pBuffer->pPixSourceGC =
|
||||
pBuffer->pPixMaskGC = NULL;
|
||||
#ifdef ARGB_CURSOR
|
||||
pBuffer->pRootPicture = NULL;
|
||||
pBuffer->pTempPicture = NULL;
|
||||
#endif
|
||||
pBuffer->pSave = pBuffer->pTemp = NULL;
|
||||
|
||||
pBuffer->pSave = pBuffer->pTemp = NULL;
|
||||
|
||||
#ifdef MPX
|
||||
mpBufferIdx++;
|
||||
}
|
||||
mpBufferIdx++;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
pScreenPriv->CloseScreen = pScreen->CloseScreen;
|
||||
|
@ -210,11 +194,7 @@ miDCInitialize (pScreen, screenFuncs)
|
|||
|
||||
if (!miSpriteInitialize (pScreen, &miDCFuncs, screenFuncs))
|
||||
{
|
||||
#ifdef MPX
|
||||
xfree((pointer)pScreenPriv->pMPBuffers);
|
||||
#else
|
||||
xfree((pointer)pScreenPriv->pCoreBuffer);
|
||||
#endif
|
||||
xfree ((pointer) pScreenPriv->pCursorBuffers);
|
||||
xfree ((pointer) pScreenPriv);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -232,28 +212,25 @@ miDCCloseScreen (index, pScreen)
|
|||
{
|
||||
miDCScreenPtr pScreenPriv;
|
||||
miDCBufferPtr pBuffer;
|
||||
int mpBufferIdx;
|
||||
|
||||
pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr;
|
||||
pScreen->CloseScreen = pScreenPriv->CloseScreen;
|
||||
pBuffer = pScreenPriv->pCoreBuffer;
|
||||
|
||||
#ifdef MPX
|
||||
mpBufferIdx = 0;
|
||||
while (mpBufferIdx < MAX_DEVICES)
|
||||
{
|
||||
int mpBufferIdx = 0;
|
||||
while (mpBufferIdx < MAX_DEVICES)
|
||||
{
|
||||
pBuffer = &pScreenPriv->pMPBuffers[mpBufferIdx];
|
||||
pBuffer = &pScreenPriv->pCursorBuffers[mpBufferIdx];
|
||||
|
||||
#endif
|
||||
tossGC (pBuffer->pSourceGC);
|
||||
tossGC (pBuffer->pMaskGC);
|
||||
tossGC (pBuffer->pSaveGC);
|
||||
tossGC (pBuffer->pRestoreGC);
|
||||
tossGC (pBuffer->pMoveGC);
|
||||
tossGC (pBuffer->pPixSourceGC);
|
||||
tossGC (pBuffer->pPixMaskGC);
|
||||
tossPix (pBuffer->pSave);
|
||||
tossPix (pBuffer->pTemp);
|
||||
tossGC (pBuffer->pSourceGC);
|
||||
tossGC (pBuffer->pMaskGC);
|
||||
tossGC (pBuffer->pSaveGC);
|
||||
tossGC (pBuffer->pRestoreGC);
|
||||
tossGC (pBuffer->pMoveGC);
|
||||
tossGC (pBuffer->pPixSourceGC);
|
||||
tossGC (pBuffer->pPixMaskGC);
|
||||
tossPix (pBuffer->pSave);
|
||||
tossPix (pBuffer->pTemp);
|
||||
#ifdef ARGB_CURSOR
|
||||
#if 0 /* This has been free()d before */
|
||||
tossPict (pScreenPriv->pRootPicture);
|
||||
|
@ -261,16 +238,10 @@ miDCCloseScreen (index, pScreen)
|
|||
tossPict (pBuffer->pTempPicture);
|
||||
#endif
|
||||
|
||||
#ifdef MPX
|
||||
mpBufferIdx++;
|
||||
}
|
||||
}
|
||||
|
||||
xfree((pointer) pScreenPriv->pMPBuffers);
|
||||
#else
|
||||
|
||||
xfree((pointer) pScreenPriv->pCoreBuffer);
|
||||
#endif
|
||||
xfree((pointer) pScreenPriv->pCursorBuffers);
|
||||
|
||||
xfree ((pointer) pScreenPriv);
|
||||
return (*pScreen->CloseScreen) (index, pScreen);
|
||||
|
@ -567,10 +538,8 @@ miDCPutUpCursor (pDev, pScreen, pCursor, x, y, source, mask)
|
|||
pWin = WindowTable[pScreen->myNum];
|
||||
pBuffer = pScreenPriv->pCoreBuffer;
|
||||
|
||||
#ifdef MPX
|
||||
if (MPHasCursor(pDev))
|
||||
pBuffer = &pScreenPriv->pMPBuffers[pDev->id];
|
||||
#endif
|
||||
pBuffer = &pScreenPriv->pCursorBuffers[pDev->id];
|
||||
|
||||
#ifdef ARGB_CURSOR
|
||||
if (pPriv->pPicture)
|
||||
|
@ -619,10 +588,10 @@ miDCSaveUnderCursor (pDev, pScreen, x, y, w, h)
|
|||
|
||||
pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr;
|
||||
pBuffer = pScreenPriv->pCoreBuffer;
|
||||
#ifdef MPX
|
||||
|
||||
if (MPHasCursor(pDev))
|
||||
pBuffer = &pScreenPriv->pMPBuffers[pDev->id];
|
||||
#endif
|
||||
pBuffer = &pScreenPriv->pCursorBuffers[pDev->id];
|
||||
|
||||
pSave = pBuffer->pSave;
|
||||
pWin = WindowTable[pScreen->myNum];
|
||||
if (!pSave || pSave->drawable.width < w || pSave->drawable.height < h)
|
||||
|
@ -658,10 +627,10 @@ miDCRestoreUnderCursor (pDev, pScreen, x, y, w, h)
|
|||
|
||||
pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr;
|
||||
pBuffer = pScreenPriv->pCoreBuffer;
|
||||
#ifdef MPX
|
||||
|
||||
if (MPHasCursor(pDev))
|
||||
pBuffer = &pScreenPriv->pMPBuffers[pDev->id];
|
||||
#endif
|
||||
pBuffer = &pScreenPriv->pCursorBuffers[pDev->id];
|
||||
|
||||
pSave = pBuffer->pSave;
|
||||
pWin = WindowTable[pScreen->myNum];
|
||||
if (!pSave)
|
||||
|
@ -691,10 +660,10 @@ miDCChangeSave (pDev, pScreen, x, y, w, h, dx, dy)
|
|||
|
||||
pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr;
|
||||
pBuffer = pScreenPriv->pCoreBuffer;
|
||||
#ifdef MPX
|
||||
|
||||
if (MPHasCursor(pDev))
|
||||
pBuffer = &pScreenPriv->pMPBuffers[pDev->id];
|
||||
#endif
|
||||
pBuffer = &pScreenPriv->pCursorBuffers[pDev->id];
|
||||
|
||||
pSave = pBuffer->pSave;
|
||||
pWin = WindowTable[pScreen->myNum];
|
||||
/*
|
||||
|
@ -842,10 +811,10 @@ miDCMoveCursor (pDev, pScreen, pCursor, x, y, w, h, dx, dy, source, mask)
|
|||
pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr;
|
||||
pWin = WindowTable[pScreen->myNum];
|
||||
pBuffer = pScreenPriv->pCoreBuffer;
|
||||
#ifdef MPX
|
||||
|
||||
if (MPHasCursor(pDev))
|
||||
pBuffer = &pScreenPriv->pMPBuffers[pDev->id];
|
||||
#endif
|
||||
pBuffer = &pScreenPriv->pCursorBuffers[pDev->id];
|
||||
|
||||
pTemp = pBuffer->pTemp;
|
||||
if (!pTemp ||
|
||||
pTemp->drawable.width != pBuffer->pSave->drawable.width ||
|
||||
|
|
143
mi/mipointer.c
143
mi/mipointer.c
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* miPointer->c
|
||||
* mipointer.c
|
||||
*/
|
||||
|
||||
|
||||
|
@ -63,15 +63,14 @@ static unsigned long miPointerGeneration = 0;
|
|||
* until more than one pointer device exists.
|
||||
*/
|
||||
|
||||
static miPointerPtr miPointer;
|
||||
static miPointerPtr miCorePointer;
|
||||
|
||||
#ifdef MPX
|
||||
/* Multipointers
|
||||
* ID of a device == index in this array.
|
||||
*/
|
||||
static miPointerRec miMPPointers[MAX_DEVICES];
|
||||
|
||||
#endif
|
||||
static miPointerRec miPointers[MAX_DEVICES];
|
||||
#define MIPOINTER(dev) \
|
||||
(MPHasCursor((dev))) ? &miPointers[(dev)->id] : miCorePointer
|
||||
|
||||
static Bool miPointerRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||
CursorPtr pCursor);
|
||||
|
@ -103,6 +102,7 @@ miPointerInitialize (pScreen, spriteFuncs, screenFuncs, waitForUpdate)
|
|||
{
|
||||
miPointerScreenPtr pScreenPriv;
|
||||
miPointerPtr pPointer;
|
||||
int ptrIdx;
|
||||
|
||||
if (miPointerGeneration != serverGeneration)
|
||||
{
|
||||
|
@ -139,29 +139,16 @@ miPointerInitialize (pScreen, spriteFuncs, screenFuncs, waitForUpdate)
|
|||
pScreen->SetCursorPosition = miPointerSetCursorPosition;
|
||||
pScreen->RecolorCursor = miRecolorCursor;
|
||||
pScreen->PointerNonInterestBox = miPointerPointerNonInterestBox;
|
||||
|
||||
/*
|
||||
* set up the pointer object
|
||||
* virtual core pointer ID is always 1, so we let it point to the matching
|
||||
* index in the array.
|
||||
*/
|
||||
#if !defined MPX
|
||||
miPointer = (miPointerPtr)xalloc(sizeof(miPointerRec));
|
||||
if (!miPointer)
|
||||
miCorePointer = &miPointers[1];
|
||||
for(ptrIdx = 0; ptrIdx < MAX_DEVICES; ptrIdx++)
|
||||
{
|
||||
xfree((pointer)pScreenPriv);
|
||||
return FALSE;
|
||||
}
|
||||
pPointer = miPointer;
|
||||
#else /* ifdef MPX */
|
||||
miPointer = &miMPPointers[1];
|
||||
{
|
||||
int mpPtrIdx = 0; /* loop counter */
|
||||
/*
|
||||
* Set up pointer objects for multipointer devices.
|
||||
*/
|
||||
while(mpPtrIdx < MAX_DEVICES)
|
||||
{
|
||||
pPointer = &miMPPointers[mpPtrIdx];
|
||||
#endif
|
||||
|
||||
pPointer = &miPointers[ptrIdx];
|
||||
pPointer->pScreen = NULL;
|
||||
pPointer->pSpriteScreen = NULL;
|
||||
pPointer->pCursor = NULL;
|
||||
|
@ -173,11 +160,7 @@ miPointerInitialize (pScreen, spriteFuncs, screenFuncs, waitForUpdate)
|
|||
pPointer->confined = FALSE;
|
||||
pPointer->x = 0;
|
||||
pPointer->y = 0;
|
||||
#ifdef MPX
|
||||
mpPtrIdx++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -187,28 +170,21 @@ miPointerCloseScreen (index, pScreen)
|
|||
int index;
|
||||
ScreenPtr pScreen;
|
||||
{
|
||||
miPointerPtr pPointer;
|
||||
int ptrIdx;
|
||||
|
||||
SetupScreen(pScreen);
|
||||
miPointerPtr pPointer = miPointer;
|
||||
|
||||
#ifdef MPX
|
||||
int mpPointerIdx = 0;
|
||||
|
||||
while(mpPointerIdx < MAX_DEVICES)
|
||||
for(ptrIdx = 0; ptrIdx < MAX_DEVICES; ptrIdx++)
|
||||
{
|
||||
pPointer = &miMPPointers[mpPointerIdx];
|
||||
#endif
|
||||
pPointer = &miPointers[ptrIdx];
|
||||
|
||||
if (pScreen == pPointer->pScreen)
|
||||
pPointer->pScreen = 0;
|
||||
if (pScreen == pPointer->pSpriteScreen)
|
||||
pPointer->pSpriteScreen = 0;
|
||||
#ifdef MPX
|
||||
mpPointerIdx++;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined MPX
|
||||
xfree((pointer)miPointer);
|
||||
#endif
|
||||
pScreen->CloseScreen = pScreenPriv->CloseScreen;
|
||||
xfree ((pointer) pScreenPriv);
|
||||
return (*pScreen->CloseScreen) (index, pScreen);
|
||||
|
@ -244,12 +220,8 @@ miPointerDisplayCursor (pDev, pScreen, pCursor)
|
|||
ScreenPtr pScreen;
|
||||
CursorPtr pCursor;
|
||||
{
|
||||
miPointerPtr pPointer = miPointer;
|
||||
#ifdef MPX
|
||||
/* use core pointer for non MPX devices */
|
||||
if (MPHasCursor(pDev))
|
||||
pPointer = &miMPPointers[pDev->id];
|
||||
#endif
|
||||
miPointerPtr pPointer = MIPOINTER(pDev);
|
||||
|
||||
pPointer->pCursor = pCursor;
|
||||
pPointer->pScreen = pScreen;
|
||||
miPointerUpdateSprite(pDev);
|
||||
|
@ -262,11 +234,8 @@ miPointerConstrainCursor (pDev, pScreen, pBox)
|
|||
ScreenPtr pScreen;
|
||||
BoxPtr pBox;
|
||||
{
|
||||
miPointerPtr pPointer = miPointer;
|
||||
#ifdef MPX
|
||||
if (MPHasCursor(pDev))
|
||||
pPointer = &miMPPointers[pDev->id];
|
||||
#endif
|
||||
miPointerPtr pPointer = MIPOINTER(pDev);
|
||||
|
||||
pPointer->limits = *pBox;
|
||||
pPointer->confined = PointerConfinedToScreen(pDev);
|
||||
}
|
||||
|
@ -320,15 +289,9 @@ miPointerWarpCursor (pDev, pScreen, x, y)
|
|||
ScreenPtr pScreen;
|
||||
int x, y;
|
||||
{
|
||||
miPointerPtr pPointer = miPointer;
|
||||
miPointerPtr pPointer = MIPOINTER(pDev);
|
||||
SetupScreen (pScreen);
|
||||
|
||||
#ifdef MPX
|
||||
if (MPHasCursor(pDev))
|
||||
pPointer = &miMPPointers[pDev->id];
|
||||
#endif
|
||||
|
||||
|
||||
if (pPointer->pScreen != pScreen)
|
||||
(*pScreenPriv->screenFuncs->NewEventScreen) (pScreen, TRUE);
|
||||
|
||||
|
@ -376,20 +339,13 @@ miPointerUpdateSprite (DeviceIntPtr pDev)
|
|||
miPointerScreenPtr pScreenPriv;
|
||||
CursorPtr pCursor;
|
||||
int x, y, devx, devy;
|
||||
miPointerPtr pPointer = miPointer;
|
||||
miPointerPtr pPointer;
|
||||
|
||||
if (!pDev ||
|
||||
!(pDev->coreEvents || pDev == inputInfo.pointer
|
||||
#ifdef MPX
|
||||
|| pDev->isMPDev
|
||||
#endif
|
||||
))
|
||||
!(pDev->coreEvents || pDev == inputInfo.pointer || pDev->isMPDev))
|
||||
return;
|
||||
|
||||
#ifdef MPX
|
||||
if (MPHasCursor(pDev))
|
||||
pPointer = &miMPPointers[pDev->id];
|
||||
#endif
|
||||
pPointer = MIPOINTER(pDev);
|
||||
|
||||
pScreen = pPointer->pScreen;
|
||||
if (!pScreen)
|
||||
|
@ -458,7 +414,7 @@ miPointerUpdateSprite (DeviceIntPtr pDev)
|
|||
void
|
||||
miPointerDeltaCursor (int dx, int dy, unsigned long time)
|
||||
{
|
||||
int x = miPointer->x + dx, y = miPointer->y + dy;
|
||||
int x = miCorePointer->x + dx, y = miCorePointer->y + dy;
|
||||
|
||||
miPointerSetPosition(inputInfo.pointer, &x, &y, time);
|
||||
}
|
||||
|
@ -474,16 +430,13 @@ miPointerSetScreen(DeviceIntPtr pDev, int screen_no, int x, int y)
|
|||
{
|
||||
miPointerScreenPtr pScreenPriv;
|
||||
ScreenPtr pScreen;
|
||||
miPointerPtr pPointer = miPointer;
|
||||
miPointerPtr pPointer = MIPOINTER(pDev);
|
||||
|
||||
pScreen = screenInfo.screens[screen_no];
|
||||
pScreenPriv = GetScreenPrivate (pScreen);
|
||||
(*pScreenPriv->screenFuncs->NewEventScreen) (pScreen, FALSE);
|
||||
NewCurrentScreen (pDev, pScreen, x, y);
|
||||
#ifdef MPX
|
||||
if (MPHasCursor(pDev))
|
||||
pPointer = &miMPPointers[pDev->id];
|
||||
#endif
|
||||
|
||||
pPointer->limits.x2 = pScreen->width;
|
||||
pPointer->limits.y2 = pScreen->height;
|
||||
}
|
||||
|
@ -497,11 +450,7 @@ miPointerCurrentScreen ()
|
|||
_X_EXPORT ScreenPtr
|
||||
miPointerGetScreen(DeviceIntPtr pDev)
|
||||
{
|
||||
miPointerPtr pPointer;
|
||||
#ifdef MPX
|
||||
if (MPHasCursor(pDev))
|
||||
pPointer = &miMPPointers[pDev->id];
|
||||
#endif
|
||||
miPointerPtr pPointer = MIPOINTER(pDev);
|
||||
return pPointer->pScreen;
|
||||
}
|
||||
|
||||
|
@ -521,22 +470,14 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y, unsigned long time)
|
|||
ScreenPtr pScreen;
|
||||
ScreenPtr newScreen;
|
||||
|
||||
miPointerPtr pPointer = miPointer;
|
||||
#ifdef MPX
|
||||
if (MPHasCursor(pDev))
|
||||
pPointer = &(miMPPointers[pDev->id]);
|
||||
#endif
|
||||
miPointerPtr pPointer = MIPOINTER(pDev);
|
||||
|
||||
pScreen = pPointer->pScreen;
|
||||
if (!pScreen)
|
||||
return; /* called before ready */
|
||||
|
||||
if (!pDev ||
|
||||
!(pDev->coreEvents || pDev == inputInfo.pointer
|
||||
#ifdef MPX
|
||||
|| pDev->isMPDev
|
||||
#endif
|
||||
))
|
||||
!(pDev->coreEvents || pDev == inputInfo.pointer || pDev->isMPDev))
|
||||
return;
|
||||
|
||||
if (*x < 0 || *x >= pScreen->width || *y < 0 || *y >= pScreen->height)
|
||||
|
@ -583,11 +524,7 @@ miPointerPosition (int *x, int *y)
|
|||
_X_EXPORT void
|
||||
miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y)
|
||||
{
|
||||
miPointerPtr pPointer = miPointer;
|
||||
#ifdef MPX
|
||||
if (MPHasCursor(pDev))
|
||||
pPointer = &miMPPointers[pDev->id];
|
||||
#endif
|
||||
miPointerPtr pPointer = MIPOINTER(pDev);
|
||||
*x = pPointer->x;
|
||||
*y = pPointer->y;
|
||||
}
|
||||
|
@ -603,20 +540,12 @@ void
|
|||
miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y,
|
||||
unsigned long time)
|
||||
{
|
||||
miPointerPtr pPointer = miPointer;
|
||||
miPointerPtr pPointer = MIPOINTER(pDev);
|
||||
SetupScreen(pScreen);
|
||||
|
||||
#ifdef MPX
|
||||
if (MPHasCursor(pDev))
|
||||
pPointer = &miMPPointers[pDev->id];
|
||||
#endif
|
||||
|
||||
if (pDev && (pDev->coreEvents || pDev == inputInfo.pointer
|
||||
#ifdef MPX
|
||||
|| pDev->isMPDev
|
||||
#endif
|
||||
) &&
|
||||
!pScreenPriv->waitForUpdate && pScreen == pPointer->pSpriteScreen)
|
||||
if (pDev && (pDev->coreEvents || pDev == inputInfo.pointer || pDev->isMPDev)
|
||||
&& !pScreenPriv->waitForUpdate && pScreen == pPointer->pSpriteScreen)
|
||||
{
|
||||
pPointer->devx = x;
|
||||
pPointer->devy = y;
|
||||
|
|
248
mi/misprite.c
248
mi/misprite.c
|
@ -146,31 +146,25 @@ miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
|
|||
ScreenPtr pScreen = closure;
|
||||
miSpriteScreenPtr pScreenPriv;
|
||||
miCursorInfoPtr pCursorInfo;
|
||||
DeviceIntPtr pDev = inputInfo.pointer;
|
||||
DeviceIntPtr pDev;
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||
pCursorInfo = pScreenPriv->cp;
|
||||
|
||||
#ifdef MPX
|
||||
pDev = inputInfo.devices;
|
||||
while(pDev)
|
||||
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
if (MPHasCursor(pDev))
|
||||
{
|
||||
pCursorInfo = &pScreenPriv->mpCursors[pDev->id];
|
||||
#endif
|
||||
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
|
||||
|
||||
if (pCursorInfo->isUp &&
|
||||
RECT_IN_REGION (pScreen, pRegion, &pCursorInfo->saved)
|
||||
RECT_IN_REGION (pScreen, pRegion, &pCursorInfo->saved)
|
||||
!= rgnOUT)
|
||||
{
|
||||
SPRITE_DEBUG(("Damage remove\n"));
|
||||
miSpriteRemoveCursor (pDev, pScreen);
|
||||
}
|
||||
#ifdef MPX
|
||||
}
|
||||
pDev = pDev->next;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -188,6 +182,7 @@ miSpriteInitialize (pScreen, cursorFuncs, screenFuncs)
|
|||
miSpriteScreenPtr pScreenPriv;
|
||||
VisualPtr pVisual;
|
||||
miCursorInfoPtr pCursorInfo;
|
||||
int cursorIdx;
|
||||
|
||||
if (!DamageSetup (pScreen))
|
||||
return FALSE;
|
||||
|
@ -235,54 +230,41 @@ miSpriteInitialize (pScreen, cursorFuncs, screenFuncs)
|
|||
|
||||
pScreenPriv->BlockHandler = pScreen->BlockHandler;
|
||||
|
||||
#if !defined MPX
|
||||
pScreenPriv->cp = (miCursorInfoPtr)xalloc(sizeof(miCursorInfoRec));
|
||||
if (!pScreenPriv->cp)
|
||||
/* alloc and zero memory for all cursors */
|
||||
pScreenPriv->pDevCursors =
|
||||
(miCursorInfoPtr)xalloc(MAX_DEVICES * sizeof(miCursorInfoRec));
|
||||
|
||||
if (!pScreenPriv->pDevCursors)
|
||||
{
|
||||
xfree((pointer)pScreenPriv);
|
||||
return FALSE;
|
||||
}
|
||||
pCursorInfo = pScreenPriv->cp;
|
||||
#else
|
||||
/* alloc and zero memory for all MPX cursors */
|
||||
pScreenPriv->mpCursors = (miCursorInfoPtr)xalloc(MAX_DEVICES * sizeof(miCursorInfoRec));
|
||||
if (!pScreenPriv->mpCursors)
|
||||
/* virtual core pointer's ID is 1 */
|
||||
pScreenPriv->cp = &(pScreenPriv->pDevCursors[1]);
|
||||
|
||||
cursorIdx = 0;
|
||||
while (cursorIdx < MAX_DEVICES)
|
||||
{
|
||||
xfree((pointer)pScreenPriv->cp);
|
||||
xfree((pointer)pScreenPriv);
|
||||
return FALSE;
|
||||
pCursorInfo = &(pScreenPriv->pDevCursors[cursorIdx]);
|
||||
pCursorInfo->pCursor = NULL;
|
||||
pCursorInfo->x = 0;
|
||||
pCursorInfo->y = 0;
|
||||
pCursorInfo->isUp = FALSE;
|
||||
pCursorInfo->shouldBeUp = FALSE;
|
||||
pCursorInfo->pCacheWin = NullWindow;
|
||||
pCursorInfo->isInCacheWin = FALSE;
|
||||
pCursorInfo->checkPixels = TRUE;
|
||||
pCursorInfo->pInstalledMap = NULL;
|
||||
pCursorInfo->pColormap = NULL;
|
||||
pCursorInfo->colors[SOURCE_COLOR].red = 0;
|
||||
pCursorInfo->colors[SOURCE_COLOR].green = 0;
|
||||
pCursorInfo->colors[SOURCE_COLOR].blue = 0;
|
||||
pCursorInfo->colors[MASK_COLOR].red = 0;
|
||||
pCursorInfo->colors[MASK_COLOR].green = 0;
|
||||
pCursorInfo->colors[MASK_COLOR].blue = 0;
|
||||
|
||||
cursorIdx++;
|
||||
}
|
||||
pScreenPriv->cp = &(pScreenPriv->mpCursors[1]);
|
||||
|
||||
{
|
||||
int mpCursorIdx = 0;
|
||||
while (mpCursorIdx < MAX_DEVICES)
|
||||
{
|
||||
pCursorInfo = &(pScreenPriv->mpCursors[mpCursorIdx]);
|
||||
#endif
|
||||
|
||||
pCursorInfo->pCursor = NULL;
|
||||
pCursorInfo->x = 0;
|
||||
pCursorInfo->y = 0;
|
||||
pCursorInfo->isUp = FALSE;
|
||||
pCursorInfo->shouldBeUp = FALSE;
|
||||
pCursorInfo->pCacheWin = NullWindow;
|
||||
pCursorInfo->isInCacheWin = FALSE;
|
||||
pCursorInfo->checkPixels = TRUE;
|
||||
pCursorInfo->pInstalledMap = NULL;
|
||||
pCursorInfo->pColormap = NULL;
|
||||
pCursorInfo->colors[SOURCE_COLOR].red = 0;
|
||||
pCursorInfo->colors[SOURCE_COLOR].green = 0;
|
||||
pCursorInfo->colors[SOURCE_COLOR].blue = 0;
|
||||
pCursorInfo->colors[MASK_COLOR].red = 0;
|
||||
pCursorInfo->colors[MASK_COLOR].green = 0;
|
||||
pCursorInfo->colors[MASK_COLOR].blue = 0;
|
||||
|
||||
#ifdef MPX
|
||||
mpCursorIdx++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
pScreenPriv->funcs = cursorFuncs;
|
||||
pScreen->devPrivates[miSpriteScreenIndex].ptr = (pointer) pScreenPriv;
|
||||
|
@ -321,6 +303,7 @@ miSpriteCloseScreen (i, pScreen)
|
|||
ScreenPtr pScreen;
|
||||
{
|
||||
miSpriteScreenPtr pScreenPriv;
|
||||
DeviceIntPtr pDev;
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||
|
||||
|
@ -333,15 +316,18 @@ miSpriteCloseScreen (i, pScreen)
|
|||
pScreen->StoreColors = pScreenPriv->StoreColors;
|
||||
|
||||
pScreen->SaveDoomedAreas = pScreenPriv->SaveDoomedAreas;
|
||||
miSpriteIsUpFALSE (pScreenPriv->cp, pScreen, pScreenPriv);
|
||||
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
if (MPHasCursor(pDev))
|
||||
{
|
||||
miCursorInfoPtr pCursor;
|
||||
pCursor = &pScreenPriv->pDevCursors[pDev->id];
|
||||
miSpriteIsUpFALSE (pCursor, pScreen, pScreenPriv);
|
||||
}
|
||||
}
|
||||
DamageDestroy (pScreenPriv->pDamage);
|
||||
|
||||
#ifdef MPX
|
||||
xfree((pointer)(pScreenPriv->mpCursors));
|
||||
#else
|
||||
xfree((pointer)(pScreenPriv->cp));
|
||||
#endif
|
||||
|
||||
xfree ((pointer)(pScreenPriv->pDevCursors));
|
||||
xfree ((pointer) pScreenPriv);
|
||||
|
||||
return (*pScreen->CloseScreen) (i, pScreen);
|
||||
|
@ -363,16 +349,12 @@ miSpriteGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine)
|
|||
SCREEN_PROLOGUE (pScreen, GetImage);
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||
pCursorInfo = pScreenPriv->cp;
|
||||
|
||||
#ifdef MPX
|
||||
pDev = inputInfo.devices;
|
||||
while (pDev)
|
||||
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
if (MPHasCursor(pDev))
|
||||
{
|
||||
pCursorInfo = &pScreenPriv->mpCursors[pDev->id];
|
||||
#endif
|
||||
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
|
||||
if (pDrawable->type == DRAWABLE_WINDOW &&
|
||||
pCursorInfo->isUp &&
|
||||
ORG_OVERLAP(&pCursorInfo->saved,pDrawable->x,pDrawable->y,
|
||||
|
@ -381,11 +363,8 @@ miSpriteGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine)
|
|||
SPRITE_DEBUG (("GetImage remove\n"));
|
||||
miSpriteRemoveCursor (pDev, pScreen);
|
||||
}
|
||||
#ifdef MPX
|
||||
}
|
||||
pDev = pDev->next;
|
||||
}
|
||||
#endif
|
||||
|
||||
(*pScreen->GetImage) (pDrawable, sx, sy, w, h,
|
||||
format, planemask, pdstLine);
|
||||
|
@ -410,16 +389,12 @@ miSpriteGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart)
|
|||
SCREEN_PROLOGUE (pScreen, GetSpans);
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||
pCursorInfo = pScreenPriv->cp;
|
||||
|
||||
#ifdef MPX
|
||||
pDev = inputInfo.devices;
|
||||
while(pDev)
|
||||
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
if (MPHasCursor(pDev))
|
||||
{
|
||||
pCursorInfo = &pScreenPriv->mpCursors[pDev->id];
|
||||
#endif
|
||||
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
|
||||
|
||||
if (pDrawable->type == DRAWABLE_WINDOW && pCursorInfo->isUp)
|
||||
{
|
||||
|
@ -445,11 +420,8 @@ miSpriteGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart)
|
|||
}
|
||||
}
|
||||
}
|
||||
#ifdef MPX
|
||||
}
|
||||
pDev = pDev->next;
|
||||
}
|
||||
#endif
|
||||
|
||||
(*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
|
||||
|
||||
|
@ -469,16 +441,12 @@ miSpriteSourceValidate (pDrawable, x, y, width, height)
|
|||
SCREEN_PROLOGUE (pScreen, SourceValidate);
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||
pCursorInfo = pScreenPriv->cp;
|
||||
|
||||
#ifdef MPX
|
||||
pDev = inputInfo.devices;
|
||||
while(pDev)
|
||||
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
if (MPHasCursor(pDev))
|
||||
{
|
||||
pCursorInfo = &pScreenPriv->mpCursors[pDev->id];
|
||||
#endif
|
||||
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
|
||||
if (pDrawable->type == DRAWABLE_WINDOW && pCursorInfo->isUp &&
|
||||
ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y,
|
||||
x, y, width, height))
|
||||
|
@ -486,12 +454,8 @@ miSpriteSourceValidate (pDrawable, x, y, width, height)
|
|||
SPRITE_DEBUG (("SourceValidate remove\n"));
|
||||
miSpriteRemoveCursor (pDev, pScreen);
|
||||
}
|
||||
#ifdef MPX
|
||||
}
|
||||
pDev = pDev->next;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (pScreen->SourceValidate)
|
||||
(*pScreen->SourceValidate) (pDrawable, x, y, width, height);
|
||||
|
@ -510,16 +474,12 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
|||
SCREEN_PROLOGUE (pScreen, CopyWindow);
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||
pCursorInfo = pScreenPriv->cp;
|
||||
|
||||
#ifdef MPX
|
||||
pDev = inputInfo.devices;
|
||||
while(pDev)
|
||||
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
if (MPHasCursor(pDev))
|
||||
{
|
||||
pCursorInfo = &pScreenPriv->mpCursors[pDev->id];
|
||||
#endif
|
||||
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
|
||||
/*
|
||||
* Damage will take care of destination check
|
||||
*/
|
||||
|
@ -529,11 +489,8 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
|||
SPRITE_DEBUG (("CopyWindow remove\n"));
|
||||
miSpriteRemoveCursor (pDev, pScreen);
|
||||
}
|
||||
#ifdef MPX
|
||||
}
|
||||
pDev = pDev->next;
|
||||
}
|
||||
#endif
|
||||
|
||||
(*pScreen->CopyWindow) (pWindow, ptOldOrg, prgnSrc);
|
||||
SCREEN_EPILOGUE (pScreen, CopyWindow);
|
||||
|
@ -552,7 +509,6 @@ miSpriteBlockHandler (i, blockData, pTimeout, pReadmask)
|
|||
miCursorInfoPtr pCursorInfo;
|
||||
|
||||
pPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||
pCursorInfo = pPriv->cp;
|
||||
|
||||
SCREEN_PROLOGUE(pScreen, BlockHandler);
|
||||
|
||||
|
@ -560,25 +516,18 @@ miSpriteBlockHandler (i, blockData, pTimeout, pReadmask)
|
|||
|
||||
SCREEN_EPILOGUE(pScreen, BlockHandler);
|
||||
|
||||
#ifdef MPX
|
||||
pDev = inputInfo.devices;
|
||||
while(pDev)
|
||||
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
if (MPHasCursor(pDev))
|
||||
{
|
||||
pCursorInfo = &pPriv->mpCursors[pDev->id];
|
||||
#endif
|
||||
pCursorInfo = &pPriv->pDevCursors[pDev->id];
|
||||
if (!pCursorInfo->isUp && pCursorInfo->shouldBeUp)
|
||||
{
|
||||
SPRITE_DEBUG (("BlockHandler restore\n"));
|
||||
miSpriteRestoreCursor (pDev, pScreen);
|
||||
}
|
||||
#ifdef MPX
|
||||
}
|
||||
pDev = pDev->next;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -592,7 +541,6 @@ miSpriteInstallColormap (pMap)
|
|||
int cursorIdx;
|
||||
|
||||
pPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||
pCursorInfo = pPriv->cp;
|
||||
|
||||
SCREEN_PROLOGUE(pScreen, InstallColormap);
|
||||
|
||||
|
@ -600,37 +548,30 @@ miSpriteInstallColormap (pMap)
|
|||
|
||||
SCREEN_EPILOGUE(pScreen, InstallColormap);
|
||||
|
||||
#ifdef MPX
|
||||
/* InstallColormap is called before devices are initialized. We cannot
|
||||
* just run through the device list, we need to go through all possible
|
||||
* sprite structs.*/
|
||||
cursorIdx = 0;
|
||||
while(cursorIdx < MAX_DEVICES)
|
||||
for (cursorIdx = 0; cursorIdx < MAX_DEVICES; cursorIdx++)
|
||||
{
|
||||
pCursorInfo = &pPriv->mpCursors[cursorIdx];
|
||||
#endif
|
||||
pCursorInfo = &pPriv->pDevCursors[cursorIdx];
|
||||
pCursorInfo->pInstalledMap = pMap;
|
||||
if (pCursorInfo->pColormap != pMap)
|
||||
{
|
||||
pCursorInfo->checkPixels = TRUE;
|
||||
if (pCursorInfo->isUp)
|
||||
{
|
||||
#ifdef MPX
|
||||
/* find matching device */
|
||||
pDev = inputInfo.devices;
|
||||
while(pDev && pDev->id != cursorIdx)
|
||||
pDev = pDev->next;
|
||||
if (!pDev)
|
||||
pDev = inputInfo.pointer;
|
||||
#endif
|
||||
miSpriteRemoveCursor (pDev, pScreen);
|
||||
}
|
||||
}
|
||||
#ifdef MPX
|
||||
cursorIdx++;
|
||||
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
if (pDev->id == cursorIdx)
|
||||
{
|
||||
miSpriteRemoveCursor(pDev, pScreen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -650,7 +591,6 @@ miSpriteStoreColors (pMap, ndef, pdef)
|
|||
pPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||
|
||||
SCREEN_PROLOGUE(pScreen, StoreColors);
|
||||
pCursorInfo = pPriv->cp;
|
||||
|
||||
(*pScreen->StoreColors) (pMap, ndef, pdef);
|
||||
|
||||
|
@ -670,14 +610,11 @@ miSpriteStoreColors (pMap, ndef, pdef)
|
|||
UpdateDAC(dev, plane,green,greenMask) \
|
||||
UpdateDAC(dev, plane,blue,blueMask)
|
||||
|
||||
#ifdef MPX
|
||||
pDev = inputInfo.devices;
|
||||
while(pDev)
|
||||
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
if (MPHasCursor(pDev))
|
||||
{
|
||||
pCursorInfo = &pPriv->mpCursors[pDev->id];
|
||||
#endif
|
||||
pCursorInfo = &pPriv->pDevCursors[pDev->id];
|
||||
if (pCursorInfo->pColormap == pMap)
|
||||
{
|
||||
updated = 0;
|
||||
|
@ -688,8 +625,8 @@ miSpriteStoreColors (pMap, ndef, pdef)
|
|||
|
||||
for (i = 0; i < ndef; i++)
|
||||
{
|
||||
CheckDirect (pPriv->cp, SOURCE_COLOR)
|
||||
CheckDirect (pPriv->cp, MASK_COLOR)
|
||||
CheckDirect (pCursorInfo, SOURCE_COLOR)
|
||||
CheckDirect (pCursorInfo, MASK_COLOR)
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -720,11 +657,8 @@ miSpriteStoreColors (pMap, ndef, pdef)
|
|||
miSpriteRemoveCursor (pDev, pScreen);
|
||||
}
|
||||
}
|
||||
#ifdef MPX
|
||||
}
|
||||
pDev = pDev->next;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
@ -784,16 +718,12 @@ miSpriteSaveDoomedAreas (pWin, pObscured, dx, dy)
|
|||
SCREEN_PROLOGUE (pScreen, SaveDoomedAreas);
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||
pCursorInfo = pScreenPriv->cp;
|
||||
|
||||
#ifdef MPX
|
||||
pDev = inputInfo.devices;
|
||||
while(pDev)
|
||||
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
{
|
||||
if(MPHasCursor(pDev))
|
||||
{
|
||||
pCursorInfo = &pScreenPriv->mpCursors[pDev->id];
|
||||
#endif
|
||||
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
|
||||
if (pCursorInfo->isUp)
|
||||
{
|
||||
cursorBox = pCursorInfo->saved;
|
||||
|
@ -809,11 +739,8 @@ miSpriteSaveDoomedAreas (pWin, pObscured, dx, dy)
|
|||
miSpriteRemoveCursor (pDev, pScreen);
|
||||
}
|
||||
|
||||
#ifdef MPX
|
||||
}
|
||||
pDev = pDev->next;
|
||||
}
|
||||
#endif
|
||||
|
||||
(*pScreen->SaveDoomedAreas) (pWin, pObscured, dx, dy);
|
||||
|
||||
|
@ -838,10 +765,8 @@ miSpriteRealizeCursor (pDev, pScreen, pCursor)
|
|||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||
pCursorInfo = pScreenPriv->cp;
|
||||
|
||||
#ifdef MPX
|
||||
if (MPHasCursor(pDev))
|
||||
pCursorInfo = &pScreenPriv->mpCursors[pDev->id];
|
||||
#endif
|
||||
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
|
||||
|
||||
if (pCursor == pCursorInfo->pCursor)
|
||||
pCursorInfo->checkPixels = TRUE;
|
||||
|
@ -873,10 +798,9 @@ miSpriteSetCursor (pDev, pScreen, pCursor, x, y)
|
|||
|
||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||
miCursorInfoPtr pPointer = pScreenPriv->cp;
|
||||
#ifdef MPX
|
||||
|
||||
if (MPHasCursor(pDev))
|
||||
pPointer = &pScreenPriv->mpCursors[pDev->id];
|
||||
#endif
|
||||
pPointer = &pScreenPriv->pDevCursors[pDev->id];
|
||||
|
||||
if (!pCursor)
|
||||
{
|
||||
|
@ -992,10 +916,9 @@ miSpriteMoveCursor (pDev, pScreen, x, y)
|
|||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||
pCursor = pScreenPriv->cp->pCursor;
|
||||
|
||||
#ifdef MPX
|
||||
if (MPHasCursor(pDev))
|
||||
pCursor = pScreenPriv->mpCursors[pDev->id].pCursor;
|
||||
#endif
|
||||
pCursor = pScreenPriv->pDevCursors[pDev->id].pCursor;
|
||||
|
||||
miSpriteSetCursor (pDev, pScreen, pCursor, x, y);
|
||||
}
|
||||
|
||||
|
@ -1016,10 +939,8 @@ miSpriteRemoveCursor (pDev, pScreen)
|
|||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||
pCursorInfo = pScreenPriv->cp;
|
||||
|
||||
#ifdef MPX
|
||||
if (MPHasCursor(pDev))
|
||||
pCursorInfo = &pScreenPriv->mpCursors[pDev->id];
|
||||
#endif
|
||||
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
|
||||
|
||||
miSpriteIsUpFALSE (pCursorInfo, pScreen, pScreenPriv);
|
||||
pCursorInfo->pCacheWin = NullWindow;
|
||||
|
@ -1056,10 +977,8 @@ miSpriteRestoreCursor (pDev, pScreen)
|
|||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||
pCursorInfo = pScreenPriv->cp;
|
||||
|
||||
#ifdef MPX
|
||||
if (MPHasCursor(pDev))
|
||||
pCursorInfo = &pScreenPriv->mpCursors[pDev->id];
|
||||
#endif
|
||||
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
|
||||
|
||||
miSpriteComputeSaved (pDev, pScreen);
|
||||
pCursor = pCursorInfo->pCursor;
|
||||
|
@ -1106,11 +1025,8 @@ miSpriteComputeSaved (pDev, pScreen)
|
|||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||
pCursorInfo = pScreenPriv->cp;
|
||||
|
||||
#ifdef MPX
|
||||
if (MPHasCursor(pDev))
|
||||
pCursorInfo = &pScreenPriv->mpCursors[pDev->id];
|
||||
#endif
|
||||
|
||||
pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
|
||||
|
||||
pCursor = pCursorInfo->pCursor;
|
||||
x = pCursorInfo->x - (int)pCursor->bits->xhot;
|
||||
|
|
|
@ -88,9 +88,7 @@ typedef struct {
|
|||
VisualPtr pVisual;
|
||||
miSpriteCursorFuncPtr funcs;
|
||||
DamagePtr pDamage; /* damage tracking structure */
|
||||
#ifdef MPX
|
||||
miCursorInfoPtr mpCursors; /* all cursor's info */
|
||||
#endif
|
||||
miCursorInfoPtr pDevCursors; /* all cursors' info */
|
||||
} miSpriteScreenRec, *miSpriteScreenPtr;
|
||||
|
||||
#define SOURCE_COLOR 0
|
||||
|
|
Loading…
Reference in New Issue