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>
Allow for NULL in libevdev_event_destroy

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Allow for NULL in libinput_destroy

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
configure: add libudev dependency

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
udev: fail libinput_create_from_udev for NULL values

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Add zalloc.h

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
util: add ARRAY_FOR_EACH helper

Requires c99, but that's the future.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
configure: require c99

This enables a few nice things that gcc would otherwise not allow.
fix typo in documentation
udev: include libinput-private.h for struct libinput

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Namespace seat/device events to (seat|device)_(added|removed)

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