Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 221117 | Differences between
and this patch

Collapse All | Expand All

(-)a/ChangeLog (+6 lines)
Lines 1-3 Link Here
1
2008-05-09  Ping Cheng <pingc@wacom.com>
2
	* Updated xidump for Xserver 1.4 or later
3
	* Fixed no eraser calibration issue for LCD tablets
4
	* Fixed serial Tablet PC baudrate issue
5
	* Label 0.8.0-1
6
1
2008-04-25  Ping Cheng <pingc@wacom.com>
7
2008-04-25  Ping Cheng <pingc@wacom.com>
2
	* Updated wacom.4x
8
	* Updated wacom.4x
3
	* Update ~/.xsession from wacomcpl for KDE system
9
	* Update ~/.xsession from wacomcpl for KDE system
(-)a/src/xdrv/wcmCommon.c (+146 lines)
Lines 44-49 WacomDeviceClass* wcmDeviceClasses[] = Link Here
44
44
45
extern int xf86WcmDevSwitchModeCall(LocalDevicePtr local, int mode);
45
extern int xf86WcmDevSwitchModeCall(LocalDevicePtr local, int mode);
46
extern void xf86WcmChangeScreen(LocalDevicePtr local, int value);
46
extern void xf86WcmChangeScreen(LocalDevicePtr local, int value);
47
extern void xf86WcmInitialCoordinates(LocalDevicePtr local, int axes);
47
48
48
/*****************************************************************************
49
/*****************************************************************************
49
 * Static functions
50
 * Static functions
Lines 1868-1870 void xf86WcmInitialScreens(LocalDevicePtr local) Link Here
1868
			i, priv->screenBottomX[i], i, priv->screenBottomY[i]));
1869
			i, priv->screenBottomX[i], i, priv->screenBottomY[i]));
1869
	}
1870
	}
1870
}
1871
}
1872
1873
/*****************************************************************************
1874
 * rotateOneTool
1875
 ****************************************************************************/
1876
1877
static void rotateOneTool(WacomDevicePtr priv)
1878
{
1879
	WacomCommonPtr common = priv->common;
1880
	WacomToolAreaPtr area = priv->toolarea;
1881
	int tmpTopX, tmpTopY, tmpBottomX, tmpBottomY, oldMaxX, oldMaxY;
1882
1883
	DBG(10, priv->debugLevel, ErrorF("rotateOneTool for \"%s\" \n", priv->local->name));
1884
1885
	oldMaxX = priv->wcmMaxX;
1886
	oldMaxY = priv->wcmMaxY;
1887
1888
	tmpTopX = priv->topX;
1889
	tmpBottomX = priv->bottomX;
1890
	tmpTopY = priv->topY;
1891
	tmpBottomY = priv->bottomY;
1892
1893
	if (common->wcmRotate == ROTATE_CW || common->wcmRotate == ROTATE_CCW)
1894
	{
1895
	    priv->wcmMaxX = oldMaxY;
1896
	    priv->wcmMaxY = oldMaxX;
1897
	}
1898
1899
	switch (common->wcmRotate) {
1900
	      case ROTATE_CW:
1901
		area->topX = priv->topX = tmpTopY;
1902
		area->bottomX = priv->bottomX = tmpBottomY;
1903
		area->topY = priv->topY = oldMaxX - tmpBottomX;
1904
		area->bottomY = priv->bottomY =oldMaxX - tmpTopX;
1905
		break;
1906
	      case ROTATE_CCW:
1907
		area->topX = priv->topX = oldMaxY - tmpBottomY;
1908
		area->bottomX = priv->bottomX = oldMaxY - tmpTopY;
1909
		area->topY = priv->topY = tmpTopX;
1910
		area->bottomY = priv->bottomY = tmpBottomX;
1911
		break;
1912
	      case ROTATE_HALF:
1913
		area->topX = priv->topX = oldMaxX - tmpBottomX;
1914
		area->bottomX = priv->bottomX = oldMaxX - tmpTopX;
1915
		area->topY = priv->topY= oldMaxY - tmpBottomY;
1916
		area->bottomY = priv->bottomY = oldMaxY - tmpTopY;
1917
		break;
1918
	}
1919
	xf86WcmInitialScreens(priv->local);
1920
	xf86WcmMappingFactor(priv->local);
1921
	xf86WcmInitialCoordinates(priv->local, 0);
1922
	xf86WcmInitialCoordinates(priv->local, 1);
1923
1924
	if (tmpTopX != priv->topX)
1925
		xf86ReplaceIntOption(priv->local->options, "TopX", priv->topX);
1926
	if (tmpTopY != priv->topY)
1927
		xf86ReplaceIntOption(priv->local->options, "TopY", priv->topY);
1928
	if (tmpBottomX != priv->bottomX)
1929
		xf86ReplaceIntOption(priv->local->options, "BottomX", priv->bottomX);
1930
	if (tmpBottomY != priv->bottomY)
1931
		xf86ReplaceIntOption(priv->local->options, "BottomY", priv->bottomY);
1932
}
1933
1934
/*****************************************************************************
1935
 * xf86WcmRotateScreen
1936
 ****************************************************************************/
1937
1938
void xf86WcmRotateScreen(LocalDevicePtr local, int value)
1939
{
1940
	WacomDevicePtr priv = (WacomDevicePtr)local->private;
1941
	WacomCommonPtr common = priv->common;
1942
	WacomDevicePtr tmppriv;
1943
	int oldRotation;
1944
	int tmpTopX, tmpTopY, tmpBottomX, tmpBottomY, oldMaxX, oldMaxY;
1945
1946
	DBG(10, priv->debugLevel, ErrorF("xf86WcmRotateScreen for \"%s\" \n", local->name));
1947
1948
	if (common->wcmRotate == value) /* initialization */
1949
	{
1950
		rotateOneTool(priv);
1951
	}
1952
	else
1953
	{
1954
		oldRotation = common->wcmRotate;
1955
		common->wcmRotate = value;
1956
1957
		/* rotate all devices at once! else they get misaligned */
1958
		for (tmppriv = common->wcmDevices; tmppriv; tmppriv = tmppriv->next)
1959
		{
1960
		    oldMaxX = tmppriv->wcmMaxX;
1961
		    oldMaxY = tmppriv->wcmMaxY;
1962
1963
		    if (oldRotation == ROTATE_CW || oldRotation == ROTATE_CCW) 
1964
		    {
1965
			tmppriv->wcmMaxX = oldMaxY;
1966
			tmppriv->wcmMaxY = oldMaxX;
1967
		    }
1968
1969
		    tmpTopX = tmppriv->topX;
1970
		    tmpBottomX = tmppriv->bottomX;
1971
		    tmpTopY = tmppriv->topY;
1972
		    tmpBottomY = tmppriv->bottomY;
1973
1974
		    /* recover to the unrotated xy-rectangles */
1975
		    switch (oldRotation) {
1976
		      case ROTATE_CW:
1977
			tmppriv->topX = oldMaxY - tmpBottomY;
1978
			tmppriv->bottomX = oldMaxY - tmpTopY;
1979
			tmppriv->topY = tmpTopX;
1980
			tmppriv->bottomY = tmpBottomX;
1981
			break;
1982
		      case ROTATE_CCW:
1983
			tmppriv->topX = tmpTopY;
1984
			tmppriv->bottomX = tmpBottomY;
1985
			tmppriv->topY = oldMaxX - tmpBottomX;
1986
			tmppriv->bottomY = oldMaxX - tmpTopX;
1987
			break;
1988
		      case ROTATE_HALF:
1989
			tmppriv->topX = oldMaxX - tmpBottomX;
1990
			tmppriv->bottomX = oldMaxX - tmpTopX;
1991
			tmppriv->topY = oldMaxY - tmpBottomY;
1992
			tmppriv->bottomY = oldMaxY - tmpTopY;
1993
			break;
1994
		    }
1995
1996
		    /* and rotate them to the new value */
1997
		    rotateOneTool(tmppriv);
1998
1999
		    switch(value) {
2000
			case ROTATE_NONE:
2001
			    xf86ReplaceStrOption(local->options, "Rotate", "NONE");
2002
			break;
2003
			case ROTATE_CW:
2004
			    xf86ReplaceStrOption(local->options, "Rotate", "CW");
2005
			break;
2006
			case ROTATE_CCW:
2007
			    xf86ReplaceStrOption(local->options, "Rotate", "CCW");
2008
			break;
2009
			case ROTATE_HALF:
2010
			    xf86ReplaceStrOption(local->options, "Rotate", "HALF");
2011
			break;
2012
		    }
2013
		}
2014
	}
2015
2016
}
(-)a/src/xdrv/wcmISDV4.c (-15 / +27 lines)
Lines 99-108 static int isdv4Query(LocalDevicePtr local, const char* query, char* data) Link Here
99
	DBG(1, priv->debugLevel, ErrorF("Querying ISDV4 tablet\n"));
99
	DBG(1, priv->debugLevel, ErrorF("Querying ISDV4 tablet\n"));
100
100
101
	/* Send stop command to the tablet */
101
	/* Send stop command to the tablet */
102
	err = xf86WcmWrite(local->fd, query, strlen(query));
102
	err = xf86WcmWrite(local->fd, WC_ISDV4_STOP, strlen(WC_ISDV4_STOP));
103
	if (err == -1)
103
	if (err == -1)
104
	{
104
	{
105
		ErrorF("Wacom xf86WcmWrite error : %s\n", strerror(errno));
105
		ErrorF("Wacom xf86WcmWrite ISDV4_STOP error : %s\n", strerror(errno));
106
		return !Success;
106
		return !Success;
107
	}
107
	}
108
108
Lines 113-119 static int isdv4Query(LocalDevicePtr local, const char* query, char* data) Link Here
113
	/* Send query command to the tablet */
113
	/* Send query command to the tablet */
114
	if (!xf86WcmWriteWait(local->fd, query))
114
	if (!xf86WcmWriteWait(local->fd, query))
115
	{
115
	{
116
		ErrorF("Wacom unable to xf86WcmWrite request %s query command "
116
		ErrorF("Wacom unable to xf86WcmWrite request %s ISDV4 query command "
117
			"after %d tries\n", query, MAXTRY);
117
			"after %d tries\n", query, MAXTRY);
118
		return !Success;
118
		return !Success;
119
	}
119
	}
Lines 121-133 static int isdv4Query(LocalDevicePtr local, const char* query, char* data) Link Here
121
	/* Read the control data */
121
	/* Read the control data */
122
	if (!xf86WcmWaitForTablet(local->fd, data, 11))
122
	if (!xf86WcmWaitForTablet(local->fd, data, 11))
123
	{
123
	{
124
		/* Try 19200 now */
124
		/* Try 19200 if it is not a touch query */
125
		if (common->wcmISDV4Speed != 19200)
125
		if (common->wcmISDV4Speed != 19200 && strcmp(query, WC_ISDV4_TOUCH_QUERY))
126
		{
126
		{
127
			common->wcmISDV4Speed = 19200;
127
			common->wcmISDV4Speed = 19200;
128
			if (xf86WcmSetSerialSpeed(local->fd, common->wcmISDV4Speed) < 0)
128
			if (xf86WcmSetSerialSpeed(local->fd, common->wcmISDV4Speed) < 0)
129
				return !Success;
129
				return !Success;
130
			return isdv4Query(local, query, data);
130
 			return isdv4Query(local, query, data);
131
		}
131
		}
132
		else
132
		else
133
		{
133
		{
Lines 137-142 static int isdv4Query(LocalDevicePtr local, const char* query, char* data) Link Here
137
		}
137
		}
138
	}
138
	}
139
139
140
	/* Control data bit check */
141
	if ( !(data[0] & 0x40) )
142
	{
143
		ErrorF("Wacom Query ISDV4 control data (%x) error in %s query\n", data[0], query);
144
		return !Success;
145
	}
146
140
	return Success;
147
	return Success;
141
}
148
}
142
149
Lines 216-222 static int isdv4GetRanges(LocalDevicePtr local) Link Here
216
			}
223
			}
217
		}
224
		}
218
225
219
		if (common->wcmMaxX && common->wcmPktLength == 5)
226
		if (common->wcmMaxX && common->wcmMaxY)
220
		{
227
		{
221
			/* Touch resolution */
228
			/* Touch resolution */
222
			common->wcmTouchResolX = common->wcmMaxTouchX * 
229
			common->wcmTouchResolX = common->wcmMaxTouchX * 
Lines 256-262 static int isdv4Parse(LocalDevicePtr local, const unsigned char* data) Link Here
256
	WacomCommonPtr common = priv->common;
263
	WacomCommonPtr common = priv->common;
257
	WacomDeviceState* last = &common->wcmChannel[0].valid.state;
264
	WacomDeviceState* last = &common->wcmChannel[0].valid.state;
258
	WacomDeviceState* ds;
265
	WacomDeviceState* ds;
259
	int n, cur_type, channel;
266
	int n, cur_type, channel = 0;
260
267
261
	DBG(10, common->debugLevel, ErrorF("isdv4Parse \n"));
268
	DBG(10, common->debugLevel, ErrorF("isdv4Parse \n"));
262
269
Lines 268-275 static int isdv4Parse(LocalDevicePtr local, const unsigned char* data) Link Here
268
			return 5; /* ignore touch event */
275
			return 5; /* ignore touch event */
269
		else
276
		else
270
		{
277
		{
271
			common->wcmPktLength = 5;
278
			if (data[0] & 0x10) /* a touch data */
272
			channel = 1;
279
			{
280
				common->wcmPktLength = 5;
281
				channel = 1;
282
			}
283
			else
284
				return 5;
273
		}
285
		}
274
	}
286
	}
275
	else
287
	else
Lines 289-295 static int isdv4Parse(LocalDevicePtr local, const unsigned char* data) Link Here
289
	else
301
	else
290
	{
302
	{
291
		/* Coordinate data bit check */
303
		/* Coordinate data bit check */
292
		if (data[0] & 0x40) /* control data*/
304
		if (data[0] & 0x40) /* control data */
293
			return common->wcmPktLength;
305
			return common->wcmPktLength;
294
	}
306
	}
295
307
Lines 331-339 static int isdv4Parse(LocalDevicePtr local, const unsigned char* data) Link Here
331
		if (!last->proximity && ds->proximity) 
343
		if (!last->proximity && ds->proximity) 
332
			ds->device_type = cur_type;
344
			ds->device_type = cur_type;
333
		/* check on previous proximity */
345
		/* check on previous proximity */
334
		else if (cur_type == STYLUS_ID && ds->proximity)
346
		else if (ds->buttons && ds->proximity)
335
		{
347
		{
336
			/* we were fooled by tip and second
348
			/* we might have been fooled by tip and second
337
			 * sideswitch when it came into prox */
349
			 * sideswitch when it came into prox */
338
			if ((ds->device_type != cur_type) &&
350
			if ((ds->device_type != cur_type) &&
339
				(ds->device_type == ERASER_ID))
351
				(ds->device_type == ERASER_ID))
Lines 345-352 static int isdv4Parse(LocalDevicePtr local, const unsigned char* data) Link Here
345
			}
357
			}
346
		}
358
		}
347
359
348
		ds->device_id = (ds->device_type == CURSOR_ID) ? 
360
		ds->device_id = (ds->device_type == ERASER_ID) ? 
349
			CURSOR_DEVICE_ID : STYLUS_DEVICE_ID;
361
			ERASER_DEVICE_ID : STYLUS_DEVICE_ID;
350
362
351
		/* don't send button 3 event for eraser 
363
		/* don't send button 3 event for eraser 
352
		 * button 1 event will be sent by testing presure level
364
		 * button 1 event will be sent by testing presure level
(-)a/src/xdrv/wcmSerial.c (-5 / +6 lines)
Lines 255-261 int xf86WcmWriteWait(int fd, const char* request) Link Here
255
		len = xf86WriteSerial(fd, request, strlen(request));
255
		len = xf86WriteSerial(fd, request, strlen(request));
256
		if ((len == -1) && (errno != EAGAIN))
256
		if ((len == -1) && (errno != EAGAIN))
257
		{
257
		{
258
			ErrorF("Wacom xf86WcmWrite error : %s", strerror(errno));
258
			ErrorF("Wacom xf86WcmWriteWait error : %s", strerror(errno));
259
			return 0;
259
			return 0;
260
		}
260
		}
261
261
Lines 1249-1257 static void serialParseP4Common(LocalDevicePtr local, Link Here
1249
	if (!last->proximity && ds->proximity)
1249
	if (!last->proximity && ds->proximity)
1250
		ds->device_type = cur_type;
1250
		ds->device_type = cur_type;
1251
	/* check on previous proximity */
1251
	/* check on previous proximity */
1252
	else if (is_stylus && ds->proximity)
1252
	else if (ds->buttons && ds->proximity)
1253
	{
1253
	{
1254
		/* we were fooled by tip and second
1254
		/* we might have been fooled by tip and second
1255
		 * sideswitch when it came into prox */
1255
		 * sideswitch when it came into prox */
1256
		if ((ds->device_type != cur_type) &&
1256
		if ((ds->device_type != cur_type) &&
1257
			(ds->device_type == ERASER_ID))
1257
			(ds->device_type == ERASER_ID))
Lines 1295-1302 int xf86WcmSerialValidate(WacomCommonPtr common, const unsigned char* data) Link Here
1295
				((i!=0) && (data[i] & HEADER_BIT)) )
1295
				((i!=0) && (data[i] & HEADER_BIT)) )
1296
		{
1296
		{
1297
			bad = 1;
1297
			bad = 1;
1298
			ErrorF("xf86WcmSerialValidate: bad magic at %d "
1298
			if (i!=1)
1299
				"v=%x l=%d\n", i, data[i], common->wcmPktLength);
1299
				ErrorF("xf86WcmSerialValidate: bad magic at %d "
1300
					"v=%x l=%d\n", i, data[i], common->wcmPktLength);
1300
			if (i!=0 && (data[i] & HEADER_BIT)) return i;
1301
			if (i!=0 && (data[i] & HEADER_BIT)) return i;
1301
		}
1302
		}
1302
	}
1303
	}
(-)a/src/xdrv/wcmXCommand.c (-103 / +5 lines)
Lines 20-25 Link Here
20
 * REVISION HISTORY
20
 * REVISION HISTORY
21
 *
21
 *
22
 * 2007-05-25 0.1 - Initial release - span off from xf86Wacom.c
22
 * 2007-05-25 0.1 - Initial release - span off from xf86Wacom.c
23
 * 2008-05-14 0.2 - Rotate through routine xf86WcmRotateScreen
23
 */
24
 */
24
25
25
26
Lines 30-35 Link Here
30
31
31
extern void xf86WcmInitialCoordinates(LocalDevicePtr local, int axes);
32
extern void xf86WcmInitialCoordinates(LocalDevicePtr local, int axes);
32
extern void xf86WcmInitialScreens(LocalDevicePtr local);
33
extern void xf86WcmInitialScreens(LocalDevicePtr local);
34
extern void xf86WcmRotateScreen(LocalDevicePtr local, int value);
33
35
34
/*****************************************************************************
36
/*****************************************************************************
35
 * xf86WcmSetPadCoreMode
37
 * xf86WcmSetPadCoreMode
Lines 145-156 static int xf86WcmSetParam(LocalDevicePtr local, int param, int value) Link Here
145
{
147
{
146
	WacomDevicePtr priv = (WacomDevicePtr)local->private;
148
	WacomDevicePtr priv = (WacomDevicePtr)local->private;
147
	WacomCommonPtr common = priv->common;
149
	WacomCommonPtr common = priv->common;
148
	WacomDevicePtr tmppriv;
149
	char st[32];
150
	char st[32];
150
	int oldRotation;
151
	int tmpTopX, tmpTopY, tmpBottomX, tmpBottomY, oldMaxX, oldMaxY;
152
	WacomToolAreaPtr area = priv->toolarea;
151
	WacomToolAreaPtr area = priv->toolarea;
153
	WacomToolAreaPtr tmparea;
154
152
155
	/* We don't reset options to the values that the driver are using.  
153
	/* We don't reset options to the values that the driver are using.  
156
	 * This eliminates confusion when driver is running on default values.
154
	 * This eliminates confusion when driver is running on default values.
Lines 452-557 static int xf86WcmSetParam(LocalDevicePtr local, int param, int value) Link Here
452
		break;
450
		break;
453
	   case XWACOM_PARAM_ROTATE:
451
	   case XWACOM_PARAM_ROTATE:
454
		if ((value < 0) || (value > 3)) return BadValue;
452
		if ((value < 0) || (value > 3)) return BadValue;
455
		switch(value) {
453
		if (common->wcmRotate != value)
456
		  case ROTATE_NONE:
454
			xf86WcmRotateScreen(local, value);
457
			xf86ReplaceStrOption(local->options, "Rotate", "NONE");
458
			break;
459
		  case ROTATE_CW:
460
			xf86ReplaceStrOption(local->options, "Rotate", "CW");
461
			break;
462
		  case ROTATE_CCW:
463
			xf86ReplaceStrOption(local->options, "Rotate", "CCW");
464
			break;
465
		  case ROTATE_HALF:
466
			xf86ReplaceStrOption(local->options, "Rotate", "HALF");
467
			break;
468
		  default:
469
			return BadValue;
470
		}
471
		oldRotation = common->wcmRotate;
472
		oldMaxX = priv->wcmMaxX;
473
		oldMaxY = priv->wcmMaxY;
474
		common->wcmRotate = value;
475
		if (((oldRotation == ROTATE_NONE || oldRotation == ROTATE_HALF) && 
476
			(value == ROTATE_CW || value == ROTATE_CCW)) ||
477
		     ((oldRotation == ROTATE_CW || oldRotation == ROTATE_CCW) 
478
			&& (value == ROTATE_NONE || value == ROTATE_HALF)))
479
		{
480
		    priv->wcmMaxX = oldMaxY;
481
		    priv->wcmMaxY = oldMaxX;
482
		}
483
484
		/* rotate all devices at once! else they get misaligned */
485
		for (tmppriv = common->wcmDevices; tmppriv; tmppriv = tmppriv->next)
486
		{
487
		    tmparea = tmppriv->toolarea;
488
		    /* recover the unrotated xy-rectangles */
489
		    switch (oldRotation) {
490
		      case ROTATE_CW:
491
			tmpTopX = oldMaxY - tmppriv->bottomY;
492
			tmpBottomX = oldMaxY - tmppriv->topY;
493
			tmpTopY = tmppriv->topX;
494
			tmpBottomY = tmppriv->bottomX;
495
			break;
496
		      case ROTATE_CCW:
497
			tmpTopX = tmppriv->topY;
498
			tmpBottomX = tmppriv->bottomY;
499
			tmpTopY = oldMaxX - tmppriv->bottomX;
500
			tmpBottomY = oldMaxX - tmppriv->topX;
501
			break;
502
		      case ROTATE_HALF:
503
			tmpTopX = oldMaxX - tmppriv->bottomX;
504
			tmpBottomX = oldMaxX - tmppriv->topX;
505
			tmpTopY = oldMaxY - tmppriv->bottomY;
506
			tmpBottomY = oldMaxY - tmppriv->topY;
507
			break;
508
		      default: /* ROTATE_NONE */
509
			tmpTopX = tmppriv->topX;
510
			tmpBottomX = tmppriv->bottomX;
511
			tmpTopY = tmppriv->topY;
512
			tmpBottomY = tmppriv->bottomY;
513
			break;
514
		    } 
515
		    /* and rotate them back */
516
		    switch (value) {
517
		      case ROTATE_CW:
518
			tmparea->topX = tmppriv->topX = tmpTopY;
519
			tmparea->bottomX = tmppriv->bottomX = tmpBottomY;
520
			tmparea->topY = tmppriv->topY = priv->wcmMaxY - tmpBottomX;
521
			tmparea->bottomY = tmppriv->bottomY = priv->wcmMaxY - tmpTopX;
522
			break;
523
		      case ROTATE_CCW:
524
			tmparea->topX = tmppriv->topX = priv->wcmMaxX - tmpBottomY;
525
			tmparea->bottomX = tmppriv->bottomX = priv->wcmMaxX - tmpTopY;
526
			tmparea->topY = tmppriv->topY = tmpTopX;
527
			tmparea->bottomY = tmppriv->bottomY = tmpBottomX;
528
			break;
529
		      case ROTATE_HALF:
530
			tmparea->topX = tmppriv->topX = priv->wcmMaxX - tmpBottomX;
531
			tmparea->bottomX = tmppriv->bottomX = priv->wcmMaxX - tmpTopX;
532
			tmparea->topY = tmppriv->topY= priv->wcmMaxY - tmpBottomY;
533
			tmparea->bottomY = tmppriv->bottomY = priv->wcmMaxY - tmpTopY;
534
			break;
535
		      default: /* ROTATE_NONE */
536
			tmparea->topX = tmppriv->topX = tmpTopX;
537
			tmparea->bottomX = tmppriv->bottomX = tmpBottomX;
538
			tmparea->topY = tmppriv->topY = tmpTopY;
539
			tmparea->bottomY = tmppriv->bottomY = tmpBottomY;
540
			break;
541
		    }
542
543
		    xf86WcmInitialScreens(tmppriv->local);
544
		    xf86WcmMappingFactor(tmppriv->local);
545
		    xf86WcmInitialCoordinates(tmppriv->local, 0);
546
		    xf86WcmInitialCoordinates(tmppriv->local, 1);
547
548
		    xf86ReplaceIntOption(tmppriv->local->options, "TopX", tmppriv->topX);
549
		    xf86ReplaceIntOption(tmppriv->local->options, "TopY", tmppriv->topY);
550
		    xf86ReplaceIntOption(tmppriv->local->options, "BottomX", tmppriv->bottomX);
551
		    xf86ReplaceIntOption(tmppriv->local->options, "BottomY", tmppriv->bottomY);
552
		}
553
		break;
455
		break;
554
	      default:
456
	   default:
555
		DBG(10, priv->debugLevel, ErrorF("xf86WcmSetParam invalid param %d\n",param));
457
		DBG(10, priv->debugLevel, ErrorF("xf86WcmSetParam invalid param %d\n",param));
556
		return BadMatch;
458
		return BadMatch;
557
	}
459
	}
(-)a/src/xdrv/xf86Wacom.c (-25 / +14 lines)
Lines 69-77 Link Here
69
 * 2008-03-07 47-pc0.7.9-9 - Support keystrokes in wacomcpl
69
 * 2008-03-07 47-pc0.7.9-9 - Support keystrokes in wacomcpl
70
 * 2008-04-07 47-pc0.7.9-11 - Synchronized databases
70
 * 2008-04-07 47-pc0.7.9-11 - Synchronized databases
71
 * 2008-05-06 47-pc0.8.0-1 - new release
71
 * 2008-05-06 47-pc0.8.0-1 - new release
72
 * 2008-05-14 47-pc0.8.0-2 - Update rotation routine
72
 */
73
 */
73
74
74
static const char identification[] = "$Identification: 47-0.8.0-1 $";
75
static const char identification[] = "$Identification: 47-0.8.0-2 $";
75
76
76
/****************************************************************************/
77
/****************************************************************************/
77
78
Lines 92-97 extern int usbWcmGetRanges(LocalDevicePtr local); Link Here
92
extern int xf86WcmDevChangeControl(LocalDevicePtr local, xDeviceCtl* control);
93
extern int xf86WcmDevChangeControl(LocalDevicePtr local, xDeviceCtl* control);
93
extern int xf86WcmDevSwitchMode(ClientPtr client, DeviceIntPtr dev, int mode);
94
extern int xf86WcmDevSwitchMode(ClientPtr client, DeviceIntPtr dev, int mode);
94
extern void xf86WcmInitialScreens(LocalDevicePtr local);
95
extern void xf86WcmInitialScreens(LocalDevicePtr local);
96
extern void xf86WcmRotateScreen(LocalDevicePtr local, int value);
95
97
96
WacomModule gWacomModule =
98
WacomModule gWacomModule =
97
{
99
{
Lines 171-176 static int xf86WcmInitArea(LocalDevicePtr local) Link Here
171
	}
173
	}
172
174
173
	/* need maxWidth and maxHeight for keepshape */
175
	/* need maxWidth and maxHeight for keepshape */
176
	xf86WcmInitialScreens(local);
174
	xf86WcmMappingFactor(local);
177
	xf86WcmMappingFactor(local);
175
178
176
	/* Maintain aspect ratio */
179
	/* Maintain aspect ratio */
Lines 208-214 static int xf86WcmInitArea(LocalDevicePtr local) Link Here
208
	{
211
	{
209
		inlist = priv->tool->arealist;
212
		inlist = priv->tool->arealist;
210
213
211
		/* remove this area from the list */
214
		/* remove this overlapped area from the list */
212
		for (; inlist; inlist=inlist->next)
215
		for (; inlist; inlist=inlist->next)
213
		{
216
		{
214
			if (inlist->next == area)
217
			if (inlist->next == area)
Lines 475-481 static void xf86WcmInitialToolSize(LocalDevicePtr local) Link Here
475
	WacomCommonPtr common = priv->common;
478
	WacomCommonPtr common = priv->common;
476
	WacomToolPtr toollist = common->wcmTool;
479
	WacomToolPtr toollist = common->wcmTool;
477
	WacomToolAreaPtr arealist;
480
	WacomToolAreaPtr arealist;
478
	int temp;
479
481
480
	if (IsTouch(priv))
482
	if (IsTouch(priv))
481
	{
483
	{
Lines 492-505 static void xf86WcmInitialToolSize(LocalDevicePtr local) Link Here
492
		priv->wcmResolY = common->wcmResolY;
494
		priv->wcmResolY = common->wcmResolY;
493
	}
495
	}
494
496
495
	/* Rotation rotates the Max Y and Y */
496
	if (common->wcmRotate==ROTATE_CW || common->wcmRotate==ROTATE_CCW)
497
	{
498
		temp = priv->wcmMaxX;
499
		priv->wcmMaxX = priv->wcmMaxY;
500
		priv->wcmMaxY = temp;
501
	}
502
503
	for (; toollist; toollist=toollist->next)
497
	for (; toollist; toollist=toollist->next)
504
	{
498
	{
505
		arealist = toollist->arealist;
499
		arealist = toollist->arealist;
Lines 511-516 static void xf86WcmInitialToolSize(LocalDevicePtr local) Link Here
511
				arealist->bottomY = priv->wcmMaxY;
505
				arealist->bottomY = priv->wcmMaxY;
512
		}
506
		}
513
	}
507
	}
508
514
	return;
509
	return;
515
}
510
}
516
511
Lines 543-558 static int xf86WcmRegisterX11Devices (LocalDevicePtr local) Link Here
543
		IsPad(priv) ? "pad" : "eraser",
538
		IsPad(priv) ? "pad" : "eraser",
544
		nbbuttons, nbkeys, nbaxes));
539
		nbbuttons, nbkeys, nbaxes));
545
540
546
	xf86WcmInitialToolSize(local);
547
548
	/* initialize screen bounding rect */
549
	xf86WcmInitialScreens(local);
550
551
	if (xf86WcmInitArea(local) == FALSE)
552
	{
553
		return FALSE;
554
	}
555
556
	for(loop=1; loop<=nbbuttons; loop++)
541
	for(loop=1; loop<=nbbuttons; loop++)
557
		butmap[loop] = loop;
542
		butmap[loop] = loop;
558
543
Lines 663-673 static int xf86WcmRegisterX11Devices (LocalDevicePtr local) Link Here
663
	xf86MotionHistoryAllocate(local);
648
	xf86MotionHistoryAllocate(local);
664
#endif
649
#endif
665
650
666
	/* x */
651
 	xf86WcmInitialToolSize(local);
667
	xf86WcmInitialCoordinates(local, 0);
652
653
	if (xf86WcmInitArea(local) == FALSE)
654
	{
655
		return FALSE;
656
	}
668
657
669
	/* y */
658
	/* Rotation rotates the Max X and Y */
670
	xf86WcmInitialCoordinates(local, 1);
659
	xf86WcmRotateScreen(local, common->wcmRotate);
671
660
672
	/* pressure */
661
	/* pressure */
673
	InitValuatorAxisStruct(local->dev, 2, 0, 
662
	InitValuatorAxisStruct(local->dev, 2, 0, 

Return to bug 221117