Re: [Linuxwacom-devel] [PATCH 9/9] Revamp button/wheel/strip getters

2011-03-29 Thread Peter Hutterer
On Tue, Mar 29, 2011 at 11:21:58PM -0700, Jason Gerecke wrote: > On Tue, Mar 29, 2011 at 9:21 PM, Peter Hutterer > wrote: > > On Tue, Mar 29, 2011 at 04:18:38PM -0700, Jason Gerecke wrote: > >> @@ -1782,41 +1797,118 @@ static int get_special_button_map(Display *dpy, > >> XDevice *dev, > >> > >>  

Re: [Linuxwacom-devel] [PATCH 1/9] Fix "buttons must be set twice" bug from d650b139

2011-03-29 Thread Jason Gerecke
On Tue, Mar 29, 2011 at 9:03 PM, Peter Hutterer wrote: > applied, but from a cursory glance I'm not sure why. In fact, I would have > guessed the other way round. anyway, I've added a comment to avoid this in > the future (at least until we find the reason why and fixed it). > > Cheers, >  Peter >

Re: [Linuxwacom-devel] [PATCH 9/9] Revamp button/wheel/strip getters

2011-03-29 Thread Jason Gerecke
On Tue, Mar 29, 2011 at 9:21 PM, Peter Hutterer wrote: > On Tue, Mar 29, 2011 at 04:18:38PM -0700, Jason Gerecke wrote: >> @@ -1782,41 +1797,118 @@ static int get_special_button_map(Display *dpy, >> XDevice *dev, >> >>       TRACE("%s\n", buff); >> >> -     XFree(btnact_data); >> +     XFree(data

Re: [Linuxwacom-devel] [PATCH] Move npadkeys to fix comment.

2011-03-29 Thread Ping Cheng
Reviewed-by: Ping Cheng Ping On Tue, Mar 29, 2011 at 8:41 PM, Peter Hutterer wrote: > Fixing the comment would do too, but it really doesn't matter. > > Signed-off-by: Peter Hutterer > --- > src/xf86WacomDefs.h |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/src

Re: [Linuxwacom-devel] [PATCH] Replace manual array size with ARRAY_SIZE macro.

2011-03-29 Thread Ping Cheng
Reviewed-by: Ping Cheng Ping P.S., sorry, forgot to reply all. On Tue, Mar 29, 2011 at 8:40 PM, Peter Hutterer wrote: > Signed-off-by: Peter Hutterer > --- > src/wcmUSB.c |8 > 1 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/src/wcmUSB.c b/src/wcmUSB.c > index

Re: [Linuxwacom-devel] [PATCH 0/9] Patchset overview

2011-03-29 Thread Peter Hutterer
On Tue, Mar 29, 2011 at 04:18:29PM -0700, Jason Gerecke wrote: > This patchset can be broken down into two pieces: > > * 01..04 Fix miscelaneous bugs > - Several small one-off patches > > * 04..09 Shift xsetwacom away from "buttons" and toward "actions" > - Replaces raw button mapping

Re: [Linuxwacom-devel] [PATCH 9/9] Revamp button/wheel/strip getters

2011-03-29 Thread Peter Hutterer
On Tue, Mar 29, 2011 at 04:18:38PM -0700, Jason Gerecke wrote: > 'get_map' is the new getter entrypoint and attempts to determine > the mapping present on buttons, wheels, and strips. It calls on > 'get_actions' (essentially get_special_button_map) and 'get_button' > (an 8-bit XA_INTEGER version of

Re: [Linuxwacom-devel] [PATCH 1/9] Fix "buttons must be set twice" bug from d650b139

2011-03-29 Thread Peter Hutterer
On Tue, Mar 29, 2011 at 04:18:30PM -0700, Jason Gerecke wrote: > *facepalm* I simply can't believe I didn't test this, but there's > no denying the bug exists. Looks like the change to 'btnact_prop' > *must* occur after the change to 'prop'. If it happens beforehand, > then the driver appears to be

[Linuxwacom-devel] [PATCH v2] usb: count the number of buttons instead of hardcoding them.

2011-03-29 Thread Peter Hutterer
Signed-off-by: Peter Hutterer --- Chris, can you comment on the fixme I have added here. The current code seems to increase the number of buttons on the device when mouse buttons are found but I don't understand why. As I understand this, the code is still overlapping, so you get one pad code and

[Linuxwacom-devel] [PATCH] Move npadkeys to fix comment.

2011-03-29 Thread Peter Hutterer
Fixing the comment would do too, but it really doesn't matter. Signed-off-by: Peter Hutterer --- src/xf86WacomDefs.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h index 892a9c0..786a826 100644 --- a/src/xf86WacomDefs.h +++ b/s

[Linuxwacom-devel] [PATCH] Replace manual array size with ARRAY_SIZE macro.

2011-03-29 Thread Peter Hutterer
Signed-off-by: Peter Hutterer --- src/wcmUSB.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wcmUSB.c b/src/wcmUSB.c index 88d2eec..d4382ef 100644 --- a/src/wcmUSB.c +++ b/src/wcmUSB.c @@ -332,7 +332,7 @@ static Bool usbWcmInit(InputInfoPtr pInfo, char* id, f

Re: [Linuxwacom-devel] Moving towards 0.11

2011-03-29 Thread Chris Bagwell
On Tue, Mar 29, 2011 at 5:55 PM, Peter Hutterer wrote: > It's been a few weeks since 0.10.11, 114 patches already and I think it's > high time for another release. As we discussed after the 0.10.11 release we > should change the release tactics. So here is what I'd like to do. > > - If you have an

Re: [Linuxwacom-devel] Moving towards 0.11

2011-03-29 Thread Jason Gerecke
On Tue, Mar 29, 2011 at 3:55 PM, Peter Hutterer wrote: > It's been a few weeks since 0.10.11, 114 patches already and I think it's > high time for another release. As we discussed after the 0.10.11 release we > should change the release tactics. So here is what I'd like to do. > > - If you have an

[Linuxwacom-devel] [PATCH 9/9] Revamp button/wheel/strip getters

2011-03-29 Thread Jason Gerecke
'get_map' is the new getter entrypoint and attempts to determine the mapping present on buttons, wheels, and strips. It calls on 'get_actions' (essentially get_special_button_map) and 'get_button' (an 8-bit XA_INTEGER version of the same) to determine this. If both fail to find a mapping, it falls

[Linuxwacom-devel] [PATCH 8/9] Merge 'map_wheels' and 'map_button' into a unified 'map_actions'

2011-03-29 Thread Jason Gerecke
These two functions are very similar, and have been merged together to provide a single conduit for all action mappings. Button-handling code requires a little bit of special-casing (we need to be sure to get a button to modify, and to change the arguments appropriately), but nothing remotely worth

[Linuxwacom-devel] [PATCH 5/9] Allow parse_actions to parse simple button maps

2011-03-29 Thread Jason Gerecke
If argv contains only a single numeric argument, we assume the intent is to perform a button press. We add the necessary keywords to make the parser happy, and then parse as normal. This allows map_wheels to handle the "raw button" case that it has been missing. While map_button_simple also does t

[Linuxwacom-devel] [PATCH 7/9] Remove 'special_map_wheels' and 'special_map_buttons'

2011-03-29 Thread Jason Gerecke
Since neither function actually do anything that couldn't just be done in 'map_wheels' and 'map_button' respectively, we simply squash them together. Signed-off-by: Jason Gerecke --- tools/xsetwacom.c | 44 ++-- 1 files changed, 14 insertions(+), 30 dele

[Linuxwacom-devel] [PATCH 6/9] Remove map_button_simple

2011-03-29 Thread Jason Gerecke
With parse_actions now handling simple button mappings, we remove this function which essentially duplicates its functionality. Note that there is a small difference in how the new parse_actions code and the old map_button_simple code handle things. The former Translates a single numeric argument

[Linuxwacom-devel] [PATCH 4/9] Make it clearer when actions are sent

2011-03-29 Thread Jason Gerecke
When I first saw this, I thought somebody forgot to put an else clause here; I completely missed that tiny return statement. This makes the reality a little clearer. Signed-off-by: Jason Gerecke --- src/wcmCommon.c | 13 +++-- 1 files changed, 7 insertions(+), 6 deletions(-) diff --gi

[Linuxwacom-devel] [PATCH 1/9] Fix "buttons must be set twice" bug from d650b139

2011-03-29 Thread Jason Gerecke
*facepalm* I simply can't believe I didn't test this, but there's no denying the bug exists. Looks like the change to 'btnact_prop' *must* occur after the change to 'prop'. If it happens beforehand, then the driver appears to be eternally one step behind xsetwacom. Signed-off-by: Jason Gerecke --

[Linuxwacom-devel] [PATCH 2/9] Fix strip/wheel mapping

2011-03-29 Thread Jason Gerecke
Commit 2ce1c6b4 fixed a bug where X would crash after remapping strips or wheels. It made all the "keys" arrays one-indexed so that wcmUpdateButtonKeys would not write beyond the end of the arrays. This patch syncs the action lookup code with the use of one-indexed arrays so that the proper action

[Linuxwacom-devel] [PATCH 3/9] Add WACOM_PROP_WHEELBUTTONS to cursor devices

2011-03-29 Thread Jason Gerecke
This enables the "Wacom Wheel Buttons" property for cursor devices, allowing xsetwacom to set (rel|abs)wheel(up|down) actions. I'm not sure if there are non-puck cursor devices which should *not* have this enabled, but until somebody says otherwise... :) Signed-off-by: Jason Gerecke --- src/wcmX

[Linuxwacom-devel] [PATCH 0/9] Patchset overview

2011-03-29 Thread Jason Gerecke
This patchset can be broken down into two pieces: * 01..04 Fix miscelaneous bugs - Several small one-off patches * 04..09 Shift xsetwacom away from "buttons" and toward "actions" - Replaces raw button mapping with action button mapping - Fixes set/get issues with simple/raw maps

[Linuxwacom-devel] [PATCH] Don't accept invalid device types.

2011-03-29 Thread Peter Hutterer
Signed-off-by: Peter Hutterer --- src/wcmConfig.c | 16 ++ test/fake-symbols.c |2 +- test/wacom-tests.c | 80 +++ 3 files changed, 90 insertions(+), 8 deletions(-) diff --git a/src/wcmConfig.c b/src/wcmConfig.c index ead1296..

Re: [Linuxwacom-devel] [PATCH 6/6] Remove STYLUS_DEVICE_ID and friends.

2011-03-29 Thread Ping Cheng
On Tue, Mar 29, 2011 at 3:40 PM, Peter Hutterer wrote: > On Tue, Mar 29, 2011 at 01:24:33PM -0700, Ping Cheng wrote: > > Hi Peter, > > > > There is a bit of history behind the IDs. > > > > Those *_DEVICE_IDs are from the kernel. For protocol 5 devices, there are > > different IDs for different sty

[Linuxwacom-devel] Moving towards 0.11

2011-03-29 Thread Peter Hutterer
It's been a few weeks since 0.10.11, 114 patches already and I think it's high time for another release. As we discussed after the 0.10.11 release we should change the release tactics. So here is what I'd like to do. - If you have any larger features, cleanup works or other intrusive stuff, plea

Re: [Linuxwacom-devel] [PATCH 1/6] usb: count the number of buttons instead of hardcoding them.

2011-03-29 Thread Ping Cheng
On Tue, Mar 29, 2011 at 3:06 PM, Peter Hutterer wrote: > On Tue, Mar 29, 2011 at 12:28:09PM -0700, Ping Cheng wrote: > > I like the idea. Please see my comments inline. > > > > Ping > > > > On Mon, Mar 28, 2011 at 6:11 PM, Peter Hutterer < > peter.hutte...@who-t.net>wrote: > > > > > Signed-off-by:

Re: [Linuxwacom-devel] [PATCH 6/6] Remove STYLUS_DEVICE_ID and friends.

2011-03-29 Thread Peter Hutterer
On Tue, Mar 29, 2011 at 01:24:33PM -0700, Ping Cheng wrote: > Hi Peter, > > There is a bit of history behind the IDs. > > Those *_DEVICE_IDs are from the kernel. For protocol 5 devices, there are > different IDs for different styli and pucks. We reported them from the > kernel through ABS_MISC. T

Re: [Linuxwacom-devel] [PATCH 4/6] usb: print invalid max value if we get one.

2011-03-29 Thread Peter Hutterer
On Tue, Mar 29, 2011 at 12:37:52PM -0700, Ping Cheng wrote: > On Mon, Mar 28, 2011 at 6:11 PM, Peter Hutterer > wrote: > > > Signed-off-by: Peter Hutterer > > --- > > src/wcmUSB.c |6 -- > > 1 files changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/src/wcmUSB.c b/src/wcmUSB.

Re: [Linuxwacom-devel] [PATCH 1/6] usb: count the number of buttons instead of hardcoding them.

2011-03-29 Thread Peter Hutterer
On Tue, Mar 29, 2011 at 12:28:09PM -0700, Ping Cheng wrote: > I like the idea. Please see my comments inline. > > Ping > > On Mon, Mar 28, 2011 at 6:11 PM, Peter Hutterer > wrote: > > > Signed-off-by: Peter Hutterer > > --- > > src/wcmUSB.c | 35 ++- > > test/Makefile.am

Re: [Linuxwacom-devel] [PATCH] Change hardcoded string to already-defined constant

2011-03-29 Thread Peter Hutterer
On Tue, Mar 29, 2011 at 11:31:54AM -0700, Jason Gerecke wrote: > On Tue, Mar 29, 2011 at 1:08 AM, Peter Hutterer > wrote: > > On Mon, Mar 28, 2011 at 10:06:56AM -0700, Jason Gerecke wrote: > >> WACOM_PROP_BUTTON_ACTIONS is already defined in wacom-properties.h > >> Lets use it instead of all those

Re: [Linuxwacom-devel] [PATCH 6/6] Remove STYLUS_DEVICE_ID and friends.

2011-03-29 Thread Ping Cheng
Hi Peter, There is a bit of history behind the IDs. Those *_DEVICE_IDs are from the kernel. For protocol 5 devices, there are different IDs for different styli and pucks. We reported them from the kernel through ABS_MISC. That's why we needed the device_id field to store them. To make the id conc

Re: [Linuxwacom-devel] [PATCH 5/6] Remove discard_first field from DeviceStateRec

2011-03-29 Thread Ping Cheng
Reviewed-by: Ping Cheng Ping On Mon, Mar 28, 2011 at 6:11 PM, Peter Hutterer wrote: > Obsolete since the removal of old serial devices. > > Signed-off-by: Peter Hutterer > --- > src/wcmCommon.c |4 ++-- > src/xf86WacomDefs.h |1 - > 2 files changed, 2 insertions(+), 3 deletions(-)

Re: [Linuxwacom-devel] [PATCH 4/6] usb: print invalid max value if we get one.

2011-03-29 Thread Ping Cheng
On Mon, Mar 28, 2011 at 6:11 PM, Peter Hutterer wrote: > Signed-off-by: Peter Hutterer > --- > src/wcmUSB.c |6 -- > 1 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/src/wcmUSB.c b/src/wcmUSB.c > index aadafd0..e40a671 100644 > --- a/src/wcmUSB.c > +++ b/src/wcmUSB.c > @

Re: [Linuxwacom-devel] [PATCH 3/6] usb: swap two checks.

2011-03-29 Thread Ping Cheng
Reviewed-by: Ping Cheng Ping On Mon, Mar 28, 2011 at 6:11 PM, Peter Hutterer wrote: > If the absbit isn't set, don't bother with the EV_ABS ioctl. > > Signed-off-by: Peter Hutterer > --- > src/wcmUSB.c |6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/src/wcmU

Re: [Linuxwacom-devel] [PATCH 1/6] usb: count the number of buttons instead of hardcoding them.

2011-03-29 Thread Ping Cheng
I like the idea. Please see my comments inline. Ping On Mon, Mar 28, 2011 at 6:11 PM, Peter Hutterer wrote: > Signed-off-by: Peter Hutterer > --- > src/wcmUSB.c | 35 ++- > test/Makefile.am |4 ++- > test/usb-tests.c | 97 > ++

Re: [Linuxwacom-devel] [PATCH] Change hardcoded string to already-defined constant

2011-03-29 Thread Jason Gerecke
On Tue, Mar 29, 2011 at 1:08 AM, Peter Hutterer wrote: > On Mon, Mar 28, 2011 at 10:06:56AM -0700, Jason Gerecke wrote: >> WACOM_PROP_BUTTON_ACTIONS is already defined in wacom-properties.h >> Lets use it instead of all those magic constants. >> >> Signed-off-by: Jason Gerecke > > applied, thanks

Re: [Linuxwacom-devel] [PATCH] Change hardcoded string to already-defined constant

2011-03-29 Thread Peter Hutterer
On Mon, Mar 28, 2011 at 10:06:56AM -0700, Jason Gerecke wrote: > WACOM_PROP_BUTTON_ACTIONS is already defined in wacom-properties.h > Lets use it instead of all those magic constants. > > Signed-off-by: Jason Gerecke applied, thanks. Cheers, Peter > --- > tools/xsetwacom.c |5 +++-- > 1

Re: [Linuxwacom-devel] [PATCH v2] Resolve the oldHwProx puzzle

2011-03-29 Thread Peter Hutterer
On Mon, Mar 28, 2011 at 05:51:34PM -0700, Ping Cheng wrote: > Change oldHwProx to oldCursorHwProx to better reflect its use. > > oldCursorHwProx keeps the hardware in/out prox state so we can > set the MaxCursorDist for the next round of relative cursor > movement when tool first comes in prox. >