dix: moved isMPdev field to end of _DeviceIntRec structure
mi: added miMPPointers array to mipointer.c added DeviceIntPtr to all miPointerSpriteFuncs. Coming from miPointer we use inputInfo.pointer as standard value. ABI BREAK! ramdac: forcing failed HW Cursor initialisation. MPX needs software rendering. changes to use new miPointerSpriteFunc (this required externing inputInfo, should probably be fixed at a later point). RAC: changes to use new miPointerSpriteFuncs.
This commit is contained in:
parent
5388423eb0
commit
94e106a898
25
Changelog
25
Changelog
|
@ -1,5 +1,30 @@
|
||||||
MPX Changelog file
|
MPX Changelog file
|
||||||
|
|
||||||
|
== 17.11.06 ==
|
||||||
|
dix: moved isMPdev field to end of _DeviceIntRec structure
|
||||||
|
|
||||||
|
mi:
|
||||||
|
added miMPPointers array to mipointer.c
|
||||||
|
added DeviceIntPtr to all miPointerSpriteFuncs. Coming from miPointer
|
||||||
|
we use inputInfo.pointer as standard value. ABI BREAK!
|
||||||
|
|
||||||
|
ramdac:
|
||||||
|
forcing failed HW Cursor initialisation. MPX needs software rendering.
|
||||||
|
changes to use new miPointerSpriteFunc (this required externing
|
||||||
|
inputInfo, should probably be fixed at a later point).
|
||||||
|
|
||||||
|
|
||||||
|
RAC: changes to use new miPointerSpriteFuncs.
|
||||||
|
|
||||||
|
Files:
|
||||||
|
include/inputstr.h
|
||||||
|
mi/mipointer.c
|
||||||
|
mi/mipointer.h
|
||||||
|
mi/misprite.c
|
||||||
|
hw/xfree86/ramdac/xf86HWCurs.c
|
||||||
|
hw/xfree86/ramdac/xf86Cursor.c
|
||||||
|
hw/xfree86/rac/xf86RAC.c
|
||||||
|
|
||||||
== 16.11.06 ==
|
== 16.11.06 ==
|
||||||
dix:
|
dix:
|
||||||
merge with code cleanup from master
|
merge with code cleanup from master
|
||||||
|
|
|
@ -224,11 +224,14 @@ static void RACPolyGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit,
|
||||||
static void RACPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDraw,
|
static void RACPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDraw,
|
||||||
int dx, int dy, int xOrg, int yOrg );
|
int dx, int dy, int xOrg, int yOrg );
|
||||||
/* miSpriteFuncs */
|
/* miSpriteFuncs */
|
||||||
static Bool RACSpriteRealizeCursor(ScreenPtr pScreen, CursorPtr pCur);
|
static Bool RACSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
static Bool RACSpriteUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCur);
|
CursorPtr pCur);
|
||||||
static void RACSpriteSetCursor(ScreenPtr pScreen, CursorPtr pCur,
|
static Bool RACSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
int x, int y);
|
CursorPtr pCur);
|
||||||
static void RACSpriteMoveCursor(ScreenPtr pScreen, int x, int y);
|
static void RACSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
|
CursorPtr pCur, int x, int y);
|
||||||
|
static void RACSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
|
int x, int y);
|
||||||
#ifdef RENDER
|
#ifdef RENDER
|
||||||
static void RACComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
|
static void RACComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
|
||||||
PicturePtr pDst, INT16 xSrc, INT16 ySrc,
|
PicturePtr pDst, INT16 xSrc, INT16 ySrc,
|
||||||
|
@ -1158,46 +1161,47 @@ RACPushPixels(
|
||||||
|
|
||||||
/* miSpriteFuncs */
|
/* miSpriteFuncs */
|
||||||
static Bool
|
static Bool
|
||||||
RACSpriteRealizeCursor(ScreenPtr pScreen, CursorPtr pCur)
|
RACSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur)
|
||||||
{
|
{
|
||||||
Bool val;
|
Bool val;
|
||||||
SPRITE_PROLOG;
|
SPRITE_PROLOG;
|
||||||
DPRINT_S("RACSpriteRealizeCursor",pScreen->myNum);
|
DPRINT_S("RACSpriteRealizeCursor",pScreen->myNum);
|
||||||
ENABLE;
|
ENABLE;
|
||||||
val = PointPriv->spriteFuncs->RealizeCursor(pScreen, pCur);
|
val = PointPriv->spriteFuncs->RealizeCursor(pDev, pScreen, pCur);
|
||||||
SPRITE_EPILOG;
|
SPRITE_EPILOG;
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
RACSpriteUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCur)
|
RACSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur)
|
||||||
{
|
{
|
||||||
Bool val;
|
Bool val;
|
||||||
SPRITE_PROLOG;
|
SPRITE_PROLOG;
|
||||||
DPRINT_S("RACSpriteUnrealizeCursor",pScreen->myNum);
|
DPRINT_S("RACSpriteUnrealizeCursor",pScreen->myNum);
|
||||||
ENABLE;
|
ENABLE;
|
||||||
val = PointPriv->spriteFuncs->UnrealizeCursor(pScreen, pCur);
|
val = PointPriv->spriteFuncs->UnrealizeCursor(pDev, pScreen, pCur);
|
||||||
SPRITE_EPILOG;
|
SPRITE_EPILOG;
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
RACSpriteSetCursor(ScreenPtr pScreen, CursorPtr pCur, int x, int y)
|
RACSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
|
CursorPtr pCur, int x, int y)
|
||||||
{
|
{
|
||||||
SPRITE_PROLOG;
|
SPRITE_PROLOG;
|
||||||
DPRINT_S("RACSpriteSetCursor",pScreen->myNum);
|
DPRINT_S("RACSpriteSetCursor",pScreen->myNum);
|
||||||
ENABLE;
|
ENABLE;
|
||||||
PointPriv->spriteFuncs->SetCursor(pScreen, pCur, x, y);
|
PointPriv->spriteFuncs->SetCursor(pDev, pScreen, pCur, x, y);
|
||||||
SPRITE_EPILOG;
|
SPRITE_EPILOG;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
RACSpriteMoveCursor(ScreenPtr pScreen, int x, int y)
|
RACSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
||||||
{
|
{
|
||||||
SPRITE_PROLOG;
|
SPRITE_PROLOG;
|
||||||
DPRINT_S("RACSpriteMoveCursor",pScreen->myNum);
|
DPRINT_S("RACSpriteMoveCursor",pScreen->myNum);
|
||||||
ENABLE;
|
ENABLE;
|
||||||
PointPriv->spriteFuncs->MoveCursor(pScreen, x, y);
|
PointPriv->spriteFuncs->MoveCursor(pDev, pScreen, x, y);
|
||||||
SPRITE_EPILOG;
|
SPRITE_EPILOG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,15 +8,25 @@
|
||||||
#include "colormapst.h"
|
#include "colormapst.h"
|
||||||
#include "cursorstr.h"
|
#include "cursorstr.h"
|
||||||
|
|
||||||
|
/* FIXME: This was added with the ABI change of the miPointerSpriteFuncs for
|
||||||
|
* MPX.
|
||||||
|
* inputInfo is needed to pass the core pointer as the default argument into
|
||||||
|
* the cursor functions.
|
||||||
|
*
|
||||||
|
* Externing inputInfo is not the nice way to do it but it works.
|
||||||
|
*/
|
||||||
|
#include "inputstr.h"
|
||||||
|
extern InputInfo inputInfo;
|
||||||
|
|
||||||
int xf86CursorScreenIndex = -1;
|
int xf86CursorScreenIndex = -1;
|
||||||
static unsigned long xf86CursorGeneration = 0;
|
static unsigned long xf86CursorGeneration = 0;
|
||||||
|
|
||||||
/* sprite functions */
|
/* sprite functions */
|
||||||
|
|
||||||
static Bool xf86CursorRealizeCursor(ScreenPtr, CursorPtr);
|
static Bool xf86CursorRealizeCursor(DeviceIntPtr, ScreenPtr, CursorPtr);
|
||||||
static Bool xf86CursorUnrealizeCursor(ScreenPtr, CursorPtr);
|
static Bool xf86CursorUnrealizeCursor(DeviceIntPtr, ScreenPtr, CursorPtr);
|
||||||
static void xf86CursorSetCursor(ScreenPtr, CursorPtr, int, int);
|
static void xf86CursorSetCursor(DeviceIntPtr, ScreenPtr, CursorPtr, int, int);
|
||||||
static void xf86CursorMoveCursor(ScreenPtr, int, int);
|
static void xf86CursorMoveCursor(DeviceIntPtr, ScreenPtr, int, int);
|
||||||
|
|
||||||
static miPointerSpriteFuncRec xf86CursorSpriteFuncs = {
|
static miPointerSpriteFuncRec xf86CursorSpriteFuncs = {
|
||||||
xf86CursorRealizeCursor,
|
xf86CursorRealizeCursor,
|
||||||
|
@ -194,14 +204,17 @@ xf86CursorEnableDisableFBAccess(
|
||||||
int index,
|
int index,
|
||||||
Bool enable)
|
Bool enable)
|
||||||
{
|
{
|
||||||
|
DeviceIntPtr pDev = inputInfo.pointer;
|
||||||
|
|
||||||
ScreenPtr pScreen = screenInfo.screens[index];
|
ScreenPtr pScreen = screenInfo.screens[index];
|
||||||
xf86CursorScreenPtr ScreenPriv =
|
xf86CursorScreenPtr ScreenPriv =
|
||||||
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
|
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
|
||||||
|
|
||||||
if (!enable && ScreenPriv->CurrentCursor != NullCursor) {
|
if (!enable && ScreenPriv->CurrentCursor != NullCursor) {
|
||||||
ScreenPriv->SavedCursor = ScreenPriv->CurrentCursor;
|
ScreenPriv->SavedCursor = ScreenPriv->CurrentCursor;
|
||||||
xf86CursorSetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
|
xf86CursorSetCursor(pDev, pScreen, NullCursor, ScreenPriv->x,
|
||||||
ScreenPriv->isUp = FALSE;
|
ScreenPriv->y);
|
||||||
|
ScreenPriv->isUp = FALSE;
|
||||||
ScreenPriv->SWCursor = TRUE;
|
ScreenPriv->SWCursor = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,7 +227,7 @@ xf86CursorEnableDisableFBAccess(
|
||||||
* Re-set current cursor so drivers can react to FB access having been
|
* Re-set current cursor so drivers can react to FB access having been
|
||||||
* temporarily disabled.
|
* temporarily disabled.
|
||||||
*/
|
*/
|
||||||
xf86CursorSetCursor(pScreen, ScreenPriv->SavedCursor,
|
xf86CursorSetCursor(pDev, pScreen, ScreenPriv->SavedCursor,
|
||||||
ScreenPriv->x, ScreenPriv->y);
|
ScreenPriv->x, ScreenPriv->y);
|
||||||
ScreenPriv->SavedCursor = NULL;
|
ScreenPriv->SavedCursor = NULL;
|
||||||
}
|
}
|
||||||
|
@ -251,7 +264,7 @@ xf86CursorSwitchMode(int index, DisplayModePtr mode, int flags)
|
||||||
/****** miPointerSpriteFunctions *******/
|
/****** miPointerSpriteFunctions *******/
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
xf86CursorRealizeCursor(ScreenPtr pScreen, CursorPtr pCurs)
|
xf86CursorRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs)
|
||||||
{
|
{
|
||||||
xf86CursorScreenPtr ScreenPriv =
|
xf86CursorScreenPtr ScreenPriv =
|
||||||
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
|
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
|
||||||
|
@ -259,11 +272,12 @@ xf86CursorRealizeCursor(ScreenPtr pScreen, CursorPtr pCurs)
|
||||||
if (pCurs->refcnt <= 1)
|
if (pCurs->refcnt <= 1)
|
||||||
pCurs->devPriv[pScreen->myNum] = NULL;
|
pCurs->devPriv[pScreen->myNum] = NULL;
|
||||||
|
|
||||||
return (*ScreenPriv->spriteFuncs->RealizeCursor)(pScreen, pCurs);
|
return (*ScreenPriv->spriteFuncs->RealizeCursor)(pDev, pScreen, pCurs);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
xf86CursorUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCurs)
|
xf86CursorUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
|
CursorPtr pCurs)
|
||||||
{
|
{
|
||||||
xf86CursorScreenPtr ScreenPriv =
|
xf86CursorScreenPtr ScreenPriv =
|
||||||
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
|
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
|
||||||
|
@ -273,11 +287,12 @@ xf86CursorUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCurs)
|
||||||
pCurs->devPriv[pScreen->myNum] = NULL;
|
pCurs->devPriv[pScreen->myNum] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pScreen, pCurs);
|
return (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pDev, pScreen, pCurs);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xf86CursorSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
|
xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
|
||||||
|
int x, int y)
|
||||||
{
|
{
|
||||||
xf86CursorScreenPtr ScreenPriv =
|
xf86CursorScreenPtr ScreenPriv =
|
||||||
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
|
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
|
||||||
|
@ -294,8 +309,10 @@ xf86CursorSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
|
||||||
|
|
||||||
if (pCurs == NullCursor) { /* means we're supposed to remove the cursor */
|
if (pCurs == NullCursor) { /* means we're supposed to remove the cursor */
|
||||||
if (ScreenPriv->SWCursor)
|
if (ScreenPriv->SWCursor)
|
||||||
(*ScreenPriv->spriteFuncs->SetCursor)(pScreen, NullCursor, x, y);
|
(*ScreenPriv->spriteFuncs->SetCursor)(pDev, pScreen, NullCursor,
|
||||||
else if (ScreenPriv->isUp) {
|
x, y);
|
||||||
|
else if
|
||||||
|
(ScreenPriv->isUp) {
|
||||||
xf86SetCursor(pScreen, NullCursor, x, y);
|
xf86SetCursor(pScreen, NullCursor, x, y);
|
||||||
ScreenPriv->isUp = FALSE;
|
ScreenPriv->isUp = FALSE;
|
||||||
}
|
}
|
||||||
|
@ -319,7 +336,7 @@ xf86CursorSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (ScreenPriv->SWCursor) /* remove the SW cursor */
|
if (ScreenPriv->SWCursor) /* remove the SW cursor */
|
||||||
(*ScreenPriv->spriteFuncs->SetCursor)(pScreen, NullCursor, x, y);
|
(*ScreenPriv->spriteFuncs->SetCursor)(pDev, pScreen, NullCursor, x, y);
|
||||||
|
|
||||||
xf86SetCursor(pScreen, pCurs, x, y);
|
xf86SetCursor(pScreen, pCurs, x, y);
|
||||||
ScreenPriv->SWCursor = FALSE;
|
ScreenPriv->SWCursor = FALSE;
|
||||||
|
@ -344,11 +361,11 @@ xf86CursorSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
|
||||||
|
|
||||||
if (pCurs->bits->emptyMask && !ScreenPriv->showTransparent)
|
if (pCurs->bits->emptyMask && !ScreenPriv->showTransparent)
|
||||||
pCurs = NullCursor;
|
pCurs = NullCursor;
|
||||||
(*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCurs, x, y);
|
(*ScreenPriv->spriteFuncs->SetCursor)(pDev, pScreen, pCurs, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xf86CursorMoveCursor(ScreenPtr pScreen, int x, int y)
|
xf86CursorMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
||||||
{
|
{
|
||||||
xf86CursorScreenPtr ScreenPriv =
|
xf86CursorScreenPtr ScreenPriv =
|
||||||
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
|
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
|
||||||
|
@ -357,10 +374,10 @@ xf86CursorMoveCursor(ScreenPtr pScreen, int x, int y)
|
||||||
ScreenPriv->y = y;
|
ScreenPriv->y = y;
|
||||||
|
|
||||||
if (ScreenPriv->CursorToRestore)
|
if (ScreenPriv->CursorToRestore)
|
||||||
xf86CursorSetCursor(pScreen, ScreenPriv->CursorToRestore,
|
xf86CursorSetCursor(pDev, pScreen, ScreenPriv->CursorToRestore,
|
||||||
ScreenPriv->x, ScreenPriv->y);
|
ScreenPriv->x, ScreenPriv->y);
|
||||||
else if (ScreenPriv->SWCursor)
|
else if (ScreenPriv->SWCursor)
|
||||||
(*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y);
|
(*ScreenPriv->spriteFuncs->MoveCursor)(pDev, pScreen, x, y);
|
||||||
else if (ScreenPriv->isUp)
|
else if (ScreenPriv->isUp)
|
||||||
xf86MoveCursor(pScreen, x, y);
|
xf86MoveCursor(pScreen, x, y);
|
||||||
}
|
}
|
||||||
|
@ -368,6 +385,8 @@ xf86CursorMoveCursor(ScreenPtr pScreen, int x, int y)
|
||||||
void
|
void
|
||||||
xf86ForceHWCursor (ScreenPtr pScreen, Bool on)
|
xf86ForceHWCursor (ScreenPtr pScreen, Bool on)
|
||||||
{
|
{
|
||||||
|
DeviceIntPtr pDev = inputInfo.pointer;
|
||||||
|
|
||||||
xf86CursorScreenPtr ScreenPriv =
|
xf86CursorScreenPtr ScreenPriv =
|
||||||
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
|
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
|
||||||
|
|
||||||
|
@ -378,7 +397,7 @@ xf86ForceHWCursor (ScreenPtr pScreen, Bool on)
|
||||||
if (ScreenPriv->SWCursor && ScreenPriv->CurrentCursor)
|
if (ScreenPriv->SWCursor && ScreenPriv->CurrentCursor)
|
||||||
{
|
{
|
||||||
ScreenPriv->HWCursorForced = TRUE;
|
ScreenPriv->HWCursorForced = TRUE;
|
||||||
xf86CursorSetCursor (pScreen, ScreenPriv->CurrentCursor,
|
xf86CursorSetCursor (pDev, pScreen, ScreenPriv->CurrentCursor,
|
||||||
ScreenPriv->x, ScreenPriv->y);
|
ScreenPriv->x, ScreenPriv->y);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -390,7 +409,7 @@ xf86ForceHWCursor (ScreenPtr pScreen, Bool on)
|
||||||
if (--ScreenPriv->ForceHWCursorCount == 0)
|
if (--ScreenPriv->ForceHWCursorCount == 0)
|
||||||
{
|
{
|
||||||
if (ScreenPriv->HWCursorForced && ScreenPriv->CurrentCursor)
|
if (ScreenPriv->HWCursorForced && ScreenPriv->CurrentCursor)
|
||||||
xf86CursorSetCursor (pScreen, ScreenPriv->CurrentCursor,
|
xf86CursorSetCursor (pDev, pScreen, ScreenPriv->CurrentCursor,
|
||||||
ScreenPriv->x, ScreenPriv->y);
|
ScreenPriv->x, ScreenPriv->y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,13 @@ static unsigned char* RealizeCursorInterleave64(xf86CursorInfoPtr, CursorPtr);
|
||||||
Bool
|
Bool
|
||||||
xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr)
|
xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifdef MPX
|
||||||
|
/* Graphics cards cannot render multiple cursors in hardware. We have to
|
||||||
|
software render them. */
|
||||||
|
return FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((infoPtr->MaxWidth <= 0) || (infoPtr->MaxHeight <= 0))
|
if ((infoPtr->MaxWidth <= 0) || (infoPtr->MaxHeight <= 0))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
|
|
@ -288,9 +288,6 @@ typedef struct _DeviceIntRec {
|
||||||
Bool inited; /* TRUE if INIT returns Success */
|
Bool inited; /* TRUE if INIT returns Success */
|
||||||
Bool enabled; /* TRUE if ON returns Success */
|
Bool enabled; /* TRUE if ON returns Success */
|
||||||
Bool coreEvents; /* TRUE if device also sends core */
|
Bool coreEvents; /* TRUE if device also sends core */
|
||||||
#ifdef MPX
|
|
||||||
Bool isMPDev; /* TRUE if multipointer device */
|
|
||||||
#endif
|
|
||||||
GrabPtr grab; /* the grabber - used by DIX */
|
GrabPtr grab; /* the grabber - used by DIX */
|
||||||
struct {
|
struct {
|
||||||
Bool frozen;
|
Bool frozen;
|
||||||
|
@ -332,6 +329,9 @@ typedef struct _DeviceIntRec {
|
||||||
DevUnion *devPrivates;
|
DevUnion *devPrivates;
|
||||||
int nPrivates;
|
int nPrivates;
|
||||||
DeviceUnwrapProc unwrapProc;
|
DeviceUnwrapProc unwrapProc;
|
||||||
|
#ifdef MPX
|
||||||
|
Bool isMPDev; /* TRUE if multipointer device */
|
||||||
|
#endif
|
||||||
} DeviceIntRec;
|
} DeviceIntRec;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -27,6 +27,15 @@ Except as contained in this notice, the name of The Open Group shall not be
|
||||||
used in advertising or otherwise to promote the sale, use or other dealings
|
used in advertising or otherwise to promote the sale, use or other dealings
|
||||||
in this Software without prior written authorization from The Open Group.
|
in this Software without prior written authorization from The Open Group.
|
||||||
*/
|
*/
|
||||||
|
#ifdef MPX
|
||||||
|
/*
|
||||||
|
* MPX additions:
|
||||||
|
* Copyright © 2006 Peter Hutterer
|
||||||
|
* License see above.
|
||||||
|
* Author: Peter Hutterer <peter@cs.unisa.edu.au>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_DIX_CONFIG_H
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
@ -58,6 +67,11 @@ static unsigned long miPointerGeneration = 0;
|
||||||
|
|
||||||
static miPointerRec miPointer;
|
static miPointerRec miPointer;
|
||||||
|
|
||||||
|
#ifdef MPX
|
||||||
|
/* Multipointers */
|
||||||
|
static miPointerRec miMPPointers[MAX_DEVICES];
|
||||||
|
#endif
|
||||||
|
|
||||||
static Bool miPointerRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
static Bool miPointerRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
||||||
static Bool miPointerUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
static Bool miPointerUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
||||||
static Bool miPointerDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
static Bool miPointerDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
||||||
|
@ -77,6 +91,9 @@ miPointerInitialize (pScreen, spriteFuncs, screenFuncs, waitForUpdate)
|
||||||
miPointerScreenFuncPtr screenFuncs;
|
miPointerScreenFuncPtr screenFuncs;
|
||||||
Bool waitForUpdate;
|
Bool waitForUpdate;
|
||||||
{
|
{
|
||||||
|
#ifdef MPX
|
||||||
|
int mpPtrIdx = 0; /* loop counter */
|
||||||
|
#endif
|
||||||
miPointerScreenPtr pScreenPriv;
|
miPointerScreenPtr pScreenPriv;
|
||||||
|
|
||||||
if (miPointerGeneration != serverGeneration)
|
if (miPointerGeneration != serverGeneration)
|
||||||
|
@ -128,6 +145,28 @@ miPointerInitialize (pScreen, spriteFuncs, screenFuncs, waitForUpdate)
|
||||||
miPointer.confined = FALSE;
|
miPointer.confined = FALSE;
|
||||||
miPointer.x = 0;
|
miPointer.x = 0;
|
||||||
miPointer.y = 0;
|
miPointer.y = 0;
|
||||||
|
|
||||||
|
#ifdef MPX
|
||||||
|
/*
|
||||||
|
* Set up pointer objects for multipointer devices.
|
||||||
|
*/
|
||||||
|
while(mpPtrIdx < MAX_DEVICES)
|
||||||
|
{
|
||||||
|
miMPPointers[mpPtrIdx].pScreen = NULL;
|
||||||
|
miMPPointers[mpPtrIdx].pSpriteScreen = NULL;
|
||||||
|
miMPPointers[mpPtrIdx].pCursor = NULL;
|
||||||
|
miMPPointers[mpPtrIdx].pSpriteCursor = NULL;
|
||||||
|
miMPPointers[mpPtrIdx].limits.x1 = 0;
|
||||||
|
miMPPointers[mpPtrIdx].limits.x2 = 32767;
|
||||||
|
miMPPointers[mpPtrIdx].limits.y1 = 0;
|
||||||
|
miMPPointers[mpPtrIdx].limits.y2 = 32767;
|
||||||
|
miMPPointers[mpPtrIdx].confined = FALSE;
|
||||||
|
miMPPointers[mpPtrIdx].x = 0;
|
||||||
|
miMPPointers[mpPtrIdx].y = 0;
|
||||||
|
mpPtrIdx++;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,9 +195,11 @@ miPointerRealizeCursor (pScreen, pCursor)
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
CursorPtr pCursor;
|
CursorPtr pCursor;
|
||||||
{
|
{
|
||||||
|
DeviceIntPtr pDev = inputInfo.pointer;
|
||||||
|
|
||||||
SetupScreen(pScreen);
|
SetupScreen(pScreen);
|
||||||
|
|
||||||
return (*pScreenPriv->spriteFuncs->RealizeCursor) (pScreen, pCursor);
|
return (*pScreenPriv->spriteFuncs->RealizeCursor) (pDev, pScreen, pCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
|
@ -166,9 +207,10 @@ miPointerUnrealizeCursor (pScreen, pCursor)
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
CursorPtr pCursor;
|
CursorPtr pCursor;
|
||||||
{
|
{
|
||||||
|
DeviceIntPtr pDev = inputInfo.pointer;
|
||||||
SetupScreen(pScreen);
|
SetupScreen(pScreen);
|
||||||
|
|
||||||
return (*pScreenPriv->spriteFuncs->UnrealizeCursor) (pScreen, pCursor);
|
return (*pScreenPriv->spriteFuncs->UnrealizeCursor) (pDev, pScreen, pCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
|
@ -236,6 +278,8 @@ miPointerWarpCursor (pScreen, x, y)
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
int x, y;
|
int x, y;
|
||||||
{
|
{
|
||||||
|
DeviceIntPtr pDev = inputInfo.pointer;
|
||||||
|
|
||||||
SetupScreen (pScreen);
|
SetupScreen (pScreen);
|
||||||
|
|
||||||
if (miPointer.pScreen != pScreen)
|
if (miPointer.pScreen != pScreen)
|
||||||
|
@ -243,7 +287,7 @@ miPointerWarpCursor (pScreen, x, y)
|
||||||
|
|
||||||
if (GenerateEvent)
|
if (GenerateEvent)
|
||||||
{
|
{
|
||||||
miPointerMove (pScreen, x, y, GetTimeInMillis());
|
miPointerMoved (pDev, pScreen, x, y, GetTimeInMillis());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -254,7 +298,7 @@ miPointerWarpCursor (pScreen, x, y)
|
||||||
miPointer.devx = x;
|
miPointer.devx = x;
|
||||||
miPointer.devy = y;
|
miPointer.devy = y;
|
||||||
if(!miPointer.pCursor->bits->emptyMask)
|
if(!miPointer.pCursor->bits->emptyMask)
|
||||||
(*pScreenPriv->spriteFuncs->MoveCursor) (pScreen, x, y);
|
(*pScreenPriv->spriteFuncs->MoveCursor) (pDev, pScreen, x, y);
|
||||||
}
|
}
|
||||||
miPointer.x = x;
|
miPointer.x = x;
|
||||||
miPointer.y = y;
|
miPointer.y = y;
|
||||||
|
@ -313,13 +357,13 @@ miPointerUpdateSprite (DeviceIntPtr pDev)
|
||||||
if (miPointer.pCursor)
|
if (miPointer.pCursor)
|
||||||
{
|
{
|
||||||
(*pOldPriv->spriteFuncs->SetCursor)
|
(*pOldPriv->spriteFuncs->SetCursor)
|
||||||
(miPointer.pSpriteScreen, NullCursor, 0, 0);
|
(pDev, miPointer.pSpriteScreen, NullCursor, 0, 0);
|
||||||
}
|
}
|
||||||
(*pOldPriv->screenFuncs->CrossScreen) (miPointer.pSpriteScreen, FALSE);
|
(*pOldPriv->screenFuncs->CrossScreen) (miPointer.pSpriteScreen, FALSE);
|
||||||
}
|
}
|
||||||
(*pScreenPriv->screenFuncs->CrossScreen) (pScreen, TRUE);
|
(*pScreenPriv->screenFuncs->CrossScreen) (pScreen, TRUE);
|
||||||
(*pScreenPriv->spriteFuncs->SetCursor)
|
(*pScreenPriv->spriteFuncs->SetCursor)
|
||||||
(pScreen, miPointer.pCursor, x, y);
|
(pDev, pScreen, miPointer.pCursor, x, y);
|
||||||
miPointer.devx = x;
|
miPointer.devx = x;
|
||||||
miPointer.devy = y;
|
miPointer.devy = y;
|
||||||
miPointer.pSpriteCursor = miPointer.pCursor;
|
miPointer.pSpriteCursor = miPointer.pCursor;
|
||||||
|
@ -333,7 +377,7 @@ miPointerUpdateSprite (DeviceIntPtr pDev)
|
||||||
pCursor = miPointer.pCursor;
|
pCursor = miPointer.pCursor;
|
||||||
if (pCursor->bits->emptyMask && !pScreenPriv->showTransparent)
|
if (pCursor->bits->emptyMask && !pScreenPriv->showTransparent)
|
||||||
pCursor = NullCursor;
|
pCursor = NullCursor;
|
||||||
(*pScreenPriv->spriteFuncs->SetCursor) (pScreen, pCursor, x, y);
|
(*pScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen, pCursor, x, y);
|
||||||
|
|
||||||
miPointer.devx = x;
|
miPointer.devx = x;
|
||||||
miPointer.devy = y;
|
miPointer.devy = y;
|
||||||
|
@ -344,7 +388,7 @@ miPointerUpdateSprite (DeviceIntPtr pDev)
|
||||||
miPointer.devx = x;
|
miPointer.devx = x;
|
||||||
miPointer.devy = y;
|
miPointer.devy = y;
|
||||||
if(!miPointer.pCursor->bits->emptyMask)
|
if(!miPointer.pCursor->bits->emptyMask)
|
||||||
(*pScreenPriv->spriteFuncs->MoveCursor) (pScreen, x, y);
|
(*pScreenPriv->spriteFuncs->MoveCursor) (pDev, pScreen, x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,7 +457,12 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y, unsigned long time)
|
||||||
if (!pScreen)
|
if (!pScreen)
|
||||||
return; /* called before ready */
|
return; /* called before ready */
|
||||||
|
|
||||||
|
#ifdef MPX
|
||||||
|
if (!pDev ||
|
||||||
|
!(pDev->coreEvents || pDev == inputInfo.pointer || pDev->isMPDev))
|
||||||
|
#else
|
||||||
if (!pDev || !(pDev->coreEvents || pDev == inputInfo.pointer))
|
if (!pDev || !(pDev->coreEvents || pDev == inputInfo.pointer))
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (*x < 0 || *x >= pScreen->width || *y < 0 || *y >= pScreen->height)
|
if (*x < 0 || *x >= pScreen->width || *y < 0 || *y >= pScreen->height)
|
||||||
|
@ -482,7 +531,7 @@ miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y,
|
||||||
miPointer.devx = x;
|
miPointer.devx = x;
|
||||||
miPointer.devy = y;
|
miPointer.devy = y;
|
||||||
if(!miPointer.pCursor->bits->emptyMask)
|
if(!miPointer.pCursor->bits->emptyMask)
|
||||||
(*pScreenPriv->spriteFuncs->MoveCursor) (pScreen, x, y);
|
(*pScreenPriv->spriteFuncs->MoveCursor) (pDev, pScreen, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
miPointer.x = x;
|
miPointer.x = x;
|
||||||
|
|
|
@ -37,20 +37,24 @@ in this Software without prior written authorization from The Open Group.
|
||||||
|
|
||||||
typedef struct _miPointerSpriteFuncRec {
|
typedef struct _miPointerSpriteFuncRec {
|
||||||
Bool (*RealizeCursor)(
|
Bool (*RealizeCursor)(
|
||||||
|
DeviceIntPtr /* pDev */,
|
||||||
ScreenPtr /* pScr */,
|
ScreenPtr /* pScr */,
|
||||||
CursorPtr /* pCurs */
|
CursorPtr /* pCurs */
|
||||||
);
|
);
|
||||||
Bool (*UnrealizeCursor)(
|
Bool (*UnrealizeCursor)(
|
||||||
|
DeviceIntPtr /* pDev */,
|
||||||
ScreenPtr /* pScr */,
|
ScreenPtr /* pScr */,
|
||||||
CursorPtr /* pCurs */
|
CursorPtr /* pCurs */
|
||||||
);
|
);
|
||||||
void (*SetCursor)(
|
void (*SetCursor)(
|
||||||
|
DeviceIntPtr /* pDev */,
|
||||||
ScreenPtr /* pScr */,
|
ScreenPtr /* pScr */,
|
||||||
CursorPtr /* pCurs */,
|
CursorPtr /* pCurs */,
|
||||||
int /* x */,
|
int /* x */,
|
||||||
int /* y */
|
int /* y */
|
||||||
);
|
);
|
||||||
void (*MoveCursor)(
|
void (*MoveCursor)(
|
||||||
|
DeviceIntPtr /* pDev */,
|
||||||
ScreenPtr /* pScr */,
|
ScreenPtr /* pScr */,
|
||||||
int /* x */,
|
int /* x */,
|
||||||
int /* y */
|
int /* y */
|
||||||
|
|
|
@ -29,6 +29,15 @@ Except as contained in this notice, the name of The Open Group shall not be
|
||||||
used in advertising or otherwise to promote the sale, use or other dealings
|
used in advertising or otherwise to promote the sale, use or other dealings
|
||||||
in this Software without prior written authorization from The Open Group.
|
in this Software without prior written authorization from The Open Group.
|
||||||
*/
|
*/
|
||||||
|
#ifdef MPX
|
||||||
|
/*
|
||||||
|
* MPX additions:
|
||||||
|
* Copyright © 2006 Peter Hutterer
|
||||||
|
* License see above.
|
||||||
|
* Author: Peter Hutterer <peter@cs.unisa.edu.au>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_DIX_CONFIG_H
|
#ifdef HAVE_DIX_CONFIG_H
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
@ -105,11 +114,14 @@ static void miSpriteComputeSaved(ScreenPtr pScreen);
|
||||||
* pointer-sprite method table
|
* pointer-sprite method table
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static Bool miSpriteRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
static Bool miSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
static Bool miSpriteUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
CursorPtr pCursor);
|
||||||
static void miSpriteSetCursor(ScreenPtr pScreen, CursorPtr pCursor,
|
static Bool miSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
int x, int y);
|
CursorPtr pCursor);
|
||||||
static void miSpriteMoveCursor(ScreenPtr pScreen, int x, int y);
|
static void miSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
|
CursorPtr pCursor, int x, int y);
|
||||||
|
static void miSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
|
int x, int y);
|
||||||
|
|
||||||
_X_EXPORT miPointerSpriteFuncRec miSpritePointerFuncs = {
|
_X_EXPORT miPointerSpriteFuncRec miSpritePointerFuncs = {
|
||||||
miSpriteRealizeCursor,
|
miSpriteRealizeCursor,
|
||||||
|
@ -603,7 +615,8 @@ miSpriteSaveDoomedAreas (pWin, pObscured, dx, dy)
|
||||||
#define SPRITE_PAD 8
|
#define SPRITE_PAD 8
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
miSpriteRealizeCursor (pScreen, pCursor)
|
miSpriteRealizeCursor (pDev, pScreen, pCursor)
|
||||||
|
DeviceIntPtr pDev;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
CursorPtr pCursor;
|
CursorPtr pCursor;
|
||||||
{
|
{
|
||||||
|
@ -616,7 +629,8 @@ miSpriteRealizeCursor (pScreen, pCursor)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
miSpriteUnrealizeCursor (pScreen, pCursor)
|
miSpriteUnrealizeCursor (pDev, pScreen, pCursor)
|
||||||
|
DeviceIntPtr pDev;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
CursorPtr pCursor;
|
CursorPtr pCursor;
|
||||||
{
|
{
|
||||||
|
@ -627,7 +641,8 @@ miSpriteUnrealizeCursor (pScreen, pCursor)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
miSpriteSetCursor (pScreen, pCursor, x, y)
|
miSpriteSetCursor (pDev, pScreen, pCursor, x, y)
|
||||||
|
DeviceIntPtr pDev;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
CursorPtr pCursor;
|
CursorPtr pCursor;
|
||||||
int x;
|
int x;
|
||||||
|
@ -729,14 +744,15 @@ miSpriteSetCursor (pScreen, pCursor, x, y)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
miSpriteMoveCursor (pScreen, x, y)
|
miSpriteMoveCursor (pDev, pScreen, x, y)
|
||||||
|
DeviceIntPtr pDev;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
int x, y;
|
int x, y;
|
||||||
{
|
{
|
||||||
miSpriteScreenPtr pScreenPriv;
|
miSpriteScreenPtr pScreenPriv;
|
||||||
|
|
||||||
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
|
||||||
miSpriteSetCursor (pScreen, pScreenPriv->pCursor, x, y);
|
miSpriteSetCursor (pDev, pScreen, pScreenPriv->pCursor, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue