From: lars Date: Mon, 19 Oct 2009 20:02:25 +0000 (+0000) Subject: Make tslib compile with xserver-1.7 X-Git-Url: http://207.154.207.93/?a=commitdiff_plain;h=b35b2e9a6ba409995387f686419eea661d37c81c;p=packages.git Make tslib compile with xserver-1.7 git-svn-id: svn://svn.openwrt.org/openwrt/packages@18080 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- 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 000000000..d96e32358 --- /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"); +