diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-05-20 14:53:00 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-05-20 15:05:19 +1000 |
commit | 4cc8ddc33613209b9da6f6c184a7e5d94d30bdd1 (patch) | |
tree | 8908bddd69643417decf4dad38ccb47f2c7f4a43 | |
parent | bb1ffccf8c35afb2322fed964d8d97bd19fc4f7f (diff) | |
download | xf86-input-wacom-4cc8ddc33613209b9da6f6c184a7e5d94d30bdd1.tar.gz |
Rename LocalDevicePtr to InputInfoPtr
Not cherry-picked, sed is much faster than I am at resolving conflicts.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/wcmCommon.c | 208 | ||||
-rw-r--r-- | src/wcmConfig.c | 136 | ||||
-rw-r--r-- | src/wcmFilter.c | 2 | ||||
-rw-r--r-- | src/wcmISDV4.c | 118 | ||||
-rw-r--r-- | src/wcmTouchFilter.c | 28 | ||||
-rw-r--r-- | src/wcmUSB.c | 114 | ||||
-rw-r--r-- | src/wcmValidateDevice.c | 158 | ||||
-rw-r--r-- | src/wcmXCommand.c | 94 | ||||
-rw-r--r-- | src/xf86Wacom.c | 262 | ||||
-rw-r--r-- | src/xf86Wacom.h | 56 | ||||
-rw-r--r-- | src/xf86WacomDefs.h | 20 |
11 files changed, 598 insertions, 598 deletions
diff --git a/src/wcmCommon.c b/src/wcmCommon.c index ef6fe92..9727123 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -34,7 +34,7 @@ static void transPressureCurve(WacomDevicePtr pDev, WacomDeviceStatePtr pState); static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel, const WacomChannelPtr pChannel, int suppress); static void resetSampleCounter(const WacomChannelPtr pChannel); -static void sendAButton(LocalDevicePtr local, int button, int mask, +static void sendAButton(InputInfoPtr pInfo, int button, int mask, int rx, int ry, int rz, int v3, int v4, int v5); /***************************************************************************** @@ -43,19 +43,19 @@ static void sendAButton(LocalDevicePtr local, int button, int mask, * screen/desktop size and the tablet size ****************************************************************************/ -void wcmMappingFactor(LocalDevicePtr local) +void wcmMappingFactor(InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr) local->private; + WacomDevicePtr priv = (WacomDevicePtr) pInfo->private; DBG(10, priv, "\n"); /* just prints function name */ - wcmVirtualTabletSize(local); + wcmVirtualTabletSize(pInfo); if (!(priv->flags & ABSOLUTE_FLAG) || !priv->wcmMMonitor) { /* Get the current screen that the cursor is in */ - if (miPointerGetScreen(local->dev)) - priv->currentScreen = miPointerGetScreen(local->dev)->myNum; + if (miPointerGetScreen(pInfo->dev)) + priv->currentScreen = miPointerGetScreen(pInfo->dev)->myNum; } else { @@ -64,8 +64,8 @@ void wcmMappingFactor(LocalDevicePtr local) else if (priv->currentScreen == -1) { /* Get the current screen that the cursor is in */ - if (miPointerGetScreen(local->dev)) - priv->currentScreen = miPointerGetScreen(local->dev)->myNum; + if (miPointerGetScreen(pInfo->dev)) + priv->currentScreen = miPointerGetScreen(pInfo->dev)->myNum; } } if (priv->currentScreen == -1) /* tool on the tablet */ @@ -91,9 +91,9 @@ void wcmMappingFactor(LocalDevicePtr local) * combined horizontal and vertical setups ****************************************************************************/ -static void wcmSetScreen(LocalDevicePtr local, int v0, int v1) +static void wcmSetScreen(InputInfoPtr pInfo, int v0, int v1) { - WacomDevicePtr priv = (WacomDevicePtr) local->private; + WacomDevicePtr priv = (WacomDevicePtr) pInfo->private; int screenToSet = -1, i, j, x, y, tabletSize = 0; DBG(6, priv, "v0=%d v1=%d " @@ -102,11 +102,11 @@ static void wcmSetScreen(LocalDevicePtr local, int v0, int v1) if (priv->screen_no != -1 && priv->screen_no >= priv->numScreen) { xf86Msg(X_ERROR, "%s: wcmSetScreen Screen%d is larger than number of available screens (%d)\n", - local->name, priv->screen_no, priv->numScreen); + pInfo->name, priv->screen_no, priv->numScreen); priv->screen_no = -1; } - if (!(local->flags & (XI86_ALWAYS_CORE ))) return; + if (!(pInfo->flags & (XI86_ALWAYS_CORE ))) return; if (priv->twinview != TV_NONE && priv->screen_no == -1 && (priv->flags & ABSOLUTE_FLAG)) { @@ -146,7 +146,7 @@ static void wcmSetScreen(LocalDevicePtr local, int v0, int v1) priv->currentScreen); } - wcmMappingFactor(local); + wcmMappingFactor(pInfo); if (!(priv->flags & ABSOLUTE_FLAG) || screenInfo.numScreens == 1 || !priv->wcmMMonitor) return; @@ -190,7 +190,7 @@ static void wcmSetScreen(LocalDevicePtr local, int v0, int v1) return; } - wcmVirtualTabletPadding(local); + wcmVirtualTabletPadding(pInfo); x = ((double)(v0 + priv->leftPadding) * priv->factorX) - priv->screenTopX[screenToSet] + 0.5; y = ((double)(v1 + priv->topPadding) * priv->factorY) - priv->screenTopY[screenToSet] + 0.5; @@ -199,7 +199,7 @@ static void wcmSetScreen(LocalDevicePtr local, int v0, int v1) if (y >= screenInfo.screens[screenToSet]->height) y = screenInfo.screens[screenToSet]->height - 1; - xf86XInputSetScreen(local, screenToSet, x, y); + xf86XInputSetScreen(pInfo, screenToSet, x, y); DBG(10, priv, "current=%d ToSet=%d\n", priv->currentScreen, screenToSet); priv->currentScreen = screenToSet; @@ -211,11 +211,11 @@ static void wcmSetScreen(LocalDevicePtr local, int v0, int v1) * previous one. ****************************************************************************/ -static void wcmSendButtons(LocalDevicePtr local, int buttons, int rx, int ry, +static void wcmSendButtons(InputInfoPtr pInfo, int buttons, int rx, int ry, int rz, int v3, int v4, int v5) { int button, mask; - WacomDevicePtr priv = (WacomDevicePtr) local->private; + WacomDevicePtr priv = (WacomDevicePtr) pInfo->private; WacomCommonPtr common = priv->common; DBG(6, priv, "buttons=%d\n", buttons); @@ -230,7 +230,7 @@ static void wcmSendButtons(LocalDevicePtr local, int buttons, int rx, int ry, if (buttons == 1) { /* Button 1 pressed */ - sendAButton(local, 0, 1, rx, ry, rz, v3, v4, v5); + sendAButton(pInfo, 0, 1, rx, ry, rz, v3, v4, v5); } else { /* send all pressed buttons down */ for (button=2; button<=WCM_MAX_BUTTONS; button++) @@ -239,7 +239,7 @@ static void wcmSendButtons(LocalDevicePtr local, int buttons, int rx, int ry, if ( buttons & mask ) { /* set to the configured button */ - sendAButton(local, button-1, 1, rx, ry, + sendAButton(pInfo, button-1, 1, rx, ry, rz, v3, v4, v5); } } @@ -253,7 +253,7 @@ static void wcmSendButtons(LocalDevicePtr local, int buttons, int rx, int ry, if ((mask & priv->oldButtons) != (mask & buttons)) { /* set to the configured buttons */ - sendAButton(local, button-1, mask & buttons, + sendAButton(pInfo, button-1, mask & buttons, rx, ry, rz, v3, v4, v5); } } @@ -270,7 +270,7 @@ static void wcmSendButtons(LocalDevicePtr local, int buttons, int rx, int ry, if ((mask & priv->oldButtons) != (mask & buttons) || (mask & buttons) ) { /* set to the configured button */ - sendAButton(local, button-1, 0, rx, ry, + sendAButton(pInfo, button-1, 0, rx, ry, rz, v3, v4, v5); } } @@ -284,7 +284,7 @@ static void wcmSendButtons(LocalDevicePtr local, int buttons, int rx, int ry, if ((mask & priv->oldButtons) != (mask & buttons)) { /* set to the configured button */ - sendAButton(local, button-1, mask & buttons, rx, ry, + sendAButton(pInfo, button-1, mask & buttons, rx, ry, rz, v3, v4, v5); } } @@ -296,9 +296,9 @@ void wcmEmitKeycode (DeviceIntPtr keydev, int keycode, int state) xf86PostKeyboardEvent (keydev, keycode, state); } -static void toggleDisplay(LocalDevicePtr local) +static void toggleDisplay(InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr) local->private; + WacomDevicePtr priv = (WacomDevicePtr) pInfo->private; WacomCommonPtr common = priv->common; if (priv->numScreen > 1) @@ -313,7 +313,7 @@ static void toggleDisplay(LocalDevicePtr local) int screen = tmppriv->screen_no; if (++screen >= tmppriv->numScreen) screen = -1; - wcmChangeScreen(tmppriv->local, screen); + wcmChangeScreen(tmppriv->pInfo, screen); } } } @@ -322,7 +322,7 @@ static void toggleDisplay(LocalDevicePtr local) int screen = priv->screen_no; if (++screen >= priv->numScreen) screen = -1; - wcmChangeScreen(local, screen); + wcmChangeScreen(pInfo, screen); } } } @@ -350,10 +350,10 @@ static int countPresses(int keybtn, unsigned int* keys, int size) * sendAButton -- * Send one button event, called by wcmSendButtons ****************************************************************************/ -static void sendAButton(LocalDevicePtr local, int button, int mask, +static void sendAButton(InputInfoPtr pInfo, int button, int mask, int rx, int ry, int rz, int v3, int v4, int v5) { - WacomDevicePtr priv = (WacomDevicePtr) local->private; + WacomDevicePtr priv = (WacomDevicePtr) pInfo->private; #ifdef DEBUG WacomCommonPtr common = priv->common; #endif @@ -374,7 +374,7 @@ static void sendAButton(LocalDevicePtr local, int button, int mask, if (!priv->keys[button][0]) { /* No button action configured, send button */ - xf86PostButtonEvent(local->dev, is_absolute, priv->button[button], (mask != 0), 0, naxes, + xf86PostButtonEvent(pInfo->dev, is_absolute, priv->button[button], (mask != 0), 0, naxes, rx, ry, rz, v3, v4, v5); return; } @@ -393,7 +393,7 @@ static void sendAButton(LocalDevicePtr local, int button, int mask, { int btn_no = (action & AC_CODE); int is_press = (action & AC_KEYBTNPRESS); - xf86PostButtonEvent(local->dev, + xf86PostButtonEvent(pInfo->dev, is_absolute, btn_no, is_press, 0, naxes, rx, ry, rz, v3, v4, v5); @@ -403,28 +403,28 @@ static void sendAButton(LocalDevicePtr local, int button, int mask, { int key_code = (action & AC_CODE); int is_press = (action & AC_KEYBTNPRESS); - wcmEmitKeycode(local->dev, key_code, is_press); + wcmEmitKeycode(pInfo->dev, key_code, is_press); } break; case AC_MODETOGGLE: if (mask) - wcmDevSwitchModeCall(local, + wcmDevSwitchModeCall(pInfo, (is_absolute) ? Relative : Absolute); /* not a typo! */ break; /* FIXME: this should be implemented as 4 values, * there's no reason to have a DBLCLICK */ case AC_DBLCLICK: - xf86PostButtonEvent(local->dev, is_absolute, + xf86PostButtonEvent(pInfo->dev, is_absolute, 1,1,0,naxes, rx,ry,rz,v3,v4,v5); - xf86PostButtonEvent(local->dev, is_absolute, + xf86PostButtonEvent(pInfo->dev, is_absolute, 1,0,0,naxes,rx,ry,rz,v3,v4,v5); - xf86PostButtonEvent(local->dev, is_absolute, + xf86PostButtonEvent(pInfo->dev, is_absolute, 1,1,0,naxes, rx,ry,rz,v3,v4,v5); - xf86PostButtonEvent(local->dev, is_absolute, + xf86PostButtonEvent(pInfo->dev, is_absolute, 1,0,0,naxes,rx,ry,rz,v3,v4,v5); break; case AC_DISPLAYTOGGLE: - toggleDisplay(local); + toggleDisplay(pInfo); break; } } @@ -446,7 +446,7 @@ static void sendAButton(LocalDevicePtr local, int button, int mask, if (countPresses(btn_no, &priv->keys[button][i], ARRAY_SIZE(priv->keys[button]) - i)) - xf86PostButtonEvent(local->dev, + xf86PostButtonEvent(pInfo->dev, is_absolute, btn_no, 0, 0, naxes, rx, ry, rz, v3, v4, v5); @@ -462,7 +462,7 @@ static void sendAButton(LocalDevicePtr local, int button, int mask, if (countPresses(key_code, &priv->keys[button][i], ARRAY_SIZE(priv->keys[button]) - i)) - wcmEmitKeycode(local->dev, key_code, 0); + wcmEmitKeycode(pInfo->dev, key_code, 0); } } @@ -474,10 +474,10 @@ static void sendAButton(LocalDevicePtr local, int button, int mask, * Send events defined for relative/absolute wheels or strips ****************************************************************************/ -static void sendWheelStripEvents(LocalDevicePtr local, const WacomDeviceState* ds, +static void sendWheelStripEvents(InputInfoPtr pInfo, const WacomDeviceState* ds, int x, int y, int z, int v3, int v4, int v5) { - WacomDevicePtr priv = (WacomDevicePtr) local->private; + WacomDevicePtr priv = (WacomDevicePtr) pInfo->private; int fakeButton = 0, i, value = 0, naxes = priv->naxes; unsigned *keyP = 0; int is_absolute = priv->flags & ABSOLUTE_FLAG; @@ -580,20 +580,20 @@ static void sendWheelStripEvents(LocalDevicePtr local, const WacomDeviceState* d case 0: /* no spec. action defined */ case AC_BUTTON: /* send both button on/off in the same event for pad */ - xf86PostButtonEvent(local->dev, is_absolute, fakeButton & AC_CODE, + xf86PostButtonEvent(pInfo->dev, is_absolute, fakeButton & AC_CODE, 1,0,naxes,x,y,z,v3,v4,v5); - xf86PostButtonEvent(local->dev, is_absolute, fakeButton & AC_CODE, + xf86PostButtonEvent(pInfo->dev, is_absolute, fakeButton & AC_CODE, 0,0,naxes,x,y,z,v3,v4,v5); break; case AC_KEY: - wcmEmitKeycode(local->dev, (fakeButton & AC_CODE), 1); - wcmEmitKeycode(local->dev, (fakeButton & AC_CODE), 0); + wcmEmitKeycode(pInfo->dev, (fakeButton & AC_CODE), 1); + wcmEmitKeycode(pInfo->dev, (fakeButton & AC_CODE), 0); break; default: - xf86Msg(X_WARNING, "%s: unsupported event %x \n", local->name, fakeButton); + xf86Msg(X_WARNING, "%s: unsupported event %x \n", pInfo->name, fakeButton); } } @@ -602,26 +602,26 @@ static void sendWheelStripEvents(LocalDevicePtr local, const WacomDeviceState* d * Send events common between pad and stylus/cursor/eraser. ****************************************************************************/ -static void sendCommonEvents(LocalDevicePtr local, const WacomDeviceState* ds, int x, int y, int z, int v3, int v4, int v5) +static void sendCommonEvents(InputInfoPtr pInfo, const WacomDeviceState* ds, int x, int y, int z, int v3, int v4, int v5) { - WacomDevicePtr priv = (WacomDevicePtr) local->private; + WacomDevicePtr priv = (WacomDevicePtr) pInfo->private; int buttons = ds->buttons; /* send button events when state changed or first time in prox and button unpresses */ if (priv->oldButtons != buttons || (!priv->oldProximity && !buttons)) - wcmSendButtons(local,buttons,x,y,z,v3,v4,v5); + wcmSendButtons(pInfo,buttons,x,y,z,v3,v4,v5); /* emulate wheel/strip events when defined */ if ( ds->relwheel || ds->abswheel || ( (ds->stripx - priv->oldStripX) && ds->stripx && priv->oldStripX) || ((ds->stripy - priv->oldStripY) && ds->stripy && priv->oldStripY) ) - sendWheelStripEvents(local, ds, x, y, z, v3, v4, v5); + sendWheelStripEvents(pInfo, ds, x, y, z, v3, v4, v5); } /* rotate x and y before post X inout events */ -void wcmRotateCoordinates(LocalDevicePtr local, int* x, int* y) +void wcmRotateCoordinates(InputInfoPtr pInfo, int* x, int* y) { - WacomDevicePtr priv = (WacomDevicePtr) local->private; + WacomDevicePtr priv = (WacomDevicePtr) pInfo->private; WacomCommonPtr common = priv->common; int tmp_coord; @@ -650,7 +650,7 @@ void wcmRotateCoordinates(LocalDevicePtr local, int* x, int* y) * Send events according to the device state. ****************************************************************************/ -void wcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds) +void wcmSendEvents(InputInfoPtr pInfo, const WacomDeviceState* ds) { #ifdef DEBUG int is_button = !!(ds->buttons); @@ -668,7 +668,7 @@ void wcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds) int rot = ds->rotation; int throttle = ds->throttle; int wheel = ds->abswheel; - WacomDevicePtr priv = (WacomDevicePtr) local->private; + WacomDevicePtr priv = (WacomDevicePtr) pInfo->private; WacomCommonPtr common = priv->common; int naxes = priv->naxes; int is_absolute = priv->flags & ABSOLUTE_FLAG; @@ -706,7 +706,7 @@ void wcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds) x, y, z, is_button ? "true" : "false", buttons, tx, ty, wheel, rot, throttle); - wcmRotateCoordinates(local, &x, &y); + wcmRotateCoordinates(pInfo, &x, &y); if (IsCursor(priv)) { @@ -763,7 +763,7 @@ void wcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds) * screen and modify the axes before posting events */ if(!(priv->flags & BUTTONS_ONLY_FLAG)) { - wcmSetScreen(local, x, y); + wcmSetScreen(pInfo, x, y); } /* unify acceleration in both directions @@ -774,7 +774,7 @@ void wcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds) else { /* Padding virtual values */ - wcmVirtualTabletPadding(local); + wcmVirtualTabletPadding(pInfo); x += priv->leftPadding; y += priv->topPadding; } @@ -819,13 +819,13 @@ void wcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds) } /* don't emit proximity events if device does not support proximity */ - if ((local->dev->proximity && !priv->oldProximity)) - xf86PostProximityEvent(local->dev, 1, 0, naxes, x, y, z, v3, v4, v5); + if ((pInfo->dev->proximity && !priv->oldProximity)) + xf86PostProximityEvent(pInfo->dev, 1, 0, naxes, x, y, z, v3, v4, v5); /* Move the cursor to where it should be before sending button events */ if(!(priv->flags & BUTTONS_ONLY_FLAG)) { - xf86PostMotionEvent(local->dev, is_absolute, + xf86PostMotionEvent(pInfo->dev, is_absolute, 0, naxes, x, y, z, v3, v4, v5); /* For relative events, reset the axes as * we've already moved the device by the @@ -840,7 +840,7 @@ void wcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds) } } - sendCommonEvents(local, ds, x, y, z, v3, v4, v5); + sendCommonEvents(pInfo, ds, x, y, z, v3, v4, v5); } /* not in proximity */ @@ -858,10 +858,10 @@ void wcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds) /* reports button up when the device has been * down and becomes out of proximity */ if (priv->oldButtons) - wcmSendButtons(local,0,x,y,z,v3,v4,v5); + wcmSendButtons(pInfo,0,x,y,z,v3,v4,v5); - if (priv->oldProximity && local->dev->proximity) - xf86PostProximityEvent(local->dev,0,0,naxes,x,y,z,v3,v4,v5); + if (priv->oldProximity && pInfo->dev->proximity) + xf86PostProximityEvent(pInfo->dev,0,0,naxes,x,y,z,v3,v4,v5); } /* not in proximity */ } else @@ -871,30 +871,30 @@ void wcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds) x = 0; y = 0; if ( v3 || v4 || v5 ) - wcmSetScreen(local, x, y); + wcmSetScreen(pInfo, x, y); /* don't emit proximity events if device does not support proximity */ - if ((local->dev->proximity && !priv->oldProximity)) - xf86PostProximityEvent(local->dev, 1, 0, naxes, x, y, z, v3, v4, v5); + if ((pInfo->dev->proximity && !priv->oldProximity)) + xf86PostProximityEvent(pInfo->dev, 1, 0, naxes, x, y, z, v3, v4, v5); - sendCommonEvents(local, ds, x, y, z, v3, v4, v5); + sendCommonEvents(pInfo, ds, x, y, z, v3, v4, v5); is_proximity = 1; /* xf86PostMotionEvent is only needed to post the valuators * It should NOT move the cursor. */ if ( v3 || v4 || v5 ) { - xf86PostMotionEvent(local->dev, is_absolute, + xf86PostMotionEvent(pInfo->dev, is_absolute, 0, naxes, x, y, z, v3, v4, v5); } } else { if (priv->oldButtons) - wcmSendButtons(local, buttons, + wcmSendButtons(pInfo, buttons, x, y, z, v3, v4, v5); - if (priv->oldProximity && local->dev->proximity) - xf86PostProximityEvent(local->dev, 0, 0, naxes, + if (priv->oldProximity && pInfo->dev->proximity) + xf86PostProximityEvent(pInfo->dev, 0, 0, naxes, x, y, z, v3, v4, v5); is_proximity = 0; } @@ -1211,7 +1211,7 @@ static int idtotype(int id) static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel, const WacomChannelPtr pChannel, int suppress) { - LocalDevicePtr pDev = NULL; + InputInfoPtr pDev = NULL; WacomToolPtr tool = NULL; WacomToolPtr tooldef = NULL; WacomDeviceState* ds = &pChannel->valid.states[0]; @@ -1308,7 +1308,7 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel, if (tool->current) { /* Send soft prox-out for the old area */ - LocalDevicePtr oDev = outprox->device; + InputInfoPtr oDev = outprox->device; WacomDeviceState out = { 0 }; out.device_type = DEVICE_ID(((WacomDevicePtr)(oDev->private))->flags); DBG(2, common, "Soft prox-out for %s\n", @@ -1363,16 +1363,16 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel, if (common->wcmDevCls == &gWacomUSBDevice && !IsTouch(priv) && common->wcmTouchDefault && !priv->oldProximity) { - LocalDevicePtr localDevices = xf86FirstLocalDevice(); + InputInfoPtr pInfoDevices = xf86FirstLocalDevice(); WacomCommonPtr tempcommon = NULL; WacomDevicePtr temppriv = NULL; /* Lookup to see if associated touch was enabled */ - for (; localDevices != NULL; localDevices = localDevices->next) + for (; pInfoDevices != NULL; pInfoDevices = pInfoDevices->next) { - if (strstr(localDevices->drv->driverName, "wacom")) + if (strstr(pInfoDevices->drv->driverName, "wacom")) { - temppriv = (WacomDevicePtr) localDevices->private; + temppriv = (WacomDevicePtr) pInfoDevices->private; tempcommon = temppriv->common; if ((tempcommon->tablet_id == common->tablet_id) && @@ -1383,8 +1383,8 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel, out.device_type = DEVICE_ID(temppriv->flags); DBG(2, common, "Send soft prox-out for %s first\n", - localDevices->name); - wcmSendEvents(localDevices, &out); + pInfoDevices->name); + wcmSendEvents(pInfoDevices, &out); } } } @@ -1527,9 +1527,9 @@ static void commonDispatchDevice(WacomCommonPtr common, unsigned int channel, * wcmInitTablet -- common initialization for all tablets ****************************************************************************/ -int wcmInitTablet(LocalDevicePtr local, const char* id, float version) +int wcmInitTablet(InputInfoPtr pInfo, const char* id, float version) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; WacomModelPtr model = common->wcmModel; @@ -1538,10 +1538,10 @@ int wcmInitTablet(LocalDevicePtr local, const char* id, float version) /* Get tablet resolution */ if (model->GetResolution) - model->GetResolution(local); + model->GetResolution(pInfo); /* Get tablet range */ - if (model->GetRanges && (model->GetRanges(local) != Success)) + if (model->GetRanges && (model->GetRanges(pInfo) != Success)) return !Success; /* Default threshold value if not set */ @@ -1553,20 +1553,20 @@ int wcmInitTablet(LocalDevicePtr local, const char* id, float version) else common->wcmThreshold = common->wcmMaxZ * 3 / 50; xf86Msg(X_PROBED, "%s: using pressure threshold of %d for button 1\n", - local->name, common->wcmThreshold); + pInfo->name, common->wcmThreshold); } /* output tablet state as probed */ xf86Msg(X_PROBED, "%s: Wacom %s tablet speed=%d maxX=%d maxY=%d maxZ=%d " "resX=%d resY=%d tilt=%s\n", - local->name, + pInfo->name, model->name, common->wcmISDV4Speed, common->wcmMaxX, common->wcmMaxY, common->wcmMaxZ, common->wcmResolX, common->wcmResolY, HANDLE_TILT(common) ? "enabled" : "disabled"); /* start the tablet data */ - if (model->Start && (model->Start(local) != Success)) + if (model->Start && (model->Start(pInfo) != Success)) return !Success; return Success; @@ -1602,9 +1602,9 @@ static void transPressureCurve(WacomDevicePtr pDev, WacomDeviceStatePtr pState) * wcmInitialTVScreens ****************************************************************************/ -static void wcmInitialTVScreens(LocalDevicePtr local) +static void wcmInitialTVScreens(InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; if (priv->twinview == TV_NONE) return; @@ -1709,9 +1709,9 @@ static void wcmInitialTVScreens(LocalDevicePtr local) * wcmInitialScreens ****************************************************************************/ -void wcmInitialScreens(LocalDevicePtr local) +void wcmInitialScreens(InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; int i; DBG(2, priv, "number of screen=%d \n", screenInfo.numScreens); @@ -1719,7 +1719,7 @@ void wcmInitialScreens(LocalDevicePtr local) priv->tvoffsetY = 0; if (priv->twinview != TV_NONE) { - wcmInitialTVScreens(local); + wcmInitialTVScreens(pInfo); return; } @@ -1799,26 +1799,26 @@ static void rotateOneTool(WacomDevicePtr priv) area->bottomY = priv->bottomY = oldMaxY - tmpTopY; break; } - wcmInitialCoordinates(priv->local, 0); - wcmInitialCoordinates(priv->local, 1); + wcmInitialCoordinates(priv->pInfo, 0); + wcmInitialCoordinates(priv->pInfo, 1); if (tmpTopX != priv->topX) - xf86ReplaceIntOption(priv->local->options, "TopX", priv->topX); + xf86ReplaceIntOption(priv->pInfo->options, "TopX", priv->topX); if (tmpTopY != priv->topY) - xf86ReplaceIntOption(priv->local->options, "TopY", priv->topY); + xf86ReplaceIntOption(priv->pInfo->options, "TopY", priv->topY); if (tmpBottomX != priv->bottomX) - xf86ReplaceIntOption(priv->local->options, "BottomX", priv->bottomX); + xf86ReplaceIntOption(priv->pInfo->options, "BottomX", priv->bottomX); if (tmpBottomY != priv->bottomY) - xf86ReplaceIntOption(priv->local->options, "BottomY", priv->bottomY); + xf86ReplaceIntOption(priv->pInfo->options, "BottomY", priv->bottomY); } /***************************************************************************** * wcmRotateTablet ****************************************************************************/ -void wcmRotateTablet(LocalDevicePtr local, int value) +void wcmRotateTablet(InputInfoPtr pInfo, int value) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; WacomDevicePtr tmppriv; int oldRotation; @@ -1879,16 +1879,16 @@ void wcmRotateTablet(LocalDevicePtr local, int value) switch(value) { case ROTATE_NONE: - xf86ReplaceStrOption(local->options, "Rotate", "NONE"); + xf86ReplaceStrOption(pInfo->options, "Rotate", "NONE"); break; case ROTATE_CW: - xf86ReplaceStrOption(local->options, "Rotate", "CW"); + xf86ReplaceStrOption(pInfo->options, "Rotate", "CW"); break; case ROTATE_CCW: - xf86ReplaceStrOption(local->options, "Rotate", "CCW"); + xf86ReplaceStrOption(pInfo->options, "Rotate", "CCW"); break; case ROTATE_HALF: - xf86ReplaceStrOption(local->options, "Rotate", "HALF"); + xf86ReplaceStrOption(pInfo->options, "Rotate", "HALF"); break; } } diff --git a/src/wcmConfig.c b/src/wcmConfig.c index 5120d78..8c1f555 100644 --- a/src/wcmConfig.c +++ b/src/wcmConfig.c @@ -32,7 +32,7 @@ * Allocate the generic bits needed by any wacom device, regardless of type. ****************************************************************************/ -static int wcmAllocate(LocalDevicePtr local) +static int wcmAllocate(InputInfoPtr pInfo) { WacomDevicePtr priv = NULL; WacomCommonPtr common = NULL; @@ -56,21 +56,21 @@ static int wcmAllocate(LocalDevicePtr local) if (!area) goto error; - local->flags = 0; - local->device_control = gWacomModule.DevProc; - local->read_input = gWacomModule.DevReadInput; - local->control_proc = gWacomModule.DevChangeControl; - local->close_proc = gWacomModule.DevClose; - local->switch_mode = gWacomModule.DevSwitchMode; - local->atom = 0; - local->dev = NULL; - local->private = priv; - local->private_flags = 0; - local->old_x = -1; - local->old_y = -1; + pInfo->flags = 0; + pInfo->device_control = gWacomModule.DevProc; + pInfo->read_input = gWacomModule.DevReadInput; + pInfo->control_proc = gWacomModule.DevChangeControl; + pInfo->close_proc = gWacomModule.DevClose; + pInfo->switch_mode = gWacomModule.DevSwitchMode; + pInfo->atom = 0; + pInfo->dev = NULL; + pInfo->private = priv; + pInfo->private_flags = 0; + pInfo->old_x = -1; + pInfo->old_y = -1; priv->next = NULL; - priv->local = local; + priv->pInfo = pInfo; priv->common = common; /* common info pointer */ priv->hardProx = 1; /* previous hardware proximity */ priv->screen_no = -1; /* associated screen */ @@ -143,7 +143,7 @@ static int wcmAllocate(LocalDevicePtr local) /* tool area */ priv->toolarea = area; area->next = NULL; /* next area in list */ - area->device = local; /* associated WacomDevice */ + area->device = pInfo; /* associated WacomDevice */ return 1; @@ -155,22 +155,22 @@ error: return 0; } -static int wcmSetType(LocalDevicePtr local, const char *type) +static int wcmSetType(InputInfoPtr pInfo, const char *type) { - WacomDevicePtr priv = local->private; + WacomDevicePtr priv = pInfo->private; if (!type) { xf86Msg(X_ERROR, "%s: No type or invalid type specified.\n" "Must be one of stylus, touch, cursor, eraser, or pad\n", - local->name); + pInfo->name); return 0; } if (xf86NameCmp(type, "stylus") == 0) { priv->flags = ABSOLUTE_FLAG|STYLUS_ID; - local->type_name = XI_STYLUS; + pInfo->type_name = XI_STYLUS; } else if (xf86NameCmp(type, "touch") == 0) { int flags = TOUCH_ID; @@ -179,19 +179,19 @@ static int wcmSetType(LocalDevicePtr local, const char *type) flags |= ABSOLUTE_FLAG; priv->flags = flags; - local->type_name = XI_TOUCH; + pInfo->type_name = XI_TOUCH; } else if (xf86NameCmp(type, "cursor") == 0) { priv->flags = CURSOR_ID; - local->type_name = XI_CURSOR; + pInfo->type_name = XI_CURSOR; } else if (xf86NameCmp(type, "eraser") == 0) { priv->flags = ABSOLUTE_FLAG|ERASER_ID; - local->type_name = XI_ERASER; + pInfo->type_name = XI_ERASER; } else if (xf86NameCmp(type, "pad") == 0) { priv->flags = PAD_ID; - local->type_name = XI_PAD; + pInfo->type_name = XI_PAD; } /* Set the device id of the "last seen" device on this tool */ @@ -236,9 +236,9 @@ static const char *default_options[] = /* wcmUninit - called when the device is no longer needed. */ -static void wcmUninit(InputDriverPtr drv, LocalDevicePtr local, int flags) +static void wcmUninit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) { - WacomDevicePtr priv = (WacomDevicePtr) local->private; + WacomDevicePtr priv = (WacomDevicePtr) pInfo->private; WacomDevicePtr dev; WacomDevicePtr *prev; @@ -251,7 +251,7 @@ static void wcmUninit(InputDriverPtr drv, LocalDevicePtr local, int flags) dev = priv->common->wcmDevices; xf86Msg(X_INFO, "%s: removing automatically added devices.\n", - local->name); + pInfo->name); while(dev) { @@ -259,8 +259,8 @@ static void wcmUninit(InputDriverPtr drv, LocalDevicePtr local, int flags) if (!dev->isParent) { xf86Msg(X_INFO, "%s: removing dependent device '%s'\n", - local->name, dev->local->name); - DeleteInputDeviceRequest(dev->local->dev); + pInfo->name, dev->pInfo->name); + DeleteInputDeviceRequest(dev->pInfo->dev); } dev = next; } @@ -283,10 +283,10 @@ static void wcmUninit(InputDriverPtr drv, LocalDevicePtr local, int flags) free(priv->pPressCurve); free(priv); - local->private = NULL; + pInfo->private = NULL; - xf86DeleteInput(local, 0); + xf86DeleteInput(pInfo, 0); } /* wcmMatchDevice - locate matching device and merge common structure. If an @@ -295,11 +295,11 @@ static void wcmUninit(InputDriverPtr drv, LocalDevicePtr local, int flags) * existing one instead. * Then add the new device to the now-shared common struct. */ -static Bool wcmMatchDevice(LocalDevicePtr pLocal) +static Bool wcmMatchDevice(InputInfoPtr pLocal) { WacomDevicePtr priv = (WacomDevicePtr)pLocal->private; WacomCommonPtr common = priv->common; - LocalDevicePtr pMatch = xf86FirstLocalDevice(); + InputInfoPtr pMatch = xf86FirstLocalDevice(); if (!common->wcmDevice) return 0; @@ -326,9 +326,9 @@ static Bool wcmMatchDevice(LocalDevicePtr pLocal) /* wcmPreInit - called for each input devices with the driver set to * "wacom" */ -static LocalDevicePtr wcmPreInit(InputDriverPtr drv, IDevPtr dev, int flags) +static InputInfoPtr wcmPreInit(InputDriverPtr drv, IDevPtr dev, int flags) { - LocalDevicePtr local = NULL; + InputInfoPtr pInfo = NULL; WacomDevicePtr priv = NULL; WacomCommonPtr common = NULL; const char* type; @@ -337,19 +337,19 @@ static LocalDevicePtr wcmPreInit(InputDriverPtr drv, IDevPtr dev, int flags) gWacomModule.wcmDrv = drv; - if (!(local = xf86AllocateInput(drv, 0))) + if (!(pInfo = xf86AllocateInput(drv, 0))) goto SetupProc_fail; - local->conf_idev = dev; - local->name = dev->identifier; + pInfo->conf_idev = dev; + pInfo->name = dev->identifier; /* Force default port options to exist because the init * phase is based on those values. */ - xf86CollectInputOptions(local, default_options, NULL); + xf86CollectInputOptions(pInfo, default_options, NULL); - device = xf86SetStrOption(local->options, "Device", NULL); - type = xf86FindOptionValue(local->options, "Type"); + device = xf86SetStrOption(pInfo->options, "Device", NULL); + type = xf86FindOptionValue(pInfo->options, "Type"); /* Init process: @@ -363,69 +363,69 @@ static LocalDevicePtr wcmPreInit(InputDriverPtr drv, IDevPtr dev, int flags) - hotplug dependent devices if needed */ - if (!wcmAllocate(local)) + if (!wcmAllocate(pInfo)) goto SetupProc_fail; if (!device) { - if (!wcmAutoProbeDevice(local)) + if (!wcmAutoProbeDevice(pInfo)) goto SetupProc_fail; - device = xf86SetStrOption(local->options, "Device", NULL); + device = xf86SetStrOption(pInfo->options, "Device", NULL); } - SYSCALL(local->fd = open(device, O_RDONLY)); - if (local->fd < 0) + SYSCALL(pInfo->fd = open(device, O_RDONLY)); + if (pInfo->fd < 0) { xf86Msg(X_WARNING, "%s: failed to open %s.\n", - local->name, device); + pInfo->name, device); goto SetupProc_fail; } - priv = (WacomDevicePtr) local->private; + priv = (WacomDevicePtr) pInfo->private; common = priv->common; - priv->name = local->name; + priv->name = pInfo->name; common->wcmDevice = device; /* check if this is the first tool on the port */ - if (!wcmMatchDevice(local)) + if (!wcmMatchDevice(pInfo)) /* initialize supported keys with the first tool on the port */ - wcmDeviceTypeKeys(local); + wcmDeviceTypeKeys(pInfo); - need_hotplug = wcmNeedAutoHotplug(local, &type); + need_hotplug = wcmNeedAutoHotplug(pInfo, &type); /* check if the type is valid for those don't need hotplug */ - if(!need_hotplug && !wcmIsAValidType(local, type)) + if(!need_hotplug && !wcmIsAValidType(pInfo, type)) goto SetupProc_fail; /* check if the same device file has been added already */ - if (wcmIsDuplicate(device, local)) + if (wcmIsDuplicate(device, pInfo)) goto SetupProc_fail; - if (!wcmSetType(local, type)) + if (!wcmSetType(pInfo, type)) goto SetupProc_fail; /* Process the common options. */ - xf86ProcessCommonOptions(local, local->options); - if (!wcmParseOptions(local)) + xf86ProcessCommonOptions(pInfo, pInfo->options); + if (!wcmParseOptions(pInfo)) goto SetupProc_fail; /* mark the device configured */ - local->flags |= XI86_CONFIGURED; + pInfo->flags |= XI86_CONFIGURED; if (need_hotplug) { priv->isParent = 1; - wcmHotplugOthers(local); + wcmHotplugOthers(pInfo); } - if (local->fd != -1) + if (pInfo->fd != -1) { - close(local->fd); - local->fd = -1; + close(pInfo->fd); + pInfo->fd = -1; } - return (local); + return (pInfo); SetupProc_fail: /* restart the device list from the next one */ @@ -433,16 +433,16 @@ SetupProc_fail: common->wcmDevices = priv->next; free(common); free(priv); - if (local) + if (pInfo) { - if (local->fd != -1) + if (pInfo->fd != -1) { - close(local->fd); - local->fd = -1; + close(pInfo->fd); + pInfo->fd = -1; } - local->private = NULL; - xf86DeleteInput(local, 0); + pInfo->private = NULL; + xf86DeleteInput(pInfo, 0); } return NULL; diff --git a/src/wcmFilter.c b/src/wcmFilter.c index aa4aa4e..bf578cb 100644 --- a/src/wcmFilter.c +++ b/src/wcmFilter.c @@ -70,7 +70,7 @@ void wcmSetPressureCurve(WacomDevicePtr pDev, int x0, int y0, if (!pDev->pPressCurve) { xf86Msg(X_ERROR, "%s: wcmSetPressureCurve: failed to " - "allocate memory for curve\n", pDev->local->name); + "allocate memory for curve\n", pDev->pInfo->name); return; } } diff --git a/src/wcmISDV4.c b/src/wcmISDV4.c index 91f40d4..004ee8b 100644 --- a/src/wcmISDV4.c +++ b/src/wcmISDV4.c @@ -34,16 +34,16 @@ #define RESET_RELATIVE(ds) do { (ds).relwheel = 0; } while (0) -static Bool isdv4Detect(LocalDevicePtr); -static Bool isdv4Init(LocalDevicePtr, char* id, float *version); +static Bool isdv4Detect(InputInfoPtr); +static Bool isdv4Init(InputInfoPtr, char* id, float *version); static void isdv4InitISDV4(WacomCommonPtr, const char* id, float version); -static int isdv4GetRanges(LocalDevicePtr); -static int isdv4StartTablet(LocalDevicePtr); -static int isdv4StopTablet(LocalDevicePtr); -static int isdv4Parse(LocalDevicePtr, const unsigned char* data, int len); -static int wcmSerialValidate(LocalDevicePtr local, const unsigned char* data); -static int wcmWaitForTablet(LocalDevicePtr local, char * data, int size); -static int wcmWriteWait(LocalDevicePtr local, const char* request); +static int isdv4GetRanges(InputInfoPtr); +static int isdv4StartTablet(InputInfoPtr); +static int isdv4StopTablet(InputInfoPtr); +static int isdv4Parse(InputInfoPtr, const unsigned char* data, int len); +static int wcmSerialValidate(InputInfoPtr pInfo, const unsigned char* data); +static int wcmWaitForTablet(InputInfoPtr pInfo, char * data, int size); +static int wcmWriteWait(InputInfoPtr pInfo, const char* request); static inline int isdv4ParseQuery(const char *buffer, const size_t len, ISDV4QueryReply *reply); @@ -105,9 +105,9 @@ static int wcmSkipInvalidBytes(const unsigned char* data, int len) * positive number of bytes to skip on error. ****************************************************************************/ -static int wcmSerialValidate(LocalDevicePtr local, const unsigned char* data) +static int wcmSerialValidate(InputInfoPtr pInfo, const unsigned char* data) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; int n; @@ -119,7 +119,7 @@ static int wcmSerialValidate(LocalDevicePtr local, const unsigned char* data) int n = wcmSkipInvalidBytes(data, common->wcmPktLength); xf86Msg(X_WARNING, "%s: missing header bit. skipping %d bytes.\n", - local->name, n); + pInfo->name, n); return n; } @@ -130,7 +130,7 @@ static int wcmSerialValidate(LocalDevicePtr local, const unsigned char* data) n = wcmSkipInvalidBytes(&data[1], common->wcmPktLength - 1); n += 1; /* the header byte we already checked */ if (n != common->wcmPktLength) { - xf86Msg(X_WARNING, "%s: bad data at %d v=%x l=%d\n", local->name, + xf86Msg(X_WARNING, "%s: bad data at %d v=%x l=%d\n", pInfo->name, n, data[n], common->wcmPktLength); return n; } @@ -142,9 +142,9 @@ static int wcmSerialValidate(LocalDevicePtr local, const unsigned char* data) * isdv4Detect -- Test if the attached device is ISDV4. ****************************************************************************/ -static Bool isdv4Detect(LocalDevicePtr local) +static Bool isdv4Detect(InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr) local->private; + WacomDevicePtr priv = (WacomDevicePtr) pInfo->private; WacomCommonPtr common = priv->common; return (common->wcmForceDevice == DEVICE_ISDV4) ? 1 : 0; } @@ -153,15 +153,15 @@ static Bool isdv4Detect(LocalDevicePtr local) * isdv4Init -- ****************************************************************************/ -static Bool isdv4Init(LocalDevicePtr local, char* id, float *version) +static Bool isdv4Init(InputInfoPtr pInfo, char* id, float *version) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; DBG(1, priv, "initializing ISDV4 tablet\n"); /* Initial baudrate is 38400 */ - if (xf86SetSerialSpeed(local->fd, common->wcmISDV4Speed) < 0) + if (xf86SetSerialSpeed(pInfo->fd, common->wcmISDV4Speed) < 0) return !Success; if(id) @@ -177,7 +177,7 @@ static Bool isdv4Init(LocalDevicePtr local, char* id, float *version) /* check if TPCButton was turned off by user for stylus */ if (priv->flags & STYLUS_ID) - common->wcmTPCButton = xf86SetBoolOption(local->options, + common->wcmTPCButton = xf86SetBoolOption(pInfo->options, "TPCButton", common->wcmTPCButtonDefault); return Success; } @@ -186,30 +186,30 @@ static Bool isdv4Init(LocalDevicePtr local, char* id, float *version) * isdv4Query -- Query the device ****************************************************************************/ -static int isdv4Query(LocalDevicePtr local, const char* query, char* data) +static int isdv4Query(InputInfoPtr pInfo, const char* query, char* data) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; DBG(1, priv, "Querying ISDV4 tablet\n"); - if (isdv4StopTablet(local) != Success) + if (isdv4StopTablet(pInfo) != Success) return !Success; /* Send query command to the tablet */ - if (!wcmWriteWait(local, query)) + if (!wcmWriteWait(pInfo, query)) return !Success; /* Read the control data */ - if (!wcmWaitForTablet(local, data, ISDV4_PKGLEN_TPCCTL)) + if (!wcmWaitForTablet(pInfo, data, ISDV4_PKGLEN_TPCCTL)) { /* Try 19200 if it is not a touch query */ if (common->wcmISDV4Speed != 19200 && strcmp(query, ISDV4_TOUCH_QUERY)) { common->wcmISDV4Speed = 19200; - if (xf86SetSerialSpeed(local->fd, common->wcmISDV4Speed) < 0) + if (xf86SetSerialSpeed(pInfo->fd, common->wcmISDV4Speed) < 0) return !Success; - return isdv4Query(local, query, data); + return isdv4Query(pInfo, query, data); } else return !Success; @@ -222,14 +222,14 @@ static int isdv4Query(LocalDevicePtr local, const char* query, char* data) if (common->wcmISDV4Speed != 19200 && strcmp(query, ISDV4_TOUCH_QUERY)) { common->wcmISDV4Speed = 19200; - if (xf86SetSerialSpeed(local->fd, common->wcmISDV4Speed) < 0) + if (xf86SetSerialSpeed(pInfo->fd, common->wcmISDV4Speed) < 0) return !Success; - return isdv4Query(local, query, data); + return isdv4Query(pInfo, query, data); } else { /* Reread the control data since it may fail the first time */ - wcmWaitForTablet(local, data, ISDV4_PKGLEN_TPCCTL); + wcmWaitForTablet(pInfo, data, ISDV4_PKGLEN_TPCCTL); if ( !(data[0] & 0x40) ) return !Success; } @@ -265,17 +265,17 @@ static void isdv4InitISDV4(WacomCommonPtr common, const char* id, float version) * isdv4GetRanges -- get ranges of the device ****************************************************************************/ -static int isdv4GetRanges(LocalDevicePtr local) +static int isdv4GetRanges(InputInfoPtr pInfo) { char data[BUFFER_SIZE]; - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; int ret = Success; DBG(2, priv, "getting ISDV4 Ranges\n"); /* Send query command to the tablet */ - ret = isdv4Query(local, ISDV4_QUERY, data); + ret = isdv4Query(pInfo, ISDV4_QUERY, data); if (ret == Success) { ISDV4QueryReply reply; @@ -313,7 +313,7 @@ static int isdv4GetRanges(LocalDevicePtr local) /* Touch might be supported. Send a touch query command */ common->wcmISDV4Speed = 38400; - if (isdv4Query(local, ISDV4_TOUCH_QUERY, data) == Success) + if (isdv4Query(pInfo, ISDV4_TOUCH_QUERY, data) == Success) { ISDV4TouchQueryReply reply; int rc; @@ -366,7 +366,7 @@ static int isdv4GetRanges(LocalDevicePtr local) { xf86Msg(X_WARNING, "WACOM: %s tablet id(%x)" " mismatch with data id (0x01) \n", - local->name, common->tablet_id); + pInfo->name, common->tablet_id); return ret; } break; @@ -377,7 +377,7 @@ static int isdv4GetRanges(LocalDevicePtr local) { xf86Msg(X_WARNING, "WACOM: %s tablet id(%x)" " mismatch with data id (0x03) \n", - local->name, common->tablet_id); + pInfo->name, common->tablet_id); return ret; } break; @@ -406,24 +406,24 @@ static int isdv4GetRanges(LocalDevicePtr local) common->wcmTouchResolY); } - xf86Msg(X_INFO, "%s: serial tablet id 0x%X.\n", local->name, common->tablet_id); + xf86Msg(X_INFO, "%s: serial tablet id 0x%X.\n", pInfo->name, common->tablet_id); return ret; } -static int isdv4StartTablet(LocalDevicePtr local) +static int isdv4StartTablet(InputInfoPtr pInfo) { /* Tell the tablet to start sending coordinates */ - if (!wcmWriteWait(local, ISDV4_SAMPLING)) + if (!wcmWriteWait(pInfo, ISDV4_SAMPLING)) return !Success; return Success; } -static int isdv4StopTablet(LocalDevicePtr local) +static int isdv4StopTablet(InputInfoPtr pInfo) { /* Send stop command to the tablet */ - if (!wcmWriteWait(local, ISDV4_STOP)) + if (!wcmWriteWait(pInfo, ISDV4_STOP)) return !Success; /* Wait 250 mSecs */ @@ -433,9 +433,9 @@ static int isdv4StopTablet(LocalDevicePtr local) return Success; } -static int isdv4Parse(LocalDevicePtr local, const unsigned char* data, int len) +static int isdv4Parse(InputInfoPtr pInfo, const unsigned char* data, int len) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; WacomDeviceState* last = &common->wcmChannel[0].valid.state; WacomDeviceState* lastTemp = &common->wcmChannel[1].valid.state; @@ -489,7 +489,7 @@ static int isdv4Parse(LocalDevicePtr local, const unsigned char* data, int len) /* Coordinate data bit check */ if (data[0] & CONTROL_BIT) /* control data */ return common->wcmPktLength; - else if ((n = wcmSerialValidate(local,data)) > 0) + else if ((n = wcmSerialValidate(pInfo,data)) > 0) return n; /* pick up where we left off, minus relative values */ @@ -505,7 +505,7 @@ static int isdv4Parse(LocalDevicePtr local, const unsigned char* data, int len) if (rc == -1) { xf86Msg(X_ERROR, "%s: failed to parse touch data.\n", - local->name); + pInfo->name); return 0; } @@ -560,7 +560,7 @@ static int isdv4Parse(LocalDevicePtr local, const unsigned char* data, int len) if (rc == -1) { - xf86Msg(X_ERROR, "%s: failed to parse coordinate data.\n", local->name); + xf86Msg(X_ERROR, "%s: failed to parse coordinate data.\n", pInfo->name); return 0; } @@ -622,18 +622,18 @@ static int isdv4Parse(LocalDevicePtr local, const unsigned char* data, int len) * send a request ****************************************************************************/ -static int wcmWriteWait(LocalDevicePtr local, const char* request) +static int wcmWriteWait(InputInfoPtr pInfo, const char* request) { int len, maxtry = MAXTRY; /* send request string */ do { - len = xf86WriteSerial(local->fd, request, strlen(request)); + len = xf86WriteSerial(pInfo->fd, request, strlen(request)); if ((len == -1) && (errno != EAGAIN)) { xf86Msg(X_ERROR, "%s: wcmWriteWait error : %s\n", - local->name, strerror(errno)); + pInfo->name, strerror(errno)); return 0; } @@ -643,7 +643,7 @@ static int wcmWriteWait(LocalDevicePtr local, const char* request) if (!maxtry) xf86Msg(X_WARNING, "%s: Failed to issue command '%s' " - "after %d tries.\n", local->name, request, MAXTRY); + "after %d tries.\n", pInfo->name, request, MAXTRY); return maxtry; } @@ -653,20 +653,20 @@ static int wcmWriteWait(LocalDevicePtr local, const char* request) * wait for tablet data ****************************************************************************/ -static int wcmWaitForTablet(LocalDevicePtr local, char* answer, int size) +static int wcmWaitForTablet(InputInfoPtr pInfo, char* answer, int size) { int len, maxtry = MAXTRY; /* Read size bytes of the answer */ do { - if ((len = xf86WaitForInput(local->fd, 1000000)) > 0) + if ((len = xf86WaitForInput(pInfo->fd, 1000000)) > 0) { - len = xf86ReadSerial(local->fd, answer, size); + len = xf86ReadSerial(pInfo->fd, answer, size); if ((len == -1) && (errno != EAGAIN)) { xf86Msg(X_ERROR, "%s: xf86ReadSerial error : %s\n", - local->name, strerror(errno)); + pInfo->name, strerror(errno)); return 0; } } @@ -676,7 +676,7 @@ static int wcmWaitForTablet(LocalDevicePtr local, char* answer, int size) if (!maxtry) xf86Msg(X_WARNING, "%s: Waited too long for answer " "(failed after %d tries).\n", - local->name, MAXTRY); + pInfo->name, MAXTRY); return maxtry; } @@ -688,20 +688,20 @@ static int wcmWaitForTablet(LocalDevicePtr local, char* answer, int size) * device ID. This matching only works for wacom devices (serial ID of * WACf), all others are simply assumed to be pen + erasor. */ -int isdv4ProbeKeys(LocalDevicePtr local) +int isdv4ProbeKeys(InputInfoPtr pInfo) { int id, i; int tablet_id = 0; struct serial_struct tmp; - const char *device = xf86SetStrOption(local->options, "Device", NULL); - WacomDevicePtr priv = (WacomDevicePtr)local->private; + const char *device = xf86SetStrOption(pInfo->options, "Device", NULL); + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; - if (ioctl(local->fd, TIOCGSERIAL, &tmp) < 0) + if (ioctl(pInfo->fd, TIOCGSERIAL, &tmp) < 0) return 0; /* check device name for ID first */ - if (sscanf(local->name, "WACf%x", &id) <= 1) + if (sscanf(pInfo->name, "WACf%x", &id) <= 1) { /* id in file sys/class/tty/%str/device/id */ FILE *file; diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c index dc23a61..69ba5ca 100644 --- a/src/wcmTouchFilter.c +++ b/src/wcmTouchFilter.c @@ -105,7 +105,7 @@ static void wcmSwitchLeftClick(WacomDevicePtr priv) if (common->wcmGestureMode) { /* send button one up */ - xf86PostButtonEvent(priv->local->dev, + xf86PostButtonEvent(priv->pInfo->dev, priv->flags & ABSOLUTE_FLAG, 1,0,0,priv->naxes, priv->oldX, priv->oldY,0,0,0,0); @@ -162,12 +162,12 @@ void wcmFingerTapToClick(WacomCommonPtr common) } /* right button down */ - xf86PostButtonEvent(priv->local->dev, + xf86PostButtonEvent(priv->pInfo->dev, priv->flags & ABSOLUTE_FLAG, 3,1,0,priv->naxes, priv->oldX, priv->oldY,0,0,0,0); /* right button up */ - xf86PostButtonEvent(priv->local->dev, + xf86PostButtonEvent(priv->pInfo->dev, priv->flags & ABSOLUTE_FLAG, 3,0,0,priv->naxes, priv->oldX, priv->oldY,0,0,0,0); @@ -237,12 +237,12 @@ static void wcmSendVerticalScrollEvent(WacomDevicePtr priv, if (dist > 0) { /* button down */ - xf86PostButtonEvent(priv->local->dev, + xf86PostButtonEvent(priv->pInfo->dev, priv->flags & ABSOLUTE_FLAG, up,1,0,priv->naxes, priv->oldX, priv->oldY,0,0,0,0); /* button up */ - xf86PostButtonEvent(priv->local->dev, + xf86PostButtonEvent(priv->pInfo->dev, priv->flags & ABSOLUTE_FLAG, up,0,0,priv->naxes, priv->oldX, priv->oldY,0,0,0,0); @@ -250,12 +250,12 @@ static void wcmSendVerticalScrollEvent(WacomDevicePtr priv, else { /* button down */ - xf86PostButtonEvent(priv->local->dev, + xf86PostButtonEvent(priv->pInfo->dev, priv->flags & ABSOLUTE_FLAG, dn,1,0,priv->naxes, priv->oldX, priv->oldY,0,0,0,0); /* button up */ - xf86PostButtonEvent(priv->local->dev, + xf86PostButtonEvent(priv->pInfo->dev, priv->flags & ABSOLUTE_FLAG, dn,0,0,priv->naxes, priv->oldX, priv->oldY,0,0,0,0); @@ -274,12 +274,12 @@ static void wcmSendHorizontalScrollEvent(WacomDevicePtr priv, if (dist > 0) { /* button down */ - xf86PostButtonEvent(priv->local->dev, + xf86PostButtonEvent(priv->pInfo->dev, priv->flags & ABSOLUTE_FLAG, left,1,0,priv->naxes, priv->oldX, priv->oldY,0,0,0,0); /* button up */ - xf86PostButtonEvent(priv->local->dev, + xf86PostButtonEvent(priv->pInfo->dev, priv->flags & ABSOLUTE_FLAG, left,0,0,priv->naxes, priv->oldX, priv->oldY,0,0,0,0); @@ -287,12 +287,12 @@ static void wcmSendHorizontalScrollEvent(WacomDevicePtr priv, else { /* button down */ - xf86PostButtonEvent(priv->local->dev, + xf86PostButtonEvent(priv->pInfo->dev, priv->flags & ABSOLUTE_FLAG, right,1,0,priv->naxes, priv->oldX, priv->oldY,0,0,0,0); /* button up */ - xf86PostButtonEvent(priv->local->dev, + xf86PostButtonEvent(priv->pInfo->dev, priv->flags & ABSOLUTE_FLAG, right,0,0,priv->naxes, priv->oldX, priv->oldY,0,0,0,0); @@ -333,7 +333,7 @@ static void wcmFingerScroll(WacomDevicePtr priv) /* rotate the coordinates first */ for (i=0; i<6; i++) - wcmRotateCoordinates(priv->local, &filterd.x[i], &filterd.y[i]); + wcmRotateCoordinates(priv->pInfo, &filterd.x[i], &filterd.y[i]); /* check vertical direction */ midPoint_old = (((double)filterd.x[4] + (double)filterd.x[5]) / 2.); @@ -402,9 +402,9 @@ static void wcmFingerZoom(WacomDevicePtr priv) through the XKB table and figure out where it's hiding. Good luck. Gesture support is not supposed to be in the driver... */ - wcmEmitKeycode (priv->local->dev, 37 /*XK_Control_L*/, 1); + wcmEmitKeycode (priv->pInfo->dev, 37 /*XK_Control_L*/, 1); wcmSendVerticalScrollEvent(priv, dist, 4, 5); - wcmEmitKeycode (priv->local->dev, 37 /*XK_Control_L*/, 0); + wcmEmitKeycode (priv->pInfo->dev, 37 /*XK_Control_L*/, 0); /* reset initial states */ common->wcmGestureState[0] = ds[0]; diff --git a/src/wcmUSB.c b/src/wcmUSB.c index 6a50f6d..23649db 100644 --- a/src/wcmUSB.c +++ b/src/wcmUSB.c @@ -36,19 +36,19 @@ #define BTN_TOOL_TRIPLETAP 0x14e #endif -static Bool usbDetect(LocalDevicePtr); -static Bool usbWcmInit(LocalDevicePtr pDev, char* id, float *version); +static Bool usbDetect(InputInfoPtr); +static Bool usbWcmInit(InputInfoPtr pDev, char* id, float *version); static void usbInitProtocol5(WacomCommonPtr common, const char* id, float version); static void usbInitProtocol4(WacomCommonPtr common, const char* id, float version); -int usbWcmGetRanges(LocalDevicePtr local); -static int usbParse(LocalDevicePtr local, const unsigned char* data, int len); -static int usbDetectConfig(LocalDevicePtr local); -static void usbParseEvent(LocalDevicePtr local, +int usbWcmGetRanges(InputInfoPtr pInfo); +static int usbParse(InputInfoPtr pInfo, const unsigned char* data, int len); +static int usbDetectConfig(InputInfoPtr pInfo); +static void usbParseEvent(InputInfoPtr pInfo, const struct input_event* event); -static void usbParseChannel(LocalDevicePtr local, int channel); +static void usbParseChannel(InputInfoPtr pInfo, int channel); static int usbChooseChannel(WacomCommonPtr common, int serial); WacomDeviceClass gWacomUSBDevice = @@ -290,30 +290,30 @@ static int usbChooseChannel(WacomCommonPtr common, int serial); * Test if the attached device is USB. ****************************************************************************/ -static Bool usbDetect(LocalDevicePtr local) +static Bool usbDetect(InputInfoPtr pInfo) { int version; int err; #ifdef DEBUG - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; DBG(1, priv, "\n"); #endif - SYSCALL(err = ioctl(local->fd, EVIOCGVERSION, &version)); + SYSCALL(err = ioctl(pInfo->fd, EVIOCGVERSION, &version)); if (err < 0) { - xf86Msg(X_ERROR, "%s: usbDetect: can not ioctl version\n", local->name); + xf86Msg(X_ERROR, "%s: usbDetect: can not ioctl version\n", pInfo->name); return 0; } #ifdef EVIOCGRAB /* Try to grab the event device so that data don't leak to /dev/input/mice */ - SYSCALL(err = ioctl(local->fd, EVIOCGRAB, (pointer)1)); + SYSCALL(err = ioctl(pInfo->fd, EVIOCGRAB, (pointer)1)); if (err < 0) xf86Msg(X_ERROR, "%s: Wacom X driver can't grab event device, errno=%d\n", - local->name, errno); + pInfo->name, errno); #endif return 1; } @@ -430,19 +430,19 @@ static struct { 0xE3, 2540, 2540, &usbTabletPC } /* TabletPC 0xE3 */ }; -static Bool usbWcmInit(LocalDevicePtr local, char* id, float *version) +static Bool usbWcmInit(InputInfoPtr pInfo, char* id, float *version) { int i; struct input_id sID; - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; DBG(1, priv, "initializing USB tablet\n"); *version = 0.0; /* fetch vendor, product, and model name */ - ioctl(local->fd, EVIOCGID, &sID); - ioctl(local->fd, EVIOCGNAME(sizeof(id)), id); + ioctl(pInfo->fd, EVIOCGID, &sID); + ioctl(pInfo->fd, EVIOCGNAME(sizeof(id)), id); /* vendor is wacom */ if (sID.vendor == WACOM_VENDOR_ID) @@ -472,7 +472,7 @@ static Bool usbWcmInit(LocalDevicePtr local, char* id, float *version) /* check if TPCButton was turned off in xorg.conf for pen */ if (priv->flags & STYLUS_ID) - common->wcmTPCButton = xf86SetBoolOption(local->options, + common->wcmTPCButton = xf86SetBoolOption(pInfo->options, "TPCButton", common->wcmTPCButtonDefault); /* Find out supported button codes - except mouse button codes @@ -526,12 +526,12 @@ static void usbInitProtocol4(WacomCommonPtr common, const char* id, common->wcmFlags &= ~TILT_ENABLED_FLAG; } -int usbWcmGetRanges(LocalDevicePtr local) +int usbWcmGetRanges(InputInfoPtr pInfo) { struct input_absinfo absinfo; unsigned long ev[NBITS(EV_MAX)] = {0}; unsigned long abs[NBITS(ABS_MAX)] = {0}; - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; int is_touch = IsTouch(priv); @@ -543,37 +543,37 @@ int usbWcmGetRanges(LocalDevicePtr local) && ISBITSET(common->wcmKeys, BTN_TOOL_FINGER)) is_touch = 1; - if (ioctl(local->fd, EVIOCGBIT(0 /*EV*/, sizeof(ev)), ev) < 0) + if (ioctl(pInfo->fd, EVIOCGBIT(0 /*EV*/, sizeof(ev)), ev) < 0) { - xf86Msg(X_ERROR, "%s: unable to ioctl event bits.\n", local->name); + xf86Msg(X_ERROR, "%s: unable to ioctl event bits.\n", pInfo->name); return !Success; } common->wcmFlags |= USE_SYN_REPORTS_FLAG; - if (ioctl(local->fd, EVIOCGBIT(EV_ABS,sizeof(abs)),abs) < 0) + if (ioctl(pInfo->fd, EVIOCGBIT(EV_ABS,sizeof(abs)),abs) < 0) { - xf86Msg(X_ERROR, "%s: unable to ioctl abs bits.\n", local->name); + xf86Msg(X_ERROR, "%s: unable to ioctl abs bits.\n", pInfo->name); return !Success; } /* absolute values */ if (!ISBITSET(ev,EV_ABS)) { - xf86Msg(X_ERROR, "%s: unable to ioctl max values.\n", local->name); + xf86Msg(X_ERROR, "%s: unable to ioctl max values.\n", pInfo->name); return !Success; } /* max x */ - if (ioctl(local->fd, EVIOCGABS(ABS_X), &absinfo) < 0) + if (ioctl(pInfo->fd, EVIOCGABS(ABS_X), &absinfo) < 0) { - xf86Msg(X_ERROR, "%s: unable to ioctl xmax value.\n", local->name); + xf86Msg(X_ERROR, "%s: unable to ioctl xmax value.\n", pInfo->name); return !Success; } if (absinfo.maximum <= 0) { - xf86Msg(X_ERROR, "%s: xmax value is wrong.\n", local->name); + xf86Msg(X_ERROR, "%s: xmax value is wrong.\n", pInfo->name); return !Success; } if (!is_touch) @@ -582,15 +582,15 @@ int usbWcmGetRanges(LocalDevicePtr local) common->wcmMaxTouchX = absinfo.maximum; /* max y */ - if (ioctl(local->fd, EVIOCGABS(ABS_Y), &absinfo) < 0) + if (ioctl(pInfo->fd, EVIOCGABS(ABS_Y), &absinfo) < 0) { - xf86Msg(X_ERROR, "%s: unable to ioctl ymax value.\n", local->name); + xf86Msg(X_ERROR, "%s: unable to ioctl ymax value.\n", pInfo->name); return !Success; } if (absinfo.maximum <= 0) { - xf86Msg(X_ERROR, "%s: ymax value is wrong.\n", local->name); + xf86Msg(X_ERROR, "%s: ymax value is wrong.\n", pInfo->name); return !Success; } if (!is_touch) @@ -600,7 +600,7 @@ int usbWcmGetRanges(LocalDevicePtr local) /* max finger strip X for tablets with Expresskeys * or touch physical X for TabletPCs with touch */ - if (ioctl(local->fd, EVIOCGABS(ABS_RX), &absinfo) == 0) + if (ioctl(pInfo->fd, EVIOCGABS(ABS_RX), &absinfo) == 0) { if (is_touch) common->wcmTouchResolX = absinfo.maximum; @@ -610,7 +610,7 @@ int usbWcmGetRanges(LocalDevicePtr local) /* max finger strip Y for tablets with Expresskeys * or touch physical Y for TabletPCs with touch */ - if (ioctl(local->fd, EVIOCGABS(ABS_RY), &absinfo) == 0) + if (ioctl(pInfo->fd, EVIOCGABS(ABS_RY), &absinfo) == 0) { if (is_touch) common->wcmTouchResolY = absinfo.maximum; @@ -628,7 +628,7 @@ int usbWcmGetRanges(LocalDevicePtr local) if (!common->wcmTouchResolX || !common->wcmTouchResolY) { xf86Msg(X_ERROR, "%s: touch resolution value(s) was wrong TouchResolX" - " = %d MaxTouchY = %d.\n", local->name, common->wcmTouchResolX, + " = %d MaxTouchY = %d.\n", pInfo->name, common->wcmTouchResolX, common->wcmTouchResolY); return !Success; } @@ -636,19 +636,19 @@ int usbWcmGetRanges(LocalDevicePtr local) } /* max z cannot be configured */ - if (ioctl(local->fd, EVIOCGABS(ABS_PRESSURE), &absinfo) == 0) + if (ioctl(pInfo->fd, EVIOCGABS(ABS_PRESSURE), &absinfo) == 0) common->wcmMaxZ = absinfo.maximum; /* max distance */ - if (ioctl(local->fd, EVIOCGABS(ABS_DISTANCE), &absinfo) == 0) + if (ioctl(pInfo->fd, EVIOCGABS(ABS_DISTANCE), &absinfo) == 0) common->wcmMaxDist = absinfo.maximum; return Success; } -static int usbDetectConfig(LocalDevicePtr local) +static int usbDetectConfig(InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; DBG(10, common, "\n"); @@ -663,15 +663,15 @@ static int usbDetectConfig(LocalDevicePtr local) return TRUE; } -static int usbParse(LocalDevicePtr local, const unsigned char* data, int len) +static int usbParse(InputInfoPtr pInfo, const unsigned char* data, int len) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; if (len < sizeof(struct input_event)) return 0; - usbParseEvent(local, (const struct input_event*)data); + usbParseEvent(pInfo, (const struct input_event*)data); return common->wcmPktLength; } @@ -755,11 +755,11 @@ static int usbChooseChannel(WacomCommonPtr common, int serial) return channel; } -static void usbParseEvent(LocalDevicePtr local, +static void usbParseEvent(InputInfoPtr pInfo, const struct input_event* event) { int channel; - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; DBG(10, common, "\n"); @@ -772,7 +772,7 @@ static void usbParseEvent(LocalDevicePtr local, (sizeof(common->wcmEvents)/sizeof(*common->wcmEvents))) { xf86Msg(X_ERROR, "%s: usbParse: Exceeded event queue (%d) \n", - local->name, common->wcmEventCnt); + pInfo->name, common->wcmEventCnt); goto skipEvent; } @@ -786,7 +786,7 @@ static void usbParseEvent(LocalDevicePtr local, if (event->value == 0) { xf86Msg(X_ERROR, "%s: usbParse: Ignoring event from invalid serial 0\n", - local->name); + pInfo->name); goto skipEvent; } @@ -805,7 +805,7 @@ static void usbParseEvent(LocalDevicePtr local, if (! USE_SYN_REPORTS(common)) { xf86Msg(X_ERROR, "%s: Got unexpected SYN_REPORT, changing mode\n", - local->name); + pInfo->name); /* we can expect SYN_REPORT's from now on */ common->wcmFlags |= USE_SYN_REPORTS_FLAG; @@ -823,7 +823,7 @@ static void usbParseEvent(LocalDevicePtr local, if ((common->wcmEventCnt <= 2) && common->wcmLastToolSerial) { DBG(3, common, "%s: dropping empty event" - " for serial %d\n", local->name, common->wcmLastToolSerial); + " for serial %d\n", pInfo->name, common->wcmLastToolSerial); goto skipEvent; } @@ -840,19 +840,19 @@ static void usbParseEvent(LocalDevicePtr local, } /* dispatch event */ - usbParseChannel(local,channel); + usbParseChannel(pInfo,channel); skipEvent: common->wcmLastToolSerial = 0; common->wcmEventCnt = 0; } -static void usbParseChannel(LocalDevicePtr local, int channel) +static void usbParseChannel(InputInfoPtr pInfo, int channel) { int i, shift, nkeys; WacomDeviceState* ds; struct input_event* event; - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; DBG(6, common, "%d events received\n", common->wcmEventCnt); @@ -919,7 +919,7 @@ static void usbParseChannel(LocalDevicePtr local, int channel) ds->relwheel = -event->value; else xf86Msg(X_ERROR, "%s: rel event recv'd (%d)!\n", - local->name, event->code); + pInfo->name, event->code); } else if (event->type == EV_KEY) @@ -1067,24 +1067,24 @@ static void usbParseChannel(LocalDevicePtr local, int channel) * on success or 0 on failure. * For USB devices, we simply copy the information the kernel gives us. */ -int usbProbeKeys(LocalDevicePtr local) +int usbProbeKeys(InputInfoPtr pInfo) { struct input_id wacom_id; - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; - if (ioctl(local->fd, EVIOCGBIT(EV_KEY, (sizeof(unsigned long) + if (ioctl(pInfo->fd, EVIOCGBIT(EV_KEY, (sizeof(unsigned long) * NBITS(KEY_MAX))), common->wcmKeys) < 0) { xf86Msg(X_ERROR, "%s: wcmDeviceTypeKeys unable to " - "ioctl USB key bits.\n", local->name); + "ioctl USB key bits.\n", pInfo->name); return 0; } - if (ioctl(local->fd, EVIOCGID, &wacom_id) < 0) + if (ioctl(pInfo->fd, EVIOCGID, &wacom_id) < 0) { xf86Msg(X_ERROR, "%s: wcmDeviceTypeKeys unable to " - "ioctl Device ID.\n", local->name); + "ioctl Device ID.\n", pInfo->name); return 0; } diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c index e2eef30..c4de038 100644 --- a/src/wcmValidateDevice.c +++ b/src/wcmValidateDevice.c @@ -33,12 +33,12 @@ * before or not: don't add the tool by hal/udev if user has defined at least * one tool for the device in xorg.conf. One device can have multiple tools * with the same type to individualize tools with serial number or areas */ -static Bool wcmCheckSource(LocalDevicePtr local, dev_t min_maj) +static Bool wcmCheckSource(InputInfoPtr pInfo, dev_t min_maj) { int match = 0; char* device; - char* fsource = xf86CheckStrOption(local->options, "_source", ""); - LocalDevicePtr pDevices = xf86FirstLocalDevice(); + char* fsource = xf86CheckStrOption(pInfo->options, "_source", ""); + InputInfoPtr pDevices = xf86FirstLocalDevice(); WacomCommonPtr pCommon = NULL; char* psource; @@ -50,7 +50,7 @@ static Bool wcmCheckSource(LocalDevicePtr local, dev_t min_maj) if (!device || !strstr(pDevices->drv->driverName, "wacom")) continue; - if (local != pDevices) + if (pInfo != pDevices) { psource = xf86CheckStrOption(pDevices->options, "_source", ""); pCommon = ((WacomDevicePtr)pDevices->private)->common; @@ -69,7 +69,7 @@ static Bool wcmCheckSource(LocalDevicePtr local, dev_t min_maj) } if (match) xf86Msg(X_WARNING, "%s: device file already in use by %s. " - "Ignoring.\n", local->name, pDevices->name); + "Ignoring.\n", pInfo->name, pDevices->name); return match; } @@ -81,20 +81,20 @@ static Bool wcmCheckSource(LocalDevicePtr local, dev_t min_maj) * the xorg.conf and is then hotplugged through the server backend (HAL, * udev). In this case, the hotplugged one fails. */ -int wcmIsDuplicate(char* device, LocalDevicePtr local) +int wcmIsDuplicate(char* device, InputInfoPtr pInfo) { struct stat st; int isInUse = 0; - char* lsource = xf86CheckStrOption(local->options, "_source", ""); + char* lsource = xf86CheckStrOption(pInfo->options, "_source", ""); /* always allow xorg.conf defined tools to be added */ if (!strlen(lsource)) goto ret; - if (fstat(local->fd, &st) == -1) + if (fstat(pInfo->fd, &st) == -1) { /* can not access major/minor to check device duplication */ xf86Msg(X_ERROR, "%s: stat failed (%s). cannot check for duplicates.\n", - local->name, strerror(errno)); + pInfo->name, strerror(errno)); /* older systems don't support the required ioctl. let it pass */ goto ret; @@ -103,7 +103,7 @@ int wcmIsDuplicate(char* device, LocalDevicePtr local) if (st.st_rdev) { /* device matches with another added port */ - if (wcmCheckSource(local, st.st_rdev)) + if (wcmCheckSource(pInfo, st.st_rdev)) { isInUse = 3; goto ret; @@ -113,7 +113,7 @@ int wcmIsDuplicate(char* device, LocalDevicePtr local) { /* major/minor can never be 0, right? */ xf86Msg(X_ERROR, "%s: device opened with a major/minor of 0. " - "Something was wrong.\n", local->name); + "Something was wrong.\n", pInfo->name); isInUse = 4; } ret: @@ -134,10 +134,10 @@ static struct }; /* validate tool type for device/product */ -Bool wcmIsAValidType(LocalDevicePtr local, const char* type) +Bool wcmIsAValidType(InputInfoPtr pInfo, const char* type) { int j, ret = FALSE; - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; if (!type) @@ -157,15 +157,15 @@ Bool wcmIsAValidType(LocalDevicePtr local, const char* type) } /* Choose valid types according to device ID. */ -int wcmDeviceTypeKeys(LocalDevicePtr local) +int wcmDeviceTypeKeys(InputInfoPtr pInfo) { int ret = 1; - WacomDevicePtr priv = local->private; + WacomDevicePtr priv = pInfo->private; /* serial ISDV4 devices */ - priv->common->tablet_id = isdv4ProbeKeys(local); + priv->common->tablet_id = isdv4ProbeKeys(pInfo); if (!priv->common->tablet_id) /* USB devices */ - priv->common->tablet_id = usbProbeKeys(local); + priv->common->tablet_id = usbProbeKeys(pInfo); return ret; } @@ -173,9 +173,9 @@ int wcmDeviceTypeKeys(LocalDevicePtr local) /** * Duplicate xf86 options, replace the "type" option with the given type * (and the name with "$name $type" and convert them to InputOption */ -static InputOption *wcmOptionDupConvert(LocalDevicePtr local, const char *type) +static InputOption *wcmOptionDupConvert(InputInfoPtr pInfo, const char *type) { - pointer original = local->options; + pointer original = pInfo->options; InputOption *iopts = NULL, *new; InputInfoRec dummy; char *name; @@ -183,8 +183,8 @@ static InputOption *wcmOptionDupConvert(LocalDevicePtr local, const char *type) memset(&dummy, 0, sizeof(dummy)); xf86CollectInputOptions(&dummy, NULL, original); - name = calloc(strlen(local->name) + strlen(type) + 2, 1); - sprintf(name, "%s %s", local->name, type); + name = calloc(strlen(pInfo->name) + strlen(type) + 2, 1); + sprintf(name, "%s %s", pInfo->name, type); dummy.options = xf86ReplaceStrOption(dummy.options, "Type", type); dummy.options = xf86ReplaceStrOption(dummy.options, "Name", name); @@ -222,12 +222,12 @@ static void wcmFreeInputOpts(InputOption* opts) * erasor, stylus, pad, touch, cursor, etc. * Name of the new device is set automatically to "<device name> <type>". */ -static void wcmHotplug(LocalDevicePtr local, const char *type) +static void wcmHotplug(InputInfoPtr pInfo, const char *type) { DeviceIntPtr dev; /* dummy */ InputOption *input_options; - input_options = wcmOptionDupConvert(local, type); + input_options = wcmOptionDupConvert(pInfo, type); NewInputDeviceRequest(input_options, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 9 @@ -237,26 +237,26 @@ static void wcmHotplug(LocalDevicePtr local, const char *type) wcmFreeInputOpts(input_options); } -void wcmHotplugOthers(LocalDevicePtr local) +void wcmHotplugOthers(InputInfoPtr pInfo) { int i, skip = 1; char* device; - xf86Msg(X_INFO, "%s: hotplugging dependent devices.\n", local->name); - device = xf86SetStrOption(local->options, "Device", NULL); + xf86Msg(X_INFO, "%s: hotplugging dependent devices.\n", pInfo->name); + device = xf86SetStrOption(pInfo->options, "Device", NULL); /* same loop is used to init the first device, if we get here we * need to start at the second one */ for (i = 0; i < ARRAY_SIZE(wcmType); i++) { - if (wcmIsAValidType(local, wcmType[i].type)) + if (wcmIsAValidType(pInfo, wcmType[i].type)) { if (skip) skip = 0; else - wcmHotplug(local, wcmType[i].type); + wcmHotplug(pInfo, wcmType[i].type); } } - xf86Msg(X_INFO, "%s: hotplugging completed.\n", local->name); + xf86Msg(X_INFO, "%s: hotplugging completed.\n", pInfo->name); } /** @@ -268,9 +268,9 @@ void wcmHotplugOthers(LocalDevicePtr local) * This changes the source to _driver/wacom, all auto-hotplugged devices * will have the same source. */ -int wcmNeedAutoHotplug(LocalDevicePtr local, const char **type) +int wcmNeedAutoHotplug(InputInfoPtr pInfo, const char **type) { - char *source = xf86CheckStrOption(local->options, "_source", ""); + char *source = xf86CheckStrOption(pInfo->options, "_source", ""); int i; if (*type) /* type specified, don't hotplug */ @@ -283,7 +283,7 @@ int wcmNeedAutoHotplug(LocalDevicePtr local, const char **type) * for our device */ for (i = 0; i < ARRAY_SIZE(wcmType); i++) { - if (wcmIsAValidType(local, wcmType[i].type)) + if (wcmIsAValidType(pInfo, wcmType[i].type)) { *type = strdup(wcmType[i].type); break; @@ -293,18 +293,18 @@ int wcmNeedAutoHotplug(LocalDevicePtr local, const char **type) if (!*type) return 0; - xf86Msg(X_INFO, "%s: type not specified, assuming '%s'.\n", local->name, *type); - xf86Msg(X_INFO, "%s: other types will be automatically added.\n", local->name); + xf86Msg(X_INFO, "%s: type not specified, assuming '%s'.\n", pInfo->name, *type); + xf86Msg(X_INFO, "%s: other types will be automatically added.\n", pInfo->name); - local->options = xf86AddNewOption(local->options, "Type", *type); - local->options = xf86ReplaceStrOption(local->options, "_source", "_driver/wacom"); + pInfo->options = xf86AddNewOption(pInfo->options, "Type", *type); + pInfo->options = xf86ReplaceStrOption(pInfo->options, "_source", "_driver/wacom"); return 1; } -int wcmParseOptions(LocalDevicePtr local) +int wcmParseOptions(InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; char *s, b[12]; int i, oldButton; @@ -312,11 +312,11 @@ int wcmParseOptions(LocalDevicePtr local) WacomToolAreaPtr area = NULL; /* Optional configuration */ - priv->debugLevel = xf86SetIntOption(local->options, + priv->debugLevel = xf86SetIntOption(pInfo->options, "DebugLevel", priv->debugLevel); - common->debugLevel = xf86SetIntOption(local->options, + common->debugLevel = xf86SetIntOption(pInfo->options, "CommonDBG", common->debugLevel); - s = xf86SetStrOption(local->options, "Mode", NULL); + s = xf86SetStrOption(pInfo->options, "Mode", NULL); if (s && (xf86NameCmp(s, "absolute") == 0)) priv->flags |= ABSOLUTE_FLAG; @@ -326,7 +326,7 @@ int wcmParseOptions(LocalDevicePtr local) { if (s) xf86Msg(X_ERROR, "%s: invalid Mode (should be absolute" - " or relative). Using default.\n", local->name); + " or relative). Using default.\n", pInfo->name); /* If Mode not specified or is invalid then rely on * Type specific defaults from initialization. @@ -346,10 +346,10 @@ int wcmParseOptions(LocalDevicePtr local) } /* Store original local Core flag so it can be changed later */ - if (local->flags & (XI86_ALWAYS_CORE)) + if (pInfo->flags & (XI86_ALWAYS_CORE)) priv->flags |= COREEVENT_FLAG; - s = xf86SetStrOption(local->options, "Rotate", NULL); + s = xf86SetStrOption(pInfo->options, "Rotate", NULL); if (s) { @@ -362,12 +362,12 @@ int wcmParseOptions(LocalDevicePtr local) else if (xf86NameCmp(s, "NONE") !=0) { xf86Msg(X_ERROR, "%s: invalid Rotate option '%s'.\n", - local->name, s); + pInfo->name, s); goto error; } } - common->wcmSuppress = xf86SetIntOption(local->options, "Suppress", + common->wcmSuppress = xf86SetIntOption(pInfo->options, "Suppress", common->wcmSuppress); if (common->wcmSuppress != 0) /* 0 disables suppression */ { @@ -377,11 +377,11 @@ int wcmParseOptions(LocalDevicePtr local) common->wcmSuppress = DEFAULT_SUPPRESS; } - if (xf86SetBoolOption(local->options, "Tilt", + if (xf86SetBoolOption(pInfo->options, "Tilt", (common->wcmFlags & TILT_REQUEST_FLAG))) common->wcmFlags |= TILT_REQUEST_FLAG; - if (xf86SetBoolOption(local->options, "RawFilter", + if (xf86SetBoolOption(pInfo->options, "RawFilter", (common->wcmFlags & RAW_FILTERING_FLAG))) common->wcmFlags |= RAW_FILTERING_FLAG; @@ -391,24 +391,24 @@ int wcmParseOptions(LocalDevicePtr local) * Slightly depressed curve might be 5,0,100,95 * Slightly raised curve might be 0,5,95,100 */ - s = xf86SetStrOption(local->options, "PressCurve", NULL); + s = xf86SetStrOption(pInfo->options, "PressCurve", NULL); if (s && (IsStylus(priv) || IsEraser(priv))) { int a,b,c,d; if ((sscanf(s,"%d,%d,%d,%d",&a,&b,&c,&d) != 4) || !wcmCheckPressureCurveValues(a, b, c, d)) xf86Msg(X_CONFIG, "%s: PressCurve not valid\n", - local->name); + pInfo->name); else wcmSetPressureCurve(priv,a,b,c,d); } if (IsCursor(priv)) { - common->wcmCursorProxoutDist = xf86SetIntOption(local->options, "CursorProx", 0); + common->wcmCursorProxoutDist = xf86SetIntOption(pInfo->options, "CursorProx", 0); if (common->wcmCursorProxoutDist < 0 || common->wcmCursorProxoutDist > 255) xf86Msg(X_CONFIG, "%s: CursorProx invalid %d \n", - local->name, common->wcmCursorProxoutDist); + pInfo->name, common->wcmCursorProxoutDist); } /* Configure Monitors' resoluiton in TwinView setup. @@ -416,14 +416,14 @@ int wcmParseOptions(LocalDevicePtr local) * for a desktop of monitor 1 at 1024x768 and * monitor 2 at 1280x1024 */ - s = xf86SetStrOption(local->options, "TVResolution", NULL); + s = xf86SetStrOption(pInfo->options, "TVResolution", NULL); if (s) { int a,b,c,d; if ((sscanf(s,"%dx%d,%dx%d",&a,&b,&c,&d) != 4) || (a <= 0) || (b <= 0) || (c <= 0) || (d <= 0)) xf86Msg(X_CONFIG, "%s: TVResolution not valid\n", - local->name); + pInfo->name); else { priv->tvResolution[0] = a; @@ -433,16 +433,16 @@ int wcmParseOptions(LocalDevicePtr local) } } - priv->screen_no = xf86SetIntOption(local->options, "ScreenNo", -1); + priv->screen_no = xf86SetIntOption(pInfo->options, "ScreenNo", -1); - if (xf86SetBoolOption(local->options, "KeepShape", 0)) + if (xf86SetBoolOption(pInfo->options, "KeepShape", 0)) priv->flags |= KEEP_SHAPE_FLAG; - priv->topX = xf86SetIntOption(local->options, "TopX", 0); - priv->topY = xf86SetIntOption(local->options, "TopY", 0); - priv->bottomX = xf86SetIntOption(local->options, "BottomX", 0); - priv->bottomY = xf86SetIntOption(local->options, "BottomY", 0); - priv->serial = xf86SetIntOption(local->options, "Serial", 0); + priv->topX = xf86SetIntOption(pInfo->options, "TopX", 0); + priv->topY = xf86SetIntOption(pInfo->options, "TopY", 0); + priv->bottomX = xf86SetIntOption(pInfo->options, "BottomX", 0); + priv->bottomY = xf86SetIntOption(pInfo->options, "BottomY", 0); + priv->serial = xf86SetIntOption(pInfo->options, "Serial", 0); tool = priv->tool; area = priv->toolarea; @@ -487,17 +487,17 @@ int wcmParseOptions(LocalDevicePtr local) common->wcmScaling = 0; - common->wcmThreshold = xf86SetIntOption(local->options, "Threshold", + common->wcmThreshold = xf86SetIntOption(pInfo->options, "Threshold", common->wcmThreshold); - common->wcmMaxZ = xf86SetIntOption(local->options, "MaxZ", + common->wcmMaxZ = xf86SetIntOption(pInfo->options, "MaxZ", common->wcmMaxZ); - if (xf86SetBoolOption(local->options, "ButtonsOnly", 0)) + if (xf86SetBoolOption(pInfo->options, "ButtonsOnly", 0)) priv->flags |= BUTTONS_ONLY_FLAG; /* Tablet PC button applied to the whole tablet. Not just one tool */ if ( priv->flags & STYLUS_ID ) - common->wcmTPCButton = xf86SetBoolOption(local->options, + common->wcmTPCButton = xf86SetBoolOption(pInfo->options, "TPCButton", common->wcmTPCButtonDefault); @@ -518,35 +518,35 @@ int wcmParseOptions(LocalDevicePtr local) } /* check if touch was turned off in xorg.conf */ - common->wcmTouch = xf86SetBoolOption(local->options, "Touch", + common->wcmTouch = xf86SetBoolOption(pInfo->options, "Touch", common->wcmTouchDefault); /* Touch gesture applies to the whole tablet */ - common->wcmGesture = xf86SetBoolOption(local->options, "Gesture", + common->wcmGesture = xf86SetBoolOption(pInfo->options, "Gesture", common->wcmGestureDefault); /* Touch capacity applies to the whole tablet */ - common->wcmCapacity = xf86SetBoolOption(local->options, "Capacity", common->wcmCapacityDefault); + common->wcmCapacity = xf86SetBoolOption(pInfo->options, "Capacity", common->wcmCapacityDefault); /* Mouse cursor stays in one monitor in a multimonitor setup */ if ( !priv->wcmMMonitor ) - priv->wcmMMonitor = xf86SetBoolOption(local->options, "MMonitor", 1); + priv->wcmMMonitor = xf86SetBoolOption(pInfo->options, "MMonitor", 1); for (i=0; i<WCM_MAX_BUTTONS; i++) { sprintf(b, "Button%d", i+1); - s = xf86SetStrOption(local->options, b, NULL); + s = xf86SetStrOption(pInfo->options, b, NULL); if (s) { oldButton = priv->button[i]; - priv->button[i] = xf86SetIntOption(local->options, b, priv->button[i]); + priv->button[i] = xf86SetIntOption(pInfo->options, b, priv->button[i]); } } if (common->wcmForceDevice == DEVICE_ISDV4) { int val; - val = xf86SetIntOption(local->options, "BaudRate", 38400); + val = xf86SetIntOption(pInfo->options, "BaudRate", 38400); switch(val) { @@ -557,12 +557,12 @@ int wcmParseOptions(LocalDevicePtr local) default: xf86Msg(X_ERROR, "%s: Illegal speed value " "(must be 19200 or 38400).", - local->name); + pInfo->name); break; } } - s = xf86SetStrOption(local->options, "Twinview", NULL); + s = xf86SetStrOption(pInfo->options, "Twinview", NULL); if (s && xf86NameCmp(s, "none") == 0) priv->twinview = TV_NONE; else if ((s && xf86NameCmp(s, "horizontal") == 0) || @@ -579,7 +579,7 @@ int wcmParseOptions(LocalDevicePtr local) { xf86Msg(X_ERROR, "%s: invalid Twinview (should be none, vertical (belowof), " "horizontal (rightof), aboveof, or leftof). Using none.\n", - local->name); + pInfo->name); priv->twinview = TV_NONE; } @@ -590,18 +590,18 @@ error: return 0; } -int wcmAutoProbeDevice(LocalDevicePtr local) +int wcmAutoProbeDevice(InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr) local->private; + WacomDevicePtr priv = (WacomDevicePtr) pInfo->private; WacomCommonPtr common = priv->common; if ((!common->wcmDevice || !strcmp (common->wcmDevice, "auto-dev"))) { common->wcmFlags |= AUTODEV_FLAG; - if (! (common->wcmDevice = wcmEventAutoDevProbe (local))) + if (! (common->wcmDevice = wcmEventAutoDevProbe (pInfo))) { xf86Msg(X_ERROR, "%s: unable to probe device\n", - local->name); + pInfo->name); return 0; } } diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c index f2ac49b..70992bc 100644 --- a/src/wcmXCommand.c +++ b/src/wcmXCommand.c @@ -29,9 +29,9 @@ * wcmDevSwitchModeCall -- *****************************************************************************/ -int wcmDevSwitchModeCall(LocalDevicePtr local, int mode) +int wcmDevSwitchModeCall(InputInfoPtr pInfo, int mode) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; int is_absolute = priv->flags & ABSOLUTE_FLAG; DBG(3, priv, "to mode=%d\n", mode); @@ -43,14 +43,14 @@ int wcmDevSwitchModeCall(LocalDevicePtr local, int mode) if ((mode == Absolute) && !is_absolute) { priv->flags |= ABSOLUTE_FLAG; - wcmInitialCoordinates(local, 0); - wcmInitialCoordinates(local, 1); + wcmInitialCoordinates(pInfo, 0); + wcmInitialCoordinates(pInfo, 1); } else if ((mode == Relative) && is_absolute) { priv->flags &= ~ABSOLUTE_FLAG; - wcmInitialCoordinates(local, 0); - wcmInitialCoordinates(local, 1); + wcmInitialCoordinates(pInfo, 0); + wcmInitialCoordinates(pInfo, 1); } else if ( (mode != Absolute) && (mode != Relative)) { @@ -67,36 +67,36 @@ int wcmDevSwitchModeCall(LocalDevicePtr local, int mode) int wcmDevSwitchMode(ClientPtr client, DeviceIntPtr dev, int mode) { - LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate; + InputInfoPtr pInfo = (InputInfoPtr)dev->public.devicePrivate; #ifdef DEBUG - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; DBG(3, priv, "dev=%p mode=%d\n", (void *)dev, mode); #endif /* Share this call with sendAButton in wcmCommon.c */ - return wcmDevSwitchModeCall(local, mode); + return wcmDevSwitchModeCall(pInfo, mode); } /***************************************************************************** * wcmChangeScreen ****************************************************************************/ -void wcmChangeScreen(LocalDevicePtr local, int value) +void wcmChangeScreen(InputInfoPtr pInfo, int value) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; if (priv->screen_no != value) { priv->screen_no = value; - xf86ReplaceIntOption(local->options, "ScreenNo", value); + xf86ReplaceIntOption(pInfo->options, "ScreenNo", value); } if (priv->screen_no != -1) priv->currentScreen = priv->screen_no; - wcmInitialScreens(local); - wcmInitialCoordinates(local, 0); - wcmInitialCoordinates(local, 1); + wcmInitialScreens(pInfo); + wcmInitialCoordinates(pInfo, 0); + wcmInitialCoordinates(pInfo, 1); } #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3 @@ -165,9 +165,9 @@ static Atom InitWcmAtom(DeviceIntPtr dev, char *name, int format, int nvalues, i return atom; } -void InitWcmDeviceProperties(LocalDevicePtr local) +void InitWcmDeviceProperties(InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr) local->private; + WacomDevicePtr priv = (WacomDevicePtr) pInfo->private; WacomCommonPtr common = priv->common; int values[WCM_MAX_MOUSE_BUTTONS]; @@ -177,96 +177,96 @@ void InitWcmDeviceProperties(LocalDevicePtr local) values[1] = priv->topY; values[2] = priv->bottomX; values[3] = priv->bottomY; - prop_tablet_area = InitWcmAtom(local->dev, WACOM_PROP_TABLET_AREA, 32, 4, values); + prop_tablet_area = InitWcmAtom(pInfo->dev, WACOM_PROP_TABLET_AREA, 32, 4, values); values[0] = common->wcmRotate; - prop_rotation = InitWcmAtom(local->dev, WACOM_PROP_ROTATION, 8, 1, values); + prop_rotation = InitWcmAtom(pInfo->dev, WACOM_PROP_ROTATION, 8, 1, values); if (IsStylus(priv) || IsEraser(priv)) { values[0] = priv->nPressCtrl[0]; values[1] = priv->nPressCtrl[1]; values[2] = priv->nPressCtrl[2]; values[3] = priv->nPressCtrl[3]; - prop_pressurecurve = InitWcmAtom(local->dev, WACOM_PROP_PRESSURECURVE, 32, 4, values); + prop_pressurecurve = InitWcmAtom(pInfo->dev, WACOM_PROP_PRESSURECURVE, 32, 4, values); } values[0] = common->tablet_id; values[1] = priv->old_serial; values[2] = priv->old_device_id; values[3] = priv->serial; - prop_serials = InitWcmAtom(local->dev, WACOM_PROP_SERIALIDS, 32, 4, values); + prop_serials = InitWcmAtom(pInfo->dev, WACOM_PROP_SERIALIDS, 32, 4, values); if (IsPad(priv)) { values[0] = priv->striplup; values[1] = priv->stripldn; values[2] = priv->striprup; values[3] = priv->striprdn; - prop_strip_buttons = InitWcmAtom(local->dev, WACOM_PROP_STRIPBUTTONS, 8, 4, values); + prop_strip_buttons = InitWcmAtom(pInfo->dev, WACOM_PROP_STRIPBUTTONS, 8, 4, values); values[0] = priv->relup; values[1] = priv->reldn; values[2] = priv->wheelup; values[3] = priv->wheeldn; - prop_wheel_buttons = InitWcmAtom(local->dev, WACOM_PROP_WHEELBUTTONS, 8, 4, values); + prop_wheel_buttons = InitWcmAtom(pInfo->dev, WACOM_PROP_WHEELBUTTONS, 8, 4, values); } values[0] = priv->tvResolution[0]; values[1] = priv->tvResolution[1]; values[2] = priv->tvResolution[2]; values[3] = priv->tvResolution[3]; - prop_tv_resolutions = InitWcmAtom(local->dev, WACOM_PROP_TWINVIEW_RES, 32, 4, values); + prop_tv_resolutions = InitWcmAtom(pInfo->dev, WACOM_PROP_TWINVIEW_RES, 32, 4, values); values[0] = priv->screen_no; values[1] = priv->twinview; values[2] = priv->wcmMMonitor; - prop_display = InitWcmAtom(local->dev, WACOM_PROP_DISPLAY_OPTS, 8, 3, values); + prop_display = InitWcmAtom(pInfo->dev, WACOM_PROP_DISPLAY_OPTS, 8, 3, values); values[0] = priv->screenTopX[priv->currentScreen]; values[1] = priv->screenTopY[priv->currentScreen]; values[2] = priv->screenBottomX[priv->currentScreen]; values[3] = priv->screenBottomY[priv->currentScreen]; - prop_screen = InitWcmAtom(local->dev, WACOM_PROP_SCREENAREA, 32, 4, values); + prop_screen = InitWcmAtom(pInfo->dev, WACOM_PROP_SCREENAREA, 32, 4, values); values[0] = common->wcmCursorProxoutDist; - prop_cursorprox = InitWcmAtom(local->dev, WACOM_PROP_PROXIMITY_THRESHOLD, 32, 1, values); + prop_cursorprox = InitWcmAtom(pInfo->dev, WACOM_PROP_PROXIMITY_THRESHOLD, 32, 1, values); values[0] = common->wcmCapacity; - prop_capacity = InitWcmAtom(local->dev, WACOM_PROP_CAPACITY, 32, 1, values); + prop_capacity = InitWcmAtom(pInfo->dev, WACOM_PROP_CAPACITY, 32, 1, values); values[0] = (!common->wcmMaxZ) ? 0 : common->wcmThreshold; - prop_threshold = InitWcmAtom(local->dev, WACOM_PROP_PRESSURE_THRESHOLD, 32, 1, values); + prop_threshold = InitWcmAtom(pInfo->dev, WACOM_PROP_PRESSURE_THRESHOLD, 32, 1, values); values[0] = common->wcmSuppress; values[1] = common->wcmRawSample; - prop_suppress = InitWcmAtom(local->dev, WACOM_PROP_SAMPLE, 32, 2, values); + prop_suppress = InitWcmAtom(pInfo->dev, WACOM_PROP_SAMPLE, 32, 2, values); values[0] = common->wcmTouch; - prop_touch = InitWcmAtom(local->dev, WACOM_PROP_TOUCH, 8, 1, values); + prop_touch = InitWcmAtom(pInfo->dev, WACOM_PROP_TOUCH, 8, 1, values); values[0] = !common->wcmTPCButton; - prop_hover = InitWcmAtom(local->dev, WACOM_PROP_HOVER, 8, 1, values); + prop_hover = InitWcmAtom(pInfo->dev, WACOM_PROP_HOVER, 8, 1, values); - values[0] = MakeAtom(local->type_name, strlen(local->type_name), TRUE); - prop_tooltype = InitWcmAtom(local->dev, WACOM_PROP_TOOL_TYPE, -32, 1, values); + values[0] = MakeAtom(pInfo->type_name, strlen(pInfo->type_name), TRUE); + prop_tooltype = InitWcmAtom(pInfo->dev, WACOM_PROP_TOOL_TYPE, -32, 1, values); /* default to no actions */ memset(values, 0, sizeof(values)); - prop_btnactions = InitWcmAtom(local->dev, WACOM_PROP_BUTTON_ACTIONS, -32, WCM_MAX_MOUSE_BUTTONS, values); + prop_btnactions = InitWcmAtom(pInfo->dev, WACOM_PROP_BUTTON_ACTIONS, -32, WCM_MAX_MOUSE_BUTTONS, values); #ifdef DEBUG values[0] = priv->debugLevel; values[1] = common->debugLevel; - prop_debuglevels = InitWcmAtom(local->dev, WACOM_PROP_DEBUGLEVELS, 8, 2, values); + prop_debuglevels = InitWcmAtom(pInfo->dev, WACOM_PROP_DEBUGLEVELS, 8, 2, values); #endif } int wcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, BOOL checkonly) { - LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate; - WacomDevicePtr priv = (WacomDevicePtr) local->private; + InputInfoPtr pInfo = (InputInfoPtr) dev->public.devicePrivate; + WacomDevicePtr priv = (WacomDevicePtr) pInfo->private; WacomCommonPtr common = priv->common; DBG(10, priv, "\n"); @@ -316,14 +316,14 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, area->bottomX = priv->maxX; area->bottomY = priv->maxY; } else /* offset for multimonitor */ - wcmAdjustArea(local, area); + wcmAdjustArea(pInfo, area); priv->topX = area->topX; priv->topY = area->topY; priv->bottomX = area->bottomX; priv->bottomY = area->bottomY; - wcmInitialCoordinates(local, 0); - wcmInitialCoordinates(local, 1); + wcmInitialCoordinates(pInfo, 0); + wcmInitialCoordinates(pInfo, 1); } } else if (property == prop_pressurecurve) { @@ -376,7 +376,7 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, return BadValue; if (!checkonly && common->wcmRotate != value) - wcmRotateTablet(local, value); + wcmRotateTablet(pInfo, value); } else if (property == prop_serials) { return BadValue; /* Read-only */ @@ -458,7 +458,7 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, if (!checkonly) { if (priv->screen_no != values[0]) - wcmChangeScreen(local, values[0]); + wcmChangeScreen(pInfo, values[0]); priv->screen_no = values[0]; if (priv->twinview != values[1]) @@ -475,7 +475,7 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, DBG(10, priv, "TwinView sets to " "TV_NONE: can't change screen_no. \n"); } - wcmChangeScreen(local, screen); + wcmChangeScreen(pInfo, screen); } priv->wcmMMonitor = values[2]; @@ -584,7 +584,7 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, priv->tvResolution[3] = values[3]; /* reset screen info */ - wcmChangeScreen(local, priv->screen_no); + wcmChangeScreen(pInfo, priv->screen_no); } #ifdef DEBUG } else if (property == prop_debuglevels) @@ -636,7 +636,7 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, if (values[i] == property || !ValidAtom(values[i])) return BadValue; - if (XIGetDeviceProperty(local->dev, values[i], &val) != Success) + if (XIGetDeviceProperty(pInfo->dev, values[i], &val) != Success) return BadValue; } @@ -653,7 +653,7 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, if (i >= prop->size || !values[i]) continue; - XIGetDeviceProperty(local->dev, values[i], &val); + XIGetDeviceProperty(pInfo->dev, values[i], &val); for (j = 0; j < val->size; j++) priv->keys[i][j] = ((unsigned int*)val->data)[j]; diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c index 96d42f9..54fd0bc 100644 --- a/src/xf86Wacom.c +++ b/src/xf86Wacom.c @@ -55,11 +55,11 @@ #endif static int wcmDevOpen(DeviceIntPtr pWcm); -static int wcmReady(LocalDevicePtr local); -static void wcmDevReadInput(LocalDevicePtr local); +static int wcmReady(InputInfoPtr pInfo); +static void wcmDevReadInput(InputInfoPtr pInfo); static void wcmDevControlProc(DeviceIntPtr device, PtrCtrl* ctrl); -int wcmDevChangeControl(LocalDevicePtr local, xDeviceCtl * control); -static void wcmDevClose(LocalDevicePtr local); +int wcmDevChangeControl(InputInfoPtr pInfo, xDeviceCtl * control); +static void wcmDevClose(InputInfoPtr pInfo); static int wcmDevProc(DeviceIntPtr pWcm, int what); WacomModule gWacomModule = @@ -94,12 +94,12 @@ static void wcmKbdCtrlCallback(DeviceIntPtr di, KeybdCtrl* ctrl) * wcmDesktopSize -- * calculate the whole desktop size ****************************************************************************/ -static void wcmDesktopSize(LocalDevicePtr local) +static void wcmDesktopSize(InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr) local->private; + WacomDevicePtr priv = (WacomDevicePtr) pInfo->private; int i = 0, minX = 0, minY = 0, maxX = 0, maxY = 0; - wcmInitialScreens(local); + wcmInitialScreens(pInfo); minX = priv->screenTopX[0]; minY = priv->screenTopY[0]; maxX = priv->screenBottomX[0]; @@ -122,9 +122,9 @@ static void wcmDesktopSize(LocalDevicePtr local) priv->maxHeight = maxY - minY; } -static int wcmInitArea(LocalDevicePtr local) +static int wcmInitArea(InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomToolAreaPtr area = priv->toolarea, inlist; WacomCommonPtr common = priv->common; double screenRatio, tabletRatio; @@ -167,13 +167,13 @@ static int wcmInitArea(LocalDevicePtr local) if (priv->twinview == TV_NONE || priv->screen_no != 1) { xf86Msg(X_ERROR, "%s: invalid screen number %d, resetting to default (-1) \n", - local->name, priv->screen_no); + pInfo->name, priv->screen_no); priv->screen_no = -1; } } /* need maxWidth and maxHeight for keepshape */ - wcmDesktopSize(local); + wcmDesktopSize(pInfo); /* Maintain aspect ratio to the whole desktop * May need to consider a specific screen in multimonitor settings @@ -234,25 +234,25 @@ static int wcmInitArea(LocalDevicePtr local) tmp->next = priv->next; } xf86Msg(X_ERROR, "%s: Top/Bottom area overlaps with another devices.\n", - local->conf_idev->identifier); + pInfo->conf_idev->identifier); return FALSE; } xf86Msg(X_PROBED, "%s: top X=%d top Y=%d " "bottom X=%d bottom Y=%d " "resol X=%d resol Y=%d\n", - local->name, priv->topX, + pInfo->name, priv->topX, priv->topY, priv->bottomX, priv->bottomY, common->wcmResolX, common->wcmResolY); return TRUE; } /***************************************************************************** - * wcmVirtualTabletPadding(LocalDevicePtr local) + * wcmVirtualTabletPadding(InputInfoPtr pInfo) ****************************************************************************/ -void wcmVirtualTabletPadding(LocalDevicePtr local) +void wcmVirtualTabletPadding(InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; /* in multi-screen settings, add the left/top offset given the * current multimonitor setup. @@ -290,16 +290,16 @@ void wcmVirtualTabletPadding(LocalDevicePtr local) } void -wcmAdjustArea(const LocalDevicePtr local, WacomToolArea *area) +wcmAdjustArea(const InputInfoPtr pInfo, WacomToolArea *area) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; /* If we're bound to a specific screen, substract the screen's * offset from the area coordinates we have here. */ if (priv->screen_no != -1) { - wcmVirtualTabletPadding(local); + wcmVirtualTabletPadding(pInfo); DBG(10, priv, "padding is %d/%d\n", priv->leftPadding, priv->topPadding); area->topX -= priv->leftPadding; area->bottomX -= priv->leftPadding; @@ -311,12 +311,12 @@ wcmAdjustArea(const LocalDevicePtr local, WacomToolArea *area) } /***************************************************************************** - * wcmVirtualTabletSize(LocalDevicePtr local) + * wcmVirtualTabletSize(InputInfoPtr pInfo) ****************************************************************************/ -void wcmVirtualTabletSize(LocalDevicePtr local) +void wcmVirtualTabletSize(InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; if (!(priv->flags & ABSOLUTE_FLAG)) { @@ -385,14 +385,14 @@ void wcmVirtualTabletSize(LocalDevicePtr local) * wcmInitialCoordinates ****************************************************************************/ -void wcmInitialCoordinates(LocalDevicePtr local, int axis) +void wcmInitialCoordinates(InputInfoPtr pInfo, int axis) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; int topx = 0, topy = 0, resolution_x, resolution_y; int bottomx = priv->maxX, bottomy = priv->maxY; - wcmMappingFactor(local); + wcmMappingFactor(pInfo); /* wcmMappingFactor calls wcmVirtualTabletSize. so once we're here, * sizeX contains the total width in device coordinates accounting @@ -437,7 +437,7 @@ void wcmInitialCoordinates(LocalDevicePtr local, int axis) switch(axis) { case 0: - InitValuatorAxisStruct(local->dev, 0, + InitValuatorAxisStruct(pInfo->dev, 0, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X), #endif @@ -445,7 +445,7 @@ void wcmInitialCoordinates(LocalDevicePtr local, int axis) resolution_x, 0, resolution_x); break; case 1: - InitValuatorAxisStruct(local->dev, 1, + InitValuatorAxisStruct(pInfo->dev, 1, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y), #endif @@ -453,7 +453,7 @@ void wcmInitialCoordinates(LocalDevicePtr local, int axis) resolution_y, 0, resolution_y); break; default: - xf86Msg(X_ERROR, "%s: Cannot initialize axis %d.\n", local->name, axis); + xf86Msg(X_ERROR, "%s: Cannot initialize axis %d.\n", pInfo->name, axis); break; } @@ -610,9 +610,9 @@ static struct { KeySym keysym; CARD8 mask; } keymod[] = { * Initialize logical size and resolution for individual tool. ****************************************************************************/ -static void wcmInitialToolSize(LocalDevicePtr local) +static void wcmInitialToolSize(InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; WacomToolPtr toollist = common->wcmTool; WacomToolAreaPtr arealist; @@ -654,9 +654,9 @@ static void wcmInitialToolSize(LocalDevicePtr local) * Register the X11 input devices with X11 core. ****************************************************************************/ -static int wcmRegisterX11Devices (LocalDevicePtr local) +static int wcmRegisterX11Devices (InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; unsigned char butmap[WCM_MAX_BUTTONS+1]; int nbaxes, nbbuttons, nbkeys; @@ -668,7 +668,7 @@ static int wcmRegisterX11Devices (LocalDevicePtr local) /* Detect tablet configuration, if possible */ if (priv->common->wcmModel->DetectConfig) - priv->common->wcmModel->DetectConfig (local); + priv->common->wcmModel->DetectConfig (pInfo); nbaxes = priv->naxes; /* X, Y, Pressure, Tilt-X, Tilt-Y, Wheel */ nbbuttons = priv->nbuttons; /* Use actual number of buttons, if possible */ @@ -701,32 +701,32 @@ static int wcmRegisterX11Devices (LocalDevicePtr local) butmap[loop] = loop; /* FIXME: button labels would be nice */ - if (InitButtonClassDeviceStruct(local->dev, nbbuttons, + if (InitButtonClassDeviceStruct(pInfo->dev, nbbuttons, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 btn_labels, #endif butmap) == FALSE) { - xf86Msg(X_ERROR, "%s: unable to allocate Button class device\n", local->name); + xf86Msg(X_ERROR, "%s: unable to allocate Button class device\n", pInfo->name); return FALSE; } - if (InitFocusClassDeviceStruct(local->dev) == FALSE) + if (InitFocusClassDeviceStruct(pInfo->dev) == FALSE) { - xf86Msg(X_ERROR, "%s: unable to init Focus class device\n", local->name); + xf86Msg(X_ERROR, "%s: unable to init Focus class device\n", pInfo->name); return FALSE; } - if (InitPtrFeedbackClassDeviceStruct(local->dev, + if (InitPtrFeedbackClassDeviceStruct(pInfo->dev, wcmDevControlProc) == FALSE) { - xf86Msg(X_ERROR, "%s: unable to init ptr feedback\n", local->name); + xf86Msg(X_ERROR, "%s: unable to init ptr feedback\n", pInfo->name); return FALSE; } - if (InitProximityClassDeviceStruct(local->dev) == FALSE) + if (InitProximityClassDeviceStruct(pInfo->dev) == FALSE) { - xf86Msg(X_ERROR, "%s: unable to init proximity class device\n", local->name); + xf86Msg(X_ERROR, "%s: unable to init proximity class device\n", pInfo->name); return FALSE; } @@ -735,7 +735,7 @@ static int wcmRegisterX11Devices (LocalDevicePtr local) /* axis_labels is just zeros, we set up each valuator with the * correct property later */ - if (InitValuatorClassDeviceStruct(local->dev, nbaxes, + if (InitValuatorClassDeviceStruct(pInfo->dev, nbaxes, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 axis_labels, #endif @@ -747,7 +747,7 @@ static int wcmRegisterX11Devices (LocalDevicePtr local) Absolute : Relative) | OutOfProximity ) == FALSE) { - xf86Msg(X_ERROR, "%s: unable to allocate Valuator class device\n", local->name); + xf86Msg(X_ERROR, "%s: unable to allocate Valuator class device\n", pInfo->name); return FALSE; } @@ -787,20 +787,20 @@ static int wcmRegisterX11Devices (LocalDevicePtr local) wacom_keysyms.minKeyCode = 8; wacom_keysyms.maxKeyCode = 255; wacom_keysyms.mapWidth = 2; - if (InitKeyClassDeviceStruct(local->dev, &wacom_keysyms, modmap) == FALSE) + if (InitKeyClassDeviceStruct(pInfo->dev, &wacom_keysyms, modmap) == FALSE) { - xf86Msg(X_ERROR, "%s: unable to init key class device\n", local->name); + xf86Msg(X_ERROR, "%s: unable to init key class device\n", pInfo->name); return FALSE; } } - if(InitKbdFeedbackClassDeviceStruct(local->dev, wcmBellCallback, + if(InitKbdFeedbackClassDeviceStruct(pInfo->dev, wcmBellCallback, wcmKbdCtrlCallback) == FALSE) { - xf86Msg(X_ERROR, "%s: unable to init kbd feedback device struct\n", local->name); + xf86Msg(X_ERROR, "%s: unable to init kbd feedback device struct\n", pInfo->name); return FALSE; } #elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 - if (InitKeyboardDeviceStruct(local->dev, NULL, NULL, wcmKbdCtrlCallback)) { + if (InitKeyboardDeviceStruct(pInfo->dev, NULL, NULL, wcmKbdCtrlCallback)) { #define SYMS_PER_KEY 2 KeySymsRec syms; CARD8 modmap[MAP_LENGTH]; @@ -813,32 +813,32 @@ static int wcmRegisterX11Devices (LocalDevicePtr local) memset(modmap, 0, sizeof(modmap)); modmap[XkbMinLegalKeyCode + 2] = ShiftMask; - XkbApplyMappingChange(local->dev, &syms, syms.minKeyCode, num_keys, NULL, // modmap, + XkbApplyMappingChange(pInfo->dev, &syms, syms.minKeyCode, num_keys, NULL, // modmap, serverClient); } else { - xf86Msg(X_ERROR, "%s: unable to init kbd device struct\n", local->name); + xf86Msg(X_ERROR, "%s: unable to init kbd device struct\n", pInfo->name); return FALSE; } #endif - if(InitLedFeedbackClassDeviceStruct (local->dev, wcmKbdLedCallback) == FALSE) { - xf86Msg(X_ERROR, "%s: unable to init led feedback device struct\n", local->name); + if(InitLedFeedbackClassDeviceStruct (pInfo->dev, wcmKbdLedCallback) == FALSE) { + xf86Msg(X_ERROR, "%s: unable to init led feedback device struct\n", pInfo->name); return FALSE; } } - wcmInitialToolSize(local); + wcmInitialToolSize(pInfo); - if (wcmInitArea(local) == FALSE) + if (wcmInitArea(pInfo) == FALSE) { return FALSE; } /* Rotation rotates the Max X and Y */ - wcmRotateTablet(local, common->wcmRotate); + wcmRotateTablet(pInfo, common->wcmRotate); /* pressure */ - InitValuatorAxisStruct(local->dev, 2, + InitValuatorAxisStruct(pInfo->dev, 2, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE), #endif @@ -847,12 +847,12 @@ static int wcmRegisterX11Devices (LocalDevicePtr local) if (IsCursor(priv)) { /* z-rot and throttle */ - InitValuatorAxisStruct(local->dev, 3, + InitValuatorAxisStruct(pInfo->dev, 3, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 XIGetKnownProperty(AXIS_LABEL_PROP_ABS_RZ), #endif -900, 899, 1, 1, 1); - InitValuatorAxisStruct(local->dev, 4, + InitValuatorAxisStruct(pInfo->dev, 4, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 XIGetKnownProperty(AXIS_LABEL_PROP_ABS_THROTTLE), #endif @@ -864,12 +864,12 @@ static int wcmRegisterX11Devices (LocalDevicePtr local) if (strstr(common->wcmModel->name, "Intuos3") || strstr(common->wcmModel->name, "CintiqV5")) { - InitValuatorAxisStruct(local->dev, 3, + InitValuatorAxisStruct(pInfo->dev, 3, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 0, /* XXX what is this axis?*/ #endif 0, common->wcmMaxStripX, 1, 1, 1); - InitValuatorAxisStruct(local->dev, 4, + InitValuatorAxisStruct(pInfo->dev, 4, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 0, /* XXX what is this axis?*/ #endif @@ -879,12 +879,12 @@ static int wcmRegisterX11Devices (LocalDevicePtr local) else { /* tilt-x and tilt-y */ - InitValuatorAxisStruct(local->dev, 3, + InitValuatorAxisStruct(pInfo->dev, 3, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_X), #endif -64, 63, 1, 1, 1); - InitValuatorAxisStruct(local->dev, 4, + InitValuatorAxisStruct(pInfo->dev, 4, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_Y), #endif @@ -896,7 +896,7 @@ static int wcmRegisterX11Devices (LocalDevicePtr local) strstr(common->wcmModel->name, "Intuos4")) && IsStylus(priv)) /* Art Marker Pen rotation */ - InitValuatorAxisStruct(local->dev, 5, + InitValuatorAxisStruct(pInfo->dev, 5, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 0, /* XXX what is this axis?*/ #endif @@ -905,7 +905,7 @@ static int wcmRegisterX11Devices (LocalDevicePtr local) strstr(common->wcmModel->name, "Intuos4")) && IsPad(priv)) /* Touch ring */ - InitValuatorAxisStruct(local->dev, 5, + InitValuatorAxisStruct(pInfo->dev, 5, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 0, /* XXX what is this axis?*/ #endif @@ -913,7 +913,7 @@ static int wcmRegisterX11Devices (LocalDevicePtr local) else { /* absolute wheel */ - InitValuatorAxisStruct(local->dev, 5, + InitValuatorAxisStruct(pInfo->dev, 5, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 XIGetKnownProperty(AXIS_LABEL_PROP_ABS_WHEEL), #endif @@ -927,8 +927,8 @@ static int wcmRegisterX11Devices (LocalDevicePtr local) } #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3 - InitWcmDeviceProperties(local); - XIRegisterPropertyHandler(local->dev, wcmSetProperty, NULL, NULL); + InitWcmDeviceProperties(pInfo); + XIRegisterPropertyHandler(pInfo->dev, wcmSetProperty, NULL, NULL); #endif return TRUE; @@ -962,7 +962,7 @@ Bool wcmIsWacomDevice (char* fname) ****************************************************************************/ #define DEV_INPUT_EVENT "/dev/input/event%d" #define EVDEV_MINORS 32 -char *wcmEventAutoDevProbe (LocalDevicePtr local) +char *wcmEventAutoDevProbe (InputInfoPtr pInfo) { /* We are trying to find the right eventX device */ int i, wait = 0; @@ -981,19 +981,19 @@ char *wcmEventAutoDevProbe (LocalDevicePtr local) if (is_wacom) { xf86Msg(X_PROBED, "%s: probed device is %s (waited %d msec)\n", - local->name, fname, wait); - xf86ReplaceStrOption(local->options, "Device", fname); + pInfo->name, fname, wait); + xf86ReplaceStrOption(pInfo->options, "Device", fname); /* this assumes there is only one Wacom device on the system */ - return xf86FindOptionValue(local->options, "Device"); + return xf86FindOptionValue(pInfo->options, "Device"); } } wait += 100; - xf86Msg(X_ERROR, "%s: waiting 100 msec (total %dms) for device to become ready\n", local->name, wait); + xf86Msg(X_ERROR, "%s: waiting 100 msec (total %dms) for device to become ready\n", pInfo->name, wait); usleep(100*1000); } xf86Msg(X_ERROR, "%s: no Wacom event device found (checked %d nodes, waited %d msec)\n", - local->name, i + 1, wait); + pInfo->name, i + 1, wait); return FALSE; } @@ -1001,9 +1001,9 @@ char *wcmEventAutoDevProbe (LocalDevicePtr local) * wcmOpen -- ****************************************************************************/ -static Bool wcmOpen(LocalDevicePtr local) +static Bool wcmOpen(InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; char id[BUFFER_SIZE]; float version; @@ -1012,15 +1012,15 @@ static Bool wcmOpen(LocalDevicePtr local) DBG(1, priv, "opening device file\n"); - local->fd = xf86OpenSerial(local->options); - if (local->fd < 0) + pInfo->fd = xf86OpenSerial(pInfo->options); + if (pInfo->fd < 0) { - xf86Msg(X_ERROR, "%s: Error opening %s (%s)\n", local->name, + xf86Msg(X_ERROR, "%s: Error opening %s (%s)\n", pInfo->name, common->wcmDevice, strerror(errno)); return !Success; } - rc = ioctl(local->fd, TIOCGSERIAL, &ser); + rc = ioctl(pInfo->fd, TIOCGSERIAL, &ser); /* we initialized wcmDeviceClasses to USB * Bluetooth is also considered as USB */ @@ -1036,22 +1036,22 @@ static Bool wcmOpen(LocalDevicePtr local) else { /* Detect USB device class */ - if ((&gWacomUSBDevice)->Detect(local)) + if ((&gWacomUSBDevice)->Detect(pInfo)) common->wcmDevCls = &gWacomUSBDevice; else { xf86Msg(X_ERROR, "%s: wcmOpen found undetectable " - " %s \n", local->name, common->wcmDevice); + " %s \n", pInfo->name, common->wcmDevice); return !Success; } } /* Initialize the tablet */ - if(common->wcmDevCls->Init(local, id, &version) != Success || - wcmInitTablet(local, id, version) != Success) + if(common->wcmDevCls->Init(pInfo, id, &version) != Success || + wcmInitTablet(pInfo, id, version) != Success) { - xf86CloseSerial(local->fd); - local->fd = -1; + xf86CloseSerial(pInfo->fd); + pInfo->fd = -1; return !Success; } return Success; @@ -1064,8 +1064,8 @@ static Bool wcmOpen(LocalDevicePtr local) static int wcmDevOpen(DeviceIntPtr pWcm) { - LocalDevicePtr local = (LocalDevicePtr)pWcm->public.devicePrivate; - WacomDevicePtr priv = (WacomDevicePtr)local->private; + InputInfoPtr pInfo = (InputInfoPtr)pWcm->public.devicePrivate; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; struct stat st; @@ -1080,24 +1080,24 @@ static int wcmDevOpen(DeviceIntPtr pWcm) { /* Autoprobe if necessary */ if ((common->wcmFlags & AUTODEV_FLAG) && - !(common->wcmDevice = wcmEventAutoDevProbe (local))) - xf86Msg(X_ERROR, "%s: Cannot probe device\n", local->name); + !(common->wcmDevice = wcmEventAutoDevProbe (pInfo))) + xf86Msg(X_ERROR, "%s: Cannot probe device\n", pInfo->name); - if ((wcmOpen (local) != Success) || (local->fd < 0) || + if ((wcmOpen (pInfo) != Success) || (pInfo->fd < 0) || !common->wcmDevice) { DBG(1, priv, "Failed to open " - "device (fd=%d)\n", local->fd); - if (local->fd >= 0) + "device (fd=%d)\n", pInfo->fd); + if (pInfo->fd >= 0) { DBG(1, priv, "Closing device\n"); - xf86CloseSerial(local->fd); + xf86CloseSerial(pInfo->fd); } - local->fd = -1; + pInfo->fd = -1; return FALSE; } - if (fstat(local->fd, &st) == -1) + if (fstat(pInfo->fd, &st) == -1) { /* can not access major/minor */ DBG(1, priv, "stat failed (%s). " @@ -1109,33 +1109,33 @@ static int wcmDevOpen(DeviceIntPtr pWcm) } else common->min_maj = st.st_rdev; - common->fd = local->fd; + common->fd = pInfo->fd; common->fd_refs = 1; } /* Grab the common descriptor, if it's available */ - if (local->fd < 0) + if (pInfo->fd < 0) { - local->fd = common->fd; + pInfo->fd = common->fd; common->fd_refs++; } - if (!wcmRegisterX11Devices (local)) + if (!wcmRegisterX11Devices (pInfo)) return FALSE; return TRUE; } -static int wcmReady(LocalDevicePtr local) +static int wcmReady(InputInfoPtr pInfo) { #ifdef DEBUG - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; #endif - int n = xf86WaitForInput(local->fd, 0); + int n = xf86WaitForInput(pInfo->fd, 0); DBG(10, priv, "%d numbers of data\n", n); if (n >= 0) return n ? 1 : 0; - xf86Msg(X_ERROR, "%s: select error: %s\n", local->name, strerror(errno)); + xf86Msg(X_ERROR, "%s: select error: %s\n", pInfo->name, strerror(errno)); return 0; } @@ -1144,7 +1144,7 @@ static int wcmReady(LocalDevicePtr local) * Read the device on IO signal ****************************************************************************/ -static void wcmDevReadInput(LocalDevicePtr local) +static void wcmDevReadInput(InputInfoPtr pInfo) { int loop=0; #define MAX_READ_LOOPS 10 @@ -1153,17 +1153,17 @@ static void wcmDevReadInput(LocalDevicePtr local) for (loop=0; loop < MAX_READ_LOOPS; ++loop) { /* verify that there is still data in pipe */ - if (!wcmReady(local)) break; + if (!wcmReady(pInfo)) break; /* dispatch */ - wcmReadPacket(local); + wcmReadPacket(pInfo); } #ifdef DEBUG /* report how well we're doing */ if (loop > 0) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; if (loop >= MAX_READ_LOOPS) DBG(1, priv, "Can't keep up!!!\n"); @@ -1173,13 +1173,13 @@ static void wcmDevReadInput(LocalDevicePtr local) #endif } -void wcmReadPacket(LocalDevicePtr local) +void wcmReadPacket(InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; int len, pos, cnt, remaining; - DBG(10, common, "fd=%d\n", local->fd); + DBG(10, common, "fd=%d\n", pInfo->fd); remaining = sizeof(common->buffer) - common->bufpos; @@ -1187,7 +1187,7 @@ void wcmReadPacket(LocalDevicePtr local) " remaining=%d\n", common->bufpos, remaining); /* fill buffer with as much data as we can handle */ - len = xf86ReadSerial(local->fd, + len = xf86ReadSerial(pInfo->fd, common->buffer + common->bufpos, remaining); if (len <= 0) @@ -1198,10 +1198,10 @@ void wcmReadPacket(LocalDevicePtr local) WacomDevicePtr wDev = common->wcmDevices; for(; wDev; wDev = wDev->next) { - if (wDev->local->fd >= 0) - wcmDevProc(wDev->local->dev, DEVICE_OFF); + if (wDev->pInfo->fd >= 0) + wcmDevProc(wDev->pInfo->dev, DEVICE_OFF); } - xf86Msg(X_ERROR, "%s: Error reading wacom device : %s\n", local->name, strerror(errno)); + xf86Msg(X_ERROR, "%s: Error reading wacom device : %s\n", pInfo->name, strerror(errno)); return; } @@ -1215,7 +1215,7 @@ void wcmReadPacket(LocalDevicePtr local) while (len > 0) { /* parse packet */ - cnt = common->wcmModel->Parse(local, common->buffer + pos, len); + cnt = common->wcmModel->Parse(pInfo, common->buffer + pos, len); if (cnt <= 0) { if (cnt < 0) @@ -1236,10 +1236,10 @@ void wcmReadPacket(LocalDevicePtr local) common->bufpos = len; } -int wcmDevChangeControl(LocalDevicePtr local, xDeviceCtl * control) +int wcmDevChangeControl(InputInfoPtr pInfo, xDeviceCtl * control) { #ifdef DEBUG - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; DBG(3, priv, "\n"); #endif return Success; @@ -1252,8 +1252,8 @@ int wcmDevChangeControl(LocalDevicePtr local, xDeviceCtl * control) static void wcmDevControlProc(DeviceIntPtr device, PtrCtrl* ctrl) { #ifdef DEBUG - LocalDevicePtr local = (LocalDevicePtr)device->public.devicePrivate; - WacomDevicePtr priv = (WacomDevicePtr)local->private; + InputInfoPtr pInfo = (InputInfoPtr)device->public.devicePrivate; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; DBG(4, priv, "called\n"); #endif @@ -1264,16 +1264,16 @@ static void wcmDevControlProc(DeviceIntPtr device, PtrCtrl* ctrl) * wcmDevClose -- ****************************************************************************/ -static void wcmDevClose(LocalDevicePtr local) +static void wcmDevClose(InputInfoPtr pInfo) { - WacomDevicePtr priv = (WacomDevicePtr)local->private; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; DBG(4, priv, "Wacom number of open devices = %d\n", common->fd_refs); - if (local->fd >= 0) + if (pInfo->fd >= 0) { - local->fd = -1; + pInfo->fd = -1; if (!--common->fd_refs) { DBG(1, common, "Closing device; uninitializing.\n"); @@ -1289,8 +1289,8 @@ static void wcmDevClose(LocalDevicePtr local) static int wcmDevProc(DeviceIntPtr pWcm, int what) { - LocalDevicePtr local = (LocalDevicePtr)pWcm->public.devicePrivate; - WacomDevicePtr priv = (WacomDevicePtr)local->private; + InputInfoPtr pInfo = (InputInfoPtr)pWcm->public.devicePrivate; + WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; DBG(2, priv, "BEGIN dev=%p priv=%p " "type=%s flags=%d fd=%d what=%s\n", @@ -1298,7 +1298,7 @@ static int wcmDevProc(DeviceIntPtr pWcm, int what) IsStylus(priv) ? "stylus" : IsCursor(priv) ? "cursor" : IsPad(priv) ? "pad" : "eraser", - priv->flags, local ? local->fd : -1, + priv->flags, pInfo ? pInfo->fd : -1, (what == DEVICE_INIT) ? "INIT" : (what == DEVICE_OFF) ? "OFF" : (what == DEVICE_ON) ? "ON" : @@ -1328,23 +1328,23 @@ static int wcmDevProc(DeviceIntPtr pWcm, int what) return !Success; } priv->wcmDevOpenCount++; - xf86AddEnabledDevice(local); + xf86AddEnabledDevice(pInfo); pWcm->public.on = TRUE; break; case DEVICE_OFF: case DEVICE_CLOSE: - if (local->fd >= 0) + if (pInfo->fd >= 0) { - xf86RemoveEnabledDevice(local); - wcmDevClose(local); + xf86RemoveEnabledDevice(pInfo); + wcmDevClose(pInfo); } pWcm->public.on = FALSE; priv->wcmDevOpenCount = 0; break; default: - xf86Msg(X_ERROR, "%s: wacom unsupported mode=%d\n", local->name, what); + xf86Msg(X_ERROR, "%s: wacom unsupported mode=%d\n", pInfo->name, what); return !Success; break; } /* end switch */ diff --git a/src/xf86Wacom.h b/src/xf86Wacom.h index 2c84744..2db752d 100644 --- a/src/xf86Wacom.h +++ b/src/xf86Wacom.h @@ -91,10 +91,10 @@ struct _WacomModule InputDriverPtr wcmDrv; int (*DevOpen)(DeviceIntPtr pWcm); - void (*DevReadInput)(LocalDevicePtr local); + void (*DevReadInput)(InputInfoPtr pInfo); void (*DevControlProc)(DeviceIntPtr device, PtrCtrl* ctrl); - int (*DevChangeControl)(LocalDevicePtr local, xDeviceCtl* control); - void (*DevClose)(LocalDevicePtr local); + int (*DevChangeControl)(InputInfoPtr pInfo, xDeviceCtl* control); + void (*DevClose)(InputInfoPtr pInfo); int (*DevProc)(DeviceIntPtr pWcm, int what); int (*DevSwitchMode)(ClientPtr client, DeviceIntPtr dev, int mode); }; @@ -119,70 +119,70 @@ struct _WacomModule #define SYSCALL(call) while(((call) == -1) && (errno == EINTR)) /* device autoprobing */ -char *wcmEventAutoDevProbe (LocalDevicePtr local); +char *wcmEventAutoDevProbe (InputInfoPtr pInfo); /* common tablet initialization regime */ -int wcmInitTablet(LocalDevicePtr local, const char* id, float version); +int wcmInitTablet(InputInfoPtr pInfo, const char* id, float version); /* standard packet handler */ -void wcmReadPacket(LocalDevicePtr local); +void wcmReadPacket(InputInfoPtr pInfo); /* handles suppression, filtering, and dispatch. */ void wcmEvent(WacomCommonPtr common, unsigned int channel, const WacomDeviceState* ds); /* dispatches data to XInput event system */ -void wcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds); +void wcmSendEvents(InputInfoPtr pInfo, const WacomDeviceState* ds); /* generic area check for xf86Wacom.c, wcmCommon.c and wcmXCommand.c */ Bool wcmPointInArea(WacomToolAreaPtr area, int x, int y); Bool wcmAreaListOverlap(WacomToolAreaPtr area, WacomToolAreaPtr list); /* calculate the proper tablet to screen mapping factor */ -void wcmMappingFactor(LocalDevicePtr local); +void wcmMappingFactor(InputInfoPtr pInfo); /* validation */ -extern Bool wcmIsAValidType(LocalDevicePtr local, const char* type); +extern Bool wcmIsAValidType(InputInfoPtr pInfo, const char* type); extern Bool wcmIsWacomDevice (char* fname); -extern int wcmIsDuplicate(char* device, LocalDevicePtr local); -extern int wcmDeviceTypeKeys(LocalDevicePtr local); +extern int wcmIsDuplicate(char* device, InputInfoPtr pInfo); +extern int wcmDeviceTypeKeys(InputInfoPtr pInfo); /* hotplug */ -extern int wcmNeedAutoHotplug(LocalDevicePtr local, const char **type); -extern void wcmHotplugOthers(LocalDevicePtr local); -extern int wcmAutoProbeDevice(LocalDevicePtr local); +extern int wcmNeedAutoHotplug(InputInfoPtr pInfo, const char **type); +extern void wcmHotplugOthers(InputInfoPtr pInfo); +extern int wcmAutoProbeDevice(InputInfoPtr pInfo); /* setup */ -extern int wcmParseOptions(LocalDevicePtr local); -extern void wcmInitialCoordinates(LocalDevicePtr local, int axes); -extern void wcmInitialScreens(LocalDevicePtr local); -extern void wcmInitialScreens(LocalDevicePtr local); +extern int wcmParseOptions(InputInfoPtr pInfo); +extern void wcmInitialCoordinates(InputInfoPtr pInfo, int axes); +extern void wcmInitialScreens(InputInfoPtr pInfo); +extern void wcmInitialScreens(InputInfoPtr pInfo); -extern int wcmDevSwitchModeCall(LocalDevicePtr local, int mode); +extern int wcmDevSwitchModeCall(InputInfoPtr pInfo, int mode); extern int wcmDevSwitchMode(ClientPtr client, DeviceIntPtr dev, int mode); /* run-time modifications */ -extern void wcmChangeScreen(LocalDevicePtr local, int value); +extern void wcmChangeScreen(InputInfoPtr pInfo, int value); extern void wcmTilt2R(WacomDeviceStatePtr ds); extern void wcmFingerTapToClick(WacomCommonPtr common); extern void wcmEmitKeycode(DeviceIntPtr keydev, int keycode, int state); -extern void wcmRotateTablet(LocalDevicePtr local, int value); -extern void wcmRotateCoordinates(LocalDevicePtr local, int* x, int* y); -extern void wcmVirtualTabletSize(LocalDevicePtr local); -extern void wcmVirtualTabletPadding(LocalDevicePtr local); -extern void wcmAdjustArea(LocalDevicePtr local, WacomToolAreaPtr area); +extern void wcmRotateTablet(InputInfoPtr pInfo, int value); +extern void wcmRotateCoordinates(InputInfoPtr pInfo, int* x, int* y); +extern void wcmVirtualTabletSize(InputInfoPtr pInfo); +extern void wcmVirtualTabletPadding(InputInfoPtr pInfo); +extern void wcmAdjustArea(InputInfoPtr pInfo, WacomToolAreaPtr area); extern int wcmCheckPressureCurveValues(int x0, int y0, int x1, int y1); /* device properties */ #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3 extern int wcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, BOOL checkonly); -extern void InitWcmDeviceProperties(LocalDevicePtr local); +extern void InitWcmDeviceProperties(InputInfoPtr pInfo); #endif /* Device probing */ -int isdv4ProbeKeys(LocalDevicePtr local); -int usbProbeKeys(LocalDevicePtr local); +int isdv4ProbeKeys(InputInfoPtr pInfo); +int usbProbeKeys(InputInfoPtr pInfo); /****************************************************************************/ #endif /* __XF86WACOM_H */ diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h index baddf1d..e05db83 100644 --- a/src/xf86WacomDefs.h +++ b/src/xf86WacomDefs.h @@ -78,13 +78,13 @@ struct _WacomModel const char* name; void (*Initialize)(WacomCommonPtr common, const char* id, float version); - void (*GetResolution)(LocalDevicePtr local); - int (*GetRanges)(LocalDevicePtr local); - int (*Start)(LocalDevicePtr local); - int (*Parse)(LocalDevicePtr local, const unsigned char* data, int len); + void (*GetResolution)(InputInfoPtr pInfo); + int (*GetRanges)(InputInfoPtr pInfo); + int (*Start)(InputInfoPtr pInfo); + int (*Parse)(InputInfoPtr pInfo, const unsigned char* data, int len); int (*FilterRaw)(WacomCommonPtr common, WacomChannelPtr pChannel, WacomDeviceStatePtr ds); - int (*DetectConfig)(LocalDevicePtr local); + int (*DetectConfig)(InputInfoPtr pInfo); }; /****************************************************************************** @@ -147,7 +147,7 @@ struct _WacomDeviceRec char *name; /* Do not move, same offset as common->wcmDevice */ /* configuration fields */ struct _WacomDeviceRec *next; - LocalDevicePtr local; + InputInfoPtr pInfo; int debugLevel; unsigned int flags; /* various flags (type, abs, touch...) */ @@ -255,7 +255,7 @@ struct _WacomDeviceRec struct _WacomDeviceState { - LocalDevicePtr local; + InputInfoPtr pInfo; int device_id; /* tool id reported from the physical device */ int device_type; unsigned int serial_num; @@ -317,8 +317,8 @@ struct _WacomChannel struct _WacomDeviceClass { - Bool (*Detect)(LocalDevicePtr local); /* detect device */ - Bool (*Init)(LocalDevicePtr local, char* id, float *version); /* initialize device */ + Bool (*Detect)(InputInfoPtr pInfo); /* detect device */ + Bool (*Init)(InputInfoPtr pInfo, char* id, float *version); /* initialize device */ }; extern WacomDeviceClass gWacomUSBDevice; @@ -448,7 +448,7 @@ struct _WacomToolArea int bottomX; /* Bottom X/Y */ int bottomY; - LocalDevicePtr device; /* The InputDevice connected to this area */ + InputInfoPtr device; /* The InputDevice connected to this area */ }; #endif /*__XF86_XF86WACOMDEFS_H */ |