1 #ifndef DS_BACKEND_LIBINPUT_H
2 #define DS_BACKEND_LIBINPUT_H
7 #include "libds/interfaces/backend.h"
8 #include "libds/interfaces/input_device.h"
9 #include "libds/interfaces/pointer.h"
10 #include "libds/interfaces/keyboard.h"
11 #include "libds/interfaces/touch.h"
13 struct ds_libinput_backend
15 struct ds_backend base;
17 struct wl_display *display;
18 struct wl_listener display_destroy;
21 struct libinput *libinput_context;
22 struct wl_list devices; // ds_libinput_input_device::link
24 struct wl_event_source *server_event_source;
27 struct ds_libinput_input_device
29 struct ds_input_device base;
31 struct ds_libinput_backend *backend;
32 struct libinput_device *handle;
34 struct wl_list link; //ds_libinput_backend.devices
37 struct ds_libinput_backend *
38 libinput_backend_from_backend(struct ds_backend *backend);
40 void handle_libinput_event(struct ds_libinput_backend *state,
41 struct libinput_event *event);
43 void destroy_libinput_input_device(struct ds_libinput_input_device *dev);
46 void handle_keyboard_key(struct libinput_event *event,
47 struct ds_keyboard *kbd);
50 void handle_pointer_motion(struct libinput_event *event,
51 struct ds_pointer *pointer);
52 void handle_pointer_motion_abs(struct libinput_event *event,
53 struct ds_pointer *pointer);
54 void handle_pointer_button(struct libinput_event *event,
55 struct ds_pointer *pointer);
56 void handle_pointer_axis(struct libinput_event *event,
57 struct ds_pointer *pointer);
60 void handle_touch_down(struct libinput_event *event,
61 struct ds_touch *touch);
62 void handle_touch_up(struct libinput_event *event,
63 struct ds_touch *touch);
64 void handle_touch_motion(struct libinput_event *event,
65 struct ds_touch *touch);
66 void handle_touch_cancel(struct libinput_event *event,
67 struct ds_touch *touch);
68 void handle_touch_frame(struct libinput_event *event,
69 struct ds_touch *touch);