|
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>
|