dmx: fix build.
Just because it builds, doesn't mean it works.
This commit is contained in:
parent
00db0f35ac
commit
68b4f250ee
|
@ -178,14 +178,14 @@ static void dmxCrossScreen(ScreenPtr pScreen, Bool entering)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dmxWarpCursor(ScreenPtr pScreen, int x, int y)
|
static void dmxWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
||||||
{
|
{
|
||||||
DMXDBG3("dmxWarpCursor(%d,%d,%d)\n", pScreen->myNum, x, y);
|
DMXDBG3("dmxWarpCursor(%d,%d,%d)\n", pScreen->myNum, x, y);
|
||||||
#if 11 /*BP*/
|
#if 11 /*BP*/
|
||||||
/* This call is depracated. Replace with???? */
|
/* This call is depracated. Replace with???? */
|
||||||
miPointerWarpCursor(pScreen, x, y);
|
miPointerWarpCursor(pDev, pScreen, x, y);
|
||||||
#else
|
#else
|
||||||
pScreen->SetCursorPosition(pScreen, x, y, FALSE);
|
pScreen->SetCursorPosition(pDev, pScreen, x, y, FALSE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -753,7 +753,7 @@ static void _dmxSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
|
||||||
if (dmxScreen->beDisplay) dmxSync(dmxScreen, TRUE);
|
if (dmxScreen->beDisplay) dmxSync(dmxScreen, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool dmxRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
|
static Bool dmxRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
||||||
{
|
{
|
||||||
DMXScreenInfo *start = &dmxScreens[pScreen->myNum];
|
DMXScreenInfo *start = &dmxScreens[pScreen->myNum];
|
||||||
DMXScreenInfo *pt;
|
DMXScreenInfo *pt;
|
||||||
|
@ -771,7 +771,7 @@ static Bool dmxRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool dmxUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
|
static Bool dmxUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
||||||
{
|
{
|
||||||
DMXScreenInfo *start = &dmxScreens[pScreen->myNum];
|
DMXScreenInfo *start = &dmxScreens[pScreen->myNum];
|
||||||
DMXScreenInfo *pt;
|
DMXScreenInfo *pt;
|
||||||
|
@ -794,14 +794,14 @@ static CursorPtr dmxFindCursor(DMXScreenInfo *start)
|
||||||
DMXScreenInfo *pt;
|
DMXScreenInfo *pt;
|
||||||
|
|
||||||
if (!start || !start->over)
|
if (!start || !start->over)
|
||||||
return GetSpriteCursor();
|
return GetSpriteCursor(inputInfo.pointer);
|
||||||
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
|
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
|
||||||
if (pt->cursor)
|
if (pt->cursor)
|
||||||
return pt->cursor;
|
return pt->cursor;
|
||||||
if (pt == start)
|
if (pt == start)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return GetSpriteCursor();
|
return GetSpriteCursor(inputInfo.pointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Move the cursor to coordinates (\a x, \a y)on \a pScreen. This
|
/** Move the cursor to coordinates (\a x, \a y)on \a pScreen. This
|
||||||
|
@ -813,7 +813,7 @@ static CursorPtr dmxFindCursor(DMXScreenInfo *start)
|
||||||
* back-end screens and see if they contain the global coord. If so, call
|
* back-end screens and see if they contain the global coord. If so, call
|
||||||
* _dmxMoveCursor() (XWarpPointer) to position the pointer on that screen.
|
* _dmxMoveCursor() (XWarpPointer) to position the pointer on that screen.
|
||||||
*/
|
*/
|
||||||
void dmxMoveCursor(ScreenPtr pScreen, int x, int y)
|
void dmxMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
||||||
{
|
{
|
||||||
DMXScreenInfo *start = &dmxScreens[pScreen->myNum];
|
DMXScreenInfo *start = &dmxScreens[pScreen->myNum];
|
||||||
DMXScreenInfo *pt;
|
DMXScreenInfo *pt;
|
||||||
|
@ -860,7 +860,7 @@ void dmxMoveCursor(ScreenPtr pScreen, int x, int y)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dmxSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
|
static void dmxSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
|
||||||
{
|
{
|
||||||
DMXScreenInfo *start = &dmxScreens[pScreen->myNum];
|
DMXScreenInfo *start = &dmxScreens[pScreen->myNum];
|
||||||
DMXScreenInfo *pt;
|
DMXScreenInfo *pt;
|
||||||
|
|
|
@ -55,7 +55,7 @@ extern void dmxReInitOrigins(void);
|
||||||
extern void dmxInitOrigins(void);
|
extern void dmxInitOrigins(void);
|
||||||
extern void dmxInitOverlap(void);
|
extern void dmxInitOverlap(void);
|
||||||
extern void dmxCursorNoMulti(void);
|
extern void dmxCursorNoMulti(void);
|
||||||
extern void dmxMoveCursor(ScreenPtr pScreen, int x, int y);
|
extern void dmxMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y);
|
||||||
extern void dmxCheckCursor(void);
|
extern void dmxCheckCursor(void);
|
||||||
extern int dmxOnScreen(int x, int y, DMXScreenInfo *dmxScreen);
|
extern int dmxOnScreen(int x, int y, DMXScreenInfo *dmxScreen);
|
||||||
extern void dmxHideCursor(DMXScreenInfo *dmxScreen);
|
extern void dmxHideCursor(DMXScreenInfo *dmxScreen);
|
||||||
|
|
|
@ -141,8 +141,8 @@ extern void dmxUpdateWindowInfo(DMXUpdateType type, WindowPtr pWindow);
|
||||||
|
|
||||||
/* These functions are defined in input/dmxeq.c */
|
/* These functions are defined in input/dmxeq.c */
|
||||||
extern Bool dmxeqInitialized(void);
|
extern Bool dmxeqInitialized(void);
|
||||||
extern void dmxeqEnqueue(xEvent *e);
|
extern void dmxeqEnqueue(DeviceIntPtr pDev, xEvent *e);
|
||||||
extern void dmxeqSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
|
extern void dmxeqSwitchScreen(DeviceIntPtr pDev, ScreenPtr pScreen, Bool fromDIX);
|
||||||
|
|
||||||
/* This type is used in input/dmxevents.c. Also, these functions are
|
/* This type is used in input/dmxevents.c. Also, these functions are
|
||||||
* defined in input/dmxevents.c */
|
* defined in input/dmxevents.c */
|
||||||
|
|
|
@ -99,6 +99,7 @@ typedef struct _Event {
|
||||||
xEvent event; /**< Event. */
|
xEvent event; /**< Event. */
|
||||||
ScreenPtr pScreen; /**< Screen on which event occurred. */
|
ScreenPtr pScreen; /**< Screen on which event occurred. */
|
||||||
deviceValuator valuator; /**< XInput device valuator information. */
|
deviceValuator valuator; /**< XInput device valuator information. */
|
||||||
|
DeviceIntPtr pDev;
|
||||||
} EventRec, *EventPtr;
|
} EventRec, *EventPtr;
|
||||||
|
|
||||||
/** Event queue. */
|
/** Event queue. */
|
||||||
|
@ -154,7 +155,7 @@ Bool dmxeqInit(DevicePtr pKbd, DevicePtr pPtr)
|
||||||
* called from regular code.
|
* called from regular code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void dmxeqEnqueue(xEvent *e)
|
void dmxeqEnqueue(DeviceIntPtr pDev, xEvent *e)
|
||||||
{
|
{
|
||||||
HWEventQueueType oldtail, newtail;
|
HWEventQueueType oldtail, newtail;
|
||||||
Bool isMotion;
|
Bool isMotion;
|
||||||
|
@ -179,6 +180,7 @@ void dmxeqEnqueue(xEvent *e)
|
||||||
|
|
||||||
/* Store the event in the queue */
|
/* Store the event in the queue */
|
||||||
dmxEventQueue.events[oldtail].event = *e;
|
dmxEventQueue.events[oldtail].event = *e;
|
||||||
|
dmxEventQueue.events[oldtail].pDev = pDev;
|
||||||
/* If this is an XInput event, store the
|
/* If this is an XInput event, store the
|
||||||
* valuator event, too */
|
* valuator event, too */
|
||||||
deviceKeyButtonPointer *ev = (deviceKeyButtonPointer *)e;
|
deviceKeyButtonPointer *ev = (deviceKeyButtonPointer *)e;
|
||||||
|
@ -197,7 +199,7 @@ void dmxeqEnqueue(xEvent *e)
|
||||||
|
|
||||||
/** Make \a pScreen the new screen for enqueueing events. If \a fromDIX
|
/** Make \a pScreen the new screen for enqueueing events. If \a fromDIX
|
||||||
* is TRUE, also make \a pScreen the new screen for dequeuing events. */
|
* is TRUE, also make \a pScreen the new screen for dequeuing events. */
|
||||||
void dmxeqSwitchScreen(ScreenPtr pScreen, Bool fromDIX)
|
void dmxeqSwitchScreen(DeviceIntPtr pDev, ScreenPtr pScreen, Bool fromDIX)
|
||||||
{
|
{
|
||||||
dmxEventQueue.pEnqueueScreen = pScreen;
|
dmxEventQueue.pEnqueueScreen = pScreen;
|
||||||
if (fromDIX) dmxEventQueue.pDequeueScreen = pScreen;
|
if (fromDIX) dmxEventQueue.pDequeueScreen = pScreen;
|
||||||
|
@ -258,7 +260,7 @@ void dmxeqProcessInputEvents(void)
|
||||||
y = e->event.u.keyButtonPointer.rootY;
|
y = e->event.u.keyButtonPointer.rootY;
|
||||||
if (dmxEventQueue.head == QUEUE_SIZE - 1) dmxEventQueue.head = 0;
|
if (dmxEventQueue.head == QUEUE_SIZE - 1) dmxEventQueue.head = 0;
|
||||||
else ++dmxEventQueue.head;
|
else ++dmxEventQueue.head;
|
||||||
NewCurrentScreen(dmxEventQueue.pDequeueScreen, x, y);
|
NewCurrentScreen(e->pDev, dmxEventQueue.pDequeueScreen, x, y);
|
||||||
} else {
|
} else {
|
||||||
xe[0] = e->event;
|
xe[0] = e->event;
|
||||||
if (dmxEventQueue.head == QUEUE_SIZE - 1) dmxEventQueue.head = 0;
|
if (dmxEventQueue.head == QUEUE_SIZE - 1) dmxEventQueue.head = 0;
|
||||||
|
|
|
@ -201,7 +201,7 @@ static void dmxEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, xEvent *e,
|
||||||
|
|
||||||
if (block)
|
if (block)
|
||||||
dmxSigioBlock();
|
dmxSigioBlock();
|
||||||
dmxeqEnqueue(xE);
|
dmxeqEnqueue(pDevice, xE);
|
||||||
if (block)
|
if (block)
|
||||||
dmxSigioUnblock();
|
dmxSigioUnblock();
|
||||||
}
|
}
|
||||||
|
@ -227,14 +227,16 @@ static void enqueueMotion(DevicePtr pDev, int x, int y)
|
||||||
GETDMXLOCALFROMPDEV;
|
GETDMXLOCALFROMPDEV;
|
||||||
DeviceIntPtr p = dmxLocal->pDevice;
|
DeviceIntPtr p = dmxLocal->pDevice;
|
||||||
int i, nevents, valuators[3];
|
int i, nevents, valuators[3];
|
||||||
xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
EventListPtr events;
|
||||||
int detail = 0; /* XXX should this be mask of pressed buttons? */
|
int detail = 0; /* XXX should this be mask of pressed buttons? */
|
||||||
valuators[0] = x;
|
valuators[0] = x;
|
||||||
valuators[1] = y;
|
valuators[1] = y;
|
||||||
|
|
||||||
|
GetEventList(&events);
|
||||||
nevents = GetPointerEvents(events, p, MotionNotify, detail,
|
nevents = GetPointerEvents(events, p, MotionNotify, detail,
|
||||||
POINTER_ABSOLUTE, 0, 2, valuators);
|
POINTER_ABSOLUTE, 0, 2, valuators);
|
||||||
for (i = 0; i < nevents; i++)
|
for (i = 0; i < nevents; i++)
|
||||||
mieqEnqueue(p, events + i);
|
mieqEnqueue(p, (events + i)->event);
|
||||||
xfree(events);
|
xfree(events);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -419,7 +421,7 @@ static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
|
||||||
if (block)
|
if (block)
|
||||||
dmxSigioBlock();
|
dmxSigioBlock();
|
||||||
dmxPointerPutMotionEvent(pDevice, firstAxis, axesCount, v, xev->time);
|
dmxPointerPutMotionEvent(pDevice, firstAxis, axesCount, v, xev->time);
|
||||||
dmxeqEnqueue(xE);
|
dmxeqEnqueue(pDevice, xE);
|
||||||
if (block)
|
if (block)
|
||||||
dmxSigioUnblock();
|
dmxSigioUnblock();
|
||||||
}
|
}
|
||||||
|
@ -434,6 +436,7 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
|
||||||
int event = -1;
|
int event = -1;
|
||||||
XDeviceKeyEvent *ke = (XDeviceKeyEvent *)e;
|
XDeviceKeyEvent *ke = (XDeviceKeyEvent *)e;
|
||||||
XDeviceMotionEvent *me = (XDeviceMotionEvent *)e;
|
XDeviceMotionEvent *me = (XDeviceMotionEvent *)e;
|
||||||
|
DeviceIntPtr pDevice = dmxLocal->pDevice;
|
||||||
|
|
||||||
if (!e)
|
if (!e)
|
||||||
return -1; /* No extended event passed, cannot handle */
|
return -1; /* No extended event passed, cannot handle */
|
||||||
|
@ -499,7 +502,7 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
|
||||||
|
|
||||||
if (block)
|
if (block)
|
||||||
dmxSigioBlock();
|
dmxSigioBlock();
|
||||||
dmxeqEnqueue(xE);
|
dmxeqEnqueue(pDevice, xE);
|
||||||
if (block)
|
if (block)
|
||||||
dmxSigioUnblock();
|
dmxSigioUnblock();
|
||||||
break;
|
break;
|
||||||
|
@ -674,7 +677,7 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
|
||||||
xEvent xE;
|
xEvent xE;
|
||||||
DeviceIntPtr p = dmxLocal->pDevice;
|
DeviceIntPtr p = dmxLocal->pDevice;
|
||||||
int i, nevents, valuators[3];
|
int i, nevents, valuators[3];
|
||||||
xEvent *events;
|
EventListPtr events;
|
||||||
|
|
||||||
DMXDBG2("dmxEnqueue: Enqueuing type=%d detail=0x%0x\n", type, detail);
|
DMXDBG2("dmxEnqueue: Enqueuing type=%d detail=0x%0x\n", type, detail);
|
||||||
|
|
||||||
|
@ -688,25 +691,24 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
|
||||||
if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard)
|
if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard)
|
||||||
xE.u.u.detail = dmxFixup(pDev, detail, keySym);
|
xE.u.u.detail = dmxFixup(pDev, detail, keySym);
|
||||||
|
|
||||||
events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
GetEventList(&events);
|
||||||
/*ErrorF("KEY %d sym %d\n", detail, (int) keySym);*/
|
/*ErrorF("KEY %d sym %d\n", detail, (int) keySym);*/
|
||||||
nevents = GetKeyboardEvents(events, p, type, detail);
|
nevents = GetKeyboardEvents(events, p, type, detail);
|
||||||
for (i = 0; i < nevents; i++)
|
for (i = 0; i < nevents; i++)
|
||||||
mieqEnqueue(p, events + i);
|
mieqEnqueue(p, (events + i)->event);
|
||||||
xfree(events);
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
detail = dmxGetButtonMapping(dmxLocal, detail);
|
detail = dmxGetButtonMapping(dmxLocal, detail);
|
||||||
events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
GetEventList(&events);
|
||||||
nevents = GetPointerEvents(events, p, type, detail,
|
nevents = GetPointerEvents(events, p, type, detail,
|
||||||
POINTER_ABSOLUTE,
|
POINTER_ABSOLUTE,
|
||||||
0, /* first_valuator = 0 */
|
0, /* first_valuator = 0 */
|
||||||
0, /* num_valuators = 0 */
|
0, /* num_valuators = 0 */
|
||||||
valuators);
|
valuators);
|
||||||
for (i = 0; i < nevents; i++)
|
for (i = 0; i < nevents; i++)
|
||||||
mieqEnqueue(p, events + i);
|
mieqEnqueue(p, (events + i)->event);
|
||||||
xfree(events);
|
xfree(events);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -718,8 +720,7 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
|
||||||
nevents = GetPointerEvents(events, p, type, detail,
|
nevents = GetPointerEvents(events, p, type, detail,
|
||||||
POINTER_ABSOLUTE, 0, 3, valuators);
|
POINTER_ABSOLUTE, 0, 3, valuators);
|
||||||
for (i = 0; i < nevents; i++)
|
for (i = 0; i < nevents; i++)
|
||||||
mieqEnqueue(p, events + i);
|
mieqEnqueue(p, (events + i)->event);
|
||||||
xfree(events);
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case EnterNotify:
|
case EnterNotify:
|
||||||
|
|
|
@ -755,7 +755,7 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal)
|
||||||
if (!name || !registerProcPtr)
|
if (!name || !registerProcPtr)
|
||||||
dmxLog(dmxFatal, "Cannot add device %s\n", dmxLocal->name);
|
dmxLog(dmxFatal, "Cannot add device %s\n", dmxLocal->name);
|
||||||
|
|
||||||
pDevice = AddInputDevice(dmxDeviceOnOff, TRUE);
|
pDevice = AddInputDevice(serverClient, dmxDeviceOnOff, TRUE);
|
||||||
if (!pDevice) {
|
if (!pDevice) {
|
||||||
dmxLog(dmxError, "Too many devices -- cannot add device %s\n",
|
dmxLog(dmxError, "Too many devices -- cannot add device %s\n",
|
||||||
dmxLocal->name);
|
dmxLocal->name);
|
||||||
|
|
Loading…
Reference in New Issue