Properly map 2nd abswheel of Cintiq 24HD touch

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
wacom 0.19.0

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
include: don't redefine ARRAY_SIZE

The server provides this macro in its headers, so only redefine it where
needed (for the tools)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Fix indentation in usbStart()

No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Drop unused maxWidth/maxHeight

These two are never set to anything but 0 since
xf86-input-wacom-0.10.10-19-g6f5f29b

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ping Cheng <pinglinux@gmail.com>
Fix a debug message not parsed by sigsafe printf code

The server doesn't interpret %g, use %f instead. tbh, right now it doesn't
interpret %f either, but there's patches on the way for that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pinglinux@gmail.com>
test: replace INCLUDES with AM_CPPFLAGS

see https://lists.gnu.org/archive/html/automake/2012-12/msg00038.html

- Support for the long-deprecated INCLUDES variable will be
  removed altogether in Automake 1.14.  The AM_CPPFLAGS variable should be
  used instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pinglinux@gmail.com>
Improve logging of X property setting

Sprinkles a few extra DBG() calls into the code to make it a little
easier to track down issues with property-setting code.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Increase maximum allowed X11 button number

Actions specify X11 button numbers that should be generated when
performed. The maximum button number that could be used in an event
has been raised from the driver-imposed limit (WCM_MAX_BUTTON) to
the server-imposed limit (WCM_MAX_X11BUTTON).

This feature is necessary for gnome-settings-daemon to work properly.
To reliably identify each touch strip and ring, g-s-d assigns each
a high button numbers to send for each direction. Without this
patch, the driver ignores the actions set by g-s-d and continues
to send whatever the default action is instead.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Improve wcmFindProp readability

The existing code is needlessly hard to follow. It should return
immediately upon success, and unconditionally bail if it never
succeeded.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Have wcmFindActionHandler properly handle wcmFindProp error

If wcmFindProp cannot find the given property, it will return a
negative error code. At the moment, this is taken as the success
condition(!?) for the strip_actions case... Aside from being
wrong, this has the potential to cause some nasty memory corruption.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Setting an invalid action property should return an error

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ping Cheng <pinglinux@gmail.com>
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
Pass errors from wcmSetActionProperty up the stack

Errors when setting an action property should not be swallowed. Note
that because the containing function does not bother to call this
function 'checkonly', clients still can't find out about errors
until its too late. We'll fix this in the next commit.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Have wcmSetActionProperty run checkonly

Instead of checking only the 'actions' property, also check the
individual 'action' properties as well. We obviously won't be able
to correctly apply the former if the latter fails midway through.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
NONE is not a valid action, and NULL a bad value

While the NONE Atom indicates that the driver should reset the
action at the index it resides it, it is not *itself* a valid
action. This patch prevents us from attempting to set NONE as
an action.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Have wcmFindActionHandler return success/failure directly

We can guarantee that the out arguments are non-NULL if the property
was found, so return a boolean instead of relying on the caller to
check for non-NULL results.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
include: Move wacom-util.h after X11 headers

Combined with the "#ifndef" in commit c95c1f2c, this fixes the compiler
warnings generated about ARRAY_SIZE being redefined.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>