diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2021-11-19 15:50:11 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2021-11-19 21:40:38 +1000 |
commit | a2a33b41f1ae8d918190e3f0bf14c38cc7db8549 (patch) | |
tree | 4492507c5223e697fef6f8d6079202ee562eebe2 | |
parent | b13a40cb9c2015093cc9e12fb1ecc1cedbe8925c (diff) | |
download | xf86-input-wacom-a2a33b41f1ae8d918190e3f0bf14c38cc7db8549.tar.gz |
Require xserver 1.10 as minimum version
Released in 2011 and available in RHEL6.2 and later, this should be
conservative enough. It allows us to drop a bunch of code that requires
older ABIs (anything ABI_XINPUT_VERSION < 12).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | configure.ac | 2 | ||||
-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 | ||||
-rw-r--r-- | test/fake-symbols.c | 51 |
6 files changed, 15 insertions, 177 deletions
diff --git a/configure.ac b/configure.ac index c156604..a2359bf 100644 --- a/configure.ac +++ b/configure.ac @@ -53,7 +53,7 @@ AC_CHECK_LIB([m], [rint]) XPROTOS="xproto xext kbproto inputproto randrproto" # Obtain compiler/linker options from server and required extensions -PKG_CHECK_MODULES(XORG, [xorg-server >= 1.7.0] $XPROTOS) +PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10.0] $XPROTOS) # Obtain compiler/linker options for the xsetwacom tool PKG_CHECK_MODULES(X11, x11 xi xrandr xinerama $XPROTOS) 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; diff --git a/test/fake-symbols.c b/test/fake-symbols.c index 07fa3a4..c8cc676 100644 --- a/test/fake-symbols.c +++ b/test/fake-symbols.c @@ -161,14 +161,11 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev) return; } - -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 11 _X_EXPORT void FreeInputAttributes(InputAttributes *attrs) { return; } -#endif _X_EXPORT void xf86PostButtonEvent(DeviceIntPtr device, @@ -262,10 +259,7 @@ xf86PostButtonEventP(DeviceIntPtr device, int is_down, int first_valuator, int num_valuators, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12 - const -#endif - int *valuators) + const int *valuators) { return; } @@ -279,14 +273,7 @@ InitPtrFeedbackClassDeviceStruct(DeviceIntPtr dev, PtrCtrlProcPtr controlProc) _X_EXPORT int XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type, int format, int mode, unsigned long len, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) > 16 - const void * -#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) > 12 - const pointer -#else - pointer -#endif - value, Bool sendevent) + const void * value, Bool sendevent) { return 0; } @@ -300,9 +287,7 @@ GetTimeInMillis (void) _X_EXPORT int NewInputDeviceRequest (InputOption *options, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 11 InputAttributes *attrs, -#endif DeviceIntPtr *pdev) { return 0; @@ -316,13 +301,11 @@ InitLedFeedbackClassDeviceStruct (DeviceIntPtr dev, LedCtrlProcPtr controlProc) } -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 11 _X_EXPORT InputAttributes* DuplicateInputAttributes(InputAttributes *attrs) { return NULL; } -#endif _X_EXPORT int ValidAtom(Atom atom) @@ -380,10 +363,7 @@ xf86PostMotionEventP(DeviceIntPtr device, int is_absolute, int first_valuator, int num_valuators, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12 - const -#endif - int *valuators) + const int *valuators) { return; } @@ -437,10 +417,7 @@ xf86PostProximityEventP(DeviceIntPtr device, int is_in, int first_valuator, int num_valuators, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12 - const -#endif - int *valuators) + const int *valuators) { return; } @@ -452,26 +429,6 @@ InitFocusClassDeviceStruct(DeviceIntPtr dev) return FALSE; } -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 -void -xf86ProcessCommonOptions(InputInfoPtr pInfo, pointer list) -{ -} - -void -xf86CollectInputOptions(InputInfoPtr pInfo, - const char **defaultOpts, - pointer extraOpts) -{ -} - -InputInfoPtr xf86AllocateInput(InputDriverPtr drv, int flags) -{ - return NULL; -} - -#endif - ClientPtr serverClient; Bool QueueWorkProc ( |