|
@@ -1,42 +1,25 @@
|
|
-fixed compile for xorg 1.7.1
|
|
|
|
--- xf86-input-evtouch-0.8.8.orig/evtouch.c 2008-11-11 09:47:55.000000000 +0100
|
|
--- xf86-input-evtouch-0.8.8.orig/evtouch.c 2008-11-11 09:47:55.000000000 +0100
|
|
-+++ xf86-input-evtouch-0.8.8/evtouch.c 2010-01-06 16:11:16.000000000 +0100
|
|
++++ xf86-input-evtouch-0.8.8/evtouch.c 2010-01-08 17:14:02.000000000 +0100
|
|
-@@ -30,10 +30,10 @@
|
|
+@@ -30,8 +30,8 @@
|
|
|
|
|
|
#define _evdev_touch_C_
|
|
#define _evdev_touch_C_
|
|
|
|
|
|
-#include <xf86Version.h>
|
|
-#include <xf86Version.h>
|
|
-#if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(3,9,0,0,0)
|
|
-#if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(3,9,0,0,0)
|
|
--#define XFREE86_V4
|
|
++#include <xorgVersion.h>
|
|
--#endif
|
|
++#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(3,9,0,0,0)
|
|
-+//#include <xf86Version.h>
|
|
+ #define XFREE86_V4
|
|
-+//#if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(3,9,0,0,0)
|
|
+ #endif
|
|
-+//#define XFREE86_V4
|
|
|
|
-+//#endif
|
|
|
|
-
|
|
|
|
- /*****************************************************************************
|
|
|
|
- * Standard Headers
|
|
|
|
-@@ -88,6 +88,11 @@
|
|
|
|
-
|
|
|
|
- #include <linux/input.h>
|
|
|
|
|
|
|
|
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
|
|
+@@ -74,7 +74,6 @@
|
|
-+#include <X11/Xatom.h>
|
|
+ #include "xf86_OSproc.h"
|
|
-+#include <xserver-properties.h>
|
|
+ #include "xf86Xinput.h"
|
|
-+#endif
|
|
+ #include "exevents.h"
|
|
-+
|
|
+-#include "xf86OSmouse.h"
|
|
- /*****************************************************************************
|
|
+ #include "randrstr.h"
|
|
- * Local Headers
|
|
|
|
- ****************************************************************************/
|
|
|
|
-@@ -132,14 +137,14 @@ InputDriverRec EVTOUCH = {
|
|
|
|
- 0
|
|
|
|
- };
|
|
|
|
|
|
|
|
--#ifdef XFree86LOADER
|
|
+ #ifndef NEED_XF86_TYPES
|
|
-+//#ifdef XFree86LOADER
|
|
+@@ -139,7 +138,7 @@ static XF86ModuleVersionInfo VersionRec
|
|
- static XF86ModuleVersionInfo VersionRec =
|
|
|
|
- {
|
|
|
|
- "evtouch",
|
|
|
|
"Kenan Esau",
|
|
"Kenan Esau",
|
|
MODINFOSTRING1,
|
|
MODINFOSTRING1,
|
|
MODINFOSTRING2,
|
|
MODINFOSTRING2,
|
|
@@ -45,130 +28,98 @@ fixed compile for xorg 1.7.1
|
|
0, 8, 8,
|
|
0, 8, 8,
|
|
ABI_CLASS_XINPUT,
|
|
ABI_CLASS_XINPUT,
|
|
ABI_XINPUT_VERSION,
|
|
ABI_XINPUT_VERSION,
|
|
-@@ -167,9 +172,9 @@ Unplug(pointer p)
|
|
+@@ -167,7 +166,7 @@ Unplug(pointer p)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-XF86ModuleData evtouchModuleData = {&VersionRec, Plug, Unplug };
|
|
-XF86ModuleData evtouchModuleData = {&VersionRec, Plug, Unplug };
|
|
+_X_EXPORT XF86ModuleData evtouchModuleData = {&VersionRec, Plug, Unplug };
|
|
+_X_EXPORT XF86ModuleData evtouchModuleData = {&VersionRec, Plug, Unplug };
|
|
|
|
|
|
--#endif /* XFree86LOADER */
|
|
+ #endif /* XFree86LOADER */
|
|
-+//#endif /* XFree86LOADER */
|
|
+
|
|
-
|
|
+@@ -306,7 +305,7 @@ void EVTouchProcessAbs(EVTouchPrivatePtr
|
|
-
|
|
+ }
|
|
- static const char *default_options[] =
|
|
+
|
|
-@@ -581,6 +586,32 @@ DeviceOff (DeviceIntPtr dev)
|
|
+ if (pos_changed == 1) {
|
|
- }
|
|
+-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2
|
|
-
|
|
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 2
|
|
-
|
|
+ ConvertProc(priv->local, 0, 2,
|
|
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
|
|
+ priv->raw_x, priv->raw_y,
|
|
-+static void xf86WcmInitButtonLabels(Atom *labels, int nlabels)
|
|
+ 0, 0, 0, 0,
|
|
-+{
|
|
+@@ -370,7 +369,7 @@ void EVTouchProcessRel(EVTouchPrivatePtr
|
|
-+ memset(labels, 0, nlabels * sizeof(Atom));
|
|
+ priv->raw_y = priv->min_y;
|
|
-+ switch(nlabels)
|
|
+ }
|
|
-+ {
|
|
+
|
|
-+ default:
|
|
+-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2
|
|
-+ case 7:
|
|
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 2
|
|
-+ labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT);
|
|
+ ConvertProc(priv->local, 0, 2,
|
|
-+ case 6:
|
|
+ priv->raw_x, priv->raw_y,
|
|
-+ labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT);
|
|
+ 0, 0, 0, 0,
|
|
-+ case 5:
|
|
+@@ -591,6 +590,10 @@ DeviceInit (DeviceIntPtr dev)
|
|
-+ labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN);
|
|
|
|
-+ case 4:
|
|
|
|
-+ labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP);
|
|
|
|
-+ case 3:
|
|
|
|
-+ labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
|
|
|
|
-+ case 2:
|
|
|
|
-+ labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
|
|
|
|
-+ case 1:
|
|
|
|
-+ labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
|
|
|
|
-+ break;
|
|
|
|
-+ }
|
|
|
|
-+}
|
|
|
|
-+#endif
|
|
|
|
-+
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- static Bool
|
|
|
|
-@@ -591,12 +622,21 @@ DeviceInit (DeviceIntPtr dev)
|
|
|
|
EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private);
|
|
EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private);
|
|
unsigned char map[EV_MAX_BUTTONS];
|
|
unsigned char map[EV_MAX_BUTTONS];
|
|
int i;
|
|
int i;
|
|
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
|
|
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
|
|
-+ Atom *axis_labels, *btn_labels;
|
|
++ Atom btn_label;
|
|
|
|
++ Atom axis_labels[2] = { 0, 0 };
|
|
+#endif
|
|
+#endif
|
|
|
|
|
|
for (i = 0; i < EV_MAX_BUTTONS; i++)
|
|
for (i = 0; i < EV_MAX_BUTTONS; i++)
|
|
map[i] = i;
|
|
map[i] = i;
|
|
-
|
|
+@@ -629,7 +632,11 @@ DeviceInit (DeviceIntPtr dev)
|
|
- priv->btn_count = EV_MAX_BUTTONS;
|
|
|
|
-
|
|
|
|
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
|
|
|
|
-+ axis_labels = xcalloc(2, sizeof(Atom));
|
|
|
|
-+ btn_labels = xcalloc(EV_MAX_BUTTONS, sizeof(Atom));
|
|
|
|
-+ xf86WcmInitButtonLabels(btn_labels, EV_MAX_BUTTONS);
|
|
|
|
-+#endif
|
|
|
|
-+
|
|
|
|
- /*
|
|
|
|
- * these have to be here instead of in the SetupProc, because when the
|
|
|
|
- * SetupProc is run at server startup, screenInfo is not setup yet
|
|
|
|
-@@ -629,8 +669,18 @@ DeviceInit (DeviceIntPtr dev)
|
|
|
|
/*
|
|
/*
|
|
* Device reports button press for 5 buttons.
|
|
* Device reports button press for 5 buttons.
|
|
*/
|
|
*/
|
|
- if (InitButtonClassDeviceStruct (dev, EV_MAX_BUTTONS, map) == FALSE)
|
|
- if (InitButtonClassDeviceStruct (dev, EV_MAX_BUTTONS, map) == FALSE)
|
|
+ if (InitButtonClassDeviceStruct (dev, EV_MAX_BUTTONS,
|
|
+ if (InitButtonClassDeviceStruct (dev, EV_MAX_BUTTONS,
|
|
-+
|
|
|
|
-+ #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
|
|
|
|
-+ btn_labels,
|
|
|
|
-+ #endif
|
|
|
|
-+ map) == FALSE)
|
|
|
|
- {
|
|
|
|
-+
|
|
|
|
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
|
|
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
|
|
-+ xfree(btn_labels);
|
|
++ &btn_label,
|
|
+#endif
|
|
+#endif
|
|
-+
|
|
++ map) == FALSE)
|
|
|
|
+ {
|
|
ErrorF("Unable to allocate EVTouch touchscreen ButtonClassDeviceStruct\n");
|
|
ErrorF("Unable to allocate EVTouch touchscreen ButtonClassDeviceStruct\n");
|
|
return BadAlloc;
|
|
return BadAlloc;
|
|
- }
|
|
+@@ -653,28 +660,34 @@ DeviceInit (DeviceIntPtr dev)
|
|
-@@ -653,7 +703,12 @@ DeviceInit (DeviceIntPtr dev)
|
|
|
|
* Device reports motions on 2 axes in absolute coordinates.
|
|
* Device reports motions on 2 axes in absolute coordinates.
|
|
* Axes min and max values are reported in raw coordinates.
|
|
* Axes min and max values are reported in raw coordinates.
|
|
*/
|
|
*/
|
|
- if (InitValuatorClassDeviceStruct(dev, 2, xf86GetMotionEvents,
|
|
- if (InitValuatorClassDeviceStruct(dev, 2, xf86GetMotionEvents,
|
|
-+ if (InitValuatorClassDeviceStruct(dev, 2,
|
|
+- local->history_size, Absolute) == FALSE)
|
|
|
|
++ if (InitValuatorClassDeviceStruct(dev, 2,
|
|
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
|
|
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
|
|
-+ axis_labels,
|
|
++ axis_labels,
|
|
+#endif
|
|
+#endif
|
|
-+
|
|
++ local->history_size, Absolute) == FALSE)
|
|
-+// xf86GetMotionEvents,
|
|
|
|
- local->history_size, Absolute) == FALSE)
|
|
|
|
{
|
|
{
|
|
ErrorF ("Unable to allocate EVTouch touchscreen ValuatorClassDeviceStruct\n");
|
|
ErrorF ("Unable to allocate EVTouch touchscreen ValuatorClassDeviceStruct\n");
|
|
-@@ -672,7 +727,24 @@ DeviceInit (DeviceIntPtr dev)
|
|
+ return !Success;
|
|
- EV_AXIS_MAX_RES /* max_res */ );
|
|
+ }
|
|
- xf86InitValuatorDefaults(dev, 1);
|
|
+
|
|
- #else
|
|
+-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2
|
|
-- xf86InitValuatorAxisStruct(dev, 0, priv->min_x, priv->max_x,
|
|
+- xf86InitValuatorAxisStruct(dev, 0, 0, priv->screen_width,
|
|
+ xf86InitValuatorAxisStruct(dev, 0,
|
|
+ xf86InitValuatorAxisStruct(dev, 0,
|
|
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
|
|
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
|
|
-+ XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X),
|
|
++ axis_labels[0],
|
|
+#endif
|
|
+#endif
|
|
-+ 0, priv->screen_width,
|
|
++ 0, priv->screen_width,
|
|
-+ 1024,
|
|
+ 1024,
|
|
-+ EV_AXIS_MIN_RES /* min_res */ ,
|
|
+ EV_AXIS_MIN_RES /* min_res */ ,
|
|
-+ EV_AXIS_MAX_RES /* max_res */ );
|
|
+ EV_AXIS_MAX_RES /* max_res */ );
|
|
-+ xf86InitValuatorDefaults(dev, 0);
|
|
+ xf86InitValuatorDefaults(dev, 0);
|
|
-+
|
|
+- xf86InitValuatorAxisStruct(dev, 1, 0, priv->screen_height,
|
|
-+ xf86InitValuatorAxisStruct(dev, 1,
|
|
++ xf86InitValuatorAxisStruct(dev, 1,
|
|
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
|
|
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
|
|
-+ XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y),
|
|
++ axis_labels[1],
|
|
+#endif
|
|
+#endif
|
|
-+ 0, priv->screen_width,
|
|
++ 0, priv->screen_height,
|
|
-+ 1024,
|
|
+ 1024,
|
|
-+ EV_AXIS_MIN_RES /* min_res */ ,
|
|
+ EV_AXIS_MIN_RES /* min_res */ ,
|
|
-+ EV_AXIS_MAX_RES /* max_res */ );
|
|
+ EV_AXIS_MAX_RES /* max_res */ );
|
|
xf86InitValuatorDefaults(dev, 1);
|
|
xf86InitValuatorDefaults(dev, 1);
|
|
- #endif
|
|
+-#else
|
|
|
|
+- xf86InitValuatorAxisStruct(dev, 0, priv->min_x, priv->max_x,
|
|
|
|
+- xf86InitValuatorDefaults(dev, 1);
|
|
|
|
+-#endif
|
|
|
|
|
|
|
|
+ /* Initial position of pointer on screen: Centered */
|
|
|
|
+ priv->cur_x=(priv->max_x - priv->min_x)/2;
|