From: Lars-Peter Clausen Date: Mon, 19 Oct 2009 20:02:25 +0000 (+0000) Subject: Make tslib compile with xserver-1.7 X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;h=7d315a346d20ab7f2338308b7207e87f616bcd0a Make tslib compile with xserver-1.7 SVN-Revision: 18080 --- diff --git a/Xorg/driver/xf86-input-tslib/patches/030-xserver-1.7.patch b/Xorg/driver/xf86-input-tslib/patches/030-xserver-1.7.patch new file mode 100644 index 0000000000..d96e32358f --- /dev/null +++ b/Xorg/driver/xf86-input-tslib/patches/030-xserver-1.7.patch @@ -0,0 +1,91 @@ +--- a/src/tslib.c ++++ b/src/tslib.c +@@ -49,6 +49,7 @@ + #include + #include + #include ++#include + + #include + +@@ -211,6 +212,15 @@ xf86TslibControlProc(DeviceIntPtr device, int what) + unsigned char map[MAXBUTTONS + 1]; + int i; + struct ts_priv *priv; ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 ++ Atom buttons[MAXBUTTONS]; ++ Atom axes[2]; ++ ++ axes[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X); ++ axes[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y); ++ ++ buttons[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); ++#endif + + #ifdef DEBUG + ErrorF("%s\n", __FUNCTION__); +@@ -226,33 +236,45 @@ xf86TslibControlProc(DeviceIntPtr device, int what) + map[i + 1] = i + 1; + } + +- if (InitButtonClassDeviceStruct(device, +- MAXBUTTONS, map) == FALSE) { ++ if (InitButtonClassDeviceStruct(device, MAXBUTTONS, ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 ++ buttons, ++#endif ++ map) == FALSE) { + ErrorF("unable to allocate Button class device\n"); + return !Success; + } + +- if (InitValuatorClassDeviceStruct(device, +- 2, +-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3 +- xf86GetMotionEvents, ++ if (InitValuatorClassDeviceStruct(device, 2, ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 ++ axes, ++#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3 ++ xf86GetMotionEvents, + #endif +- 0, Absolute) == FALSE) { ++ 0, Absolute) == FALSE) { + ErrorF("unable to allocate Valuator class device\n"); + return !Success; + } + +- InitValuatorAxisStruct(device, 0, 0, /* min val */ +- priv->width - 1, /* max val */ +- priv->width, /* resolution */ +- 0, /* min_res */ +- priv->width); /* max_res */ +- +- InitValuatorAxisStruct(device, 1, 0, /* min val */ +- priv->height - 1,/* max val */ +- priv->height, /* resolution */ +- 0, /* min_res */ +- priv->height); /* max_res */ ++ InitValuatorAxisStruct(device, 0, ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 ++ axes[0], ++#endif ++ 0, /* min val */ ++ priv->width - 1, /* max val */ ++ priv->width, /* resolution */ ++ 0, /* min_res */ ++ priv->width); /* max_res */ ++ ++ InitValuatorAxisStruct(device, 1, ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 ++ axes[1], ++#endif ++ 0, /* min val */ ++ priv->height - 1, /* max val */ ++ priv->height, /* resolution */ ++ 0, /* min_res */ ++ priv->height); /* max_res */ + + if (InitProximityClassDeviceStruct (device) == FALSE) { + ErrorF ("Unable to allocate EVTouch touchscreen ProximityClassDeviceStruct\n"); +