xfree86/hurd: remove OsMouseProc (bug #5613)

Remove OsMouseProc, let the mouse driver deal with it.
This commit is contained in:
Samuel Thibault 2006-11-04 19:00:57 +02:00 committed by Daniel Stone
parent 0273610578
commit f72927d26c

View File

@ -76,85 +76,6 @@ typedef struct {
#define NUMEVENTS 64
/*
* OsMouseProc --
* Handle the initialization, etc. of a mouse
*/
static int
OsMouseProc(DeviceIntPtr pPointer, int what)
{
InputInfoPtr pInfo;
MouseDevPtr pMse;
unsigned char map[MSE_MAXBUTTONS + 1];
int nbuttons;
pInfo = pPointer->public.devicePrivate;
pMse = pInfo->private;
pMse->device = pPointer;
switch (what) {
case DEVICE_INIT:
pPointer->public.on = FALSE;
for (nbuttons = 0; nbuttons < MSE_MAXBUTTONS; ++nbuttons)
map[nbuttons + 1] = nbuttons + 1;
InitPointerDeviceStruct((DevicePtr)pPointer,
map,
min(pMse->buttons, MSE_MAXBUTTONS),
miPointerGetMotionEvents,
pMse->Ctrl,
miPointerGetMotionBufferSize());
/* X valuator */
xf86InitValuatorAxisStruct(pPointer, 0, 0, -1, 1, 0, 1);
xf86InitValuatorDefaults(pPointer, 0);
/* Y valuator */
xf86InitValuatorAxisStruct(pPointer, 1, 0, -1, 1, 0, 1);
xf86InitValuatorDefaults(pPointer, 1);
xf86MotionHistoryAllocate(pInfo);
break;
case DEVICE_ON:
pInfo->fd = xf86OpenSerial(pInfo->options);
if (pInfo->fd == -1)
xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
else {
pMse->buffer = XisbNew(pInfo->fd,
NUMEVENTS * sizeof(kd_event));
if (!pMse->buffer) {
xfree(pMse);
xf86CloseSerial(pInfo->fd);
pInfo->fd = -1;
} else {
xf86FlushInput(pInfo->fd);
AddEnabledDevice(pInfo->fd);
}
}
pMse->lastButtons = 0;
pMse->lastMappedButtons = 0;
pMse->emulateState = 0;
pPointer->public.on = TRUE;
break;
case DEVICE_OFF:
case DEVICE_CLOSE:
if (pInfo->fd != -1) {
RemoveEnabledDevice(pInfo->fd);
if (pMse->buffer) {
XisbFree(pMse->buffer);
pMse->buffer = NULL;
}
xf86CloseSerial(pInfo->fd);
pInfo->fd = -1;
}
pPointer->public.on = FALSE;
usleep(300000);
break;
}
return Success;
}
/*
* OsMouseReadInput --
* Get some events from our queue. Process all outstanding events now.
@ -240,7 +161,6 @@ OsMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags)
pMse->CommonOptions(pInfo);
/* Setup the local procs. */
pInfo->device_control = OsMouseProc;
pInfo->read_input = OsMouseReadInput;
pInfo->flags |= XI86_CONFIGURED;