rpms/linuxwacom/devel linuxwacom-0.8.2.2-intuos4-support-backport.patch, NONE, 1.1 linuxwacom.spec, 1.79, 1.80

Jarod Wilson jwilson at fedoraproject.org
Mon Jul 20 21:58:31 UTC 2009


Author: jwilson

Update of /cvs/pkgs/rpms/linuxwacom/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv12575

Modified Files:
	linuxwacom.spec 
Added Files:
	linuxwacom-0.8.2.2-intuos4-support-backport.patch 
Log Message:
* Mon Jul 20 2009 Jarod Wilson <jarod at redhat.com> 0.8.2.2-12
- Backport support for Intuos4 tablets from linuxwacom-dev branch


linuxwacom-0.8.2.2-intuos4-support-backport.patch:
 include/Xwacom.h        |    6 
 util/xsetwacom.c        |   11 
 xdrv/wcmCommon.c        |  310 +++++++-------
 xdrv/wcmConfig.c.orig   | 1013 ------------------------------------------------
 xdrv/wcmTilt2Rotation.c |  740 +++++++++++++++++++++++++++++++++++
 xdrv/wcmUSB.c           |   65 ++-
 xdrv/wcmXCommand.c      |   25 -
 xdrv/xf86Wacom.c        |  254 +++++++-----
 xdrv/xf86Wacom.h.orig   |  236 -----------
 xdrv/xf86WacomDefs.h    |    4 
 10 files changed, 1156 insertions(+), 1508 deletions(-)

--- NEW FILE linuxwacom-0.8.2.2-intuos4-support-backport.patch ---
diff -Naurp linuxwacom-0.8.2-2/src/include/Xwacom.h linuxwacom-0.8.2-2.new/src/include/Xwacom.h
--- linuxwacom-0.8.2-2/src/include/Xwacom.h	2009-01-19 13:58:37.000000000 -0500
+++ linuxwacom-0.8.2-2.new/src/include/Xwacom.h	2009-07-20 17:51:46.854323665 -0400
@@ -1,6 +1,6 @@
 /*
  * Copyright 2003 by John Joganic <john at joganic.com>
- * Copyright 2003 - 2008 by Ping Cheng <pingc at wacom.com> 
+ * Copyright 2003 - 2009 by Ping Cheng <pingc at wacom.com> 
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -95,6 +95,7 @@
 #define XWACOM_PARAM_TVRESOLUTION0	207
 #define XWACOM_PARAM_TVRESOLUTION1	208
 #define XWACOM_PARAM_COREEVENT		209
+#define XWACOM_PARAM_THRESHOLD		210
 
 #define XWACOM_PARAM_GETONLYPARAM	320
 #define XWACOM_PARAM_TID		321
@@ -138,6 +139,9 @@
 #define TV_NONE 		0
 #define TV_ABOVE_BELOW 		1
 #define TV_LEFT_RIGHT		2
+#define TV_BELOW_ABOVE		3
+#define TV_RIGHT_LEFT		4
+#define TV_MAX			4
 
 #define ROTATE_NONE 		0
 #define ROTATE_CW 		1
diff -Naurp linuxwacom-0.8.2-2/src/util/xsetwacom.c linuxwacom-0.8.2-2.new/src/util/xsetwacom.c
--- linuxwacom-0.8.2-2/src/util/xsetwacom.c	2009-01-19 13:58:37.000000000 -0500
+++ linuxwacom-0.8.2-2.new/src/util/xsetwacom.c	2009-07-20 17:55:05.006448526 -0400
@@ -105,6 +105,8 @@ static const char* tv_char[] = 
 	"none",
 	"vertical",
 	"horizontal",
+	"aboveof",
+	"leftof",
 	"NULL"
 };
 
@@ -330,9 +332,9 @@ static PARAMINFO gParamInfo[] =
 
 	{ "TwinView",
 		"Sets the mapping to TwinView horizontal/vertical/none. "
-		"Values = none, vertical, horizontal (default is none).",
+		"Values = none, vertical, horizontal, leftof, aboveof (default is none).",
 		XWACOM_PARAM_TWINVIEW, VALUE_OPTIONAL, RANGE, 
-		TV_NONE, TV_LEFT_RIGHT, SINGLE_VALUE, TV_NONE },
+		TV_NONE, TV_MAX, SINGLE_VALUE, TV_NONE },
 
 	{ "Mode",
 		"Switches cursor movement mode (default is absolute/on). ",
@@ -438,6 +440,11 @@ static PARAMINFO gParamInfo[] =
 		XWACOM_PARAM_CLICKFORCE, VALUE_OPTIONAL, RANGE, 
 		1, 21, SINGLE_VALUE, 6 },	
 
+	{ "Threshold",
+		"Sets tip/eraser pressure threshold directly to the pressure "
+		"(default is 6*MaxZ/100)",
+		XWACOM_PARAM_THRESHOLD, VALUE_REQUIRED },
+
 	{ "Accel",
 		"Sets relative cursor movement acceleration "
 		"(default is 1)",
diff -Naurp linuxwacom-0.8.2-2/src/xdrv/wcmCommon.c linuxwacom-0.8.2-2.new/src/xdrv/wcmCommon.c
--- linuxwacom-0.8.2-2/src/xdrv/wcmCommon.c	2009-07-20 17:55:12.880446282 -0400
+++ linuxwacom-0.8.2-2.new/src/xdrv/wcmCommon.c	2009-07-20 17:34:00.255321464 -0400
@@ -1,6 +1,6 @@
 /*
  * Copyright 1995-2002 by Frederic Lepied, France. <Lepied at XFree86.org>
- * Copyright 2002-2008 by Ping Cheng, Wacom Technology. <pingc at wacom.com>		
+ * Copyright 2002-2009 by Ping Cheng, Wacom Technology. <pingc at wacom.com>		
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -45,6 +45,9 @@ WacomDeviceClass* wcmDeviceClasses[] =
 extern int xf86WcmDevSwitchModeCall(LocalDevicePtr local, int mode);
 extern void xf86WcmChangeScreen(LocalDevicePtr local, int value);
 extern void xf86WcmInitialCoordinates(LocalDevicePtr local, int axes);
+extern void xf86WcmVirtaulTabletSize(LocalDevicePtr local);
+extern void xf86WcmVirtaulTabletPadding(LocalDevicePtr local);
+extern void xf86WcmTilt2R(WacomDeviceStatePtr ds);
 
 /*****************************************************************************
  * Static functions
@@ -66,13 +69,10 @@ static void sendAButton(LocalDevicePtr l
 void xf86WcmMappingFactor(LocalDevicePtr local)
 {
 	WacomDevicePtr priv = (WacomDevicePtr) local->private;
-	int i = 0, minX = 0, minY = 0, maxX = 0, maxY = 0;
  
 	DBG(10, priv->debugLevel, ErrorF("xf86WcmMappingFactor \n"));
 
-	priv->sizeX = priv->bottomX - priv->topX - 2*priv->tvoffsetX;
-	priv->sizeY = priv->bottomY - priv->topY - 2*priv->tvoffsetY;
-	priv->maxWidth = 0, priv->maxHeight = 0;
+	xf86WcmVirtaulTabletSize(local);
 	
 	if (!(priv->flags & ABSOLUTE_FLAG) || !priv->wcmMMonitor)
 	{
@@ -104,44 +104,11 @@ void xf86WcmMappingFactor(LocalDevicePtr
 	if (priv->currentScreen == -1) /* tool on the tablet */
 		priv->currentScreen = 0;
 
-	if ( ((priv->twinview != TV_NONE) || /* TwinView & whole desktop */
-		/* stay in one screen at a time (multimonitor) */
-		!priv->wcmMMonitor || 
-		/* always stay in the configured screen */
-		(screenInfo.numScreens > 1 && priv->screen_no != -1))  
-		 && (priv->flags & ABSOLUTE_FLAG) )
-	{
-		priv->maxWidth = priv->screenBottomX[priv->currentScreen] - 
-			priv->screenTopX[priv->currentScreen];
-		priv->maxHeight = priv->screenBottomY[priv->currentScreen] - 
-			priv->screenTopY[priv->currentScreen];
-	}
-	else
-	{
-		/* count the whole desktop when no specific screen is defined or 
-		 * tool is in relative mode
-		 */
-		minX = priv->screenTopX[0];
-		minY = priv->screenTopY[0];
-		maxX = priv->screenBottomX[0];
-		maxY = priv->screenBottomY[0];
-		for (i = 1; i < priv->numScreen; i++)
-		{
-			if (priv->screenTopX[i] < minX)
-				minX = priv->screenTopX[i];
-			if (priv->screenTopY[i] < minY)
-				minY = priv->screenTopY[i];
-			if (priv->screenBottomX[i] > maxX)
-				maxX = priv->screenBottomX[i];
-			if (priv->screenBottomY[i] > maxY)
-				maxY = priv->screenBottomY[i];
-		}
-		priv->maxWidth = maxX - minX;
-		priv->maxHeight = maxY - minY;
-	}
 	DBG(10, priv->debugLevel, ErrorF("xf86WcmMappingFactor"
-		" Active tablet area x=%d y=%d map to maxWidth =%d maxHeight =%d\n", 
-		priv->sizeX, priv->sizeY, priv->maxWidth, priv->maxHeight));
+		" Active tablet area x=%d y=%d (virtual table area x=%d y=%d) map"
+		" to maxWidth =%d maxHeight =%d\n", 
+		priv->bottomX, priv->bottomY, priv->sizeX, priv->sizeY,
+		priv->maxWidth, priv->maxHeight));
 
 	priv->factorX = (double)priv->maxWidth / (double)priv->sizeX;
 	priv->factorY = (double)priv->maxHeight / (double)priv->sizeY;
@@ -157,15 +124,20 @@ void xf86WcmMappingFactor(LocalDevicePtr
  *   combined horizontal and vertical setups
  ****************************************************************************/
 
-static void xf86WcmSetScreen(LocalDevicePtr local, int *value0, int *value1)
+static void xf86WcmSetScreen(LocalDevicePtr local, int v0, int v1)
 {
 	WacomDevicePtr priv = (WacomDevicePtr) local->private;
-	int screenToSet = -1, letfPadding = 0, topPadding = 0;
-	int i, j, x, y, v0 = *value0, v1 = *value1;
+	int screenToSet = -1, i, j, x, y, tabletSize = 0;
 
-	DBG(6, priv->debugLevel, ErrorF("xf86WcmSetScreen "
-		"v0=%d v1=%d currentScreen=%d\n", *value0, 
-		*value1, priv->currentScreen));
+	DBG(6, priv->debugLevel, ErrorF("xf86WcmSetScreen v0=%d v1=%d "
+		"currentScreen=%d\n", v0, v1, priv->currentScreen));
+
+	if (priv->screen_no != -1 && priv->screen_no >= priv->numScreen)
+	{
+		ErrorF("xf86WcmSetScreen Screen%d is larger than number of available screens (%d)\n",
+			priv->screen_no, priv->numScreen);
+		priv->screen_no = -1;
+	}
 
 	if (!(local->flags & (XI86_ALWAYS_CORE | XI86_CORE_POINTER))) return;
 
@@ -173,18 +145,38 @@ static void xf86WcmSetScreen(LocalDevice
 	{
 		if (priv->twinview == TV_LEFT_RIGHT)
 		{
-			if (v0 > priv->bottomX - priv->tvoffsetX && v0 <= priv->bottomX)
+			tabletSize = priv->bottomX - priv->tvoffsetX;
+			if (v0 > tabletSize && v0 <= priv->bottomX)
 				priv->currentScreen = 1;
 			if (v0 > priv->topX && v0 <= priv->topX + priv->tvoffsetX)
 				priv->currentScreen = 0;
 		}
 		if (priv->twinview == TV_ABOVE_BELOW)
 		{
-			if (v1 > priv->bottomY - priv->tvoffsetY && v1 <= priv->bottomY)
+			tabletSize = priv->bottomY - priv->tvoffsetY;
+			if (v0 > tabletSize && v0 <= priv->bottomY)
 				priv->currentScreen = 1;
-			if (v1 > priv->topY && v1 <= priv->topY + priv->tvoffsetY)
+			if (v0 > priv->topY && v0 <= priv->topY + priv->tvoffsetY)
 				priv->currentScreen = 0;
 		}
+		if (priv->twinview == TV_RIGHT_LEFT)
[...2940 lines suppressed...]
-
-#ifdef WCM_ENABLE_LINUXINPUT
-#include <asm/types.h>
-#include <linux/input.h>
-
-/* keithp - a hack to avoid redefinitions of these in xf86str.h */
-#ifdef BUS_PCI
-#undef BUS_PCI
-#endif
-#ifdef BUS_ISA
-#undef BUS_ISA
-#endif
-
-#define MAX_USB_EVENTS 32
-
-#endif /* WCM_ENABLE_LINUXINPUT */
-
-/* max number of input events to read in one read call */
-#define MAX_EVENTS 50
-
-/*****************************************************************************
- * XFree86 V4.x Headers
- ****************************************************************************/
-
-#ifndef XFree86LOADER
-#include <unistd.h>
-#include <errno.h>
-#endif
-
-#include <misc.h>
-#include <xf86.h>
-#define NEED_XF86_TYPES
-#if !defined(DGUX)
-# include <xisb.h>
-/* X.org recently kicked out the libc-wrapper */
-# ifdef WCM_NO_LIBCWRAPPER
-#  include <string.h>
-#  include <errno.h>
-# else
-#  include <xf86_ansic.h>
-# endif
-#endif
-#include <xf86_OSproc.h>
-#include <xf86Xinput.h>
-#include <exevents.h>           /* Needed for InitValuator/Proximity stuff */
-#include <X11/keysym.h>
-#include <mipointer.h>
-
-#ifdef XFree86LOADER
-#include <xf86Module.h>
-#endif
-
-/*****************************************************************************
- * QNX support
- ****************************************************************************/
-
-#if defined(__QNX__) || defined(__QNXNTO__)
-#define POSIX_TTY
-#endif
-
-/******************************************************************************
- * Debugging support
- *****************************************************************************/
-
-#ifdef DBG
-#undef DBG
-#endif
-#ifdef DEBUG
-#undef DEBUG
-#endif
-
-#define DEBUG 1
-#if DEBUG
-#define DBG(lvl, dLevel, f) do { if ((lvl) <= dLevel) f; } while (0)
-#else
-#define DBG(lvl, dLevel, f)
-#endif
-
-/*****************************************************************************
- * General Macros
- ****************************************************************************/
-
-#define ABS(x) ((x) > 0 ? (x) : -(x))
-
-/*****************************************************************************
- * General Defines
- ****************************************************************************/
-#define XI_STYLUS "STYLUS"      /* X device name for the stylus */
-#define XI_CURSOR "CURSOR"      /* X device name for the cursor */
-#define XI_ERASER "ERASER"      /* X device name for the eraser */
-#define XI_PAD    "PAD"         /* X device name for the Pad */
-#define XI_TOUCH  "TOUCH"       /* X device name for the touch */
-
-/******************************************************************************
- * WacomModule - all globals are packed in a single structure to keep the
- *               global namespaces as clean as possible.
- *****************************************************************************/
-typedef struct _WacomModule WacomModule;
-
-struct _WacomModule
-{
-	const char* identification;
-
-	InputDriverPtr wcmDrv;
-
-	int (*DevOpen)(DeviceIntPtr pWcm);
-	void (*DevReadInput)(LocalDevicePtr local);
-	void (*DevControlProc)(DeviceIntPtr device, PtrCtrl* ctrl);
-	void (*DevClose)(LocalDevicePtr local);
-	int (*DevProc)(DeviceIntPtr pWcm, int what);
-	int (*DevChangeControl)(LocalDevicePtr local, xDeviceCtl* control);
-	int (*DevSwitchMode)(ClientPtr client, DeviceIntPtr dev, int mode);
-	Bool (*DevConvert)(LocalDevicePtr local, int first, int num,
-		int v0, int v1, int v2, int v3, int v4, int v5, int* x, int* y);
-	Bool (*DevReverseConvert)(LocalDevicePtr local, int x, int y,
-		int* valuators);
-};
-
-	extern WacomModule gWacomModule;
-
-/* The rest are defined in a separate .h-file */
-#include "xf86WacomDefs.h"
-
-/*****************************************************************************
- * XFree86 V4 Inlined Functions and Prototypes
- ****************************************************************************/
-
-#define xf86WcmFlushTablet(fd) xf86FlushInput(fd)
-#define xf86WcmSetSerialSpeed(fd,rate) xf86SetSerialSpeed((fd),(rate))
-
-#define xf86WcmRead(a,b,c) xf86ReadSerial((a),(b),(c))
-#define xf86WcmWrite(a,b,c) xf86WriteSerial((a),(char*)(b),(c))
-#define xf86WcmClose(a) xf86CloseSerial((a))
-
-#define XCONFIG_PROBED "(==)"
-#define XCONFIG_GIVEN "(**)"
-#define xf86Verbose 1
-#undef PRIVATE
-#define PRIVATE(x) XI_PRIVATE(x)
-
-/*****************************************************************************
- * General Inlined functions and Prototypes
- ****************************************************************************/
-/* BIG HAIRY WARNING:
- * Don't overuse SYSCALL(): use it ONLY when you call low-level functions such
- * as ioctl(), read(), write() and such. Otherwise you can easily lock up X11,
- * for example: you pull out the USB tablet, the handle becomes invalid,
- * xf86WcmRead() returns -1 AND errno is left as EINTR from hell knows where.
- * Then you'll loop forever, and even Ctrl+Alt+Backspace doesn't help.
- * xf86WcmReadSerial, WriteSerial, CloseSerial & company already use SYSCALL()
- * internally; there's no need to duplicate it outside the call.
- */
-#define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
-
-#define RESET_RELATIVE(ds) do { (ds).relwheel = 0; } while (0)
-
-int xf86WcmWait(int t);
-int xf86WcmReady(int fd);
-
-LocalDevicePtr xf86WcmAllocate(char* name, int flag);
-LocalDevicePtr xf86WcmAllocateStylus(void);
-LocalDevicePtr xf86WcmAllocateCursor(void);
-LocalDevicePtr xf86WcmAllocateEraser(void);
-LocalDevicePtr xf86WcmAllocatePad(void);
-
-Bool xf86WcmOpen(LocalDevicePtr local);
-
-/* device autoprobing */
-char *xf86WcmEventAutoDevProbe (LocalDevicePtr local);
-
-/* serial write and wait command */
-int xf86WcmWriteWait(int fd, const char* request);
-
-/*wait for tablet data */
-int xf86WcmWaitForTablet(int fd, char * data, int size);
-
-/* common tablet initialization regime */
-int xf86WcmInitTablet(LocalDevicePtr local, const char* id, float version);
-
-/* standard packet handler */
-void xf86WcmReadPacket(LocalDevicePtr local);
-
-/* handles suppression, filtering, and dispatch. */
-void xf86WcmEvent(WacomCommonPtr common, unsigned int channel, const WacomDeviceState* ds);
-
-/* dispatches data to XInput event system */
-void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds);
-
-/* generic area check for wcmConfig.c, xf86Wacom.c, and wcmCommon.c */
-Bool xf86WcmPointInArea(WacomToolAreaPtr area, int x, int y);
-Bool xf86WcmAreaListOverlap(WacomToolAreaPtr area, WacomToolAreaPtr list);
-
-/* Change pad's mode according to it core event status */
-int xf86WcmSetPadCoreMode(LocalDevicePtr local);
-
-/* calculate the proper tablet to screen mapping factor */
-void xf86WcmMappingFactor(LocalDevicePtr local);
-
-/****************************************************************************/
-#endif /* __XF86WACOM_H */


Index: linuxwacom.spec
===================================================================
RCS file: /cvs/pkgs/rpms/linuxwacom/devel/linuxwacom.spec,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -p -r1.79 -r1.80
--- linuxwacom.spec	6 Apr 2009 02:29:16 -0000	1.79
+++ linuxwacom.spec	20 Jul 2009 21:58:30 -0000	1.80
@@ -3,7 +3,7 @@
 # Upstream's versioning is goofy.  Note the mapping from tarname to version.
 Name:		linuxwacom
 Version:	0.8.2.2
-Release:	11%{?dist}
+Release:	12%{?dist}
 Summary:	Wacom Drivers from Linux Wacom Project
 
 Group:		User Interface/X Hardware Support
@@ -11,15 +11,27 @@ License:	LGPLv2+ and GPLv2+
 URL:		http://linuxwacom.sourceforge.net
 Source0:	http://prdownloads.sourceforge.net/linuxwacom/%{tarname}.tar.bz2
 Source1:	60-wacom.rules
+# in upstream linuxwacom-dev tree
 Source2:	10-linuxwacom.fdi
+# in upstream linuxwacom-dev tree
 Patch1:		linuxwacom-0.7.8.3-sdk-me-harder.patch
+# in upstream linuxwacom-dev tree
 Patch2:		linuxwacom-0.7.9.7-fix_build.patch
+# not upstream, reason unknown
 Patch3:		linuxwacom-0.8.2.1-fix_build.patch
+# appears to be fixed differently upstream
 Patch4:		linuxwacom-0.8.2.2-fix-mapping.patch
+# in upstream linuxwacom-dev tree
 Patch5:		linuxwacom-0.8.2.2-export-module.patch
+# in upstream linuxwacom-dev tree
 Patch7:		linuxwacom-0.8.2.2-wcmMaxX.patch
+# in upstream linuxwacom-dev tree
 Patch8:		linuxwacom-0.8.2.2-hal-setup.patch
+# a revert of an upstream change that is irrelevant for current Xorg,
+# an in fact, breaks some devices
 Patch9:		linuxwacom-0.8.2.2-serial-check.patch
+# backport of upstream intuos4 support
+Patch10:	linuxwacom-0.8.2.2-intuos4-support-backport.patch
 
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}
 BuildRequires:	libX11-devel libXi-devel ncurses-devel
@@ -55,6 +67,7 @@ compiling applications for manipulating 
 %patch7 -p1
 %patch8 -p1
 %patch9 -p1
+%patch10 -p1
 
 %build
 
@@ -117,6 +130,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/libwacomcfg*.so
 
 %changelog
+* Mon Jul 20 2009 Jarod Wilson <jarod at redhat.com> 0.8.2.2-12
+- Backport support for Intuos4 tablets from linuxwacom-dev branch
+
 * Mon Apr 06 2009 Peter Hutterer <peter.hutterer at redhat.com> 0.8.2.2-11
 - linuxwacom-0.8.2.2-serial-check.patch: revert serial channel checking, it
   breaks waltop tablets. 




More information about the fedora-extras-commits mailing list