[PATCH libinput 00/23] Revised: Tablet support in libinput
Peter Hutterer
peter.hutterer at who-t.net
Sun Jun 15 22:57:37 PDT 2014
On Thu, Jun 12, 2014 at 11:28:21PM -0400, Stephen Chandler Paul wrote:
> Hello! I've done a ton of revisions and changes to the patches Carlos sent
> a little while ago to add tablet support to libinput. Feel free to let me
> know what you think.
Thanks for all this work, much appreciated. Any patch I didn't comment on
gets my Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
most of the comments are minor changes, once you fixed them up please give
me a branch to pull from and I'll merge them locally. From then on we'll do
the rest as follow-ups.
> * Tablet events are now in their own group of events.
> * Tool update events are no longer emitted when the tool leaves proximity,
> they have been replaced with a more specific
> "LIBINPUT_EVENT_TABLET_PROXIMITY_OUT" event. This is similar to how X
> handles tools going out of proximity.
to make this easier to understand, can you provide a high-level description
of the event sequence expected as a tablet tool appears and moves in/out of
proximity?
> * Normalization is now done for both the tilt axes and the pressure axes.
> Pressure is normalized from 0 to 1, and tilt is normalized from *1 to 1. All
> of the other axes are left as-is.
we will eventually require some API to request the min/max/res from the
device for x and y. otherwise client's won't know what a specific value
stands for.
> * Axis changes are now compressed into a single TABLET_AXIS_UPDATE event. The
> event contains a bitmask of the changed axes that can be accessed with
> libinput_event_tablet_axis_has_changed(). These bitfields are internally
> managed using modified versions of some of the bitfield helpers from
> libevdev.
> * During an axis update, the collected values of all of the axes are available
> to the caller using libinput_event_tablet_axis_get_value(), regardless of
> whether or not they actually updated.
> * Tools are now abstracted by libinput as objects. Each tool object contains
> the tool type and the serial number of the tool. These can be retrieved with
> libinput_tool_get_serial() and libinput_tool_get_type().
> * Tools now have ref counts and are stored internally in a list. By default,
> every tool is destroyed at the end of an event, but if the caller wishes
> they can increment the reference count of the tool. When this happens, the
> tool is kept in the list and whenever that tool comes into proximity of the
> tablet again the same object whose ref count was incremented is returned by
> libinput.
as I pointed out in the patch, this is not necessary. we can just keep the
tools around internally and re-use them. there's a >90% chance that we'll
have a fixed set of tools and that the tool list is small anyway.
Cheers,
Peter
> * Other miscellanious fixes and additions
> * Style fixes
>
> Carlos Garnacho (6):
> Add LIBINPUT_DEVICE_CAP_TABLET libinput_device_capability value
> test: Add infrastructure for testing tablet events.
> test: Add Wacom Bamboo 16FG 4x5 Pen device definition
> test: Add Wacom Cintiq 12WX device definition
> test: Add Wacom Intuos5 touch M Pen device definition
> test: Add Wacom ISDv4 E6 Pen device definition
>
> Stephen Chandler Paul (17):
> evdev: Add basic support for tablet devices
> tools: handle TABLET_EVENT_AXIS in event-debug
> Add the libinput_tool object
> Emit LIBINPUT_TABLET_EVENT_TOOL_UPDATE events on tool changes
> tools: handle LIBINPUT_TABLET_EVENT_TOOL_UPDATE in event-debug
> Emit LIBINPUT_EVENT_TABLET_PROXIMITY_OUT when tool leaves proximity
> tools: Handle LIBINPUT_EVENT_TABLET_PROXIMITY_OUT in event-debug
> tablet: Handle button-events
> tools: handle tablet button events in event-debug
> tablet: Report and normalize distance, pressure, and tilt axes
> Sanitize distance and pressure axes before reporting their values
> tools: Handle pressure, tilt, and distance in event-debug
> test: Add litest_assert_double_*() macros
> test: Add proximity-in-out and proximity-out-clear-buttons tests
> test: Add motion event test for tablets
> test: Add bad-distance-events test
> test: Add tests for normalization
>
> src/Makefile.am | 2 +
> src/evdev-tablet.c | 469 +++++++++++++++++++++++++++++++++++++
> src/evdev-tablet.h | 93 ++++++++
> src/evdev.c | 10 +
> src/evdev.h | 6 +-
> src/libinput-private.h | 27 +++
> src/libinput-util.h | 2 +
> src/libinput.c | 256 ++++++++++++++++++++
> src/libinput.h | 292 ++++++++++++++++++++++-
> test/Makefile.am | 10 +
> test/litest-int.h | 8 +
> test/litest-wacom-bamboo-tablet.c | 105 +++++++++
> test/litest-wacom-cintiq-tablet.c | 136 +++++++++++
> test/litest-wacom-intuos-tablet.c | 134 +++++++++++
> test/litest-wacom-isdv4-tablet.c | 98 ++++++++
> test/litest.c | 97 ++++++++
> test/litest.h | 31 +++
> test/tablet.c | 481 ++++++++++++++++++++++++++++++++++++++
> tools/event-debug.c | 140 ++++++++++-
> 19 files changed, 2390 insertions(+), 7 deletions(-)
> create mode 100644 src/evdev-tablet.c
> create mode 100644 src/evdev-tablet.h
> create mode 100644 test/litest-wacom-bamboo-tablet.c
> create mode 100644 test/litest-wacom-cintiq-tablet.c
> create mode 100644 test/litest-wacom-intuos-tablet.c
> create mode 100644 test/litest-wacom-isdv4-tablet.c
> create mode 100644 test/tablet.c
>
> --
> 1.8.5.5
>
More information about the wayland-devel
mailing list