Directly index into the various *keys arrays

The 'keys' array is indexed into by reference to the X11 button
number stored in the 'buttons' array. While this may have been
useful at some point in time, the benefits have since gone and
left behind nothing but headaches.

Note that because the association with X11 buttons has been
removed, action mapping (via xsetwacom) no longer depends on
on the raw mapping (via xorg.conf). For instance, on a system
which has 'Option "Button3" "1"' set, use of the command
'xsetwacom set <id> button 1 10' will no longer cause *both*
button 1 and button 3 to emit button 10. Its unlikely anyone
relies on this quirk, but can be easily worked around if
necessary.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Replace multiple default variables with arrays

Storing the defaults for strips and wheels in individual
variables makes updating and scanning through them very
tedious. This patch replaces the variables with arrays
and introduces new #define statements to keep the level
of semantic meaning we had.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Remove support for 8-bit (raw button) strip/ring properties

This patch removes the ability to set up the touchstrips or
touchrings with raw 8-bit button numbers. Buttons have been
without this ability for quite some time, and this brings
these two properties in line.

This patch will break applications which rely on the use
of raw buttons in the properties, but the actual fallout is
expected to be minimal. Applications which don't understand
Actions are already broken (since they can't work with buttons)
and those that do understand Actions but don't use them can
be easily modified.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Cleanup call chain for action properties

This patch rewrites the call chains used for setting the three
action properties by introducing a single function to handle
the 'Actions' properties, and a single function for 'Action'
properties. Functions which were merely helper functions have
been inlined if appropriate.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Initialize action properties from defaults

This patch adds functions capable of resetting the action
properties (button/stip/wheel) to their default, and calls
them on initialization.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reset-on-None for Actions property

This patch adds the ability to reset an individual Action by
setting the corresponding element of an Actions property to
the 'None' atom (i.e. 0). When encountered, the None will be
replaced with an atom representing the default Action. This
will let the driver behave as it currently does once raw
button support is removed.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Remove raw button fallback codepaths from wcmCommon

With actions now defined on initialization and reset to default
when given a 'None' action, we can remove the raw button codepaths
without a noticible change in driver behavior.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Internally use physical button numbering for actions

One should not have to keep in mind the historic quirk that
mouse buttons 4-7 have when dealing with buttons events generated
by the tablet. This patch isolates conversion between physical
and X11 numbering to the single place it has historically
mattered: the button property getters/setters.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Add missing newline to error message

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