diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/wcmCommon.c | 37 | ||||
-rw-r--r-- | src/wcmConfig.c | 61 | ||||
-rw-r--r-- | src/wcmValidateDevice.c | 21 | ||||
-rw-r--r-- | src/xf86Wacom.c | 20 |
4 files changed, 10 insertions, 129 deletions
diff --git a/src/wcmCommon.c b/src/wcmCommon.c index 15997dd..b60e77b 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -33,22 +33,6 @@ struct _WacomDriverRec WACOM_DRIVER = { .active = NULL, }; -/* X servers pre 1.9 didn't copy data passed into xf86Post*Event. - * Data passed in would be modified, requiring the driver to copy the - * data beforehand. - */ -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 11 -static int v[MAX_VALUATORS]; -static int *VCOPY(const int *valuators, int nvals) -{ - memcpy(v, valuators, nvals * sizeof(int)); - return v; -} -#else /* ABI >= 11 */ -#define VCOPY(vals, nval) (vals) -#endif - - /***************************************************************************** * Static functions @@ -288,7 +272,7 @@ static void sendAction(InputInfoPtr pInfo, const WacomDeviceState* ds, xf86PostButtonEventP(pInfo->dev, is_absolute(pInfo), btn_no, is_press, first_val, num_val, - VCOPY(valuators, num_val)); + valuators); } } break; @@ -332,7 +316,7 @@ static void sendAction(InputInfoPtr pInfo, const WacomDeviceState* ds, xf86PostButtonEventP(pInfo->dev, is_absolute(pInfo), btn_no, 0, first_val, num_val, - VCOPY(valuators, num_val)); + valuators); } break; case AC_KEY: @@ -619,7 +603,7 @@ wcmSendPadEvents(InputInfoPtr pInfo, const WacomDeviceState* ds, WacomDevicePtr priv = (WacomDevicePtr) pInfo->private; if (!priv->oldState.proximity && ds->proximity) - xf86PostProximityEventP(pInfo->dev, 1, first_val, num_vals, VCOPY(valuators, num_vals)); + xf86PostProximityEventP(pInfo->dev, 1, first_val, num_vals, valuators); for (i = 0; i < num_vals; i++) if (valuators[i]) @@ -632,8 +616,7 @@ wcmSendPadEvents(InputInfoPtr pInfo, const WacomDeviceState* ds, /* xf86PostMotionEvent is only needed to post the valuators * It should NOT move the cursor. */ - xf86PostMotionEventP(pInfo->dev, TRUE, first_val, num_vals, - VCOPY(valuators, num_vals)); + xf86PostMotionEventP(pInfo->dev, TRUE, first_val, num_vals, valuators); } else { @@ -644,8 +627,7 @@ wcmSendPadEvents(InputInfoPtr pInfo, const WacomDeviceState* ds, wcmSendKeys(pInfo, ds->keys, priv->oldState.keys); if (priv->oldState.proximity && !ds->proximity) - xf86PostProximityEventP(pInfo->dev, 0, first_val, num_vals, - VCOPY(valuators, num_vals)); + xf86PostProximityEventP(pInfo->dev, 0, first_val, num_vals, valuators); } /* Send events for all tools but pads */ @@ -678,16 +660,14 @@ wcmSendNonPadEvents(InputInfoPtr pInfo, const WacomDeviceState *ds, { /* don't emit proximity events if device does not support proximity */ if ((pInfo->dev->proximity && !priv->oldState.proximity)) - xf86PostProximityEventP(pInfo->dev, 1, first_val, num_vals, - VCOPY(valuators, num_vals)); + xf86PostProximityEventP(pInfo->dev, 1, first_val, num_vals, valuators); /* Move the cursor to where it should be before sending button events */ if(!(priv->flags & BUTTONS_ONLY_FLAG) && !(priv->flags & SCROLLMODE_FLAG && (!is_absolute(pInfo) || priv->oldState.buttons & 1))) { xf86PostMotionEventP(pInfo->dev, is_absolute(pInfo), - first_val, num_vals, - VCOPY(valuators, num_vals)); + first_val, num_vals, valuators); /* For relative events, do not repost * the valuators. Otherwise, a button * event in sendCommonEvents will move the @@ -712,8 +692,7 @@ wcmSendNonPadEvents(InputInfoPtr pInfo, const WacomDeviceState *ds, wcmSendButtons(pInfo, ds, buttons, first_val, num_vals, valuators); if (priv->oldState.proximity) - xf86PostProximityEventP(pInfo->dev, 0, first_val, num_vals, - VCOPY(valuators, num_vals)); + xf86PostProximityEventP(pInfo->dev, 0, first_val, num_vals, valuators); } /* not in proximity */ } diff --git a/src/wcmConfig.c b/src/wcmConfig.c index 50df00e..63ec29b 100644 --- a/src/wcmConfig.c +++ b/src/wcmConfig.c @@ -240,34 +240,6 @@ static void wcmUninit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) if (WACOM_DRIVER.active == priv) WACOM_DRIVER.active = NULL; - /* Server 1.10 will UnInit all devices for us */ -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 - if (priv->isParent) - { - /* HAL removal sees the parent device removed first. */ - WacomDevicePtr next; - dev = priv->common->wcmDevices; - - xf86Msg(X_INFO, "%s: removing automatically added devices.\n", - pInfo->name); - - while(dev) - { - next = dev->next; - if (!dev->isParent) - { - xf86Msg(X_INFO, "%s: removing dependent device '%s'\n", - pInfo->name, dev->pInfo->name); - DeleteInputDeviceRequest(dev->pInfo->dev); - } - dev = next; - } - - free(pInfo->name); - pInfo->name = NULL; - } -#endif - if (priv->tool) { WacomToolPtr *prev_tool = &common->wcmTool; @@ -567,38 +539,7 @@ static int wcmIsHotpluggedDevice(InputInfoPtr pInfo) /* wcmPreInit - called for each input devices with the driver set to * "wacom" */ -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 -static int NewWcmPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags); - -static InputInfoPtr wcmPreInit(InputDriverPtr drv, IDevPtr dev, int flags) -{ - InputInfoPtr pInfo = NULL; - - if (!(pInfo = xf86AllocateInput(drv, 0))) - return NULL; - - pInfo->conf_idev = dev; - pInfo->name = dev->identifier; - - /* Force default port options to exist because the init - * phase is based on those values. - */ - xf86CollectInputOptions(pInfo, (const char**)default_options, NULL); - xf86ProcessCommonOptions(pInfo, pInfo->options); - - if (NewWcmPreInit(drv, pInfo, flags) == Success) { - pInfo->flags |= XI86_CONFIGURED; - return pInfo; - } else { - xf86DeleteInput(pInfo, 0); - return NULL; - } -} - -static int NewWcmPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) -#else static int wcmPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) -#endif { WacomDevicePtr priv = NULL; WacomCommonPtr common = NULL; @@ -724,9 +665,7 @@ static InputDriverRec WACOM = wcmPreInit, /* pre-init */ wcmUninit, /* un-init */ NULL, /* module */ -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12 default_options, -#endif #ifdef XI86_DRV_CAP_SERVER_FD XI86_DRV_CAP_SERVER_FD, #endif diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c index bc48656..22e537c 100644 --- a/src/wcmValidateDevice.c +++ b/src/wcmValidateDevice.c @@ -486,17 +486,7 @@ static InputOption *wcmOptionDupConvert(InputInfoPtr pInfo, const char* basename pointer options, o; int rc; -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12 options = xf86OptionListDuplicate(original); -#else - { - InputInfoRec dummy; - - memset(&dummy, 0, sizeof(dummy)); - xf86CollectInputOptions(&dummy, NULL, original); - options = dummy.options; - } -#endif if (serial > -1) { while (ser->serial && ser->serial != serial) @@ -533,8 +523,6 @@ static InputOption *wcmOptionDupConvert(InputInfoPtr pInfo, const char* basename return iopts; } - -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 11 /** * Duplicate the attributes of the given device. "product" gets the type * appended, so a device of product "Wacom" will then have a product "Wacom @@ -553,7 +541,6 @@ static InputAttributes* wcmDuplicateAttributes(InputInfoPtr pInfo, attr->product = (rc != -1) ? product : NULL; return attr; } -#endif /** * This struct contains the necessary info for hotplugging a device later. @@ -561,9 +548,7 @@ static InputAttributes* wcmDuplicateAttributes(InputInfoPtr pInfo, */ typedef struct { InputOption *input_options; -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 9 InputAttributes *attrs; -#endif } WacomHotplugInfo; /** @@ -586,9 +571,7 @@ wcmHotplugDevice(ClientPtr client, pointer closure ) #endif NewInputDeviceRequest(hotplug_info->input_options, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 9 hotplug_info->attrs, -#endif &dev); #if HAVE_THREADED_INPUT input_unlock(); @@ -596,9 +579,7 @@ wcmHotplugDevice(ClientPtr client, pointer closure ) input_option_free_list(&hotplug_info->input_options); -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 11 FreeInputAttributes(hotplug_info->attrs); -#endif free(hotplug_info); return TRUE; @@ -633,9 +614,7 @@ static void wcmQueueHotplug(InputInfoPtr pInfo, const char* basename, const char } hotplug_info->input_options = wcmOptionDupConvert(pInfo, basename, type, serial); -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 11 hotplug_info->attrs = wcmDuplicateAttributes(pInfo, type); -#endif QueueWorkProc(wcmHotplugDevice, serverClient, hotplug_info); } diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c index 738e35a..b655bbb 100644 --- a/src/xf86Wacom.c +++ b/src/xf86Wacom.c @@ -47,13 +47,9 @@ #include <xf86_OSproc.h> #include <exevents.h> /* Needed for InitValuator/Proximity stuff */ -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 #include <xserver-properties.h> #include <X11/extensions/XKB.h> #include <xkbsrv.h> -#else -#define XIGetKnownProperty(prop) 0 -#endif #ifndef XI86_SERVER_FD #define XI86_SERVER_FD 0x20 @@ -133,13 +129,9 @@ wcmInitialToolSize(InputInfoPtr pInfo) static void wcmInitAxis(DeviceIntPtr dev, int axis, Atom label, int min, int max, int res, int min_res, int max_res, int mode) { InitValuatorAxisStruct(dev, axis, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 label, -#endif - min, max, res, min_res, max_res -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12 - ,mode -#endif + min, max, res, min_res, max_res, + mode ); } @@ -320,10 +312,8 @@ static int wcmDevInit(DeviceIntPtr pWcm) unsigned char butmap[WCM_MAX_BUTTONS+1]; int nbaxes, nbbuttons, nbkeys; int loop; -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 Atom btn_labels[WCM_MAX_BUTTONS] = {0}; Atom axis_labels[MAX_VALUATORS] = {0}; -#endif /* Detect tablet configuration, if possible */ if (priv->common->wcmModel->DetectConfig) @@ -351,9 +341,7 @@ static int wcmDevInit(DeviceIntPtr pWcm) /* FIXME: button labels would be nice */ 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", pInfo->name); @@ -385,9 +373,7 @@ static int wcmDevInit(DeviceIntPtr pWcm) /* axis_labels is just zeros, we set up each valuator with the * correct property later */ if (InitValuatorClassDeviceStruct(pInfo->dev, nbaxes, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 axis_labels, -#endif GetMotionHistorySize(), (is_absolute(pInfo) ? Absolute : Relative) | OutOfProximity) == FALSE) { @@ -396,12 +382,10 @@ static int wcmDevInit(DeviceIntPtr pWcm) } -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 if (!InitKeyboardDeviceStruct(pInfo->dev, NULL, NULL, wcmKbdCtrlCallback)) { xf86Msg(X_ERROR, "%s: unable to init kbd device struct\n", pInfo->name); return FALSE; } -#endif if(InitLedFeedbackClassDeviceStruct (pInfo->dev, wcmKbdLedCallback) == FALSE) { xf86Msg(X_ERROR, "%s: unable to init led feedback device struct\n", pInfo->name); return FALSE; |