diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/bsd_mouse.c | 8 | ||||
-rw-r--r-- | src/hurd_mouse.c | 13 | ||||
-rw-r--r-- | src/mouse.c | 99 | ||||
-rw-r--r-- | src/mouse.h | 6 | ||||
-rw-r--r-- | src/sun_mouse.c | 3 |
6 files changed, 7 insertions, 124 deletions
diff --git a/configure.ac b/configure.ac index 5e2ff20..87a8a57 100644 --- a/configure.ac +++ b/configure.ac @@ -48,7 +48,7 @@ XORG_WITH_LINT AC_CHECK_FUNCS([asprintf timingsafe_memcmp]) # Obtain compiler/linker options from server and required extensions -PKG_CHECK_MODULES(XORG, [xorg-server >= 1.7] xproto inputproto) +PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10] xproto inputproto) # Define a configure option for an alternate input module directory AC_ARG_WITH(xorg-module-dir, diff --git a/src/bsd_mouse.c b/src/bsd_mouse.c index e48cc72..3df7691 100644 --- a/src/bsd_mouse.c +++ b/src/bsd_mouse.c @@ -480,9 +480,6 @@ wsconsPreInit(InputInfoPtr pInfo, const char *protocol, int flags) pInfo->read_input = wsconsReadInput; pMse->xisbscale = sizeof(struct wscons_event); -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 - pInfo->flags |= XI86_CONFIGURED; -#endif return TRUE; } #endif @@ -658,7 +655,7 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags) xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol); /* Collect the options, and process the common options. */ - COLLECT_INPUT_OPTIONS(pInfo, NULL); + xf86CollectInputOptions(pInfo, NULL); xf86ProcessCommonOptions(pInfo, pInfo->options); /* Check if the device can be opened. */ @@ -751,9 +748,6 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags) pInfo->device_control = usbMouseProc; pInfo->read_input = usbReadInput; -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 - pInfo->flags |= XI86_CONFIGURED; -#endif return TRUE; } #endif /* USBMOUSE */ diff --git a/src/hurd_mouse.c b/src/hurd_mouse.c index 2b0d786..3bf95a0 100644 --- a/src/hurd_mouse.c +++ b/src/hurd_mouse.c @@ -144,15 +144,7 @@ OsMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags) xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol); /* Collect the options, and process the common options. */ -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 - /* need some special handling here. xf86CollectInputOptions will reset - * pInfo->options. To re-merge the previously set arguments, pass the - * original pInfo->options in. - */ - xf86CollectInputOptions(pInfo, NULL, pInfo->options); -#else - COLLECT_INPUT_OPTIONS(pInfo, NULL); -#endif + xf86CollectInputOptions(pInfo, NULL); xf86ProcessCommonOptions(pInfo, pInfo->options); /* Check if the device can be opened. */ @@ -175,9 +167,6 @@ OsMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags) /* Setup the local procs. */ pInfo->read_input = OsMouseReadInput; -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 - pInfo->flags |= XI86_CONFIGURED; -#endif return TRUE; } diff --git a/src/mouse.c b/src/mouse.c index 1579555..849d664 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -80,13 +80,6 @@ #include "mousePriv.h" #include "mipointer.h" -/* Xorg >= 1.10 provides an asprintf() implementation even if libc doesn't */ -#include "xorgVersion.h" -#if defined(HAVE_ASPRINTF) || \ - (XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,10,0,0,0)) -# define USE_ASPRINTF -#endif - enum { /* number of bits in mapped nibble */ NIB_BITS=4, @@ -141,12 +134,7 @@ typedef struct _DragLockRec { #define WAKEUP_HANDLER_ARGS void *data, int i, pointer LastSelectMask #endif -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 -static InputInfoPtr MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags); -#else static int MousePreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags); -#endif - static int MouseProc(DeviceIntPtr device, int what); static void MouseCtrl(DeviceIntPtr device, PtrCtrl *ctrl); static void MousePostEvent(InputInfoPtr pInfo, int buttons, @@ -182,12 +170,10 @@ _X_EXPORT InputDriverRec MOUSE = { .PreInit = MousePreInit, .UnInit = NULL, .module = NULL, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12 .default_options = NULL, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 21 .capabilities = 0 #endif -#endif }; #define RETRY_COUNT 4 @@ -477,21 +463,13 @@ MouseCommonOptions(InputInfoPtr pInfo) b4 > 0 && b4 <= MSE_MAXBUTTONS) { pMse->negativeW = 1 << (b3-1); pMse->positiveW = 1 << (b4-1); -#ifdef USE_ASPRINTF if (asprintf(&msg, "buttons %d, %d, %d and %d", b1, b2, b3, b4) == -1) msg = NULL; -#else - msg = Xprintf("buttons %d, %d, %d and %d", b1, b2, b3, b4); -#endif } else { -#ifdef USE_ASPRINTF if (asprintf(&msg, "buttons %d and %d", b1, b2) == -1) msg = NULL; -#else - msg = Xprintf("buttons %d and %d", b1, b2); -#endif } if (b1 > pMse->buttons) pMse->buttons = b1; if (b2 > pMse->buttons) pMse->buttons = b2; @@ -546,12 +524,8 @@ MouseCommonOptions(InputInfoPtr pInfo) if ((sscanf(s, "%d %d", &b1, &b2) == 2) && b1 > 0 && b1 <= MSE_MAXBUTTONS && b2 > 0 && b2 <= MSE_MAXBUTTONS) { -#ifdef USE_ASPRINTF if (asprintf(&msg, "buttons %d and %d", b1, b2) == -1) msg = NULL; -#else - msg = Xprintf("buttons %d and %d", b1, b2); -#endif pMse->negativeX = b1; pMse->positiveX = b2; if (b1 > pMse->buttons) pMse->buttons = b1; @@ -574,12 +548,8 @@ MouseCommonOptions(InputInfoPtr pInfo) if ((sscanf(s, "%d %d", &b1, &b2) == 2) && b1 > 0 && b1 <= MSE_MAXBUTTONS && b2 > 0 && b2 <= MSE_MAXBUTTONS) { -#ifdef USE_ASPRINTF if (asprintf(&msg, "buttons %d and %d", b1, b2) == -1) msg = NULL; -#else - msg = Xprintf("buttons %d and %d", b1, b2); -#endif pMse->negativeY = b1; pMse->positiveY = b2; if (b1 > pMse->buttons) pMse->buttons = b1; @@ -649,12 +619,8 @@ MouseCommonOptions(InputInfoPtr pInfo) if ((sscanf(s, "%d %d", &b1, &b2) == 2) && (b1 > 0) && (b1 <= MSE_MAXBUTTONS) && (b2 > 0) && (b2 <= MSE_MAXBUTTONS)) { -#ifdef USE_ASPRINTF if (asprintf(&msg, "buttons %d and %d", b1, b2) == -1) msg = NULL; -#else - msg = Xprintf("buttons %d and %d", b1, b2); -#endif pMse->doubleClickTargetButton = b1; pMse->doubleClickTargetButtonMask = 1 << (b1 - 1); pMse->doubleClickSourceButtonMask = 1 << (b2 - 1); @@ -905,49 +871,8 @@ MousePickProtocol(InputInfoPtr pInfo, const char* device, return protocol; } -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 -static int NewMousePreInit(InputDriverPtr drv, InputInfoPtr pInfo, - int flags); - -static InputInfoPtr -MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags) -{ - InputInfoPtr pInfo; - - if (!(pInfo = xf86AllocateInput(drv, 0))) - return NULL; - - pInfo->name = dev->identifier; - pInfo->flags = XI86_SEND_DRAG_EVENTS; - pInfo->conf_idev = dev; - pInfo->close_proc = NULL; - pInfo->private_flags = 0; - pInfo->always_core_feedback = NULL; - - COLLECT_INPUT_OPTIONS(pInfo, NULL); - - if (NewMousePreInit(drv, pInfo, flags) == Success) - { - /* Check if SendDragEvents has been disabled. */ - if (!xf86SetBoolOption(dev->commonOptions, "SendDragEvents", TRUE)) - pInfo->flags &= ~XI86_SEND_DRAG_EVENTS; - - pInfo->flags |= XI86_CONFIGURED; - - return pInfo; - } - - xf86DeleteInput(pInfo, 0); - - return NULL; -} - -static int -NewMousePreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) -#else static int MousePreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) -#endif { MouseDevPtr pMse; mousePrivPtr mPriv; @@ -1022,15 +947,7 @@ MousePreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) pMse->autoProbe = FALSE; /* Collect the options, and process the common options. */ -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 - /* need some special handling here. xf86CollectInputOptions will reset - * pInfo->options if the second argument is not-null. To re-merge the - * previously set arguments, pass the original pInfo->options in. - */ - xf86CollectInputOptions(pInfo, pProto->defaults, pInfo->options); -#else - COLLECT_INPUT_OPTIONS(pInfo, pProto->defaults); -#endif + xf86CollectInputOptions(pInfo, pProto->defaults); xf86ProcessCommonOptions(pInfo, pInfo->options); /* Check if the device can be opened. */ @@ -1749,20 +1666,12 @@ MouseProc(DeviceIntPtr device, int what) /* X valuator */ xf86InitValuatorAxisStruct(device, 0, axes_labels[0], - -1, -1, 1, 0, 1 -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12 - , Relative -#endif - ); + -1, -1, 1, 0, 1, Relative); xf86InitValuatorDefaults(device, 0); /* Y valuator */ xf86InitValuatorAxisStruct(device, 1, axes_labels[1], - -1, -1, 1, 0, 1 -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12 - , Relative -#endif - ); + -1, -1, 1, 0, 1, Relative); xf86InitValuatorDefaults(device, 1); #ifdef EXTMOUSEDEBUG @@ -2783,7 +2692,7 @@ initMouseHW(InputInfoPtr pInfo) usleep(100000); /* Set the parameters up for the MM series protocol. */ options = pInfo->options; - COLLECT_INPUT_OPTIONS(pInfo, mmDefaults); + xf86CollectInputOptions(pInfo, mmDefaults); xf86SetSerial(pInfo->fd, pInfo->options); pInfo->options = options; diff --git a/src/mouse.h b/src/mouse.h index e1165f2..e0cff9e 100644 --- a/src/mouse.h +++ b/src/mouse.h @@ -32,12 +32,6 @@ #include "xf86Xinput.h" -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 -#define COLLECT_INPUT_OPTIONS(pInfo, options) xf86CollectInputOptions((pInfo), (options), NULL) -#else -#define COLLECT_INPUT_OPTIONS(pInfo, options) xf86CollectInputOptions((pInfo), (options)) -#endif - #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 18 #define LogMessageVerbSigSafe LogMessageVerb #endif diff --git a/src/sun_mouse.c b/src/sun_mouse.c index 20ec10d..45c13d6 100644 --- a/src/sun_mouse.c +++ b/src/sun_mouse.c @@ -254,9 +254,6 @@ vuidPreInit(InputInfoPtr pInfo, const char *protocol, int flags) pVuidMse->next = vuidMouseList; vuidMouseList = pVuidMse; -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 - pInfo->flags |= XI86_CONFIGURED; -#endif return TRUE; } |