checkpoint clean-up

This commit is contained in:
Brian 2007-04-02 15:12:04 -06:00
parent 0f873a9d4f
commit 44eb15adee
2 changed files with 11 additions and 41 deletions

View File

@ -242,11 +242,7 @@ static int dmxBackendOffscreen(int screen, int x, int y)
void dmxBackendUpdatePosition(pointer private, int x, int y)
{
GETPRIVFROMPRIVATE;
#if 00 /*BP*/
int screen = miPointerCurrentScreen()->myNum;
#else
int screen = miPointerGetScreen(inputInfo.pointer)->myNum;
#endif
DMXScreenInfo *dmxScreen = &dmxScreens[priv->myScreen];
int oldRelative = priv->relative;
int topscreen = dmxBackendFindOverlapping(priv, screen, x, y);
@ -397,7 +393,6 @@ void dmxBackendCollectEvents(DevicePtr pDev,
}
break;
case MotionNotify:
#if 001 /*BP*/
DMXDBG9("dmxBackendCollectEvents: MotionNotify %d/%d (mi %d)"
" newscreen=%d: %d %d (e=%d; last=%d,%d)\n",
dmxScreen->index, priv->myScreen,
@ -451,25 +446,15 @@ void dmxBackendCollectEvents(DevicePtr pDev,
(dmxScreen->rootYOrigin + X.xmotion.y
- dmxScreen->rootY));
}
#else
/*
ErrorF("motion %d, %d, %d\n",
X.xmotion.x, X.xmotion.y, X.xmotion.state);
*/
enqueue(priv->mou, X.type, 0/*X.xbutton.button*/, 0, &X, block);
#endif
break;
case KeyPress:
case KeyRelease:
enqueue(priv->kbd, X.type, X.xkey.keycode, 0, NULL, block);
break;
#if 11/*BP*/
case ButtonPress:
case ButtonRelease:
ErrorF("press/release at %d, %d\n", X.xbutton.x, X.xbutton.y);
/* fall-through */
#endif
/* fall-through */
default:
/* Pass the whole event here, because
* this may be an extension event. */

View File

@ -194,30 +194,20 @@ DMXScreenInfo *dmxFindFirstScreen(int x, int y)
#if 11/*BP*/
/**
* Enqueue a motion event.
*/
static void enqueueMotion(DevicePtr pDev, int x, int y)
{
GETDMXINPUTFROMPDEV;
GETDMXLOCALFROMPDEV;
DeviceIntPtr p = dmxLocal->pDevice;
int i, nevents, valuators[3];
xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
int detail = 0;
int detail = 0; /* XXX should this be mask of pressed buttons? */
valuators[0] = x;
valuators[1] = y;
valuators[2] = detail;
nevents = GetPointerEvents(events,
/*pDev*/p,
MotionNotify,
detail,
POINTER_ABSOLUTE,
0, 2, valuators);
ErrorF("MOTION2 %d, %d n = %d\n", valuators[0], valuators[1], nevents);
/*
ErrorF("NEW MOTION %d st %d (%d,%d,%d) n=%d\n",
detail, e->xmotion.state,
valuators[0], valuators[1], valuators[2],
nevents);
*/
nevents = GetPointerEvents(events, p, MotionNotify, detail,
POINTER_ABSOLUTE, 0, 2, valuators);
for (i = 0; i < nevents; i++)
mieqEnqueue(p, events + i);
xfree(events);
@ -347,8 +337,6 @@ void dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
if (dmxGlobalX >= dmxGlobalWidth) dmxGlobalX = dmxGlobalWidth + delta -1;
if (dmxGlobalY >= dmxGlobalHeight) dmxGlobalY = dmxGlobalHeight + delta -1;
ErrorF("Global Pos: %d, %d\n", dmxGlobalX, dmxGlobalY);
if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) {
localX = dmxGlobalX - dmxScreen->rootXOrigin;
localY = dmxGlobalY - dmxScreen->rootYOrigin;
@ -397,7 +385,6 @@ void dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
#endif
dmxGlobalX = localX + dmxScreens[pScreen->myNum].rootXOrigin;
dmxGlobalY = localY + dmxScreens[pScreen->myNum].rootYOrigin;
ErrorF("Global is now %d, %d\n", dmxGlobalX, dmxGlobalY);
DMXDBG6(" Moved to dmxGlobalX=%d dmxGlobalY=%d"
" on screen index=%d/%d localX=%d localY=%d\n",
dmxGlobalX, dmxGlobalY,
@ -750,7 +737,7 @@ static int dmxFixup(DevicePtr pDev, int detail, KeySym keySym)
return keyCode ? keyCode : detail;
}
/** Enqueue a non-motion event from the \a pDev device with the
/** Enqueue an event from the \a pDev device with the
* specified \a type and \a detail. If the event is a KeyPress or
* KeyRelease event, then the \a keySym is also specified.
*
@ -778,10 +765,7 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
DeviceIntPtr p = dmxLocal->pDevice;
int i, nevents;
xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
nevents = GetKeyboardEvents(events,
/*pDev*/p,
/*KeyPress*/type,
/*n*/detail);
nevents = GetKeyboardEvents(events, p, type, detail);
ErrorF("KEY %d n=%d\n", detail, nevents);
for (i = 0; i < nevents; i++)
mieqEnqueue(p, events + i);
@ -795,6 +779,7 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
#if 00 /*BP*/
detail = dmxGetButtonMapping(dmxLocal, detail);
#else
detail = dmxGetButtonMapping(dmxLocal, detail);
{
DeviceIntPtr p = dmxLocal->pDevice;
int i, nevents, valuators[3];