summaryrefslogtreecommitdiff
path: root/hw/dmx
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2008-05-14 16:18:48 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-05-14 16:18:48 +0930
commit68b4f250eef441a3d75e3b9b2665a51d3a1538d6 (patch)
tree40d8705ad2cc40ac202d08d13cbc9a3573069cea /hw/dmx
parent00db0f35acc00cb771ab1c23f35b0db1c25d81bb (diff)
dmx: fix build.
Just because it builds, doesn't mean it works.
Diffstat (limited to 'hw/dmx')
-rw-r--r--hw/dmx/dmxcursor.c18
-rw-r--r--hw/dmx/dmxcursor.h2
-rw-r--r--hw/dmx/dmxinput.h4
-rw-r--r--hw/dmx/input/dmxeq.c8
-rw-r--r--hw/dmx/input/dmxevents.c27
-rw-r--r--hw/dmx/input/dmxinputinit.c2
6 files changed, 32 insertions, 29 deletions
diff --git a/hw/dmx/dmxcursor.c b/hw/dmx/dmxcursor.c
index 8a801169c..3dcbc3364 100644
--- a/hw/dmx/dmxcursor.c
+++ b/hw/dmx/dmxcursor.c
@@ -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);
#if 11 /*BP*/
/* This call is depracated. Replace with???? */
- miPointerWarpCursor(pScreen, x, y);
+ miPointerWarpCursor(pDev, pScreen, x, y);
#else
- pScreen->SetCursorPosition(pScreen, x, y, FALSE);
+ pScreen->SetCursorPosition(pDev, pScreen, x, y, FALSE);
#endif
}
@@ -753,7 +753,7 @@ static void _dmxSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
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 *pt;
@@ -771,7 +771,7 @@ static Bool dmxRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
return TRUE;
}
-static Bool dmxUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
+static Bool dmxUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{
DMXScreenInfo *start = &dmxScreens[pScreen->myNum];
DMXScreenInfo *pt;
@@ -794,14 +794,14 @@ static CursorPtr dmxFindCursor(DMXScreenInfo *start)
DMXScreenInfo *pt;
if (!start || !start->over)
- return GetSpriteCursor();
+ return GetSpriteCursor(inputInfo.pointer);
for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
if (pt->cursor)
return pt->cursor;
if (pt == start)
break;
}
- return GetSpriteCursor();
+ return GetSpriteCursor(inputInfo.pointer);
}
/** 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
* _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 *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 *pt;
diff --git a/hw/dmx/dmxcursor.h b/hw/dmx/dmxcursor.h
index d909bd01e..da8ea5e85 100644
--- a/hw/dmx/dmxcursor.h
+++ b/hw/dmx/dmxcursor.h
@@ -55,7 +55,7 @@ extern void dmxReInitOrigins(void);
extern void dmxInitOrigins(void);
extern void dmxInitOverlap(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 int dmxOnScreen(int x, int y, DMXScreenInfo *dmxScreen);
extern void dmxHideCursor(DMXScreenInfo *dmxScreen);
diff --git a/hw/dmx/dmxinput.h b/hw/dmx/dmxinput.h
index 8a3ccdcbd..7af7b1801 100644
--- a/hw/dmx/dmxinput.h
+++ b/hw/dmx/dmxinput.h
@@ -141,8 +141,8 @@ extern void dmxUpdateWindowInfo(DMXUpdateType type, WindowPtr pWindow);
/* These functions are defined in input/dmxeq.c */
extern Bool dmxeqInitialized(void);
-extern void dmxeqEnqueue(xEvent *e);
-extern void dmxeqSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
+extern void dmxeqEnqueue(DeviceIntPtr pDev, xEvent *e);
+extern void dmxeqSwitchScreen(DeviceIntPtr pDev, ScreenPtr pScreen, Bool fromDIX);
/* This type is used in input/dmxevents.c. Also, these functions are
* defined in input/dmxevents.c */
diff --git a/hw/dmx/input/dmxeq.c b/hw/dmx/input/dmxeq.c
index afa2b2cd3..86ba960b8 100644
--- a/hw/dmx/input/dmxeq.c
+++ b/hw/dmx/input/dmxeq.c
@@ -99,6 +99,7 @@ typedef struct _Event {
xEvent event; /**< Event. */
ScreenPtr pScreen; /**< Screen on which event occurred. */
deviceValuator valuator; /**< XInput device valuator information. */
+ DeviceIntPtr pDev;
} EventRec, *EventPtr;
/** Event queue. */
@@ -154,7 +155,7 @@ Bool dmxeqInit(DevicePtr pKbd, DevicePtr pPtr)
* called from regular code.
*/
-void dmxeqEnqueue(xEvent *e)
+void dmxeqEnqueue(DeviceIntPtr pDev, xEvent *e)
{
HWEventQueueType oldtail, newtail;
Bool isMotion;
@@ -179,6 +180,7 @@ void dmxeqEnqueue(xEvent *e)
/* Store the event in the queue */
dmxEventQueue.events[oldtail].event = *e;
+ dmxEventQueue.events[oldtail].pDev = pDev;
/* If this is an XInput event, store the
* valuator event, too */
deviceKeyButtonPointer *ev = (deviceKeyButtonPointer *)e;
@@ -197,7 +199,7 @@ void dmxeqEnqueue(xEvent *e)
/** Make \a pScreen the new screen for enqueueing events. If \a fromDIX
* 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;
if (fromDIX) dmxEventQueue.pDequeueScreen = pScreen;
@@ -258,7 +260,7 @@ void dmxeqProcessInputEvents(void)
y = e->event.u.keyButtonPointer.rootY;
if (dmxEventQueue.head == QUEUE_SIZE - 1) dmxEventQueue.head = 0;
else ++dmxEventQueue.head;
- NewCurrentScreen(dmxEventQueue.pDequeueScreen, x, y);
+ NewCurrentScreen(e->pDev, dmxEventQueue.pDequeueScreen, x, y);
} else {
xe[0] = e->event;
if (dmxEventQueue.head == QUEUE_SIZE - 1) dmxEventQueue.head = 0;
diff --git a/hw/dmx/input/dmxevents.c b/hw/dmx/input/dmxevents.c
index 2e24ff42f..1d0e872a0 100644
--- a/hw/dmx/input/dmxevents.c
+++ b/hw/dmx/input/dmxevents.c
@@ -201,7 +201,7 @@ static void dmxEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, xEvent *e,
if (block)
dmxSigioBlock();
- dmxeqEnqueue(xE);
+ dmxeqEnqueue(pDevice, xE);
if (block)
dmxSigioUnblock();
}
@@ -227,14 +227,16 @@ static void enqueueMotion(DevicePtr pDev, int x, int y)
GETDMXLOCALFROMPDEV;
DeviceIntPtr p = dmxLocal->pDevice;
int i, nevents, valuators[3];
- xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
+ EventListPtr events;
int detail = 0; /* XXX should this be mask of pressed buttons? */
valuators[0] = x;
valuators[1] = y;
+
+ GetEventList(&events);
nevents = GetPointerEvents(events, p, MotionNotify, detail,
POINTER_ABSOLUTE, 0, 2, valuators);
for (i = 0; i < nevents; i++)
- mieqEnqueue(p, events + i);
+ mieqEnqueue(p, (events + i)->event);
xfree(events);
return;
}
@@ -419,7 +421,7 @@ static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
if (block)
dmxSigioBlock();
dmxPointerPutMotionEvent(pDevice, firstAxis, axesCount, v, xev->time);
- dmxeqEnqueue(xE);
+ dmxeqEnqueue(pDevice, xE);
if (block)
dmxSigioUnblock();
}
@@ -434,6 +436,7 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
int event = -1;
XDeviceKeyEvent *ke = (XDeviceKeyEvent *)e;
XDeviceMotionEvent *me = (XDeviceMotionEvent *)e;
+ DeviceIntPtr pDevice = dmxLocal->pDevice;
if (!e)
return -1; /* No extended event passed, cannot handle */
@@ -499,7 +502,7 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
if (block)
dmxSigioBlock();
- dmxeqEnqueue(xE);
+ dmxeqEnqueue(pDevice, xE);
if (block)
dmxSigioUnblock();
break;
@@ -674,7 +677,7 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
xEvent xE;
DeviceIntPtr p = dmxLocal->pDevice;
int i, nevents, valuators[3];
- xEvent *events;
+ EventListPtr events;
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)
xE.u.u.detail = dmxFixup(pDev, detail, keySym);
- events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
+ GetEventList(&events);
/*ErrorF("KEY %d sym %d\n", detail, (int) keySym);*/
nevents = GetKeyboardEvents(events, p, type, detail);
for (i = 0; i < nevents; i++)
- mieqEnqueue(p, events + i);
- xfree(events);
+ mieqEnqueue(p, (events + i)->event);
return;
case ButtonPress:
case ButtonRelease:
detail = dmxGetButtonMapping(dmxLocal, detail);
- events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
+ GetEventList(&events);
nevents = GetPointerEvents(events, p, type, detail,
POINTER_ABSOLUTE,
0, /* first_valuator = 0 */
0, /* num_valuators = 0 */
valuators);
for (i = 0; i < nevents; i++)
- mieqEnqueue(p, events + i);
+ mieqEnqueue(p, (events + i)->event);
xfree(events);
return;
@@ -718,8 +720,7 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
nevents = GetPointerEvents(events, p, type, detail,
POINTER_ABSOLUTE, 0, 3, valuators);
for (i = 0; i < nevents; i++)
- mieqEnqueue(p, events + i);
- xfree(events);
+ mieqEnqueue(p, (events + i)->event);
return;
case EnterNotify:
diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index 7b5cc73a3..277e164a3 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -755,7 +755,7 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal)
if (!name || !registerProcPtr)
dmxLog(dmxFatal, "Cannot add device %s\n", dmxLocal->name);
- pDevice = AddInputDevice(dmxDeviceOnOff, TRUE);
+ pDevice = AddInputDevice(serverClient, dmxDeviceOnOff, TRUE);
if (!pDevice) {
dmxLog(dmxError, "Too many devices -- cannot add device %s\n",
dmxLocal->name);