1 #ifndef DS_SEAT_PRIVATE_H
2 #define DS_SEAT_PRIVATE_H
5 #include <wayland-server.h>
7 #include "libds/seat.h"
14 struct wl_client *wl_client;
17 struct wl_list resources; // wl_seat
18 struct wl_list pointers; // wl_pointer
19 struct wl_list keyboards; // wl_keyboard
20 struct wl_list touches; // wl_touch
23 struct wl_signal destroy;
26 bool needs_touch_frame;
29 #define DS_POINTER_BUTTONS_CAP 16
31 struct ds_seat_pointer
34 struct ds_seat_client *focused_client;
35 struct ds_surface *focused_surface;
38 struct ds_seat_pointer_grab *grab;
39 struct ds_seat_pointer_grab *default_grab;
41 bool sent_axis_source;
42 enum ds_axis_source cached_axis_source;
44 uint32_t buttons[DS_POINTER_BUTTONS_CAP];
50 struct wl_listener surface_destroy;
53 struct wl_signal focus_change;
57 struct ds_seat_keyboard
61 struct ds_seat_client *focused_client;
62 struct ds_surface *focused_surface;
64 struct wl_listener surface_destroy;
66 struct ds_seat_keyboard_grab *grab;
67 struct ds_seat_keyboard_grab *default_grab;
70 struct wl_signal focus_change;
77 struct ds_surface *surface;
78 struct ds_seat_client *seat_client;
80 struct ds_seat_client *focused_client;
81 struct ds_surface *focused_surface;
84 struct wl_listener surface_destroy;
85 struct wl_listener focused_surface_destroy;
86 struct wl_listener client_destroy;
89 struct wl_signal destroy;
98 struct wl_list touch_points; // ds_touch_point::link
100 uint32_t grab_serial;
103 struct ds_seat_touch_grab *grab;
104 struct ds_seat_touch_grab *default_grab;
110 enum wl_seat_capability capabilities;
111 enum wl_seat_capability accumulated_capabilities;
112 struct timespec last_event;
114 struct wl_display *display;
115 struct wl_global *global;
117 struct wl_list clients; // ds_seat_client::link
119 struct ds_seat_pointer pointer;
120 struct ds_seat_keyboard keyboard;
121 struct ds_seat_touch touch;
123 struct wl_listener display_destroy;
126 struct wl_signal destroy;
128 struct wl_signal pointer_grab_begin;
129 struct wl_signal pointer_grab_end;
131 struct wl_signal keyboard_grab_begin;
132 struct wl_signal keyboard_grab_end;
134 struct wl_signal touch_grab_begin;
135 struct wl_signal touch_grab_end;
139 struct ds_seat_client *
140 seat_client_for_wl_client(struct ds_seat *seat, struct wl_client *wl_client);
142 bool seat_pointer_init(struct ds_seat *seat);
144 void seat_pointer_finish(struct ds_seat *seat);
146 void seat_client_add_pointer_resource(struct ds_seat_client *seat_client,
147 uint32_t version, uint32_t id);
150 seat_client_remove_all_pointer_resources(struct ds_seat_client *seat_client);
152 bool seat_keyboard_init(struct ds_seat *seat);
154 void seat_keyboard_finish(struct ds_seat *seat);
156 void seat_client_add_keyboard_resource(struct ds_seat_client *seat_client,
157 uint32_t version, uint32_t id);
160 seat_client_remove_all_keyboard_resources(struct ds_seat_client *seat_client);
162 bool seat_touch_init(struct ds_seat *seat);
164 void seat_touch_finish(struct ds_seat *seat);
166 void seat_client_add_touch_resource(struct ds_seat_client *seat_client,
167 uint32_t version, uint32_t id);
170 seat_client_remove_all_touch_resources(struct ds_seat_client *seat_client);