On Sun, Jan 9, 2011 at 5:28 PM, Peter Hutterer <[email protected]> wrote: > We're using them as type field, clients expect them, so let's export them > somewhere more visible. > > Signed-off-by: Peter Hutterer <[email protected]>
Acked-by: Ping Cheng <[email protected]> > --- > This patch brings up some new question: should we add the types for > Airbrush, etc as well? IMO we should, I agree that it would be helpful if we can report specific device types to the clients. > but AFAIK there's clients currently > checking for stylus/eraser/etc. and they may ignore airbrush types then. By default, the 5 generic types are supported. > mind you, I'd consider this a bug in the client... :) If we can add the other types on top of those default types, it would be a feature instead of a bug. That is what we call "backward compatible", isn't it? We could let xsetwacom turn the feature on/off. Don't ask me about the details. I know you have aces up your sleeve ;). Ping > include/wacom-properties.h | 11 +++++++++++ > src/wcmConfig.c | 11 ++++++----- > src/xf86Wacom.h | 9 --------- > 3 files changed, 17 insertions(+), 14 deletions(-) > > diff --git a/include/wacom-properties.h b/include/wacom-properties.h > index 3ec12dd..dfa454d 100644 > --- a/include/wacom-properties.h > +++ b/include/wacom-properties.h > @@ -96,4 +96,15 @@ > */ > #define WACOM_PROP_DEBUGLEVELS "Wacom Debug Levels" > > + > +/* The following are tool types used by the driver in WACOM_PROP_TOOL_TYPE > + * or in the 'type' field for XI1 clients. Clients may check for one of > + * these types to identify tool types. > + */ > +#define WACOM_PROP_XI_TYPE_STYLUS "STYLUS" > +#define WACOM_PROP_XI_TYPE_CURSOR "CURSOR" > +#define WACOM_PROP_XI_TYPE_ERASER "ERASER" > +#define WACOM_PROP_XI_TYPE_PAD "PAD" > +#define WACOM_PROP_XI_TYPE_TOUCH "TOUCH" > + > #endif > diff --git a/src/wcmConfig.c b/src/wcmConfig.c > index b20174c..cd12531 100644 > --- a/src/wcmConfig.c > +++ b/src/wcmConfig.c > @@ -26,6 +26,7 @@ > #include <sys/stat.h> > #include <fcntl.h> > #include <unistd.h> > +#include <wacom-properties.h> > > /***************************************************************************** > * wcmAllocate -- > @@ -180,7 +181,7 @@ static int wcmSetType(InputInfoPtr pInfo, const char > *type) > if (xf86NameCmp(type, "stylus") == 0) > { > priv->flags = ABSOLUTE_FLAG|STYLUS_ID; > - pInfo->type_name = XI_STYLUS; > + pInfo->type_name = WACOM_PROP_XI_TYPE_STYLUS; > } else if (xf86NameCmp(type, "touch") == 0) > { > int flags = TOUCH_ID; > @@ -189,19 +190,19 @@ static int wcmSetType(InputInfoPtr pInfo, const char > *type) > flags |= ABSOLUTE_FLAG; > > priv->flags = flags; > - pInfo->type_name = XI_TOUCH; > + pInfo->type_name = WACOM_PROP_XI_TYPE_TOUCH; > } else if (xf86NameCmp(type, "cursor") == 0) > { > priv->flags = CURSOR_ID; > - pInfo->type_name = XI_CURSOR; > + pInfo->type_name = WACOM_PROP_XI_TYPE_CURSOR; > } else if (xf86NameCmp(type, "eraser") == 0) > { > priv->flags = ABSOLUTE_FLAG|ERASER_ID; > - pInfo->type_name = XI_ERASER; > + pInfo->type_name = WACOM_PROP_XI_TYPE_ERASER; > } else if (xf86NameCmp(type, "pad") == 0) > { > priv->flags = ABSOLUTE_FLAG|PAD_ID; > - pInfo->type_name = XI_PAD; > + pInfo->type_name = WACOM_PROP_XI_TYPE_PAD; > } > > /* Set the device id of the "last seen" device on this tool */ > diff --git a/src/xf86Wacom.h b/src/xf86Wacom.h > index 7b5401e..2fc8850 100644 > --- a/src/xf86Wacom.h > +++ b/src/xf86Wacom.h > @@ -66,15 +66,6 @@ > > #define ABS(x) ((x) > 0 ? (x) : -(x)) > > -/***************************************************************************** > - * General Defines > - > ****************************************************************************/ > -#define XI_STYLUS "STYLUS" /* X device type name for the stylus */ > -#define XI_CURSOR "CURSOR" /* X device type name for the cursor */ > -#define XI_ERASER "ERASER" /* X device type name for the eraser */ > -#define XI_PAD "PAD" /* X device type name for the Pad */ > -#define XI_TOUCH "TOUCH" /* X device type name for the touch */ > - > /****************************************************************************** > * WacomModule - all globals are packed in a single structure to keep the > * global namespaces as clean as possible. > -- > 1.7.3.4 > > Cheers, > Peter > > ------------------------------------------------------------------------------ > Gaining the trust of online customers is vital for the success of any company > that requires sensitive data to be transmitted over the Web. Learn how to > best implement a security strategy that keeps consumers' information secure > and instills the confidence they need to proceed with transactions. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Linuxwacom-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel > ------------------------------------------------------------------------------ Gaining the trust of online customers is vital for the success of any company that requires sensitive data to be transmitted over the Web. Learn how to best implement a security strategy that keeps consumers' information secure and instills the confidence they need to proceed with transactions. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Linuxwacom-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
