On Tue, Jul 27, 2010 at 08:52:29AM +0200, Jan Steffens wrote:
> Hi,
> 
> I want to submit some cleanup patches:
> 
> [PATCH 1/3] Fix CintiqV5 type
> The LCD type was overwritten later, in what appears to be an obvious
> bug.
> 
> [PATCH 2/3] Eliminate TPCButtonDefault
> The code to set TPCButton in wcmUSB.c should be redundant, as it is
> already handled by wcmParseOptions. In that case, we can eliminate the
> TPCButtonDefault member completely.
> 
> [PATCH 3/3] Use IsStylus template


all three merged, much appreciated, thanks.

Cheers,
  Peter
 
> From 03ac3e4cf72138c7e4b06d7a8ce9b47fc082c226 Mon Sep 17 00:00:00 2001
> From: Jan Steffens <[email protected]>
> Date: Tue, 20 Jul 2010 01:19:16 +0200
> Subject: [PATCH 1/3] Fix CintiqV5 type
> 
> The LCD type was overwritten later, in what appears to be an obvious
> bug.
> 
> Signed-off-by: Jan Steffens <[email protected]>
> ---
>  src/wcmValidateDevice.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
> index e43a07c..116dd23 100644
> --- a/src/wcmValidateDevice.c
> +++ b/src/wcmValidateDevice.c
> @@ -207,7 +207,7 @@ int wcmDeviceTypeKeys(LocalDevicePtr local)
>               case 0x3F:  /* CintiqV5 */
>               case 0xC5:  /* CintiqV5 */
>               case 0xC6:  /* CintiqV5 */
> -                     priv->common->tablet_type |= WCM_LCD;
> +                     priv->common->tablet_type = WCM_LCD;
>                       /* fall through */
>               case 0xB0:  /* I3 */
>               case 0xB1:  /* I3 */
> @@ -216,7 +216,7 @@ int wcmDeviceTypeKeys(LocalDevicePtr local)
>               case 0xB4:  /* I3 */
>               case 0xB5:  /* I3 */
>               case 0xB7:  /* I3 */
> -                     priv->common->tablet_type = WCM_STRIP | WCM_ROTATION;
> +                     priv->common->tablet_type |= WCM_STRIP | WCM_ROTATION;
>                       break;
>  
>               case 0xE2: /* TPC with 2FGT */
> -- 
> 1.7.2
> 

> From 01888cc1aa787d7e7ccf971475b85ac54411a785 Mon Sep 17 00:00:00 2001
> From: Jan Steffens <[email protected]>
> Date: Mon, 19 Jul 2010 05:31:08 +0200
> Subject: [PATCH 2/3] Eliminate TPCButtonDefault
> 
> The code to set TPCButton in wcmUSB.c should be redundant, as it is
> already handled by wcmParseOptions. In that case, we can eliminate the
> TPCButtonDefault member completely.
> 
> Signed-off-by: Jan Steffens <[email protected]>
> ---
>  src/wcmConfig.c         |    3 +--
>  src/wcmUSB.c            |    5 -----
>  src/wcmValidateDevice.c |    5 +----
>  src/xf86WacomDefs.h     |    1 -
>  4 files changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/src/wcmConfig.c b/src/wcmConfig.c
> index b3dda15..d4a48eb 100644
> --- a/src/wcmConfig.c
> +++ b/src/wcmConfig.c
> @@ -109,8 +109,7 @@ static int wcmAllocate(LocalDevicePtr local)
>       common->wcmFlags = RAW_FILTERING_FLAG;   /* various flags */
>       common->wcmDevices = priv;
>       common->wcmProtocolLevel = 4;      /* protocol level */
> -     common->wcmTPCButton = 
> -             common->wcmTPCButtonDefault; /* set Tablet PC button on/off */
> +     common->wcmTPCButton = 0;          /* set Tablet PC button on/off */
>       common->wcmCapacity = -1;          /* Capacity is disabled */
>       common->wcmCapacityDefault = -1;    /* default to -1 when capacity 
> isn't supported */
>                                          /* 3 when capacity is supported */
> diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> index 169ad26..80b75f9 100644
> --- a/src/wcmUSB.c
> +++ b/src/wcmUSB.c
> @@ -505,11 +505,6 @@ static Bool usbWcmInit(LocalDevicePtr local, char* id, 
> float *version)
>               common->wcmResolX = common->wcmResolY = 1016;
>       }
>  
> -     /* check if TPCButton was turned off in xorg.conf for pen */
> -     if (priv->flags & STYLUS_ID)
> -             common->wcmTPCButton = xf86SetBoolOption(local->options,
> -                     "TPCButton", common->wcmTPCButtonDefault);
> -
>       /* Find out supported button codes - except mouse button codes
>        * BTN_LEFT and BTN_RIGHT, which are always fixed. */
>       common->npadkeys = 0;
> diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
> index 116dd23..dff98df 100644
> --- a/src/wcmValidateDevice.c
> +++ b/src/wcmValidateDevice.c
> @@ -602,11 +602,8 @@ int wcmParseOptions(LocalDevicePtr local, int hotplugged)
>               priv->flags |= BUTTONS_ONLY_FLAG;
>  
>       /* TPCButton on for Tablet PC by default */
> -     if (TabletHasFeature(common, WCM_TPC))
> -             common->wcmTPCButtonDefault = 1;
> -
>       oldButton = xf86SetBoolOption(local->options, "TPCButton",
> -                                     common->wcmTPCButtonDefault);
> +                                     TabletHasFeature(common, WCM_TPC));
>  
>       if (hotplugged || IsStylus(priv))
>               common->wcmTPCButton = oldButton;
> diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
> index 7b5a34c..d497be9 100644
> --- a/src/xf86WacomDefs.h
> +++ b/src/xf86WacomDefs.h
> @@ -419,7 +419,6 @@ struct _WacomCommonRec
>       WacomModelPtr wcmModel;        /* model-specific functions */
>       int wcmTPCButton;            /* set Tablet PC button on/off */
>       int wcmTouch;                /* disable/enable touch event */
> -     int wcmTPCButtonDefault;     /* Tablet PC button default */
>       int wcmTouchDefault;         /* default to disable when not supported */
>       int wcmGesture;              /* disable/enable touch gesture */
>       int wcmGestureDefault;       /* default touch gesture to disable when 
> not supported */
> -- 
> 1.7.2
> 

> From 2d565bd813c2b2296dfa19f526cc278705d61790 Mon Sep 17 00:00:00 2001
> From: Jan Steffens <[email protected]>
> Date: Mon, 19 Jul 2010 05:43:51 +0200
> Subject: [PATCH 3/3] Use IsStylus template
> 
> 
> Signed-off-by: Jan Steffens <[email protected]>
> ---
>  src/wcmCommon.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/wcmCommon.c b/src/wcmCommon.c
> index 4516cc6..c025740 100644
> --- a/src/wcmCommon.c
> +++ b/src/wcmCommon.c
> @@ -247,7 +247,7 @@ static void wcmSendButtons(LocalDevicePtr local, int 
> buttons, int rx, int ry,
>       DBG(6, priv, "buttons=%d\n", buttons);
>  
>       /* Tablet PC buttons only apply to penabled devices */
> -     if (common->wcmTPCButton && (priv->flags & STYLUS_ID))
> +     if (common->wcmTPCButton && IsStylus(priv))
>       {
>               if ( buttons & 1 )
>               {
> -- 
> 1.7.2
> 

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to