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

2011-03-30 Thread Jason Gerecke
On Tue, Mar 29, 2011 at 9:21 PM, Peter Hutterer peter.hutte...@who-t.net 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); +    

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

2011-03-30 Thread Jason Gerecke
On Tue, Mar 29, 2011 at 9:03 PM, Peter Hutterer peter.hutte...@who-t.net 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).

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

2011-03-30 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 peter.hutte...@who-t.net 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

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

2011-03-30 Thread Jason Gerecke
On Tue, Mar 29, 2011 at 11:37 PM, Peter Hutterer peter.hutte...@who-t.net wrote: On Tue, Mar 29, 2011 at 11:21:58PM -0700, Jason Gerecke wrote: On Tue, Mar 29, 2011 at 9:21 PM, Peter Hutterer peter.hutte...@who-t.net wrote: On Tue, Mar 29, 2011 at 04:18:38PM -0700, Jason Gerecke wrote: @@

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

2011-03-30 Thread Chris Bagwell
On Tue, Mar 29, 2011 at 10:53 PM, Peter Hutterer peter.hutte...@who-t.net wrote: Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- 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

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

2011-03-30 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

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

2011-03-30 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

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

2011-03-30 Thread Eduard Hasenleithner
Hi I join the discussion, because I have to deal with Array of Atom constructs also for my OLED Images. 2011/3/30 Peter Hutterer peter.hutte...@who-t.net: 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

[Linuxwacom-devel] [PATCH 7/7] Fix get_map to return proper wheel/strip button number

2011-03-30 Thread Jason Gerecke
Adding to the only-kinda-hackish use of XGetDeviceButtonMapping, in get_map, this total hackjob of a patch fixes the problem with us having no way of knowing the driver's defaults for wheels and strips. Thankfully, the defaults aren't changing anytime soon so its not likely to break.

[Linuxwacom-devel] [PATCH 0/7] Patchset summary

2011-03-30 Thread Jason Gerecke
Patches 1-4 improve argument validation and make xsetwacom noiser when it fails. Patches 5-7 finish up the remaining raw button removal from xsetwacom. Jason Gerecke (7): Fail with warnings where possible More explicit input check for set_rotate Change from prop_extra to arg_count More

[Linuxwacom-devel] [PATCH 1/7] Fail with warnings where possible

2011-03-30 Thread Jason Gerecke
For many commands, improper arguments cause a silent failure. The user is often given no indication if their command succeeded or failed. I've tried to find all the silent return; statements and provide some kind of warning message where possible. In some cases I've added in new checks to ensure

[Linuxwacom-devel] [PATCH 4/7] More strict argument-count checking

2011-03-30 Thread Jason Gerecke
Add/replace checks in functions to ensure that they have the right number of arguments to do their job properly. The worst offender here was the set() function -- providing too many arguments would result in it walking off the end of data structures (often resulting in a segfault) Signed-off-by:

[Linuxwacom-devel] [PATCH 5/7] Decrease minimum number of args to 'set' [allow wheels/strips reset]

2011-03-30 Thread Jason Gerecke
Since the worker functions now check that they have the appropriate number of arguments, its possible to decrease the number of arguments required by 'set'. Since all it really needs is a device number and a property, the minimum argc is now 2. A handy side-effect of this change is that its now

[Linuxwacom-devel] [PATCH 6/7] Have wheel and strip properties be actions instead of buttons

2011-03-30 Thread Jason Gerecke
Continuing with removing raw button code, we create the wheel and strip properties ready to hold actions. Prior to this, the properties would be initialized with the raw buttons; before xsetwacom could set them to actions they would need to be converted. This does away with the conversion step by

[Linuxwacom-devel] [PATCH 1/3] Check predefined serial number as early as we can

2011-03-30 Thread Ping Cheng
Don't wait before we can post the events. Verify the serial number as soon as the information is accessible. Signed-off-by: Ping Cheng pingli...@gmail.com --- src/wcmCommon.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/wcmCommon.c b/src/wcmCommon.c

[Linuxwacom-devel] [PATCH 2/3] Add IsPen to cover both IsStylus and IsEraser

2011-03-30 Thread Ping Cheng
It will be used more often when we need to compare touch events with pen events. Signed-off-by: Ping Cheng pingli...@gmail.com --- src/wcmCommon.c |2 +- src/xf86WacomDefs.h |2 ++ 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/wcmCommon.c b/src/wcmCommon.c index

Re: [Linuxwacom-devel] [PATCH 1/3] Check predefined serial number as early as we can

2011-03-30 Thread Peter Hutterer
On Wed, Mar 30, 2011 at 04:24:15PM -0700, Ping Cheng wrote: Don't wait before we can post the events. Verify the serial number as soon as the information is accessible. Signed-off-by: Ping Cheng pingli...@gmail.com --- src/wcmCommon.c | 16 1 files changed, 8

Re: [Linuxwacom-devel] [PATCH 2/3] Add IsPen to cover both IsStylus and IsEraser

2011-03-30 Thread Peter Hutterer
On Wed, Mar 30, 2011 at 04:24:43PM -0700, Ping Cheng wrote: It will be used more often when we need to compare touch events with pen events. Signed-off-by: Ping Cheng pingli...@gmail.com --- src/wcmCommon.c |2 +- src/xf86WacomDefs.h |2 ++ 2 files changed, 3 insertions(+), 1

Re: [Linuxwacom-devel] [PATCH 3/7] Change from prop_extra to arg_count

2011-03-30 Thread Peter Hutterer
On Wed, Mar 30, 2011 at 01:54:43PM -0700, Jason Gerecke wrote: When setting an XInternAtom property, 'prop_extra' listed the number of extra properties beyond the first that needed to be set. For instance WACOM_PROP_TABLET_AREA had a total of 4 properties, so prop_extra=3. To provide better

Re: [Linuxwacom-devel] [PATCH 5/7] Decrease minimum number of args to 'set' [allow wheels/strips reset]

2011-03-30 Thread Peter Hutterer
On Wed, Mar 30, 2011 at 01:54:45PM -0700, Jason Gerecke wrote: Since the worker functions now check that they have the appropriate number of arguments, its possible to decrease the number of arguments required by 'set'. Since all it really needs is a device number and a property, the minimum

Re: [Linuxwacom-devel] [RFC] wdaemon on linuxwacom.sf.net

2011-03-30 Thread Favux ...
Hi Peter, That sounds reasonable to me given that we are still linking to Aris' repository in the mediawiki's Linuxwacom HOWTO and FAQ: http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Linuxwacom_HOWTO#Hotplugging_the_device Favux

Re: [Linuxwacom-devel] [PATCH 7/7] Fix get_map to return proper wheel/strip button number

2011-03-30 Thread Peter Hutterer
On Wed, Mar 30, 2011 at 01:54:47PM -0700, Jason Gerecke wrote: Adding to the only-kinda-hackish use of XGetDeviceButtonMapping, in get_map, this total hackjob of a patch fixes the problem with us having no way of knowing the driver's defaults for wheels and strips. Thankfully, the defaults