Make buttons unsigned, there are no negative button numbers

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Make the slots unsigned, the kernel guarantees a base of 0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
libinput_dispatch: return negative error number on failure

Might as well tell the caller what went wrong without having to worry about
errno.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
libinput_dispatch: return -EAGAIN if no events are ready

Notify the caller that no events are currently ready to be processed.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Move libinput, libinput_seat and libinput_device to the top

Declare all three before they are used.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
evdev: fix memcopy for calibration

Function arguments with fixed length are still just pointers, so
sizeof(calibration) here is sizeof(float*), not sizeof(float) * 6.

evdev.c: In function 'evdev_device_calibrate':
evdev.c:693:54: warning: argument to 'sizeof' in 'memcpy' call is the same
  pointer type 'float *' as the destination; expected 'float' or an explicit
  length [-Wsizeof-pointer-memaccess]
  memcpy(device->abs.calibration, calibration, sizeof calibration);

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Drop unused libinput_fd_handle and libinput_fd_callback

Obsolete with ce787552bce26ccac433c7fcf9868d2a5561a0cc

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Drop include of evdev.h from evdev.h

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
udev-seat: fix leak when failing to add devices

udev-monitor and the udev_monitor_source would leak.

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

A lot more obvious what it does, it creates a libinput context from a udev
handler (rather than creating the udev handler).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
doc: hook up doxygen to generate the public API documentation

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
doc: Clarify that the caller need to free retrieved event

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Remove unused disabled code

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reference count event target struct when applicable

If the target of an event is a reference counted object, such as
libinput_seat and libinput_device, make events own its own reference to
the object, releasing it when destroyed.

In order to do this, a new API requirement and function are introduced;
libinput_event_destroy(). The user is required to use
libinput_event_destroy() instead of free() after having retrieved an
event using libinput_get_event().

This fixes a race that would be triggered if a device or seat would be
added and removed before the user calling libinput_get_event().

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Put libinput_interface struct below base doxygen group

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Make even structs private

To ease the possibility to extend messages with more information, make
every event struct private, while providing functions used for accessing
the parameters previously found directly in the public structs.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Put libinput_event_destroy() together with other event functions

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
doc: Document basic event accessor functions

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>