Commit graph

109 commits

Author SHA1 Message Date
Stephen Chandler Paul
9357166114 evdev: Add basic support for tablet devices
These devices set the LIBINPUT_DEVICE_CAP_TABLET flag, and emit a lot more axis
information then mice and touchpads. As such, tablet events are in a whole new
group of events that is separate from everything else.

In this commit, only X and Y axes are reported in libinput.

Based off the patch originally written by Carlos Garnacho

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:15:58 -04:00
Stephen Chandler Paul
812ea542e7 Add bitfield helper functions from libdevdev-util.h and some tests
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-16 20:31:03 -04:00
Jonas Ådahl
f3084e2c0d Use floating point numbers instead of fixed point numbers
Fixed point numbers can easily overflow, and double to fixed point
conversion is lossy. Use floating point (double) where fixed point
numbers where previously used and remove the li_fixed_t type.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-09 20:46:53 +02:00
Peter Hutterer
c9ab49ee0c Fix up ARRAY_FOR_EACH macro
Remove compiler warning about signed/unsigned comparison. And while we're at
it, rename i to _i in the macro to avoid name clashes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2014-04-10 11:11:56 +10:00
Peter Hutterer
01ee0f7ef9 util: add min/max macros
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-02-17 14:35:06 +10:00
Peter Hutterer
b59d9c537b util: add ARRAY_FOR_EACH helper
Requires c99, but that's the future.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-12-21 12:09:55 +01:00
Peter Hutterer
e4f4389341 Move zalloc() up to libinput-util.h
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-12-21 12:09:27 +01:00
Jonas Ådahl
c0af815eae util: Add logging utilities
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 12:55:44 +01:00
Jonas Ådahl
ce787552bc Introduce libinput object managing all input data
Instead of having the user manage added and removed fd's as well as the
fd used for creating evdev devices, introduce a libinput object that
itself has an epoll fd.

The user no longer manages multiple fd's per libinput instance, but
instead handles one fd, dispatches libinput when data is available, then
reading events using libinput_get_event().

libinput_event's are now per libinstance, but divided into categories.
So far the only category is device events. Device events are categorized
by the presence of a non-NULL device pointer in the event.

The current API usage should look like:

struct libinput libinput = ...;
struct libinput_event *event;

if (libinput_dispatch(libinput) != 0)
	return -1;
while ((event = libinput_get_event(libinput))) {
	if (event->device)
		process_device_event(event);
	free(event);
}

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-17 17:03:06 +01:00