View | Details | Raw Unified | Return to bug 146495
Collapse All | Expand All

(-)x11-drivers/input-wacom/Makefile (-3 / +2 lines)
Lines 65-76 Link Here
65
PORTTYPE=	serial
65
PORTTYPE=	serial
66
.endif
66
.endif
67
67
68
BROKEN=		build failed
69
70
do-configure:
68
do-configure:
71
	@cd ${WRKDIR}/linuxwacom \
69
	@cd ${WRKDIR}/linuxwacom \
72
		&& ${LN} -s ${DISTDIR}/${DIST_SUBDIR}/${LINUXWACOM}.tar.bz2 \
70
		&& ${LN} -s ${DISTDIR}/${DIST_SUBDIR}/${LINUXWACOM}.tar.bz2 \
73
		&& ${SETENV} ${MAKE_ENV} ./run_configure
71
		&& ${SETENV} ${MAKE_ENV} ./run_configure \
72
		&& ${PATCH} -p0 < ${PATCHDIR}/xorg-server-1.7.patch
74
73
75
do-build:
74
do-build:
76
.if defined(WITH_UWACOMKLD)
75
.if defined(WITH_UWACOMKLD)
(-)x11-drivers/input-wacom/files/xorg-server-1.7.patch (+387 lines)
Line 0 Link Here
1
--- linuxwacom-0.8.2-2/src/xdrv/wcmCommon.c.orig	2009-01-19 21:58:37.000000000 +0300
2
+++ linuxwacom-0.8.2-2/src/xdrv/wcmCommon.c	2010-05-11 17:25:41.265742759 +0400
3
@@ -19,6 +19,8 @@
4
 
5
 #include "xf86Wacom.h"
6
 #include "../include/Xwacom.h"
7
+#include <xkbsrv.h>
8
+#include <xf86_OSproc.h>
9
 
10
 /*
11
 #if XF86_VERSION_MAJOR < 4
12
@@ -277,7 +279,7 @@
13
 				bsent = 0;
14
 
15
 				/* send all pressed buttons down */
16
-				for (button=2; button<=MAX_BUTTONS; button++)
17
+				for (button=2; button<=WCM_MAX_BUTTONS; button++)
18
 				{
19
 					mask = 1 << (button-1);
20
 					if ( buttons & mask ) 
21
@@ -302,7 +304,7 @@
22
 			else
23
 			{
24
 				bsent = 0;
25
-				for (button=2; button<=MAX_BUTTONS; button++)
26
+				for (button=2; button<=WCM_MAX_BUTTONS; button++)
27
 				{
28
 					mask = 1 << (button-1);
29
 					if ((mask & priv->oldButtons) != (mask & buttons))
30
@@ -333,7 +335,7 @@
31
 			priv->flags &= ~TPCBUTTONS_FLAG;
32
 
33
 			/* send all pressed buttons up */
34
-			for (button=2; button<=MAX_BUTTONS; button++)
35
+			for (button=2; button<=WCM_MAX_BUTTONS; button++)
36
 			{
37
 				mask = 1 << (button-1);
38
 				if ((mask & priv->oldButtons) != (mask & buttons) || (mask & buttons) )
39
@@ -356,7 +358,7 @@
40
 	}
41
 	else  /* normal buttons */
42
 	{
43
-		for (button=1; button<=MAX_BUTTONS; button++)
44
+		for (button=1; button<=WCM_MAX_BUTTONS; button++)
45
 		{
46
 			mask = 1 << (button-1);
47
 			if ((mask & priv->oldButtons) != (mask & buttons))
48
@@ -405,7 +407,11 @@
49
 	int i, j, alt_keysym = 0;
50
 
51
 	/* Now that we have the keycode look for key index */
52
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
53
+	KeySymsRec *ksr = XkbGetCoreMap(keydev);
54
+#else
55
 	KeySymsRec *ksr = &keydev->key->curKeySyms;
56
+#endif
57
 
58
 	for (i = ksr->minKeyCode; i <= ksr->maxKeyCode; i++)
59
 		if (ksr->map [(i - ksr->minKeyCode) * ksr->mapWidth] == keysym)
60
@@ -443,11 +449,17 @@
61
 				xf86PostKeyboardEvent (keydev, j, 0);
62
 		}
63
 		else
64
-			xf86Msg (X_WARNING, "Couldn't find key with code %08x on keyboard device %s\n",
65
-					keysym, keydev->name);
66
+			xf86Msg (X_WARNING, "%s: Couldn't find key with code %08x on keyboard device %s\n",
67
+					keydev->name, keysym, keydev->name);
68
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
69
+		xfree(ksr);
70
+#endif
71
 		return;
72
 	}
73
 	xf86PostKeyboardEvent (keydev, i, state);
74
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
75
+	xfree(ksr);
76
+#endif
77
 }
78
 
79
 static int wcm_modifier [ ] =
80
--- linuxwacom-0.8.2-2/src/xdrv/wcmConfig.c.orig	2009-01-19 21:58:37.000000000 +0300
81
+++ linuxwacom-0.8.2-2/src/xdrv/wcmConfig.c	2010-05-11 17:27:43.775135419 +0400
82
@@ -136,15 +136,15 @@
83
 	priv->nPressCtrl [3] = 100;  /* pressure curve y1 */
84
 
85
 	/* Default button and expresskey values */
86
-	for (i=0; i<MAX_BUTTONS; i++)
87
+	for (i=0; i<WCM_MAX_BUTTONS; i++)
88
 		priv->button[i] = IsPad (priv) ?
89
-			(AC_BUTTON | (MAX_MOUSE_BUTTONS/2 + i + 1)) : (AC_BUTTON | (i + 1));
90
+			(AC_BUTTON | (WCM_MAX_MOUSE_BUTTONS/2 + i + 1)) : (AC_BUTTON | (i + 1));
91
 
92
-	for (i=0; i<MAX_BUTTONS; i++)
93
+	for (i=0; i<WCM_MAX_BUTTONS; i++)
94
 		for (j=0; j<256; j++)
95
 			priv->keys[i][j] = 0;
96
 
97
-	priv->nbuttons = MAX_BUTTONS;		/* Default number of buttons */
98
+	priv->nbuttons = WCM_MAX_BUTTONS;		/* Default number of buttons */
99
 	priv->relup = 5;			/* Default relative wheel up event */
100
 	priv->reldn = 4;			/* Default relative wheel down event */
101
 	
102
@@ -859,7 +859,7 @@
103
 	}
104
 
105
 
106
-	for (i=0; i<MAX_BUTTONS; i++)
107
+	for (i=0; i<WCM_MAX_BUTTONS; i++)
108
 	{
109
 		sprintf(b, "Button%d", i+1);
110
 		s = xf86SetStrOption(local->options, b, NULL);
111
--- linuxwacom-0.8.2-2/src/xdrv/wcmUSB.c.orig	2009-01-19 21:58:37.000000000 +0300
112
+++ linuxwacom-0.8.2-2/src/xdrv/wcmUSB.c	2010-05-11 17:30:02.434108111 +0400
113
@@ -1064,7 +1064,7 @@
114
 				for (nkeys = 0; nkeys < common->npadkeys; nkeys++)
115
 					if (event->code == common->padkey_code [nkeys])
116
 					{
117
-						MOD_BUTTONS ((MAX_MOUSE_BUTTONS/2+nkeys), event->value);
118
+						MOD_BUTTONS ((WCM_MAX_MOUSE_BUTTONS/2+nkeys), event->value);
119
 						break;
120
 					}
121
 			}
122
--- linuxwacom-0.8.2-2/src/xdrv/xf86Wacom.c.orig	2009-01-19 21:58:37.000000000 +0300
123
+++ linuxwacom-0.8.2-2/src/xdrv/xf86Wacom.c	2010-05-11 17:28:07.865752615 +0400
124
@@ -84,6 +84,14 @@
125
 #include "xf86Wacom.h"
126
 #include "wcmFilter.h"
127
 
128
+#include <xf86_OSproc.h>
129
+#include <exevents.h>
130
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
131
+#include <xserver-properties.h>
132
+#include <X11/extensions/XKB.h>
133
+#include <xkbsrv.h>
134
+#endif
135
+
136
 static int xf86WcmDevOpen(DeviceIntPtr pWcm);
137
 static void xf86WcmDevReadInput(LocalDevicePtr local);
138
 static void xf86WcmDevControlProc(DeviceIntPtr device, PtrCtrl* ctrl);
139
@@ -290,7 +298,11 @@
140
 		resolution = (int)((double)resolution * priv->factorX + 0.5);
141
 #endif
142
 
143
-		InitValuatorAxisStruct(local->dev, 0, topx, tabletSize, 
144
+		InitValuatorAxisStruct(local->dev, 0,
145
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
146
+			XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X),
147
+#endif
148
+			topx, tabletSize, 
149
 			resolution, 0, resolution); 
150
 	}
151
 	else /* y ax */
152
@@ -317,7 +329,11 @@
153
 		resolution = (int)((double)resolution * priv->factorY + 0.5);
154
 #endif
155
 
156
-		InitValuatorAxisStruct(local->dev, 1, topy, tabletSize, 
157
+		InitValuatorAxisStruct(local->dev, 1,
158
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
159
+			XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y),
160
+#endif
161
+			topy, tabletSize, 
162
 			resolution, 0, resolution); 
163
 	}
164
 }
165
@@ -523,9 +539,13 @@
166
 {
167
 	WacomDevicePtr priv = (WacomDevicePtr)local->private;
168
 	WacomCommonPtr common = priv->common;
169
-	CARD8 butmap[MAX_BUTTONS+1];
170
+	CARD8 butmap[WCM_MAX_BUTTONS+1];
171
 	int nbaxes, nbbuttons, nbkeys;
172
 	int loop;
173
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
174
+	Atom btn_labels[WCM_MAX_BUTTONS] = {0};
175
+	Atom axis_labels[MAX_VALUATORS] = {0};
176
+#endif
177
 
178
 	/* Detect tablet configuration, if possible */
179
 	if (priv->common->wcmModel->DetectConfig)
180
@@ -552,7 +572,11 @@
181
 	for(loop=1; loop<=nbbuttons; loop++)
182
 		butmap[loop] = loop;
183
 
184
-	if (InitButtonClassDeviceStruct(local->dev, nbbuttons, butmap) == FALSE)
185
+	if (InitButtonClassDeviceStruct(local->dev, nbbuttons,
186
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
187
+					btn_labels,
188
+#endif
189
+					butmap) == FALSE)
190
 	{
191
 		ErrorF("unable to allocate Button class device\n");
192
 		return FALSE;
193
@@ -581,15 +605,13 @@
194
 		nbaxes = priv->naxes = 6;
195
 
196
 	if (InitValuatorClassDeviceStruct(local->dev, nbaxes,
197
-#if WCM_XINPUTABI_MAJOR == 0
198
-					  xf86GetMotionEvents,
199
-					  local->history_size,
200
-#else
201
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
202
+					  axis_labels,
203
+#endif
204
 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
205
 					  GetMotionHistory,
206
 #endif
207
 					  GetMotionHistorySize(),
208
-#endif
209
 					  ((priv->flags & ABSOLUTE_FLAG) ?
210
 					  Absolute : Relative) | 
211
 					  OutOfProximity ) == FALSE)
212
@@ -602,7 +624,7 @@
213
 	/* only initial KeyClass and LedFeedbackClass once */
214
 	if (!priv->wcmInitKeyClassCount)
215
 	{
216
-#ifdef WCM_KEY_SENDING_SUPPORT
217
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 5
218
 		if (nbkeys)
219
 		{
220
 			KeySymsRec wacom_keysyms;
221
@@ -641,19 +663,37 @@
222
 			}
223
 		}
224
 
225
-#ifndef WCM_XFREE86
226
 		if(InitKbdFeedbackClassDeviceStruct(local->dev, xf86WcmBellCallback,
227
 				xf86WcmKbdCtrlCallback) == FALSE) {
228
 			ErrorF("unable to init kbd feedback device struct\n");
229
 			return FALSE;
230
 		}
231
+#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
232
+		if (InitKeyboardDeviceStruct(local->dev, NULL, NULL, xf86WcmKbdCtrlCallback)) {
233
+#define SYMS_PER_KEY 2
234
+			KeySymsRec syms;
235
+			CARD8 modmap[MAP_LENGTH];
236
+			int num_keys = XkbMaxLegalKeyCode - XkbMinLegalKeyCode + 1;
237
 
238
+			syms.map = keymap;
239
+			syms.mapWidth = SYMS_PER_KEY;
240
+			syms.minKeyCode = XkbMinLegalKeyCode;
241
+			syms.maxKeyCode = XkbMaxLegalKeyCode;
242
+
243
+			memset(modmap, 0, sizeof(modmap));
244
+			modmap[XkbMinLegalKeyCode + 2] = ShiftMask;
245
+			XkbApplyMappingChange(local->dev, &syms, syms.minKeyCode, num_keys, NULL, // modmap,
246
+					serverClient);
247
+		} else
248
+		{
249
+			xf86Msg(X_ERROR, "%s: unable to init kbd device struct\n ", local->name);
250
+			return FALSE;
251
+		}
252
+#endif
253
 		if(InitLedFeedbackClassDeviceStruct (local->dev, xf86WcmKbdLedCallback) == FALSE) {
254
 			ErrorF("unable to init led feedback device struct\n");
255
 			return FALSE;
256
 		}
257
-#endif /* WCM_XFREE86 */
258
-#endif /* WCM_KEY_SENDING_SUPPORT */
259
 	}
260
 
261
 #if WCM_XINPUTABI_MAJOR == 0
262
@@ -672,42 +712,81 @@
263
 	xf86WcmRotateScreen(local, common->wcmRotate);
264
 
265
 	/* pressure */
266
-	InitValuatorAxisStruct(local->dev, 2, 0, 
267
-		common->wcmMaxZ, 1, 1, 1);
268
+	InitValuatorAxisStruct(local->dev, 2,
269
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
270
+		XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE),
271
+#endif
272
+		0, common->wcmMaxZ, 1, 1, 1);
273
 
274
 	if (IsCursor(priv))
275
 	{
276
 		/* z-rot and throttle */
277
-		InitValuatorAxisStruct(local->dev, 3, -900, 899, 1, 1, 1);
278
-		InitValuatorAxisStruct(local->dev, 4, -1023, 1023, 1, 1, 1);
279
+		InitValuatorAxisStruct(local->dev, 3,
280
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
281
+			XIGetKnownProperty(AXIS_LABEL_PROP_ABS_RZ),
282
+#endif
283
+			-900, 899, 1, 1, 1);
284
+		InitValuatorAxisStruct(local->dev, 4,
285
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
286
+			XIGetKnownProperty(AXIS_LABEL_PROP_ABS_THROTTLE),
287
+#endif
288
+			-1023, 1023, 1, 1, 1);
289
 	}
290
 	else if (IsPad(priv))
291
 	{
292
 		/* strip-x and strip-y */
293
 		if (priv->naxes)
294
 		{
295
-			InitValuatorAxisStruct(local->dev, 3, 0, common->wcmMaxStripX, 1, 1, 1);
296
-			InitValuatorAxisStruct(local->dev, 4, 0, common->wcmMaxStripY, 1, 1, 1);
297
+			InitValuatorAxisStruct(local->dev, 3,
298
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
299
+				0, /* XXX what is this axis?*/
300
+#endif
301
+				0, common->wcmMaxStripX, 1, 1, 1);
302
+			InitValuatorAxisStruct(local->dev, 4,
303
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
304
+				0, /* XXX what is this axis?*/
305
+#endif
306
+				0, common->wcmMaxStripY, 1, 1, 1);
307
 		}
308
 	}
309
 	else
310
 	{
311
 		/* tilt-x and tilt-y */
312
-		InitValuatorAxisStruct(local->dev, 3, -64, 63, 1, 1, 1);
313
-		InitValuatorAxisStruct(local->dev, 4, -64, 63, 1, 1, 1);
314
+		InitValuatorAxisStruct(local->dev, 3,
315
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
316
+			XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_X),
317
+#endif
318
+			-64, 63, 1, 1, 1);
319
+		InitValuatorAxisStruct(local->dev, 4,
320
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
321
+			XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_Y),
322
+#endif
323
+			-64, 63, 1, 1, 1);
324
 	}
325
 
326
 	if ((strstr(common->wcmModel->name, "Intuos3") || 
327
 		strstr(common->wcmModel->name, "CintiqV5")) 
328
 			&& IsStylus(priv))
329
 		/* Art Marker Pen rotation */
330
-		InitValuatorAxisStruct(local->dev, 5, -900, 899, 1, 1, 1);
331
+		InitValuatorAxisStruct(local->dev, 5,
332
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
333
+			0, /* XXX what is this axis?*/
334
+#endif
335
+			-900, 899, 1, 1, 1);
336
 	else if (strstr(common->wcmModel->name, "Bamboo") && IsPad(priv))
337
-		InitValuatorAxisStruct(local->dev, 5, 0, 71, 1, 1, 1);
338
+		InitValuatorAxisStruct(local->dev, 5,
339
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
340
+			0, /* XXX what is this axis?*/
341
+#endif
342
+			0, 71, 1, 1, 1);
343
 	else
344
 	{
345
 		/* absolute wheel */
346
-		InitValuatorAxisStruct(local->dev, 5, 0, 1023, 1, 1, 1);
347
+		InitValuatorAxisStruct(local->dev, 5,
348
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
349
+			XIGetKnownProperty(AXIS_LABEL_PROP_ABS_WHEEL),
350
+#endif
351
+			0, 1023, 1, 1, 1);
352
 	}
353
 
354
 	if (IsTouch(priv))
355
--- linuxwacom-0.8.2-2/src/xdrv/xf86WacomDefs.h.orig	2009-01-19 21:58:37.000000000 +0300
356
+++ linuxwacom-0.8.2-2/src/xdrv/xf86WacomDefs.h	2010-05-11 17:28:56.624883674 +0400
357
@@ -125,8 +125,8 @@
358
 #define IsPad(priv)    (DEVICE_ID((priv)->flags) == PAD_ID)
359
 
360
 #define FILTER_PRESSURE_RES	2048	/* maximum points in pressure curve */
361
-#define MAX_BUTTONS		32	/* maximum number of tablet buttons */
362
-#define MAX_MOUSE_BUTTONS	16	/* maximum number of buttons-on-pointer
363
+#define WCM_MAX_BUTTONS		32	/* maximum number of tablet buttons */
364
+#define WCM_MAX_MOUSE_BUTTONS	16	/* maximum number of buttons-on-pointer
365
                                          * (which are treated as mouse buttons,
366
                                          * not as keys like tablet menu buttons). 
367
 					 * For backword compability support, 
368
@@ -161,8 +161,8 @@
369
 	int screenBottomY[32];	/* bottom cordinate of the associated screen */
370
 	int maxWidth;		/* max active screen width */
371
 	int maxHeight;		/* max active screen height */
372
-	int button[MAX_BUTTONS];/* buttons assignments */
373
-	unsigned keys[MAX_BUTTONS][256]; /* keystrokes assigned to buttons */
374
+	int button[WCM_MAX_BUTTONS];/* buttons assignments */
375
+	unsigned keys[WCM_MAX_BUTTONS][256]; /* keystrokes assigned to buttons */
376
 	int relup;
377
 	unsigned rupk[256];     /* keystrokes assigned to relative wheel up event (default is button 4) */
378
 	int reldn;
379
@@ -386,7 +386,7 @@
380
 
381
 	int nbuttons;                /* total number of buttons */
382
 	int npadkeys;                /* number of pad keys in the above array */
383
-	int padkey_code[MAX_BUTTONS];/* hardware codes for buttons */
384
+	int padkey_code[WCM_MAX_BUTTONS];/* hardware codes for buttons */
385
 
386
 	WacomDevicePtr wcmDevices;   /* list of devices sharing same port */
387
 	int wcmPktLength;            /* length of a packet */

Return to bug 146495