CC-ing the list, got dropped accidentally.

On Thu, Mar 18, 2010 at 02:32:34PM -0700, Ping Cheng wrote:
> From a65bfd399c817f679924424649b49efb9ce6d325 Mon Sep 17 00:00:00 2001
> From: Ping Cheng <[email protected]>
> Date: Thu, 18 Mar 2010 14:18:32 -0700
> Subject: [PATCH 3/3] Change Copyright
> 
> Change "Wacom Technology" to "Wacom" to cover all regions
> 
> Signed-off-by: Ping Cheng <[email protected]>
> ---
>  src/wcmCommon.c      |    2 +-
>  src/wcmISDV4.c       |    2 +-
>  src/wcmTouchFilter.c |    2 +-
>  src/wcmUSB.c         |    2 +-
>  src/wcmXCommand.c    |    2 +-
>  src/xf86Wacom.c      |    2 +-
>  src/xf86WacomDefs.h  |    2 +-
>  7 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/src/wcmCommon.c b/src/wcmCommon.c
> index 5839ee5..14c5c62 100644
> --- a/src/wcmCommon.c
> +++ b/src/wcmCommon.c
> @@ -1,6 +1,6 @@
>  /*
>   * Copyright 1995-2002 by Frederic Lepied, France. <[email protected]>
> - * Copyright 2002-2009 by Ping Cheng, Wacom Technology. <[email protected]>    
>         
> + * Copyright 2002-2010 by Ping Cheng, Wacom. <[email protected]>               
>   *
>   * This program is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU General Public License
> diff --git a/src/wcmISDV4.c b/src/wcmISDV4.c
> index e10816e..8182f75 100644
> --- a/src/wcmISDV4.c
> +++ b/src/wcmISDV4.c
> @@ -1,6 +1,6 @@
>  /*
>   * Copyright 1995-2002 by Frederic Lepied, France. <[email protected]>
> - * Copyright 2002-2010 by Ping Cheng, Wacom Technology. <[email protected]>
> + * Copyright 2002-2010 by Ping Cheng, Wacom. <[email protected]>
>   * 
>   * This program is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU General Public License
> diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c
> index 90c794c..f31d948 100644
> --- a/src/wcmTouchFilter.c
> +++ b/src/wcmTouchFilter.c
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright 2009 by Ping Cheng, Wacom Technology. <[email protected]>
> + * Copyright 2009 - 2010 by Ping Cheng, Wacom. <[email protected]>
>   *
>   * This program is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU General Public License
> diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> index 26c4754..8d2c75b 100644
> --- a/src/wcmUSB.c
> +++ b/src/wcmUSB.c
> @@ -1,6 +1,6 @@
>  /*
>   * Copyright 1995-2002 by Frederic Lepied, France. <[email protected]>
> - * Copyright 2002-2010 by Ping Cheng, Wacom Technology. <[email protected]>
> + * Copyright 2002-2010 by Ping Cheng, Wacom. <[email protected]>
>   *                                                                           
>  
>   * This program is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU General Public License
> diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
> index 0fd2ca0..da2de14 100644
> --- a/src/wcmXCommand.c
> +++ b/src/wcmXCommand.c
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright 2007-2009 by Ping Cheng, Wacom Technology. <[email protected]>
> + * Copyright 2007-2010 by Ping Cheng, Wacom. <[email protected]>
>   * 
>   * This program is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU General Public License
> diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
> index 1f61503..0aad6fa 100644
> --- a/src/xf86Wacom.c
> +++ b/src/xf86Wacom.c
> @@ -1,6 +1,6 @@
>  /*
>   * Copyright 1995-2002 by Frederic Lepied, France. <[email protected]> 
> - * Copyright 2002-2009 by Ping Cheng, Wacom Technology. <[email protected]>
> + * Copyright 2002-2010 by Ping Cheng, Wacom. <[email protected]>
>   * 
>   * This program is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU General Public License
> diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
> index 3af8a3f..b468da6 100644
> --- a/src/xf86WacomDefs.h
> +++ b/src/xf86WacomDefs.h
> @@ -1,6 +1,6 @@
>  /*
>   * Copyright 1995-2002 by Frederic Lepied, France. <[email protected]>
> - * Copyright 2002-2010 by Ping Cheng, Wacom Technology. <[email protected]>
> + * Copyright 2002-2010 by Ping Cheng, Wacom. <[email protected]>
>   * 
>   * This program is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU General Public License
> -- 
> 1.6.6.1
> 

> From c055a1f06ce840f1b2237fe0df273aee63d653f0 Mon Sep 17 00:00:00 2001
> From: Ping Cheng <[email protected]>
> Date: Thu, 18 Mar 2010 14:13:19 -0700
> Subject: [PATCH 2/3] use wcmKeys to check tool type
> 
> Since wcmKeys can be accessed from usbWcmGetRanges, we retrieve
> the supported tool types instead of product ID for touch devices
> that also report pad data. This change makes the code generic to
> all touch devices that report pad data.
> 
> Signed-off-by: Ping Cheng <[email protected]>
> ---
>  src/wcmUSB.c |   14 ++++++--------
>  1 files changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> index e7b1f30..26c4754 100644
> --- a/src/wcmUSB.c
> +++ b/src/wcmUSB.c
> @@ -528,16 +528,14 @@ int usbWcmGetRanges(LocalDevicePtr local)
>       unsigned long abs[NBITS(ABS_MAX)] = {0};
>       WacomDevicePtr priv = (WacomDevicePtr)local->private;
>       WacomCommonPtr common = priv->common;
> -     int is_touch;
> +     int is_touch = IsTouch(priv);
>  
> -     is_touch = IsTouch(priv);
> -     /* Bamboo P&T have both Touch and Pad types on same
> -      * device.  Its normal for this to be called for pad
> -      * case and logic requires it to act same as Touch
> -      * case.
> +     /* Devices such as Bamboo P&T may have Pad data reported in the same
> +      * packet as Touch.  It's normal for Pad to be called first but logic
> +      * requires it to act the same as Touch.
>        */
> -     if (IsPad(priv) &&
> -         common->tablet_id >= 0xd0 && common->tablet_id <= 0xd3)
> +     if (ISBITSET(common->wcmKeys, BTN_TOOL_DOUBLETAP)
> +          && ISBITSET(common->wcmKeys, BTN_TOOL_FINGER))
>               is_touch = 1;
>  
>       if (ioctl(local->fd, EVIOCGBIT(0 /*EV*/, sizeof(ev)), ev) < 0)
> -- 
> 1.6.6.1
> 

> From 8b3e17b39c39925b7ace2162b4621bdb2d3c63e4 Mon Sep 17 00:00:00 2001
> From: Ping Cheng <[email protected]>
> Date: Thu, 18 Mar 2010 14:10:46 -0700
> Subject: [PATCH 1/3] Make keys into wcmKeys
> 
> Tool type and other device/tool specific characters can be retrieved
> through the supported events, defined in keys, from the kernel. Make
> this variable an attribute of common so we only need to retrieve it
> once in wcmPreInit.
> 
> Signed-off-by: Ping Cheng <[email protected]>
> ---
>  src/wcmConfig.c         |   46 +++++++++++++++++++++-------------------------
>  src/wcmISDV4.c          |   20 +++++++++++---------
>  src/wcmUSB.c            |   28 +++++++++++-----------------
>  src/wcmValidateDevice.c |   33 +++++++++++++++++----------------
>  src/xf86Wacom.h         |   16 ++++++++--------
>  src/xf86WacomDefs.h     |    3 ++-
>  6 files changed, 70 insertions(+), 76 deletions(-)
> 
> diff --git a/src/wcmConfig.c b/src/wcmConfig.c
> index 0bc0436..6768f3a 100644
> --- a/src/wcmConfig.c
> +++ b/src/wcmConfig.c
> @@ -1,6 +1,6 @@
>  /*
>   * Copyright 1995-2002 by Frederic Lepied, France. <[email protected]>
> - * Copyright 2002-2009 by Ping Cheng, Wacom. <[email protected]>
> + * Copyright 2002-2010 by Ping Cheng, Wacom. <[email protected]>
>   *                                                                           
>  
>   * This program is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU General Public License
> @@ -154,7 +154,7 @@ error:
>       return 0;
>  }
>  
> -static int wcmSetType(LocalDevicePtr local, const char *type, int tablet_id)
> +static int wcmSetType(LocalDevicePtr local, const char *type)
>  {
>       WacomDevicePtr priv = local->private;
>  
> @@ -174,7 +174,7 @@ static int wcmSetType(LocalDevicePtr local, const char 
> *type, int tablet_id)
>       {
>               int flags = TOUCH_ID;
>  
> -             if (tablet_id < 0xd0 || tablet_id > 0xd3)
> +             if (priv->common->tablet_id < 0xd0 || priv->common->tablet_id > 
> 0xd3)
>                       flags |= ABSOLUTE_FLAG;
>  
>               priv->flags = flags;
> @@ -333,8 +333,6 @@ static LocalDevicePtr wcmPreInit(InputDriverPtr drv, 
> IDevPtr dev, int flags)
>       const char*     type;
>       char*           device;
>       int             need_hotplug = 0;
> -     unsigned long   keys[NBITS(KEY_MAX)];
> -     int             tablet_id = 0;
>  
>       gWacomModule.wcmDrv = drv;
>  
> @@ -383,37 +381,32 @@ static LocalDevicePtr wcmPreInit(InputDriverPtr drv, 
> IDevPtr dev, int flags)
>               goto SetupProc_fail;
>       }
>  
> -     /* initialize supported keys */
> -     wcmDeviceTypeKeys(local, keys, &tablet_id);
> -     need_hotplug = wcmNeedAutoHotplug(local, &type, keys);
> +     priv = (WacomDevicePtr) local->private;
> +     common = priv->common;
> +     priv->name = local->name;
> +     common->wcmDevice = device;
> +
> +     /* check if this is the first tool on the port */
> +     if (!wcmMatchDevice(local))
> +             /* initialize supported keys with the first tool on the port */
> +             wcmDeviceTypeKeys(local);
> +
> +     need_hotplug = wcmNeedAutoHotplug(local, &type);
>  
>       /* check if the type is valid for those don't need hotplug */
> -     if(!need_hotplug && !wcmIsAValidType(type, keys))
> +     if(!need_hotplug && !wcmIsAValidType(local, type))
>               goto SetupProc_fail;
>  
>       /* check if the same device file has been added already */
>       if (wcmIsDuplicate(device, local))
>               goto SetupProc_fail;
>  
> -     if (!wcmSetType(local, type, tablet_id))
> +     if (!wcmSetType(local, type))
>               goto SetupProc_fail;
>  
> -     priv = (WacomDevicePtr) local->private;
> -     priv->name = local->name;
> -     common = priv->common;
> -
> -     common->wcmDevice = device;
> -
> -     /* Hardware specific initialization relies on tablet_id */
> -     common->tablet_id = tablet_id;
> -
> -     /* Lookup to see if there is another wacom device sharing the same port 
> */
> -     if (wcmMatchDevice(local))
> -             common = priv->common;
> -
>       /* Process the common options. */
>       xf86ProcessCommonOptions(local, local->options);
> -     if (!wcmParseOptions(local, keys))
> +     if (!wcmParseOptions(local))
>               goto SetupProc_fail;
>  
>       /* mark the device configured */
> @@ -422,7 +415,7 @@ static LocalDevicePtr wcmPreInit(InputDriverPtr drv, 
> IDevPtr dev, int flags)
>       if (need_hotplug)
>       {
>               priv->isParent = 1;
> -             wcmHotplugOthers(local, keys);
> +             wcmHotplugOthers(local);
>       }
>  
>       if (local->fd != -1)
> @@ -434,6 +427,9 @@ static LocalDevicePtr wcmPreInit(InputDriverPtr drv, 
> IDevPtr dev, int flags)
>       return (local);
>  
>  SetupProc_fail:
> +     /* restart the device list from the next one */
> +     if (common && priv)
> +             common->wcmDevices = priv->next;
>       xfree(common);
>       xfree(priv);
>       if (local)
> diff --git a/src/wcmISDV4.c b/src/wcmISDV4.c
> index 8d96216..e10816e 100644
> --- a/src/wcmISDV4.c
> +++ b/src/wcmISDV4.c
> @@ -1,6 +1,6 @@
>  /*
>   * Copyright 1995-2002 by Frederic Lepied, France. <[email protected]>
> - * Copyright 2002-2009 by Ping Cheng, Wacom Technology. <[email protected]>
> + * Copyright 2002-2010 by Ping Cheng, Wacom Technology. <[email protected]>
>   * 
>   * This program is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU General Public License
> @@ -633,12 +633,14 @@ static int wcmWaitForTablet(LocalDevicePtr local, char* 
> answer, int size)
>   * device ID. This matching only works for wacom devices (serial ID of
>   * WACf), all others are simply assumed to be pen + erasor.
>   */
> -int isdv4ProbeKeys(LocalDevicePtr local, unsigned long *keys)
> +int isdv4ProbeKeys(LocalDevicePtr local)
>  {
>       int id, i;
>       int tablet_id = 0;
>       struct serial_struct tmp;
>       const char *device = xf86SetStrOption(local->options, "Device", NULL);
> +     WacomDevicePtr  priv = (WacomDevicePtr)local->private;
> +     WacomCommonPtr  common = priv->common;
>  
>       if (ioctl(local->fd, TIOCGSERIAL, &tmp) < 0)
>               return 0;
> @@ -667,23 +669,23 @@ int isdv4ProbeKeys(LocalDevicePtr local, unsigned long 
> *keys)
>  
>       /* we have tried memset. it doesn't work */
>       for (i=0; i<NBITS(KEY_MAX); i++)
> -             keys[i] = 0;
> +             common->wcmKeys[i] = 0;
>  
>       /* default to penabled */
> -     keys[LONG(BTN_TOOL_PEN)] |= BIT(BTN_TOOL_PEN);
> -     keys[LONG(BTN_TOOL_RUBBER)] |= BIT(BTN_TOOL_RUBBER);
> +     common->wcmKeys[LONG(BTN_TOOL_PEN)] |= BIT(BTN_TOOL_PEN);
> +     common->wcmKeys[LONG(BTN_TOOL_RUBBER)] |= BIT(BTN_TOOL_RUBBER);
>  
>       /* id < 0x008 are only penabled */
>       if (id > 0x007)
> -             keys[LONG(BTN_TOOL_DOUBLETAP)] |= BIT(BTN_TOOL_DOUBLETAP);
> +             common->wcmKeys[LONG(BTN_TOOL_DOUBLETAP)] |= 
> BIT(BTN_TOOL_DOUBLETAP);
>       if (id > 0x0a)
> -             keys[LONG(BTN_TOOL_TRIPLETAP)] |= BIT(BTN_TOOL_TRIPLETAP);
> +             common->wcmKeys[LONG(BTN_TOOL_TRIPLETAP)] |= 
> BIT(BTN_TOOL_TRIPLETAP);
>  
>       /* no pen 2FGT */
>       if (id == 0x010)
>       {
> -             keys[LONG(BTN_TOOL_PEN)] &= ~BIT(BTN_TOOL_PEN);
> -             keys[LONG(BTN_TOOL_RUBBER)] &= ~BIT(BTN_TOOL_RUBBER);
> +             common->wcmKeys[LONG(BTN_TOOL_PEN)] &= ~BIT(BTN_TOOL_PEN);
> +             common->wcmKeys[LONG(BTN_TOOL_RUBBER)] &= ~BIT(BTN_TOOL_RUBBER);
>       }
>  
>       /* 0x9a and 0x9f are only detected by communicating
> diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> index 7532551..e7b1f30 100644
> --- a/src/wcmUSB.c
> +++ b/src/wcmUSB.c
> @@ -1,6 +1,6 @@
>  /*
>   * Copyright 1995-2002 by Frederic Lepied, France. <[email protected]>
> - * Copyright 2002-2009 by Ping Cheng, Wacom Technology. <[email protected]>    
>         
> + * Copyright 2002-2010 by Ping Cheng, Wacom Technology. <[email protected]>
>   *                                                                           
>  
>   * This program is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU General Public License
> @@ -429,7 +429,6 @@ static Bool usbWcmInit(LocalDevicePtr local, char* id, 
> float *version)
>  {
>       int i;
>       struct input_id sID;
> -     unsigned long keys[NBITS(KEY_MAX)] = {0};
>       WacomDevicePtr priv = (WacomDevicePtr)local->private;
>       WacomCommonPtr common = priv->common;
>  
> @@ -440,13 +439,6 @@ static Bool usbWcmInit(LocalDevicePtr local, char* id, 
> float *version)
>       ioctl(local->fd, EVIOCGID, &sID);
>       ioctl(local->fd, EVIOCGNAME(sizeof(id)), id);
>  
> -     /* retrieve tool type, device type and buttons from the kernel */
> -     if (ioctl(local->fd, EVIOCGBIT(EV_KEY,sizeof(keys)),keys) < 0)
> -     {
> -             xf86Msg(X_ERROR, "%s: unable to ioctl key bits.\n", 
> local->name);
> -             return FALSE;
> -     }
> -
>       /* vendor is wacom */
>       if (sID.vendor == WACOM_VENDOR_ID)
>       {
> @@ -482,18 +474,18 @@ static Bool usbWcmInit(LocalDevicePtr local, char* id, 
> float *version)
>        * BTN_LEFT and BTN_RIGHT, which are always fixed. */
>       common->npadkeys = 0;
>       for (i = 0; i < sizeof (padkey_codes) / sizeof (padkey_codes [0]); i++)
> -             if (ISBITSET (keys, padkey_codes [i]))
> +             if (ISBITSET (common->wcmKeys, padkey_codes [i]))
>                       common->padkey_code [common->npadkeys++] = padkey_codes 
> [i];
>  
> -     if (ISBITSET (keys, BTN_TASK))
> +     if (ISBITSET (common->wcmKeys, BTN_TASK))
>               common->nbuttons = 10;
> -     else if (ISBITSET (keys, BTN_BACK))
> +     else if (ISBITSET (common->wcmKeys, BTN_BACK))
>               common->nbuttons = 9;
> -     else if (ISBITSET (keys, BTN_FORWARD))
> +     else if (ISBITSET (common->wcmKeys, BTN_FORWARD))
>               common->nbuttons = 8;
> -     else if (ISBITSET (keys, BTN_EXTRA))
> +     else if (ISBITSET (common->wcmKeys, BTN_EXTRA))
>               common->nbuttons = 7;
> -     else if (ISBITSET (keys, BTN_SIDE))
> +     else if (ISBITSET (common->wcmKeys, BTN_SIDE))
>               common->nbuttons = 6;
>       else
>               common->nbuttons = 5;
> @@ -1066,12 +1058,14 @@ static void usbParseChannel(LocalDevicePtr local, int 
> channel)
>   * on success or 0 on failure.
>   * For USB devices, we simply copy the information the kernel gives us.
>   */
> -int usbProbeKeys(LocalDevicePtr local, unsigned long *keys)
> +int usbProbeKeys(LocalDevicePtr local)
>  {
>       struct input_id wacom_id;
> +     WacomDevicePtr  priv = (WacomDevicePtr)local->private;
> +     WacomCommonPtr  common = priv->common;
>  
>       if (ioctl(local->fd, EVIOCGBIT(EV_KEY, (sizeof(unsigned long)
> -                                             * NBITS(KEY_MAX))), keys) < 0)
> +                                             * NBITS(KEY_MAX))), 
> common->wcmKeys) < 0)
>       {
>               xf86Msg(X_ERROR, "%s: wcmDeviceTypeKeys unable to "
>                               "ioctl USB key bits.\n", local->name);
> diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
> index 9597d61..f153cd2 100644
> --- a/src/wcmValidateDevice.c
> +++ b/src/wcmValidateDevice.c
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright 2009 by Ping Cheng, Wacom. <[email protected]>
> + * Copyright 2009 - 2010 by Ping Cheng, Wacom. <[email protected]>
>   *
>   * This program is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU General Public License
> @@ -134,9 +134,11 @@ static struct
>  };
>  
>  /* validate tool type for device/product */
> -Bool wcmIsAValidType(const char* type, unsigned long* keys)
> +Bool wcmIsAValidType(LocalDevicePtr local, const char* type)
>  {
>       int j, ret = FALSE;
> +     WacomDevicePtr priv = (WacomDevicePtr)local->private;
> +     WacomCommonPtr common = priv->common;
>  
>       if (!type)
>               return FALSE;
> @@ -145,7 +147,7 @@ Bool wcmIsAValidType(const char* type, unsigned long* 
> keys)
>       for (j = 0; j < ARRAY_SIZE(wcmType); j++)
>       {
>               if (!strcmp(wcmType[j].type, type))
> -                     if (ISBITSET (keys, wcmType[j].tool))
> +                     if (ISBITSET (common->wcmKeys, wcmType[j].tool))
>                       {
>                               ret = TRUE;
>                               break;
> @@ -155,15 +157,15 @@ Bool wcmIsAValidType(const char* type, unsigned long* 
> keys)
>  }
>  
>  /* Choose valid types according to device ID. */
> -int wcmDeviceTypeKeys(LocalDevicePtr local, unsigned long* keys,
> -                   int* tablet_id)
> +int wcmDeviceTypeKeys(LocalDevicePtr local)
>  {
>       int ret = 1;
> +     WacomDevicePtr priv = local->private;
>  
>       /* serial ISDV4 devices */
> -     *tablet_id = isdv4ProbeKeys(local, keys);
> -     if (!*tablet_id) /* USB devices */
> -             *tablet_id = usbProbeKeys(local, keys);
> +     priv->common->tablet_id = isdv4ProbeKeys(local);
> +     if (!priv->common->tablet_id) /* USB devices */
> +             priv->common->tablet_id = usbProbeKeys(local);
>  
>       return ret;
>  }
> @@ -235,7 +237,7 @@ static void wcmHotplug(LocalDevicePtr local, const char 
> *type)
>       wcmFreeInputOpts(input_options);
>  }
>  
> -void wcmHotplugOthers(LocalDevicePtr local, unsigned long* keys)
> +void wcmHotplugOthers(LocalDevicePtr local)
>  {
>       int i, skip = 1;
>       char*           device;
> @@ -246,7 +248,7 @@ void wcmHotplugOthers(LocalDevicePtr local, unsigned 
> long* keys)
>           * need to start at the second one */
>       for (i = 0; i < ARRAY_SIZE(wcmType); i++)
>       {
> -             if (wcmIsAValidType(wcmType[i].type, keys))
> +             if (wcmIsAValidType(local, wcmType[i].type))
>               {
>                       if (skip)
>                               skip = 0;
> @@ -266,8 +268,7 @@ void wcmHotplugOthers(LocalDevicePtr local, unsigned 
> long* keys)
>   * This changes the source to _driver/wacom, all auto-hotplugged devices
>   * will have the same source.
>   */
> -int wcmNeedAutoHotplug(LocalDevicePtr local, const char **type,
> -             unsigned long* keys)
> +int wcmNeedAutoHotplug(LocalDevicePtr local, const char **type)
>  {
>       char *source = xf86CheckStrOption(local->options, "_source", "");
>       int i;
> @@ -282,7 +283,7 @@ int wcmNeedAutoHotplug(LocalDevicePtr local, const char 
> **type,
>        * for our device */
>       for (i = 0; i < ARRAY_SIZE(wcmType); i++)
>       {
> -             if (wcmIsAValidType(wcmType[i].type, keys))
> +             if (wcmIsAValidType(local, wcmType[i].type))
>               {
>                       *type = strdup(wcmType[i].type);
>                       break;
> @@ -301,7 +302,7 @@ int wcmNeedAutoHotplug(LocalDevicePtr local, const char 
> **type,
>       return 1;
>  }
>  
> -int wcmParseOptions(LocalDevicePtr local, unsigned long* keys)
> +int wcmParseOptions(LocalDevicePtr local)
>  {
>       WacomDevicePtr  priv = (WacomDevicePtr)local->private;
>       WacomCommonPtr  common = priv->common;
> @@ -493,7 +494,7 @@ int wcmParseOptions(LocalDevicePtr local, unsigned long* 
> keys)
>                                                        
> common->wcmTPCButtonDefault);
>  
>       /* a single touch device */
> -     if (ISBITSET (keys, BTN_TOOL_DOUBLETAP))
> +     if (ISBITSET (common->wcmKeys, BTN_TOOL_DOUBLETAP))
>       {
>               /* TouchDefault was off for all devices
>                * except when touch is supported */
> @@ -501,7 +502,7 @@ int wcmParseOptions(LocalDevicePtr local, unsigned long* 
> keys)
>       }
>  
>       /* 2FG touch device */
> -     if (ISBITSET (keys, BTN_TOOL_TRIPLETAP))
> +     if (ISBITSET (common->wcmKeys, BTN_TOOL_TRIPLETAP))
>       {
>               /* GestureDefault was off for all devices
>                * except when multi-touch is supported */
> diff --git a/src/xf86Wacom.h b/src/xf86Wacom.h
> index 6303c27..00c22b4 100644
> --- a/src/xf86Wacom.h
> +++ b/src/xf86Wacom.h
> @@ -1,6 +1,6 @@
>  /*
>   * Copyright 1995-2002 by Frederic Lepied, France. <[email protected]>
> - * Copyright 2002-2009 by Ping Cheng, Wacom Technology. <[email protected]>
> + * Copyright 2002-2010 by Ping Cheng, Wacom. <[email protected]>
>   * 
>   * This program is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU General Public License
> @@ -148,18 +148,18 @@ Bool wcmAreaListOverlap(WacomToolAreaPtr area, 
> WacomToolAreaPtr list);
>  void wcmMappingFactor(LocalDevicePtr local);
>  
>  /* validation */
> -extern Bool wcmIsAValidType(const char* type, unsigned long* keys);
> +extern Bool wcmIsAValidType(LocalDevicePtr local, const char* type);
>  extern Bool wcmIsWacomDevice (char* fname);
>  extern int wcmIsDuplicate(char* device, LocalDevicePtr local);
> -extern int wcmDeviceTypeKeys(LocalDevicePtr local, unsigned long* keys, int* 
> tablet_id);
> +extern int wcmDeviceTypeKeys(LocalDevicePtr local);
>  
>  /* hotplug */
> -extern int wcmNeedAutoHotplug(LocalDevicePtr local, const char **type, 
> unsigned long* keys);
> -extern void wcmHotplugOthers(LocalDevicePtr local, unsigned long* keys);
> +extern int wcmNeedAutoHotplug(LocalDevicePtr local, const char **type);
> +extern void wcmHotplugOthers(LocalDevicePtr local);
>  extern int wcmAutoProbeDevice(LocalDevicePtr local);
>  
>  /* setup */
> -extern int wcmParseOptions(LocalDevicePtr local, unsigned long* keys);
> +extern int wcmParseOptions(LocalDevicePtr local);
>  extern void wcmInitialCoordinates(LocalDevicePtr local, int axes);
>  extern void wcmInitialScreens(LocalDevicePtr local);
>  extern void wcmInitialScreens(LocalDevicePtr local);
> @@ -187,8 +187,8 @@ extern void InitWcmDeviceProperties(LocalDevicePtr local);
>  #endif
>  
>  /* Device probing */
> -int isdv4ProbeKeys(LocalDevicePtr local, unsigned long *keys);
> -int usbProbeKeys(LocalDevicePtr local, unsigned long *keys);
> +int isdv4ProbeKeys(LocalDevicePtr local);
> +int usbProbeKeys(LocalDevicePtr local);
>  
>  
> /****************************************************************************/
>  #endif /* __XF86WACOM_H */
> diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
> index 3a9a89a..3af8a3f 100644
> --- a/src/xf86WacomDefs.h
> +++ b/src/xf86WacomDefs.h
> @@ -1,6 +1,6 @@
>  /*
>   * Copyright 1995-2002 by Frederic Lepied, France. <[email protected]>
> - * Copyright 2002-2009 by Ping Cheng, Wacom Technology. <[email protected]>
> + * Copyright 2002-2010 by Ping Cheng, Wacom Technology. <[email protected]>
>   * 
>   * This program is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU General Public License
> @@ -352,6 +352,7 @@ struct _WacomCommonRec
>       int tablet_id;               /* USB tablet ID */
>       int fd;                      /* file descriptor to tablet */
>       int fd_refs;                 /* number of references to fd; if =0, fd 
> is invalid */
> +     unsigned long wcmKeys[NBITS(KEY_MAX)]; /* supported tool types for the 
> device */
>  
>       /* These values are in tablet coordinates */
>       int wcmMaxX;                 /* tablet max X value */
> -- 
> 1.6.6.1

thanks, merged and tested. Will be pushed in a tick.

Cheers,
  Peter

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to