.gitignore | 2 configure.ac | 6 doc/pointer-acceleration.dox | 9 doc/svg/ptraccel-touchpad.svg | 1971 +--------- src/Makefile.am | 4 src/evdev-mt-touchpad-gestures.c | 6 src/evdev-mt-touchpad-tap.c | 16 src/evdev-mt-touchpad.c | 122 src/evdev-mt-touchpad.h | 11 src/evdev-tablet.c | 13 src/evdev.c | 56 src/evdev.h | 92 src/filter-private.h | 4 src/filter.c | 423 +- src/filter.h | 25 src/libinput-private.h | 50 src/libinput-util.c | 28 src/libinput.h | 32 src/path-seat.c | 385 + src/path-seat.h | 47 src/path.c | 385 - src/path.h | 47 src/udev-seat.c | 5 test/Makefile.am | 58 test/device.c | 1535 ------- test/gestures.c | 1241 ------ test/keyboard.c | 392 -- test/litest-device-alps-dualpoint.c | 2 test/litest-device-alps-semi-mt.c | 2 test/litest-device-anker-mouse-kbd.c | 2 test/litest-device-apple-internal-keyboard.c | 2 test/litest-device-apple-magicmouse.c | 2 test/litest-device-asus-rog-gladius.c | 2 test/litest-device-atmel-hover.c | 2 test/litest-device-bcm5974.c | 2 test/litest-device-calibrated-touchscreen.c | 101 test/litest-device-cyborg-rat-5.c | 2 test/litest-device-elantech-touchpad.c | 2 test/litest-device-generic-singletouch.c | 2 test/litest-device-huion-pentablet.c | 35 test/litest-device-keyboard-all-codes.c | 2 test/litest-device-keyboard-razer-blackwidow.c | 2 test/litest-device-keyboard.c | 2 test/litest-device-logitech-trackball.c | 2 test/litest-device-magic-trackpad.c | 2 test/litest-device-mouse-low-dpi.c | 2 test/litest-device-mouse-roccat.c | 2 test/litest-device-mouse-wheel-click-angle.c | 2 test/litest-device-mouse-wheel-click-count.c | 2 test/litest-device-mouse.c | 2 test/litest-device-ms-surface-cover.c | 2 test/litest-device-nexus4-touch-screen.c | 2 test/litest-device-protocol-a-touch-screen.c | 2 test/litest-device-qemu-usb-tablet.c | 2 test/litest-device-synaptics-hover.c | 2 test/litest-device-synaptics-i2c.c | 2 test/litest-device-synaptics-rmi4.c | 132 test/litest-device-synaptics-st.c | 2 test/litest-device-synaptics-t440.c | 2 test/litest-device-synaptics-x1-carbon-3rd.c | 2 test/litest-device-synaptics.c | 2 test/litest-device-touch-screen.c | 2 test/litest-device-touchscreen-fuzz.c | 2 test/litest-device-trackpoint.c | 2 test/litest-device-vmware-virtual-usb-mouse.c | 2 test/litest-device-wacom-bamboo-16fg-pen.c | 118 test/litest-device-wacom-bamboo-tablet.c | 119 test/litest-device-wacom-cintiq-12wx-pen.c | 157 test/litest-device-wacom-cintiq-13hdt-finger.c | 35 test/litest-device-wacom-cintiq-13hdt-pad.c | 35 test/litest-device-wacom-cintiq-13hdt-pen.c | 35 test/litest-device-wacom-cintiq-24hd-pen.c | 146 test/litest-device-wacom-cintiq-24hd.c | 147 test/litest-device-wacom-cintiq-24hdt-pad.c | 35 test/litest-device-wacom-cintiq-tablet.c | 158 test/litest-device-wacom-ekr.c | 35 test/litest-device-wacom-hid4800-pen.c | 35 test/litest-device-wacom-intuos-finger.c | 114 test/litest-device-wacom-intuos-tablet.c | 173 test/litest-device-wacom-intuos3-pad.c | 35 test/litest-device-wacom-intuos5-finger.c | 112 test/litest-device-wacom-intuos5-pad.c | 35 test/litest-device-wacom-intuos5-pen.c | 172 test/litest-device-wacom-isdv4-e6-finger.c | 97 test/litest-device-wacom-isdv4-e6-pen.c | 111 test/litest-device-wacom-isdv4-tablet.c | 112 test/litest-device-wacom-touch.c | 99 test/litest-device-waltop-tablet.c | 46 test/litest-device-wheel-only.c | 2 test/litest-device-xen-virtual-pointer.c | 2 test/litest-device-yubikey.c | 2 test/litest-int.h | 2 test/litest.c | 43 test/litest.h | 7 test/log.c | 150 test/misc.c | 1091 ----- test/pad.c | 663 --- test/path.c | 964 ---- test/pointer.c | 1817 --------- test/tablet.c | 4191 --------------------- test/test-device.c | 1535 +++++++ test/test-gestures.c | 1295 ++++++ test/test-keyboard.c | 392 ++ test/test-log.c | 200 + test/test-misc.c | 1129 +++++ test/test-pad.c | 663 +++ test/test-path.c | 964 ++++ test/test-pointer.c | 1817 +++++++++ test/test-tablet.c | 4097 +++++++++++++++++++++ test/test-touch.c | 853 ++++ test/test-touchpad-buttons.c | 1865 +++++++++ test/test-touchpad-tap.c | 2191 +++++++++++ test/test-touchpad.c | 4793 ++++++++++++++++++++++++ test/test-trackball.c | 273 + test/test-trackpoint.c | 391 ++ test/test-udev.c | 525 ++ test/touch.c | 752 --- test/touchpad-buttons.c | 1865 --------- test/touchpad-tap.c | 2209 ----------- test/touchpad.c | 4821 ------------------------- test/trackball.c | 273 - test/trackpoint.c | 391 -- test/udev.c | 525 -- tools/Makefile.am | 12 tools/event-debug.c | 22 tools/event-gui.c | 9 tools/libinput-list-devices.c | 3 tools/make-ptraccel-graphs.sh | 16 tools/ptraccel-debug.c | 58 tools/shared.c | 11 tools/shared.h | 2 udev/parse_hwdb.py | 2 132 files changed, 25869 insertions(+), 26483 deletions(-)
New commits: commit 7f78251018b65d336f947a8725af046cac012d66 Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Fri Jan 20 08:29:28 2017 +1000 configure.ac: libinput 1.6.0 Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/configure.ac b/configure.ac index 195862a..e611d77 100644 --- a/configure.ac +++ b/configure.ac @@ -1,8 +1,8 @@ AC_PREREQ([2.64]) m4_define([libinput_major_version], [1]) -m4_define([libinput_minor_version], [5]) -m4_define([libinput_micro_version], [902]) +m4_define([libinput_minor_version], [6]) +m4_define([libinput_micro_version], [0]) m4_define([libinput_version], [libinput_major_version.libinput_minor_version.libinput_micro_version]) @@ -35,7 +35,7 @@ AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz]) # b) If interfaces have been changed or added, but binary compatibility has # been preserved, change to C+1:0:A+1 # c) If the interface is the same as the previous version, change to C:R+1:A -LIBINPUT_LT_VERSION=21:1:11 +LIBINPUT_LT_VERSION=21:2:11 AC_SUBST(LIBINPUT_LT_VERSION) AM_SILENT_RULES([yes]) commit 5f0d310ead52b953bd4c92403877000f3ce9714d Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Wed Jan 18 17:58:36 2017 +1000 filter: normalize deltas before processing or returning them When the filter code switched to raw device coordinates (bdd4264d) the input data remained in device coordinates. Since the factor for touchpads was still based on the physical velocity (and thus all touchpads get the same acceleration factor for identical moves), the actual delta was dependent on the resolution. e.g. touchpad with 40u/mm: delta of 2/2 * accel factor 2 -> accel delta of 4/4 touchpad with 20u/mm: delta of 1/1 * accel factor 2 -> accel delta of 2/2 The normalized coordinates should be independent of the touchpad's resolution though. Affected by this was the standard mouse accel code and the touchpad accel code, other filters always returned unnormalized coordinates (separate bug, not addressed here). This patch restores the correct behaviour for mice and touchpads while leaving the special filters untouched. For comparision: * 1000+dpi mice: accelerate normalized, return normalized * touchpads: accelerate unnormalized, return normalized * low-dpi mice: accelerate unnormalized, return unnormalized * trackpoints: accelerate unnormalized, return unnormalized * x230: don't touch, already does the right thing https://bugs.freedesktop.org/show_bug.cgi?id=99383 Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> Reviewed-by: Hans de Goede <hdego...@redhat.com> diff --git a/src/filter.c b/src/filter.c index 3035234..7c500f8 100644 --- a/src/filter.c +++ b/src/filter.c @@ -405,10 +405,10 @@ calculate_acceleration_factor(struct pointer_accelerator *accel, * @param data Caller-specific data * @param time Current time in µs * - * @return An accelerated tuple of coordinates representing normalized - * motion + * @return An accelerated tuple of coordinates representing accelerated + * motion, still in device units. */ -static struct normalized_coords +static struct device_float_coords accelerator_filter_generic(struct motion_filter *filter, const struct device_float_coords *unaccelerated, void *data, uint64_t time) @@ -416,7 +416,7 @@ accelerator_filter_generic(struct motion_filter *filter, struct pointer_accelerator *accel = (struct pointer_accelerator *) filter; double accel_value; /* unitless factor */ - struct normalized_coords accelerated; + struct device_float_coords accelerated; accel_value = calculate_acceleration_factor(accel, unaccelerated, @@ -429,6 +429,66 @@ accelerator_filter_generic(struct motion_filter *filter, return accelerated; } +static struct normalized_coords +accelerator_filter_post_normalized(struct motion_filter *filter, + const struct device_float_coords *unaccelerated, + void *data, uint64_t time) +{ + struct pointer_accelerator *accel = + (struct pointer_accelerator *) filter; + struct device_float_coords accelerated; + + /* Accelerate for device units, normalize afterwards */ + accelerated = accelerator_filter_generic(filter, + unaccelerated, + data, + time); + return normalize_for_dpi(&accelerated, accel->dpi); +} + +static struct normalized_coords +accelerator_filter_pre_normalized(struct motion_filter *filter, + const struct device_float_coords *unaccelerated, + void *data, uint64_t time) +{ + struct pointer_accelerator *accel = + (struct pointer_accelerator *) filter; + struct normalized_coords normalized; + struct device_float_coords converted, accelerated; + + /* Accelerate for normalized units and return normalized units. + API requires device_floats, so we just copy the bits around */ + normalized = normalize_for_dpi(unaccelerated, accel->dpi); + converted.x = normalized.x; + converted.y = normalized.y; + + accelerated = accelerator_filter_generic(filter, + &converted, + data, + time); + normalized.x = accelerated.x; + normalized.y = accelerated.y; + return normalized; +} + +static struct normalized_coords +accelerator_filter_unnormalized(struct motion_filter *filter, + const struct device_float_coords *unaccelerated, + void *data, uint64_t time) +{ + struct device_float_coords accelerated; + struct normalized_coords normalized; + + /* Accelerate for device units and return device units */ + accelerated = accelerator_filter_generic(filter, + unaccelerated, + data, + time); + normalized.x = accelerated.x; + normalized.y = accelerated.y; + return normalized; +} + /** * Generic filter that does nothing beyond converting from the device's * native dpi into normalized coordinates. @@ -878,7 +938,7 @@ trackpoint_accel_profile(struct motion_filter *filter, struct motion_filter_interface accelerator_interface = { .type = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE, - .filter = accelerator_filter_generic, + .filter = accelerator_filter_pre_normalized, .filter_constant = accelerator_filter_noop, .restart = accelerator_restart, .destroy = accelerator_destroy, @@ -925,7 +985,7 @@ create_pointer_accelerator_filter_linear(int dpi) struct motion_filter_interface accelerator_interface_low_dpi = { .type = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE, - .filter = accelerator_filter_generic, + .filter = accelerator_filter_unnormalized, .filter_constant = accelerator_filter_noop, .restart = accelerator_restart, .destroy = accelerator_destroy, @@ -949,7 +1009,7 @@ create_pointer_accelerator_filter_linear_low_dpi(int dpi) struct motion_filter_interface accelerator_interface_touchpad = { .type = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE, - .filter = accelerator_filter_generic, + .filter = accelerator_filter_post_normalized, .filter_constant = touchpad_constant_filter, .restart = accelerator_restart, .destroy = accelerator_destroy, @@ -1011,7 +1071,7 @@ create_pointer_accelerator_filter_lenovo_x230(int dpi) struct motion_filter_interface accelerator_interface_trackpoint = { .type = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE, - .filter = accelerator_filter_generic, + .filter = accelerator_filter_unnormalized, .filter_constant = accelerator_filter_noop, .restart = accelerator_restart, .destroy = accelerator_destroy, commit 79339bca9c0f2884e679aeba94f0db65692fe652 Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Wed Jan 18 17:22:30 2017 +1000 filter: change the tracker delta type to device-units We were just switching type here without actual normalization, the filter code is in device units as of bdd4264d6150f4a6248eec7. Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> Reviewed-by: Hans de Goede <hdego...@redhat.com> diff --git a/src/filter.c b/src/filter.c index d7a1515..3035234 100644 --- a/src/filter.c +++ b/src/filter.c @@ -156,7 +156,7 @@ filter_get_type(struct motion_filter *filter) #define NUM_POINTER_TRACKERS 16 struct pointer_tracker { - struct normalized_coords delta; /* delta to most recent event */ + struct device_float_coords delta; /* delta to most recent event */ uint64_t time; /* us */ uint32_t dir; }; @@ -230,7 +230,7 @@ static double calculate_tracker_velocity(struct pointer_tracker *tracker, uint64_t time) { double tdelta = time - tracker->time + 1; - return normalized_length(tracker->delta) / tdelta; /* units/us */ + return hypot(tracker->delta.x, tracker->delta.y) / tdelta; /* units/us */ } static inline double commit 8660c19f71aecfabbd9d5931b08f05054cd7d701 Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Wed Jan 18 09:10:12 2017 +1000 gitignore: add test suite runner binary to gitignore Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/.gitignore b/.gitignore index 5a50a87..3776e4a 100644 --- a/.gitignore +++ b/.gitignore @@ -38,5 +38,6 @@ doc/html tags test/test-* !test/test-*.c +test/libinput-test-suite-runner* test/symbols-leak-test* test-driver commit 493a7dc0f12ab3e5618043f807bf351d37cdb675 Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Tue Jan 17 15:59:26 2017 +1000 Update gitignore for new test source names Fallout from 5d66edc9f413a35d Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/.gitignore b/.gitignore index ab5f993..5a50a87 100644 --- a/.gitignore +++ b/.gitignore @@ -37,5 +37,6 @@ doc/libinput.doxygen doc/html tags test/test-* +!test/test-*.c test/symbols-leak-test* test-driver commit 393a7ff5e9e4c6ecb437f432164400c36e6ba895 Author: Rohith Mukku <rohithmu...@gmail.com> Date: Wed Jan 18 01:11:22 2017 +0530 Fix typos in Documentation Signed-off-by: Rohith Mukku <rohithmu...@gmail.com> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/src/libinput.h b/src/libinput.h index 8c9cf9a..86bfeaf 100644 --- a/src/libinput.h +++ b/src/libinput.h @@ -307,7 +307,7 @@ enum libinput_tablet_pad_strip_axis_source { * while a button is held down. * * @note The @ref libinput_tablet_tool_type can only describe the default physical - * type of the device. For devices with adjustible physical properties + * type of the device. For devices with adjustable physical properties * the tool type remains the same, i.e. putting a Wacom stroke nib into a * classic pen leaves the tool type as @ref LIBINPUT_TABLET_TOOL_TYPE_PEN. */ @@ -329,7 +329,7 @@ enum libinput_tablet_tool_type { * LIBINPUT_DEVICE_CAP_TABLET_TOOL capability. * * The proximity of a tool is a binary state signalling whether the tool is - * within detectable distance of the tablet device. A tool that is out of + * within a detectable distance of the tablet device. A tool that is out of * proximity cannot generate events. * * On some hardware a tool goes out of proximity when it ceases to touch the @@ -2004,7 +2004,7 @@ libinput_event_tablet_tool_get_distance(struct libinput_event_tablet_tool *event * If this axis does not exist on the current tool, this function returns 0. * * @param event The libinput tablet tool event - * @return The current value of the the axis in degrees + * @return The current value of the axis in degrees */ double libinput_event_tablet_tool_get_tilt_x(struct libinput_event_tablet_tool *event); @@ -3395,7 +3395,7 @@ libinput_device_get_seat(struct libinput_device *device); * device and adding it to the new seat. * * This command is identical to physically unplugging the device, then - * re-plugging it as member of the new seat. libinput will generate a + * re-plugging it as a member of the new seat. libinput will generate a * @ref LIBINPUT_EVENT_DEVICE_REMOVED event and this @ref libinput_device is * considered removed from the context; it will not generate further events * and will be freed when the refcount reaches zero. commit 5dcb949c3d7358b343b3802620c671e66960d5c8 Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Mon Jan 16 16:24:02 2017 +1000 Fix doxygen references for natural scroll config Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/src/libinput.h b/src/libinput.h index 18a96bd..8c9cf9a 100644 --- a/src/libinput.h +++ b/src/libinput.h @@ -4399,9 +4399,9 @@ libinput_device_config_accel_get_default_profile(struct libinput_device *device) * @return Zero if natural scrolling is not supported, non-zero if natural * scrolling is supported by this device * - * @see libinput_device_config_set_natural_scroll_enabled - * @see libinput_device_config_get_natural_scroll_enabled - * @see libinput_device_config_get_default_natural_scroll_enabled + * @see libinput_device_config_scroll_set_natural_scroll_enabled + * @see libinput_device_config_scroll_get_natural_scroll_enabled + * @see libinput_device_config_scroll_get_default_natural_scroll_enabled */ int libinput_device_config_scroll_has_natural_scroll(struct libinput_device *device); @@ -4416,9 +4416,9 @@ libinput_device_config_scroll_has_natural_scroll(struct libinput_device *device) * * @return A config status code * - * @see libinput_device_config_has_natural_scroll - * @see libinput_device_config_get_natural_scroll_enabled - * @see libinput_device_config_get_default_natural_scroll_enabled + * @see libinput_device_config_scroll_has_natural_scroll + * @see libinput_device_config_scroll_get_natural_scroll_enabled + * @see libinput_device_config_scroll_get_default_natural_scroll_enabled */ enum libinput_config_status libinput_device_config_scroll_set_natural_scroll_enabled(struct libinput_device *device, @@ -4432,9 +4432,9 @@ libinput_device_config_scroll_set_natural_scroll_enabled(struct libinput_device * * @return Zero if natural scrolling is disabled, non-zero if enabled * - * @see libinput_device_config_has_natural_scroll - * @see libinput_device_config_set_natural_scroll_enabled - * @see libinput_device_config_get_default_natural_scroll_enabled + * @see libinput_device_config_scroll_has_natural_scroll + * @see libinput_device_config_scroll_set_natural_scroll_enabled + * @see libinput_device_config_scroll_get_default_natural_scroll_enabled */ int libinput_device_config_scroll_get_natural_scroll_enabled(struct libinput_device *device); @@ -4448,9 +4448,9 @@ libinput_device_config_scroll_get_natural_scroll_enabled(struct libinput_device * * @return Zero if natural scrolling is disabled by default, non-zero if enabled * - * @see libinput_device_config_has_natural_scroll - * @see libinput_device_config_set_natural_scroll_enabled - * @see libinput_device_config_get_natural_scroll_enabled + * @see libinput_device_config_scroll_has_natural_scroll + * @see libinput_device_config_scroll_set_natural_scroll_enabled + * @see libinput_device_config_scroll_get_natural_scroll_enabled */ int libinput_device_config_scroll_get_default_natural_scroll_enabled(struct libinput_device *device); commit fd99fcc0db75e4df0b7e2c2707f0b97ae9e7c150 Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Mon Jan 16 13:08:52 2017 +1000 configure.ac: libinput 1.6rc2 Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/configure.ac b/configure.ac index bae1c5b..195862a 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ([2.64]) m4_define([libinput_major_version], [1]) m4_define([libinput_minor_version], [5]) -m4_define([libinput_micro_version], [901]) +m4_define([libinput_micro_version], [902]) m4_define([libinput_version], [libinput_major_version.libinput_minor_version.libinput_micro_version]) @@ -35,7 +35,7 @@ AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz]) # b) If interfaces have been changed or added, but binary compatibility has # been preserved, change to C+1:0:A+1 # c) If the interface is the same as the previous version, change to C:R+1:A -LIBINPUT_LT_VERSION=21:0:11 +LIBINPUT_LT_VERSION=21:1:11 AC_SUBST(LIBINPUT_LT_VERSION) AM_SILENT_RULES([yes]) commit 572ef99bde24064aa8a829ec4bcec15714406516 Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Mon Jan 16 12:57:27 2017 +1000 udev: fix parse_hwdb.py to work with pyparsing 2.1.10 From systemd commit f644a6da7a: "pyparsing 2.1.10 fixed the handling of LineStart to really just apply to line starts and not ignore whitespace and comments any more. Adjust EMPTYLINE to this." Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/udev/parse_hwdb.py b/udev/parse_hwdb.py index 99e9c59..d90c90f 100755 --- a/udev/parse_hwdb.py +++ b/udev/parse_hwdb.py @@ -53,7 +53,7 @@ except ImportError: print('WARNING: evdev is not available') EOL = LineEnd().suppress() -EMPTYLINE = LineStart() + LineEnd() +EMPTYLINE = LineEnd() COMMENTLINE = pythonStyleComment + EOL INTEGER = Word(nums) REAL = Combine((INTEGER + Optional('.' + Optional(INTEGER))) ^ ('.' + INTEGER)) commit 1019a1703d21c240a271eafeec49779c0d8d096e Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Mon Jan 16 11:11:45 2017 +1000 test: rename wacom test devices to a consistent naming scheme Use the model names in the file name and append pad/pen/finger as appropriate Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/test/Makefile.am b/test/Makefile.am index 392d904..ba05729 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -53,21 +53,21 @@ liblitest_la_SOURCES = \ litest-device-trackpoint.c \ litest-device-touch-screen.c \ litest-device-touchscreen-fuzz.c \ - litest-device-wacom-bamboo-tablet.c \ - litest-device-wacom-cintiq-tablet.c \ + litest-device-wacom-bamboo-16fg-pen.c \ + litest-device-wacom-cintiq-12wx-pen.c \ litest-device-wacom-cintiq-13hdt-finger.c \ litest-device-wacom-cintiq-13hdt-pad.c \ litest-device-wacom-cintiq-13hdt-pen.c \ - litest-device-wacom-cintiq-24hd.c \ + litest-device-wacom-cintiq-24hd-pen.c \ litest-device-wacom-cintiq-24hdt-pad.c \ litest-device-wacom-ekr.c \ litest-device-wacom-hid4800-pen.c \ - litest-device-wacom-intuos-tablet.c \ litest-device-wacom-intuos3-pad.c \ + litest-device-wacom-intuos5-finger.c \ litest-device-wacom-intuos5-pad.c \ - litest-device-wacom-isdv4-tablet.c \ - litest-device-wacom-touch.c \ - litest-device-wacom-intuos-finger.c \ + litest-device-wacom-intuos5-pen.c \ + litest-device-wacom-isdv4-e6-pen.c \ + litest-device-wacom-isdv4-e6-finger.c \ litest-device-waltop-tablet.c \ litest-device-wheel-only.c \ litest-device-xen-virtual-pointer.c \ diff --git a/test/litest-device-wacom-bamboo-16fg-pen.c b/test/litest-device-wacom-bamboo-16fg-pen.c new file mode 100644 index 0000000..9e77c6f --- /dev/null +++ b/test/litest-device-wacom-bamboo-16fg-pen.c @@ -0,0 +1,118 @@ +/* + * Copyright © 2014 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "config.h" + +#include "litest.h" +#include "litest-int.h" + +static void litest_wacom_bamboo_tablet_setup(void) +{ + struct litest_device *d = litest_create_device(LITEST_WACOM_BAMBOO); + litest_set_current_device(d); +} + +static struct input_event proximity_in[] = { + { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_ABS, .code = ABS_DISTANCE, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_ABS, .code = ABS_PRESSURE, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_KEY, .code = BTN_TOOL_PEN, .value = 1 }, + { .type = EV_SYN, .code = SYN_REPORT, .value = 0 }, + { .type = -1, .code = -1 }, +}; + +static struct input_event proximity_out[] = { + { .type = EV_ABS, .code = ABS_X, .value = 0 }, + { .type = EV_ABS, .code = ABS_Y, .value = 0 }, + { .type = EV_ABS, .code = ABS_DISTANCE, .value = 0 }, + { .type = EV_KEY, .code = BTN_TOOL_PEN, .value = 0 }, + { .type = EV_SYN, .code = SYN_REPORT, .value = 0 }, + { .type = -1, .code = -1 }, +}; + +static struct input_event motion[] = { + { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_ABS, .code = ABS_DISTANCE, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_ABS, .code = ABS_PRESSURE, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_SYN, .code = SYN_REPORT, .value = 0 }, + { .type = -1, .code = -1 }, +}; + +static int +get_axis_default(struct litest_device *d, unsigned int evcode, int32_t *value) +{ + switch (evcode) { + case ABS_PRESSURE: + *value = 100; + return 0; + } + return 1; +} + +static struct litest_device_interface interface = { + .tablet_proximity_in_events = proximity_in, + .tablet_proximity_out_events = proximity_out, + .tablet_motion_events = motion, + + .get_axis_default = get_axis_default, +}; + +static struct input_absinfo absinfo[] = { + { ABS_X, 0, 14720, 4, 0, 100 }, + { ABS_Y, 0, 9200, 4, 0, 100 }, + { ABS_PRESSURE, 0, 1023, 0, 0, 0 }, + { ABS_DISTANCE, 0, 31, 0, 0, 0 }, + { .value = -1 }, +}; + +static struct input_id input_id = { + .bustype = 0x3, + .vendor = 0x56a, + .product = 0xde, + .version = 0x100, +}; + +static int events[] = { + EV_KEY, BTN_TOOL_PEN, + EV_KEY, BTN_TOOL_RUBBER, + EV_KEY, BTN_TOUCH, + EV_KEY, BTN_STYLUS, + EV_KEY, BTN_STYLUS2, + INPUT_PROP_MAX, INPUT_PROP_POINTER, + -1, -1, +}; + +struct litest_test_device litest_wacom_bamboo_tablet_device = { + .type = LITEST_WACOM_BAMBOO, + .features = LITEST_TABLET | LITEST_DISTANCE, + .shortname = "wacom-bamboo-tablet", + .setup = litest_wacom_bamboo_tablet_setup, + .interface = &interface, + + .name = "Wacom Bamboo 16FG 4x5 Pen", + .id = &input_id, + .events = events, + .absinfo = absinfo, +}; diff --git a/test/litest-device-wacom-bamboo-tablet.c b/test/litest-device-wacom-bamboo-tablet.c deleted file mode 100644 index 9e77c6f..0000000 --- a/test/litest-device-wacom-bamboo-tablet.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright © 2014 Red Hat, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#include "config.h" - -#include "litest.h" -#include "litest-int.h" - -static void litest_wacom_bamboo_tablet_setup(void) -{ - struct litest_device *d = litest_create_device(LITEST_WACOM_BAMBOO); - litest_set_current_device(d); -} - -static struct input_event proximity_in[] = { - { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN }, - { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN }, - { .type = EV_ABS, .code = ABS_DISTANCE, .value = LITEST_AUTO_ASSIGN }, - { .type = EV_ABS, .code = ABS_PRESSURE, .value = LITEST_AUTO_ASSIGN }, - { .type = EV_KEY, .code = BTN_TOOL_PEN, .value = 1 }, - { .type = EV_SYN, .code = SYN_REPORT, .value = 0 }, - { .type = -1, .code = -1 }, -}; - -static struct input_event proximity_out[] = { - { .type = EV_ABS, .code = ABS_X, .value = 0 }, - { .type = EV_ABS, .code = ABS_Y, .value = 0 }, - { .type = EV_ABS, .code = ABS_DISTANCE, .value = 0 }, - { .type = EV_KEY, .code = BTN_TOOL_PEN, .value = 0 }, - { .type = EV_SYN, .code = SYN_REPORT, .value = 0 }, - { .type = -1, .code = -1 }, -}; - -static struct input_event motion[] = { - { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN }, - { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN }, - { .type = EV_ABS, .code = ABS_DISTANCE, .value = LITEST_AUTO_ASSIGN }, - { .type = EV_ABS, .code = ABS_PRESSURE, .value = LITEST_AUTO_ASSIGN }, - { .type = EV_SYN, .code = SYN_REPORT, .value = 0 }, - { .type = -1, .code = -1 }, -}; - -static int -get_axis_default(struct litest_device *d, unsigned int evcode, int32_t *value) -{ - switch (evcode) { - case ABS_PRESSURE: - *value = 100; - return 0; - } - return 1; -} - -static struct litest_device_interface interface = { - .tablet_proximity_in_events = proximity_in, - .tablet_proximity_out_events = proximity_out, - .tablet_motion_events = motion, - - .get_axis_default = get_axis_default, -}; - -static struct input_absinfo absinfo[] = { - { ABS_X, 0, 14720, 4, 0, 100 }, - { ABS_Y, 0, 9200, 4, 0, 100 }, - { ABS_PRESSURE, 0, 1023, 0, 0, 0 }, - { ABS_DISTANCE, 0, 31, 0, 0, 0 }, - { .value = -1 }, -}; - -static struct input_id input_id = { - .bustype = 0x3, - .vendor = 0x56a, - .product = 0xde, - .version = 0x100, -}; - -static int events[] = { - EV_KEY, BTN_TOOL_PEN, - EV_KEY, BTN_TOOL_RUBBER, - EV_KEY, BTN_TOUCH, - EV_KEY, BTN_STYLUS, - EV_KEY, BTN_STYLUS2, - INPUT_PROP_MAX, INPUT_PROP_POINTER, - -1, -1, -}; - -struct litest_test_device litest_wacom_bamboo_tablet_device = { - .type = LITEST_WACOM_BAMBOO, - .features = LITEST_TABLET | LITEST_DISTANCE, - .shortname = "wacom-bamboo-tablet", - .setup = litest_wacom_bamboo_tablet_setup, - .interface = &interface, - - .name = "Wacom Bamboo 16FG 4x5 Pen", - .id = &input_id, - .events = events, - .absinfo = absinfo, -}; diff --git a/test/litest-device-wacom-cintiq-12wx-pen.c b/test/litest-device-wacom-cintiq-12wx-pen.c new file mode 100644 index 0000000..c6a9f4c --- /dev/null +++ b/test/litest-device-wacom-cintiq-12wx-pen.c @@ -0,0 +1,157 @@ +/* + * Copyright © 2014 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "config.h" + +#include "litest.h" +#include "litest-int.h" + +static void litest_wacom_cintiq_tablet_setup(void) +{ + struct litest_device *d = litest_create_device(LITEST_WACOM_CINTIQ); + litest_set_current_device(d); +} + +static struct input_event proximity_in[] = { + { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_ABS, .code = ABS_DISTANCE, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_ABS, .code = ABS_PRESSURE, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_ABS, .code = ABS_TILT_X, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_ABS, .code = ABS_TILT_Y, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_ABS, .code = ABS_MISC, .value = 2083 }, + { .type = EV_MSC, .code = MSC_SERIAL, .value = 297797542 }, + { .type = EV_KEY, .code = BTN_TOOL_PEN, .value = 1 }, + { .type = EV_SYN, .code = SYN_REPORT, .value = 0 }, + { .type = -1, .code = -1 }, +}; + +static struct input_event proximity_out[] = { + { .type = EV_ABS, .code = ABS_X, .value = 0 }, + { .type = EV_ABS, .code = ABS_Y, .value = 0 }, + { .type = EV_ABS, .code = ABS_DISTANCE, .value = 0 }, + { .type = EV_ABS, .code = ABS_TILT_X, .value = 0 }, + { .type = EV_ABS, .code = ABS_TILT_Y, .value = 0 }, + { .type = EV_ABS, .code = ABS_MISC, .value = 0 }, + { .type = EV_MSC, .code = MSC_SERIAL, .value = 297797542 }, + { .type = EV_KEY, .code = BTN_TOOL_PEN, .value = 0 }, + { .type = EV_SYN, .code = SYN_REPORT, .value = 0 }, + { .type = -1, .code = -1 }, +}; + +static struct input_event motion[] = { + { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_ABS, .code = ABS_DISTANCE, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_ABS, .code = ABS_PRESSURE, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_ABS, .code = ABS_TILT_X, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_ABS, .code = ABS_TILT_Y, .value = LITEST_AUTO_ASSIGN }, + { .type = EV_MSC, .code = MSC_SERIAL, .value = 297797542 }, + { .type = EV_SYN, .code = SYN_REPORT, .value = 0 }, + { .type = -1, .code = -1 }, +}; + +static int +get_axis_default(struct litest_device *d, unsigned int evcode, int32_t *value) +{ + switch (evcode) { + case ABS_TILT_X: + case ABS_TILT_Y: + *value = 0; + return 0; + case ABS_PRESSURE: + *value = 100; + return 0; + case ABS_DISTANCE: + *value = 0; + return 0; + } + return 1; +} + +static struct litest_device_interface interface = { + .tablet_proximity_in_events = proximity_in, + .tablet_proximity_out_events = proximity_out, + .tablet_motion_events = motion, + + .get_axis_default = get_axis_default, +}; + +static struct input_absinfo absinfo[] = { + { ABS_X, 0, 53020, 4, 0, 200 }, + { ABS_Y, 0, 33440, 4, 0, 200 }, + { ABS_Z, -900, 899, 0, 0, 0 }, + { ABS_RX, 0, 4096, 0, 0, 0 }, + { ABS_RY, 0, 4096, 0, 0, 0 }, + { ABS_WHEEL, 0, 1023, 0, 0, 0 }, + { ABS_PRESSURE, 0, 1023, 0, 0, 0 }, + { ABS_DISTANCE, 0, 63, 0, 0, 0 }, + { ABS_TILT_X, 0, 127, 0, 0, 0 }, + { ABS_TILT_Y, 0, 127, 0, 0, 0 }, + { ABS_MISC, 0, 0, 0, 0, 0 }, + { .value = -1 }, +}; + +static struct input_id input_id = { + .bustype = 0x3, + .vendor = 0x56a, + .product = 0xc6, + .version = 0x113, +};