diff options
Diffstat (limited to 'src/xdrv')
-rwxr-xr-x | src/xdrv/wcmCommon.c | 4 | ||||
-rwxr-xr-x | src/xdrv/wcmConfig.c | 9 | ||||
-rwxr-xr-x | src/xdrv/wcmISDV4.c | 14 | ||||
-rwxr-xr-x | src/xdrv/wcmSerial.c | 22 | ||||
-rwxr-xr-x | src/xdrv/wcmUSB.c | 4 | ||||
-rwxr-xr-x | src/xdrv/xf86Wacom.c | 9 | ||||
-rwxr-xr-x | src/xdrv/xf86Wacom.h | 6 |
7 files changed, 53 insertions, 15 deletions
diff --git a/src/xdrv/wcmCommon.c b/src/xdrv/wcmCommon.c index 52da7d6..3e103f9 100755 --- a/src/xdrv/wcmCommon.c +++ b/src/xdrv/wcmCommon.c @@ -1,6 +1,6 @@ /* * Copyright 1995-2002 by Frederic Lepied, France. <Lepied@XFree86.org> - * Copyright 2002-2006 by Ping Cheng, Wacom Technology. <pingc@wacom.com> + * Copyright 2002-2007 by Ping Cheng, Wacom Technology. <pingc@wacom.com> * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -667,6 +667,8 @@ void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds, unsigne } } priv->oldProximity = is_proximity; + priv->old_device_id = id; + priv->old_serial = serial; if (is_proximity) { priv->oldButtons = buttons; diff --git a/src/xdrv/wcmConfig.c b/src/xdrv/wcmConfig.c index d51ee80..b471b56 100755 --- a/src/xdrv/wcmConfig.c +++ b/src/xdrv/wcmConfig.c @@ -1,6 +1,6 @@ /* * Copyright 1995-2002 by Frederic Lepied, France. <Lepied@XFree86.org> - * Copyright 2002-2006 by Ping Cheng, Wacom. <pingc@wacom.com> + * Copyright 2002-2007 by Ping Cheng, Wacom. <pingc@wacom.com> * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -115,6 +115,11 @@ LocalDevicePtr xf86WcmAllocate(char* name, int flag) priv->factorY = 0.0; /* Y factor */ priv->common = common; /* common info pointer */ priv->oldProximity = 0; /* previous proximity */ + priv->old_serial = 0; /* last active tool's serial */ + priv->old_device_id = IsStylus(priv) ? STYLUS_DEVICE_ID : + (IsEraser(priv) ? ERASER_DEVICE_ID : + (IsCursor(priv) ? CURSOR_DEVICE_ID : PAD_DEVICE_ID)); + priv->devReverseCount = 0; /* flag for relative Reverse call */ priv->serial = 0; /* serial number */ priv->screen_no = -1; /* associated screen */ @@ -174,6 +179,8 @@ LocalDevicePtr xf86WcmAllocate(char* name, int flag) common->wcmProtocolLevel = 4; /* protocol level */ common->wcmThreshold = 0; /* unconfigured threshold */ common->wcmLinkSpeed = 9600; /* serial link speed */ + common->wcmISDV4Speed = 19200; /* serial ISDV4 link speed */ + common->wcmDevCls = &gWacomSerialDevice; /* device-specific functions */ common->wcmModel = NULL; /* model-specific functions */ common->wcmEraserID = 0; /* eraser id associated with the stylus */ diff --git a/src/xdrv/wcmISDV4.c b/src/xdrv/wcmISDV4.c index 691128d..ed6201b 100755 --- a/src/xdrv/wcmISDV4.c +++ b/src/xdrv/wcmISDV4.c @@ -1,6 +1,6 @@ /* * Copyright 1995-2002 by Frederic Lepied, France. <Lepied@XFree86.org> - * Copyright 2002-2005 by Ping Cheng, Wacom Technology. <pingc@wacom.com> + * Copyright 2002-2007 by Ping Cheng, Wacom Technology. <pingc@wacom.com> * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -78,10 +78,8 @@ static Bool isdv4Init(LocalDevicePtr local) DBG(1, ErrorF("initializing ISDV4 tablet\n")); - /* Set the speed of the serial link to 19200 first */ - if (common->wcmLinkSpeed == 9600) - common->wcmLinkSpeed = 19200; - if (xf86WcmSetSerialSpeed(local->fd, common->wcmLinkSpeed) < 0) + /* Try 19200 first */ + if (xf86WcmSetSerialSpeed(local->fd, common->wcmISDV4Speed) < 0) return !Success; /* Send stop command to the tablet */ @@ -114,6 +112,7 @@ static void isdv4InitISDV4(WacomCommonPtr common, const char* id, float version) common->wcmResolY = 2540; /* tablet Y resolution in points/inch */ common->wcmTPCButton = 1; /* Tablet PC buttons on by default */ common->wcmTPCButtonDefault = 1; + common->tablet_id = 0x90; } static int isdv4GetRanges(LocalDevicePtr local) { @@ -167,9 +166,10 @@ static int isdv4GetRanges(LocalDevicePtr local) /* Control data bit check */ if ( !(data[0] & 0x40) ) { - if (common->wcmLinkSpeed != 38400) + /* Try 38400 now */ + if (common->wcmISDV4Speed != 38400) { - common->wcmLinkSpeed = 38400; + common->wcmISDV4Speed = 38400; return isdv4Init(local); } else diff --git a/src/xdrv/wcmSerial.c b/src/xdrv/wcmSerial.c index a840faf..ff50c7b 100755 --- a/src/xdrv/wcmSerial.c +++ b/src/xdrv/wcmSerial.c @@ -1,6 +1,6 @@ /* * Copyright 1995-2002 by Frederic Lepied, France. <Lepied@XFree86.org> - * Copyright 2002-2005 by Ping Cheng, Wacom Technology. <pingc@wacom.com> + * Copyright 2002-2007 by Ping Cheng, Wacom Technology. <pingc@wacom.com> * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -523,6 +523,7 @@ static int serialInitTablet(LocalDevicePtr local) int loop, idx; char id[BUFFER_SIZE]; float version; + WacomCommonPtr common = ((WacomDevicePtr)(local->private))->common; WacomModelPtr model = NULL; @@ -559,19 +560,36 @@ static int serialInitTablet(LocalDevicePtr local) /* Detect tablet model based on identifier */ if (id[2] == 'G' && id[3] == 'D') + { model = &serialIntuos; + common->tablet_id = 0x20; + } else if (id[2] == 'X' && id[3] == 'D') + { model = &serialIntuos2; + common->tablet_id = 0x40; + } else if ( (id[2] == 'P' && id[3] == 'L') || (id[2] == 'D' && id[3] == 'T') ) + { model = &serialCintiq; + common->tablet_id = 0x30; + } else if (id[2] == 'C' && id[3] == 'T') + { model = &serialPenPartner; + common->tablet_id = 0x00; + } else if (id[2] == 'E' && id[3] == 'T') + { model = &serialGraphire; + common->tablet_id = 0x10; + } else + { model = &serialProtocol4; - + common->tablet_id = 0x03; + } } return xf86WcmInitTablet(local,model,id,version); diff --git a/src/xdrv/wcmUSB.c b/src/xdrv/wcmUSB.c index 7b1a876..483e612 100755 --- a/src/xdrv/wcmUSB.c +++ b/src/xdrv/wcmUSB.c @@ -1,6 +1,6 @@ /* * Copyright 1995-2002 by Frederic Lepied, France. <Lepied@XFree86.org> - * Copyright 2002-2006 by Ping Cheng, Wacom Technology. <pingc@wacom.com> + * Copyright 2002-2007 by Ping Cheng, Wacom Technology. <pingc@wacom.com> * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -722,8 +722,6 @@ static void usbParseEvent(WacomCommonPtr common, { memset(&common->wcmChannel[i],0, sizeof(WacomChannel)); - /* in case the in-prox event was missing */ - common->wcmChannel[i].work.proximity = 1; /* Intuos3 or Graphire4 Pad */ if (common->wcmLastToolSerial == 0xffffffff || common->wcmLastToolSerial == 0xf0) diff --git a/src/xdrv/xf86Wacom.c b/src/xdrv/xf86Wacom.c index 87a5b83..9ed439e 100755 --- a/src/xdrv/xf86Wacom.c +++ b/src/xdrv/xf86Wacom.c @@ -1148,6 +1148,15 @@ static int xf86WcmGetParam(LocalDevicePtr local, int param) return -1; case XWACOM_PARAM_TID: return common->tablet_id; + case XWACOM_PARAM_TOOLID: + return priv->old_device_id; + case XWACOM_PARAM_TOOLSERIAL: + return priv->old_serial; + case XWACOM_PARAM_NUMSCREEN: + if (priv->twinview == TV_NONE) + return screenInfo.numScreens; + else + return 2; } DBG(10, ErrorF("xf86WcmGetParam invalid param %d\n",param)); return -1; diff --git a/src/xdrv/xf86Wacom.h b/src/xdrv/xf86Wacom.h index 019e5ac..7ab948e 100755 --- a/src/xdrv/xf86Wacom.h +++ b/src/xdrv/xf86Wacom.h @@ -1,6 +1,6 @@ /* * Copyright 1995-2002 by Frederic Lepied, France. <Lepied@XFree86.org> - * Copyright 2002-2006 by Ping Cheng, Wacom Technology. <pingc@wacom.com> + * Copyright 2002-2007 by Ping Cheng, Wacom Technology. <pingc@wacom.com> * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -228,6 +228,7 @@ struct _WacomModel #define STYLUS_DEVICE_ID 0x02 #define CURSOR_DEVICE_ID 0x06 #define ERASER_DEVICE_ID 0x0A +#define PAD_DEVICE_ID 0x0F #define STYLUS_ID 0x00000001 #define CURSOR_ID 0x00000002 @@ -297,6 +298,8 @@ struct _WacomDeviceRec int oldThrottle; /* previous throttle value */ int oldButtons; /* previous buttons state */ int oldProximity; /* previous proximity */ + int old_device_id; /* last in prox device id */ + int old_serial; /* last in prox tool serial number */ int devReverseCount; /* Relative ReverseConvert called twice each movement*/ double speed; /* relative mode speed */ int accel; /* relative mode acceleration */ @@ -483,6 +486,7 @@ struct _WacomCommonRec int wcmThreshold; /* Threshold for button pressure */ WacomChannel wcmChannel[MAX_CHANNELS]; /* channel device state */ unsigned int wcmLinkSpeed; /* serial link speed */ + unsigned int wcmISDV4Speed; /* serial ISDV4 link speed */ WacomDeviceClassPtr wcmDevCls; /* device class functions */ WacomModelPtr wcmModel; /* model-specific functions */ |