summaryrefslogtreecommitdiff
path: root/package/xf86-input-evtouch/patches/patch-evtouch_c
blob: a0fe4919e1ab07a3e4a4f835dc22078f23fb6128 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
--- 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-08 17:14:02.000000000 +0100
@@ -30,8 +30,8 @@
 
 #define _evdev_touch_C_
 
-#include <xf86Version.h>
-#if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(3,9,0,0,0)
+#include <xorgVersion.h>
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(3,9,0,0,0)
 #define XFREE86_V4
 #endif
 
@@ -74,7 +74,6 @@
 #include "xf86_OSproc.h"
 #include "xf86Xinput.h"
 #include "exevents.h"
-#include "xf86OSmouse.h"
 #include "randrstr.h"
 
 #ifndef NEED_XF86_TYPES
@@ -139,7 +138,7 @@ static XF86ModuleVersionInfo VersionRec 
         "Kenan Esau",
         MODINFOSTRING1,
         MODINFOSTRING2,
-        XF86_VERSION_CURRENT,
+        XORG_VERSION_CURRENT,
         0, 8, 8,
         ABI_CLASS_XINPUT,
         ABI_XINPUT_VERSION,
@@ -167,7 +166,7 @@ Unplug(pointer p)
 }
 
 
-XF86ModuleData evtouchModuleData = {&VersionRec, Plug, Unplug };
+_X_EXPORT XF86ModuleData evtouchModuleData = {&VersionRec, Plug, Unplug };
 
 #endif /* XFree86LOADER */
 
@@ -306,7 +305,7 @@ void EVTouchProcessAbs(EVTouchPrivatePtr
 	}
 
         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, 
                             priv->raw_x, priv->raw_y,
                             0, 0, 0, 0, 
@@ -370,7 +369,7 @@ void EVTouchProcessRel(EVTouchPrivatePtr
                         priv->raw_y = priv->min_y;
         }
 
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 2
         ConvertProc(priv->local, 0, 2,
                     priv->raw_x, priv->raw_y,
                     0, 0, 0, 0,
@@ -591,6 +590,10 @@ DeviceInit (DeviceIntPtr dev)
         EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private);
         unsigned char map[EV_MAX_BUTTONS];
         int i;
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+        Atom btn_label;
+        Atom axis_labels[2] = { 0, 0 };
+#endif
 
         for (i = 0; i < EV_MAX_BUTTONS; i++)
                 map[i] = i;
@@ -629,7 +632,11 @@ DeviceInit (DeviceIntPtr dev)
         /* 
          * Device reports button press for 5 buttons.
          */
-        if (InitButtonClassDeviceStruct (dev, EV_MAX_BUTTONS, map) == FALSE)
+        if (InitButtonClassDeviceStruct (dev, EV_MAX_BUTTONS,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+                 &btn_label,
+#endif
+                 map) == FALSE)
         {
                 ErrorF("Unable to allocate EVTouch touchscreen ButtonClassDeviceStruct\n");
                 return BadAlloc;
@@ -653,28 +660,34 @@ DeviceInit (DeviceIntPtr dev)
          * Device reports motions on 2 axes in absolute coordinates.
          * Axes min and max values are reported in raw coordinates.
          */
-        if (InitValuatorClassDeviceStruct(dev, 2, xf86GetMotionEvents,
-                                          local->history_size, Absolute) == FALSE)
+        if (InitValuatorClassDeviceStruct(dev, 2,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+				      axis_labels,
+#endif
+                              local->history_size, Absolute) == FALSE)
         {
                 ErrorF ("Unable to allocate EVTouch touchscreen ValuatorClassDeviceStruct\n");
                 return !Success;
         }
 
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2
-        xf86InitValuatorAxisStruct(dev, 0, 0, priv->screen_width,
+        xf86InitValuatorAxisStruct(dev, 0, 
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+				           axis_labels[0],
+#endif
+                                   0, priv->screen_width,
                                    1024,
                                    EV_AXIS_MIN_RES /* min_res */ ,
                                    EV_AXIS_MAX_RES /* max_res */ );
         xf86InitValuatorDefaults(dev, 0);
-        xf86InitValuatorAxisStruct(dev, 1, 0, priv->screen_height,
+        xf86InitValuatorAxisStruct(dev, 1,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+				           axis_labels[1],
+#endif
+                                   0, priv->screen_height,
                                    1024,
                                    EV_AXIS_MIN_RES /* min_res */ ,
                                    EV_AXIS_MAX_RES /* max_res */ );
         xf86InitValuatorDefaults(dev, 1);
-#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;