touchpad: Rename some variables and functions

Rename some clickpad softbutton area variables to have bottom in their
name, this is a preperation patch for adding top softbutton area support.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
touchpad: Add support for top softbutton area

Add support for the top softbutton area found on some laptops.

For details of how this works, see the updated
doc/touchpad-softbutton-state-machine.svg diagram.

Basically this mirrors the state-machine for the bottom softbutton area, with
one exception, if a finger stays at least inner timeout milliseconds in the
top button area and then moves out of it, it will be ignored rather then
become the pointer. This is done so that people using the top buttons together
with a trackstick and accidentally move their finger out of the upper area
don't get spurious pointer movements from the finger on the trackpad.

This behavior is indentical to xf86-input-synaptics, which also ignores
movements from touches which start in the top button area.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
touchpad: fix two indentation issues in the header

7 whitespace -> tab

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
evdev: Use correct fallback value for KEY_LIGHTS_TOGGLE

The kernel defines KEY_LIGHTS_TOGGLE as 0x21e, not 0x160 (which is KEY_OK).

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
evdev: Provide fallback definition for KEY_MICMUTE

KEY_MICMUTE was added relatively recently (3.1 with 33009557bd: Add
KEY_MICMUTE and enable it on Lenovo X220), so provide a fallback definition
similar to how we do it for KEY_LIGHTS_TOGGLE to fix compilation with older
toolchains.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
test: compiler warning fixes

misc.c: In function ‘create_simple_test_device’:
misc.c:71:54: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  while ((type = va_arg(args, unsigned int)) != -1 &&
                                                      ^
misc.c:72:54: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         (code = va_arg(args, unsigned int)) != -1) {
test: use the TEST_CFLAGS for all tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test: fix a bunch of "unused variable" warnings

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tools: fix a compiler warning

event-debug.c: At top level:
event-debug.c:129:1: warning: ‘static’ is not at beginning of declaration
[-Wold-style-declaration]
 const static struct libinput_interface interface = {
  ^

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test: fix resolution on Wacom ISDv4 E6 Finger device

Resolution for x is 10, 9 for y. And while we're at it set the actual
resolution, not the fuzz.

No actual effect since resolution can't be set through uinput where we use
these devices.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test: fix resolution on all devices

struct input_absinfo has the resolution as the 6th field, not as the 4th.
This doesn't have any visible effect because uinput doesn't allow us to set
the resolution yet.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>