tablet: Fix warnings in test/tablet.c

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Fix address for memcpy()

If we ever change to a dynamic array, this would've been buggy.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Update libinput_tool_ref/unref() to return the tool object

For consistency with the other ref/unref funtions, see
13e9a1d7449d3b5db1dc7d9cf3aa6187911ee08c

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tablet: Stop redundant proximity-out events from being reported

Because bad distance events still trigger calls to tablet_flush(),
tablet_flush() will see that the tablet is out of proximity and assume it's an
appropriate time to send a proximity-out event, even when we've already sent
one. This results in multiple proximity-out events being sent in a row instead
of just one.
In addition, the bad distance events test has been modified to pick up on this.
We shouldn't be receiving /any/ events when we get false distance events from
evdev anyway.

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tablet: Remove tablet_notify_tool() and add tablet_get_tool()

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tablet: Replace tool-update with proximity-in

A proximity-in event is something we want, especially since the current drafted
wayland spec has a proximity-in event. Adding this also makes our events more
consistent. And since we can just report the current tool in use with
proximity-in events, we can get rid of the tool-update event.

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tablet: Include tool with all events

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tablet: copy the axis state into the tablet event

The tablet state updates with each event during libinput_dispatch(), but the
state in the event must reflect the state at the time of the event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
tablet: Include axes with all events

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>