2018-07-13 14:40:56 +02:00
|
|
|
/*
|
|
|
|
* This an unstable interface of wlroots. No guarantees are made regarding the
|
|
|
|
* future consistency of this API.
|
|
|
|
*/
|
|
|
|
#ifndef WLR_USE_UNSTABLE
|
|
|
|
#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
|
|
|
|
#endif
|
|
|
|
|
2017-09-23 10:26:01 +02:00
|
|
|
#ifndef WLR_TYPES_WLR_SEAT_H
|
|
|
|
#define WLR_TYPES_WLR_SEAT_H
|
2018-02-12 21:29:23 +01:00
|
|
|
|
2017-11-12 15:55:28 +01:00
|
|
|
#include <time.h>
|
2019-07-27 10:53:54 +02:00
|
|
|
#include <wayland-server-core.h>
|
2017-09-20 13:32:28 +02:00
|
|
|
#include <wlr/types/wlr_input_device.h>
|
2017-09-24 20:12:56 +02:00
|
|
|
#include <wlr/types/wlr_keyboard.h>
|
2020-11-11 14:16:41 +01:00
|
|
|
#include <wlr/types/wlr_pointer.h>
|
2022-01-13 09:55:09 +01:00
|
|
|
|
|
|
|
struct wlr_surface;
|
2017-08-16 14:50:43 +02:00
|
|
|
|
2019-06-27 21:43:58 +02:00
|
|
|
#define WLR_SERIAL_RINGSET_SIZE 128
|
|
|
|
|
|
|
|
struct wlr_serial_range {
|
|
|
|
uint32_t min_incl;
|
|
|
|
uint32_t max_incl;
|
|
|
|
};
|
|
|
|
struct wlr_serial_ringset {
|
|
|
|
struct wlr_serial_range data[WLR_SERIAL_RINGSET_SIZE];
|
|
|
|
int end;
|
|
|
|
int count;
|
|
|
|
};
|
|
|
|
|
2017-08-16 14:50:43 +02:00
|
|
|
/**
|
|
|
|
* Contains state for a single client's bound wl_seat resource and can be used
|
|
|
|
* to issue input events to that client. The lifetime of these objects is
|
|
|
|
* managed by wlr_seat; some may be NULL.
|
|
|
|
*/
|
2017-10-30 13:37:54 +01:00
|
|
|
struct wlr_seat_client {
|
|
|
|
struct wl_client *client;
|
2017-10-30 13:44:39 +01:00
|
|
|
struct wlr_seat *seat;
|
2018-11-29 19:30:04 +01:00
|
|
|
struct wl_list link;
|
2017-08-16 14:50:43 +02:00
|
|
|
|
2017-12-16 13:53:39 +01:00
|
|
|
// lists of wl_resource
|
2018-07-08 20:21:31 +02:00
|
|
|
struct wl_list resources;
|
2017-12-16 13:53:39 +01:00
|
|
|
struct wl_list pointers;
|
|
|
|
struct wl_list keyboards;
|
|
|
|
struct wl_list touches;
|
2017-12-16 14:22:59 +01:00
|
|
|
struct wl_list data_devices;
|
2017-08-16 14:50:43 +02:00
|
|
|
|
2017-11-19 17:10:27 +01:00
|
|
|
struct {
|
|
|
|
struct wl_signal destroy;
|
|
|
|
} events;
|
2019-06-27 21:43:58 +02:00
|
|
|
|
|
|
|
// set of serials which were sent to the client on this seat
|
2019-06-29 15:15:23 +02:00
|
|
|
// for use by wlr_seat_client_{next_serial,validate_event_serial}
|
2019-06-27 21:43:58 +02:00
|
|
|
struct wlr_serial_ringset serials;
|
2021-06-30 13:09:45 +02:00
|
|
|
bool needs_touch_frame;
|
2017-08-16 14:50:43 +02:00
|
|
|
};
|
|
|
|
|
2017-11-14 01:16:34 +01:00
|
|
|
struct wlr_touch_point {
|
|
|
|
int32_t touch_id;
|
2021-06-30 13:09:45 +02:00
|
|
|
struct wlr_surface *surface; // may be NULL if destroyed
|
2017-11-14 01:16:34 +01:00
|
|
|
struct wlr_seat_client *client;
|
2017-11-14 14:51:37 +01:00
|
|
|
|
|
|
|
struct wlr_surface *focus_surface;
|
|
|
|
struct wlr_seat_client *focus_client;
|
2017-11-14 01:16:34 +01:00
|
|
|
double sx, sy;
|
|
|
|
|
|
|
|
struct wl_listener surface_destroy;
|
2017-11-14 14:51:37 +01:00
|
|
|
struct wl_listener focus_surface_destroy;
|
2019-09-14 06:41:54 +02:00
|
|
|
struct wl_listener client_destroy;
|
2017-11-14 01:16:34 +01:00
|
|
|
|
|
|
|
struct {
|
|
|
|
struct wl_signal destroy;
|
|
|
|
} events;
|
|
|
|
|
|
|
|
struct wl_list link;
|
|
|
|
};
|
|
|
|
|
2017-10-05 19:28:26 +02:00
|
|
|
struct wlr_seat_pointer_grab;
|
|
|
|
|
|
|
|
struct wlr_pointer_grab_interface {
|
|
|
|
void (*enter)(struct wlr_seat_pointer_grab *grab,
|
|
|
|
struct wlr_surface *surface, double sx, double sy);
|
2020-05-21 03:04:09 +02:00
|
|
|
void (*clear_focus)(struct wlr_seat_pointer_grab *grab);
|
2019-03-01 10:57:49 +01:00
|
|
|
void (*motion)(struct wlr_seat_pointer_grab *grab, uint32_t time_msec,
|
2017-10-05 19:28:26 +02:00
|
|
|
double sx, double sy);
|
2019-03-01 10:57:49 +01:00
|
|
|
uint32_t (*button)(struct wlr_seat_pointer_grab *grab, uint32_t time_msec,
|
|
|
|
uint32_t button, enum wlr_button_state state);
|
|
|
|
void (*axis)(struct wlr_seat_pointer_grab *grab, uint32_t time_msec,
|
2018-05-12 14:04:47 +02:00
|
|
|
enum wlr_axis_orientation orientation, double value,
|
2018-05-12 14:51:30 +02:00
|
|
|
int32_t value_discrete, enum wlr_axis_source source);
|
2019-01-26 11:04:05 +01:00
|
|
|
void (*frame)(struct wlr_seat_pointer_grab *grab);
|
2017-10-05 19:28:26 +02:00
|
|
|
void (*cancel)(struct wlr_seat_pointer_grab *grab);
|
|
|
|
};
|
|
|
|
|
2017-10-07 17:02:11 +02:00
|
|
|
struct wlr_seat_keyboard_grab;
|
|
|
|
|
|
|
|
struct wlr_keyboard_grab_interface {
|
2017-10-30 13:37:54 +01:00
|
|
|
void (*enter)(struct wlr_seat_keyboard_grab *grab,
|
2018-01-06 17:06:09 +01:00
|
|
|
struct wlr_surface *surface, uint32_t keycodes[],
|
|
|
|
size_t num_keycodes, struct wlr_keyboard_modifiers *modifiers);
|
2020-05-21 03:04:09 +02:00
|
|
|
void (*clear_focus)(struct wlr_seat_keyboard_grab *grab);
|
2019-03-01 10:57:49 +01:00
|
|
|
void (*key)(struct wlr_seat_keyboard_grab *grab, uint32_t time_msec,
|
2017-10-07 17:02:11 +02:00
|
|
|
uint32_t key, uint32_t state);
|
2018-01-05 13:00:50 +01:00
|
|
|
void (*modifiers)(struct wlr_seat_keyboard_grab *grab,
|
|
|
|
struct wlr_keyboard_modifiers *modifiers);
|
2017-10-07 17:02:11 +02:00
|
|
|
void (*cancel)(struct wlr_seat_keyboard_grab *grab);
|
|
|
|
};
|
|
|
|
|
2017-11-12 23:04:56 +01:00
|
|
|
struct wlr_seat_touch_grab;
|
|
|
|
|
|
|
|
struct wlr_touch_grab_interface {
|
2019-03-01 10:57:49 +01:00
|
|
|
uint32_t (*down)(struct wlr_seat_touch_grab *grab, uint32_t time_msec,
|
2017-11-14 01:16:34 +01:00
|
|
|
struct wlr_touch_point *point);
|
2019-03-01 10:57:49 +01:00
|
|
|
void (*up)(struct wlr_seat_touch_grab *grab, uint32_t time_msec,
|
2017-11-14 01:16:34 +01:00
|
|
|
struct wlr_touch_point *point);
|
2019-03-01 10:57:49 +01:00
|
|
|
void (*motion)(struct wlr_seat_touch_grab *grab, uint32_t time_msec,
|
2017-11-14 01:16:34 +01:00
|
|
|
struct wlr_touch_point *point);
|
2019-03-01 10:57:49 +01:00
|
|
|
void (*enter)(struct wlr_seat_touch_grab *grab, uint32_t time_msec,
|
2017-11-14 14:51:37 +01:00
|
|
|
struct wlr_touch_point *point);
|
2021-06-30 13:09:45 +02:00
|
|
|
void (*frame)(struct wlr_seat_touch_grab *grab);
|
2017-11-12 23:04:56 +01:00
|
|
|
// XXX this will conflict with the actual touch cancel which is different so
|
|
|
|
// we need to rename this
|
|
|
|
void (*cancel)(struct wlr_seat_touch_grab *grab);
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Passed to `wlr_seat_touch_start_grab()` to start a grab of the touch device.
|
|
|
|
* The grabber is responsible for handling touch events for the seat.
|
|
|
|
*/
|
|
|
|
struct wlr_seat_touch_grab {
|
|
|
|
const struct wlr_touch_grab_interface *interface;
|
|
|
|
struct wlr_seat *seat;
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
2017-10-07 17:02:11 +02:00
|
|
|
/**
|
|
|
|
* Passed to `wlr_seat_keyboard_start_grab()` to start a grab of the keyboard.
|
|
|
|
* The grabber is responsible for handling keyboard events for the seat.
|
|
|
|
*/
|
|
|
|
struct wlr_seat_keyboard_grab {
|
|
|
|
const struct wlr_keyboard_grab_interface *interface;
|
|
|
|
struct wlr_seat *seat;
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
2017-10-05 19:28:26 +02:00
|
|
|
/**
|
|
|
|
* Passed to `wlr_seat_pointer_start_grab()` to start a grab of the pointer. The
|
|
|
|
* grabber is responsible for handling pointer events for the seat.
|
|
|
|
*/
|
|
|
|
struct wlr_seat_pointer_grab {
|
|
|
|
const struct wlr_pointer_grab_interface *interface;
|
|
|
|
struct wlr_seat *seat;
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
2019-06-15 20:08:53 +02:00
|
|
|
#define WLR_POINTER_BUTTONS_CAP 16
|
|
|
|
|
2017-09-20 13:32:28 +02:00
|
|
|
struct wlr_seat_pointer_state {
|
2017-10-30 13:44:39 +01:00
|
|
|
struct wlr_seat *seat;
|
2017-10-30 13:37:54 +01:00
|
|
|
struct wlr_seat_client *focused_client;
|
2017-09-20 13:32:28 +02:00
|
|
|
struct wlr_surface *focused_surface;
|
2019-01-30 10:54:57 +01:00
|
|
|
double sx, sy;
|
2017-09-20 13:32:28 +02:00
|
|
|
|
2017-10-05 19:28:26 +02:00
|
|
|
struct wlr_seat_pointer_grab *grab;
|
|
|
|
struct wlr_seat_pointer_grab *default_grab;
|
2017-10-16 12:31:53 +02:00
|
|
|
|
2021-07-17 09:20:35 +02:00
|
|
|
bool sent_axis_source;
|
|
|
|
enum wlr_axis_source cached_axis_source;
|
|
|
|
|
2019-06-15 20:08:53 +02:00
|
|
|
uint32_t buttons[WLR_POINTER_BUTTONS_CAP];
|
|
|
|
size_t button_count;
|
2017-10-16 12:31:53 +02:00
|
|
|
uint32_t grab_button;
|
|
|
|
uint32_t grab_serial;
|
|
|
|
uint32_t grab_time;
|
|
|
|
|
|
|
|
struct wl_listener surface_destroy;
|
2018-08-04 23:22:21 +02:00
|
|
|
|
|
|
|
struct {
|
2018-09-27 12:21:30 +02:00
|
|
|
struct wl_signal focus_change; // wlr_seat_pointer_focus_change_event
|
2018-08-04 23:22:21 +02:00
|
|
|
} events;
|
2017-09-20 13:32:28 +02:00
|
|
|
};
|
|
|
|
|
2017-11-12 23:25:10 +01:00
|
|
|
// TODO: May be useful to be able to simulate keyboard input events
|
2017-09-22 22:07:00 +02:00
|
|
|
struct wlr_seat_keyboard_state {
|
2017-10-30 13:44:39 +01:00
|
|
|
struct wlr_seat *seat;
|
2017-10-23 14:59:55 +02:00
|
|
|
struct wlr_keyboard *keyboard;
|
|
|
|
|
2017-10-30 13:37:54 +01:00
|
|
|
struct wlr_seat_client *focused_client;
|
2017-09-22 22:07:00 +02:00
|
|
|
struct wlr_surface *focused_surface;
|
|
|
|
|
2017-10-23 14:59:55 +02:00
|
|
|
struct wl_listener keyboard_destroy;
|
|
|
|
struct wl_listener keyboard_keymap;
|
2017-12-08 17:03:05 +01:00
|
|
|
struct wl_listener keyboard_repeat_info;
|
2017-10-23 14:59:55 +02:00
|
|
|
|
2017-09-25 14:29:35 +02:00
|
|
|
struct wl_listener surface_destroy;
|
2017-10-07 17:02:11 +02:00
|
|
|
|
|
|
|
struct wlr_seat_keyboard_grab *grab;
|
|
|
|
struct wlr_seat_keyboard_grab *default_grab;
|
2018-11-27 18:41:46 +01:00
|
|
|
|
|
|
|
struct {
|
|
|
|
struct wl_signal focus_change; // wlr_seat_keyboard_focus_change_event
|
|
|
|
} events;
|
2017-09-22 22:07:00 +02:00
|
|
|
};
|
|
|
|
|
2017-11-12 17:43:50 +01:00
|
|
|
struct wlr_seat_touch_state {
|
|
|
|
struct wlr_seat *seat;
|
|
|
|
struct wl_list touch_points; // wlr_touch_point::link
|
2017-11-12 23:04:56 +01:00
|
|
|
|
2017-11-13 14:22:04 +01:00
|
|
|
uint32_t grab_serial;
|
2017-11-13 21:41:48 +01:00
|
|
|
uint32_t grab_id;
|
2017-11-13 14:22:04 +01:00
|
|
|
|
2017-11-12 23:04:56 +01:00
|
|
|
struct wlr_seat_touch_grab *grab;
|
|
|
|
struct wlr_seat_touch_grab *default_grab;
|
2017-11-12 17:43:50 +01:00
|
|
|
};
|
|
|
|
|
2018-11-28 16:37:35 +01:00
|
|
|
struct wlr_primary_selection_source;
|
|
|
|
|
2017-08-16 14:50:43 +02:00
|
|
|
struct wlr_seat {
|
2018-07-08 20:21:31 +02:00
|
|
|
struct wl_global *global;
|
2017-09-20 13:32:28 +02:00
|
|
|
struct wl_display *display;
|
2017-10-30 13:37:54 +01:00
|
|
|
struct wl_list clients;
|
2017-11-19 15:33:55 +01:00
|
|
|
|
2017-08-16 14:50:43 +02:00
|
|
|
char *name;
|
|
|
|
uint32_t capabilities;
|
2020-05-28 00:24:50 +02:00
|
|
|
uint32_t accumulated_capabilities;
|
2017-11-12 15:55:28 +01:00
|
|
|
struct timespec last_event;
|
2017-10-11 21:48:40 +02:00
|
|
|
|
2018-03-29 17:33:40 +02:00
|
|
|
struct wlr_data_source *selection_source;
|
2017-10-11 21:48:40 +02:00
|
|
|
uint32_t selection_serial;
|
2018-12-09 17:35:11 +01:00
|
|
|
struct wl_list selection_offers; // wlr_data_offer::link
|
2017-08-16 14:50:43 +02:00
|
|
|
|
2018-11-28 16:37:35 +01:00
|
|
|
struct wlr_primary_selection_source *primary_selection_source;
|
2019-01-21 19:23:40 +01:00
|
|
|
uint32_t primary_selection_serial;
|
2017-12-22 22:22:29 +01:00
|
|
|
|
2018-03-29 17:33:40 +02:00
|
|
|
// `drag` goes away before `drag_source`, when the implicit grab ends
|
2018-03-28 18:59:11 +02:00
|
|
|
struct wlr_drag *drag;
|
2018-03-29 17:33:40 +02:00
|
|
|
struct wlr_data_source *drag_source;
|
2018-03-28 18:59:11 +02:00
|
|
|
uint32_t drag_serial;
|
2018-12-09 17:35:11 +01:00
|
|
|
struct wl_list drag_offers; // wlr_data_offer::link
|
2018-03-28 18:59:11 +02:00
|
|
|
|
2017-09-20 13:32:28 +02:00
|
|
|
struct wlr_seat_pointer_state pointer_state;
|
2017-09-22 22:07:00 +02:00
|
|
|
struct wlr_seat_keyboard_state keyboard_state;
|
2017-11-12 17:43:50 +01:00
|
|
|
struct wlr_seat_touch_state touch_state;
|
2017-09-20 13:32:28 +02:00
|
|
|
|
2017-12-07 01:02:07 +01:00
|
|
|
struct wl_listener display_destroy;
|
2018-03-29 17:33:40 +02:00
|
|
|
struct wl_listener selection_source_destroy;
|
2018-11-28 16:37:35 +01:00
|
|
|
struct wl_listener primary_selection_source_destroy;
|
2018-03-29 17:33:40 +02:00
|
|
|
struct wl_listener drag_source_destroy;
|
2017-10-12 17:41:11 +02:00
|
|
|
|
2017-08-16 14:50:43 +02:00
|
|
|
struct {
|
2017-10-06 13:32:59 +02:00
|
|
|
struct wl_signal pointer_grab_begin;
|
|
|
|
struct wl_signal pointer_grab_end;
|
2017-10-07 17:02:11 +02:00
|
|
|
|
|
|
|
struct wl_signal keyboard_grab_begin;
|
|
|
|
struct wl_signal keyboard_grab_end;
|
2017-10-05 13:11:51 +02:00
|
|
|
|
2017-11-12 23:34:32 +01:00
|
|
|
struct wl_signal touch_grab_begin;
|
|
|
|
struct wl_signal touch_grab_end;
|
|
|
|
|
2018-11-29 19:30:04 +01:00
|
|
|
// wlr_seat_pointer_request_set_cursor_event
|
2017-10-05 13:11:51 +02:00
|
|
|
struct wl_signal request_set_cursor;
|
2017-10-16 11:07:09 +02:00
|
|
|
|
2020-04-15 17:04:40 +02:00
|
|
|
// Called when an application _wants_ to set the selection (user copies some data).
|
|
|
|
// Compositors should listen to this event and call wlr_seat_set_selection
|
|
|
|
// if they want to accept the client's request.
|
|
|
|
struct wl_signal request_set_selection; // wlr_seat_request_set_selection_event
|
|
|
|
// Called after the data source is set for the selection.
|
2018-11-29 19:30:04 +01:00
|
|
|
struct wl_signal set_selection;
|
2020-04-15 17:04:40 +02:00
|
|
|
|
|
|
|
// Called when an application _wants_ to set the primary selection (user selects some data).
|
|
|
|
// Compositors should listen to this event and call wlr_seat_set_primary_selection
|
|
|
|
// if they want to accept the client's request.
|
|
|
|
struct wl_signal request_set_primary_selection; // wlr_seat_request_set_primary_selection_event
|
|
|
|
// Called after the primary selection source object is set.
|
2018-11-29 19:30:04 +01:00
|
|
|
struct wl_signal set_primary_selection;
|
2017-12-29 17:55:03 +01:00
|
|
|
|
2019-01-30 18:36:19 +01:00
|
|
|
// wlr_seat_request_start_drag_event
|
|
|
|
struct wl_signal request_start_drag;
|
2018-11-29 19:30:04 +01:00
|
|
|
struct wl_signal start_drag; // wlr_drag
|
2018-01-23 13:37:58 +01:00
|
|
|
|
2017-12-29 17:55:03 +01:00
|
|
|
struct wl_signal destroy;
|
2017-08-16 14:50:43 +02:00
|
|
|
} events;
|
|
|
|
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
2017-10-05 13:11:51 +02:00
|
|
|
struct wlr_seat_pointer_request_set_cursor_event {
|
2017-10-30 13:37:54 +01:00
|
|
|
struct wlr_seat_client *seat_client;
|
2017-10-05 13:11:51 +02:00
|
|
|
struct wlr_surface *surface;
|
2017-11-01 18:15:37 +01:00
|
|
|
uint32_t serial;
|
2017-10-05 13:11:51 +02:00
|
|
|
int32_t hotspot_x, hotspot_y;
|
|
|
|
};
|
|
|
|
|
2018-11-29 19:30:04 +01:00
|
|
|
struct wlr_seat_request_set_selection_event {
|
|
|
|
struct wlr_data_source *source;
|
|
|
|
uint32_t serial;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_seat_request_set_primary_selection_event {
|
|
|
|
struct wlr_primary_selection_source *source;
|
|
|
|
uint32_t serial;
|
|
|
|
};
|
|
|
|
|
2019-01-30 18:36:19 +01:00
|
|
|
struct wlr_seat_request_start_drag_event {
|
|
|
|
struct wlr_drag *drag;
|
|
|
|
struct wlr_surface *origin;
|
|
|
|
uint32_t serial;
|
|
|
|
};
|
|
|
|
|
2018-08-04 23:22:21 +02:00
|
|
|
struct wlr_seat_pointer_focus_change_event {
|
|
|
|
struct wlr_seat *seat;
|
|
|
|
struct wlr_surface *old_surface, *new_surface;
|
|
|
|
double sx, sy;
|
|
|
|
};
|
|
|
|
|
2018-11-27 18:41:46 +01:00
|
|
|
struct wlr_seat_keyboard_focus_change_event {
|
|
|
|
struct wlr_seat *seat;
|
|
|
|
struct wlr_surface *old_surface, *new_surface;
|
|
|
|
};
|
|
|
|
|
2017-08-16 14:50:43 +02:00
|
|
|
/**
|
|
|
|
* Allocates a new wlr_seat and adds a wl_seat global to the display.
|
|
|
|
*/
|
|
|
|
struct wlr_seat *wlr_seat_create(struct wl_display *display, const char *name);
|
|
|
|
/**
|
2020-12-28 16:10:42 +01:00
|
|
|
* Destroys a wlr_seat, removes its wl_seat global and clears focus for all
|
|
|
|
* devices belonging to the seat.
|
2017-08-16 14:50:43 +02:00
|
|
|
*/
|
|
|
|
void wlr_seat_destroy(struct wlr_seat *wlr_seat);
|
|
|
|
/**
|
2017-10-30 13:37:54 +01:00
|
|
|
* Gets a wlr_seat_client for the specified client, or returns NULL if no
|
|
|
|
* client is bound for that client.
|
2017-08-16 14:50:43 +02:00
|
|
|
*/
|
2017-10-30 13:37:54 +01:00
|
|
|
struct wlr_seat_client *wlr_seat_client_for_wl_client(struct wlr_seat *wlr_seat,
|
|
|
|
struct wl_client *wl_client);
|
2017-08-16 14:50:43 +02:00
|
|
|
/**
|
|
|
|
* Updates the capabilities available on this seat.
|
2017-08-17 12:55:59 +02:00
|
|
|
* Will automatically send them to all clients.
|
2017-08-16 14:50:43 +02:00
|
|
|
*/
|
2017-09-19 21:38:06 +02:00
|
|
|
void wlr_seat_set_capabilities(struct wlr_seat *wlr_seat,
|
|
|
|
uint32_t capabilities);
|
2017-08-16 14:50:43 +02:00
|
|
|
/**
|
|
|
|
* Updates the name of this seat.
|
2017-08-17 12:55:59 +02:00
|
|
|
* Will automatically send it to all clients.
|
2017-08-16 14:50:43 +02:00
|
|
|
*/
|
|
|
|
void wlr_seat_set_name(struct wlr_seat *wlr_seat, const char *name);
|
|
|
|
|
2017-09-20 13:32:28 +02:00
|
|
|
/**
|
|
|
|
* Whether or not the surface has pointer focus
|
|
|
|
*/
|
|
|
|
bool wlr_seat_pointer_surface_has_focus(struct wlr_seat *wlr_seat,
|
|
|
|
struct wlr_surface *surface);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send a pointer enter event to the given surface and consider it to be the
|
|
|
|
* focused surface for the pointer. This will send a leave event to the last
|
|
|
|
* surface that was entered. Coordinates for the enter event are surface-local.
|
2020-05-21 05:05:24 +02:00
|
|
|
* This function does not respect pointer grabs: you probably want
|
|
|
|
* `wlr_seat_pointer_notify_enter()` instead.
|
2017-09-20 13:32:28 +02:00
|
|
|
*/
|
|
|
|
void wlr_seat_pointer_enter(struct wlr_seat *wlr_seat,
|
2017-09-21 17:38:04 +02:00
|
|
|
struct wlr_surface *surface, double sx, double sy);
|
2017-09-20 13:32:28 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Clear the focused surface for the pointer and leave all entered surfaces.
|
2020-05-21 03:04:09 +02:00
|
|
|
* This function does not respect pointer grabs: you probably want
|
|
|
|
* `wlr_seat_pointer_notify_clear_focus()` instead.
|
2017-09-20 13:32:28 +02:00
|
|
|
*/
|
|
|
|
void wlr_seat_pointer_clear_focus(struct wlr_seat *wlr_seat);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send a motion event to the surface with pointer focus. Coordinates for the
|
2020-05-21 05:05:24 +02:00
|
|
|
* motion event are surface-local. This function does not respect pointer grabs:
|
|
|
|
* you probably want `wlr_seat_pointer_notify_motion()` instead.
|
2017-09-20 13:32:28 +02:00
|
|
|
*/
|
2019-03-01 10:57:49 +01:00
|
|
|
void wlr_seat_pointer_send_motion(struct wlr_seat *wlr_seat, uint32_t time_msec,
|
2017-09-21 17:38:04 +02:00
|
|
|
double sx, double sy);
|
2017-09-20 13:32:28 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Send a button event to the surface with pointer focus. Coordinates for the
|
2020-05-21 05:05:24 +02:00
|
|
|
* button event are surface-local. Returns the serial. This function does not
|
|
|
|
* respect pointer grabs: you probably want `wlr_seat_pointer_notify_button()`
|
|
|
|
* instead.
|
2017-09-20 13:32:28 +02:00
|
|
|
*/
|
2019-03-01 10:57:49 +01:00
|
|
|
uint32_t wlr_seat_pointer_send_button(struct wlr_seat *wlr_seat,
|
|
|
|
uint32_t time_msec, uint32_t button, enum wlr_button_state state);
|
2017-09-20 13:32:28 +02:00
|
|
|
|
2017-10-05 19:28:26 +02:00
|
|
|
/**
|
2020-05-21 05:05:24 +02:00
|
|
|
* Send an axis event to the surface with pointer focus. This function does not
|
|
|
|
* respect pointer grabs: you probably want `wlr_seat_pointer_notify_axis()`
|
|
|
|
* instead.
|
|
|
|
*/
|
2019-03-01 10:57:49 +01:00
|
|
|
void wlr_seat_pointer_send_axis(struct wlr_seat *wlr_seat, uint32_t time_msec,
|
2018-05-12 14:04:47 +02:00
|
|
|
enum wlr_axis_orientation orientation, double value,
|
2018-05-12 14:51:30 +02:00
|
|
|
int32_t value_discrete, enum wlr_axis_source source);
|
2017-09-22 16:30:09 +02:00
|
|
|
|
2019-01-26 11:04:05 +01:00
|
|
|
/**
|
2020-05-21 05:05:24 +02:00
|
|
|
* Send a frame event to the surface with pointer focus. This function does not
|
|
|
|
* respect pointer grabs: you probably want `wlr_seat_pointer_notify_frame()`
|
|
|
|
* instead.
|
2019-01-26 11:04:05 +01:00
|
|
|
*/
|
|
|
|
void wlr_seat_pointer_send_frame(struct wlr_seat *wlr_seat);
|
|
|
|
|
2017-10-05 19:28:26 +02:00
|
|
|
/**
|
2017-10-30 13:37:54 +01:00
|
|
|
* Notify the seat of a pointer enter event to the given surface and request it
|
|
|
|
* to be the focused surface for the pointer. Pass surface-local coordinates
|
2020-05-21 05:05:24 +02:00
|
|
|
* where the enter occurred. This will send a leave event to the currently-
|
|
|
|
* focused surface. Defers to any grab of the pointer.
|
2017-10-05 19:28:26 +02:00
|
|
|
*/
|
|
|
|
void wlr_seat_pointer_notify_enter(struct wlr_seat *wlr_seat,
|
|
|
|
struct wlr_surface *surface, double sx, double sy);
|
|
|
|
|
2020-05-21 03:04:09 +02:00
|
|
|
/**
|
|
|
|
* Notify the seat of a pointer leave event to the currently-focused surface.
|
|
|
|
* Defers to any grab of the pointer.
|
|
|
|
*/
|
|
|
|
void wlr_seat_pointer_notify_clear_focus(struct wlr_seat *wlr_seat);
|
|
|
|
|
2020-07-03 06:52:25 +02:00
|
|
|
/**
|
|
|
|
* Warp the pointer of this seat to the given surface-local coordinates, without
|
|
|
|
* generating motion events.
|
|
|
|
*/
|
|
|
|
void wlr_seat_pointer_warp(struct wlr_seat *wlr_seat, double sx, double sy);
|
|
|
|
|
2017-10-05 19:28:26 +02:00
|
|
|
/**
|
|
|
|
* Notify the seat of motion over the given surface. Pass surface-local
|
2020-05-21 05:05:24 +02:00
|
|
|
* coordinates where the pointer motion occurred. Defers to any grab of the
|
|
|
|
* pointer.
|
2017-10-05 19:28:26 +02:00
|
|
|
*/
|
2019-03-01 10:57:49 +01:00
|
|
|
void wlr_seat_pointer_notify_motion(struct wlr_seat *wlr_seat,
|
|
|
|
uint32_t time_msec, double sx, double sy);
|
2017-10-05 19:28:26 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify the seat that a button has been pressed. Returns the serial of the
|
2020-05-21 05:05:24 +02:00
|
|
|
* button press or zero if no button press was sent. Defers to any grab of the
|
|
|
|
* pointer.
|
2017-10-05 19:28:26 +02:00
|
|
|
*/
|
|
|
|
uint32_t wlr_seat_pointer_notify_button(struct wlr_seat *wlr_seat,
|
2019-03-01 10:57:49 +01:00
|
|
|
uint32_t time_msec, uint32_t button, enum wlr_button_state state);
|
2017-10-05 19:28:26 +02:00
|
|
|
|
|
|
|
/**
|
2020-05-21 05:05:24 +02:00
|
|
|
* Notify the seat of an axis event. Defers to any grab of the pointer.
|
2017-10-05 19:28:26 +02:00
|
|
|
*/
|
2019-03-01 10:57:49 +01:00
|
|
|
void wlr_seat_pointer_notify_axis(struct wlr_seat *wlr_seat, uint32_t time_msec,
|
2018-05-12 14:04:47 +02:00
|
|
|
enum wlr_axis_orientation orientation, double value,
|
2018-05-12 14:51:30 +02:00
|
|
|
int32_t value_discrete, enum wlr_axis_source source);
|
2017-10-05 19:28:26 +02:00
|
|
|
|
2019-01-26 11:04:05 +01:00
|
|
|
/**
|
|
|
|
* Notify the seat of a frame event. Frame events are sent to end a group of
|
|
|
|
* events that logically belong together. Motion, button and axis events should
|
2020-05-21 05:05:24 +02:00
|
|
|
* all be followed by a frame event. Defers to any grab of the pointer.
|
2019-01-26 11:04:05 +01:00
|
|
|
*/
|
|
|
|
void wlr_seat_pointer_notify_frame(struct wlr_seat *wlr_seat);
|
|
|
|
|
2017-11-15 12:43:30 +01:00
|
|
|
/**
|
2020-05-21 05:00:13 +02:00
|
|
|
* Start a grab of the pointer of this seat. The grabber is responsible for
|
|
|
|
* handling all pointer events until the grab ends.
|
2017-11-15 12:43:30 +01:00
|
|
|
*/
|
2020-05-21 05:00:13 +02:00
|
|
|
void wlr_seat_pointer_start_grab(struct wlr_seat *wlr_seat,
|
|
|
|
struct wlr_seat_pointer_grab *grab);
|
2017-11-15 12:43:30 +01:00
|
|
|
|
2017-09-24 20:12:56 +02:00
|
|
|
/**
|
2020-05-21 05:00:13 +02:00
|
|
|
* End the grab of the pointer of this seat. This reverts the grab back to the
|
|
|
|
* default grab for the pointer.
|
2017-09-24 20:12:56 +02:00
|
|
|
*/
|
2020-05-21 05:00:13 +02:00
|
|
|
void wlr_seat_pointer_end_grab(struct wlr_seat *wlr_seat);
|
2017-09-24 20:12:56 +02:00
|
|
|
|
2018-01-05 13:00:50 +01:00
|
|
|
/**
|
2020-05-21 05:00:13 +02:00
|
|
|
* Whether or not the pointer has a grab other than the default grab.
|
2018-01-05 13:00:50 +01:00
|
|
|
*/
|
2020-05-21 05:00:13 +02:00
|
|
|
bool wlr_seat_pointer_has_grab(struct wlr_seat *seat);
|
2018-01-05 13:00:50 +01:00
|
|
|
|
2017-10-07 17:02:11 +02:00
|
|
|
/**
|
2020-05-21 05:00:13 +02:00
|
|
|
* Set this keyboard as the active keyboard for the seat.
|
2017-10-07 17:02:11 +02:00
|
|
|
*/
|
2022-03-22 00:37:17 +01:00
|
|
|
void wlr_seat_set_keyboard(struct wlr_seat *seat, struct wlr_keyboard *keyboard);
|
2017-10-07 17:02:11 +02:00
|
|
|
|
|
|
|
/**
|
2020-05-21 05:00:13 +02:00
|
|
|
* Get the active keyboard for the seat.
|
2017-10-07 17:02:11 +02:00
|
|
|
*/
|
2020-05-21 05:00:13 +02:00
|
|
|
struct wlr_keyboard *wlr_seat_get_keyboard(struct wlr_seat *seat);
|
2017-10-07 17:02:11 +02:00
|
|
|
|
|
|
|
/**
|
2020-05-21 05:05:24 +02:00
|
|
|
* Send the keyboard key to focused keyboard resources. This function does not
|
|
|
|
* respect keyboard grabs: you probably want `wlr_seat_keyboard_notify_key()`
|
|
|
|
* instead.
|
2017-10-07 17:02:11 +02:00
|
|
|
*/
|
2019-03-01 10:57:49 +01:00
|
|
|
void wlr_seat_keyboard_send_key(struct wlr_seat *seat, uint32_t time_msec,
|
2017-10-07 17:02:11 +02:00
|
|
|
uint32_t key, uint32_t state);
|
|
|
|
|
|
|
|
/**
|
2020-05-21 05:05:24 +02:00
|
|
|
* Send the modifier state to focused keyboard resources. This function does
|
|
|
|
* not respect keyboard grabs: you probably want
|
|
|
|
* `wlr_seat_keyboard_notify_modifiers()` instead.
|
2017-10-07 17:02:11 +02:00
|
|
|
*/
|
2018-01-05 13:00:50 +01:00
|
|
|
void wlr_seat_keyboard_send_modifiers(struct wlr_seat *seat,
|
|
|
|
struct wlr_keyboard_modifiers *modifiers);
|
2017-10-23 14:59:55 +02:00
|
|
|
|
2017-09-22 22:07:00 +02:00
|
|
|
/**
|
2017-09-25 14:29:35 +02:00
|
|
|
* Send a keyboard enter event to the given surface and consider it to be the
|
|
|
|
* focused surface for the keyboard. This will send a leave event to the last
|
2020-05-21 05:05:24 +02:00
|
|
|
* surface that was entered. This function does not respect keyboard grabs: you
|
|
|
|
* probably want `wlr_seat_keyboard_notify_enter()` instead.
|
2017-09-22 22:07:00 +02:00
|
|
|
*/
|
2018-01-06 17:06:09 +01:00
|
|
|
void wlr_seat_keyboard_enter(struct wlr_seat *seat,
|
|
|
|
struct wlr_surface *surface, uint32_t keycodes[], size_t num_keycodes,
|
|
|
|
struct wlr_keyboard_modifiers *modifiers);
|
2017-09-22 22:07:00 +02:00
|
|
|
|
2017-09-22 23:09:47 +02:00
|
|
|
/**
|
2017-09-25 14:29:35 +02:00
|
|
|
* Clear the focused surface for the keyboard and leave all entered surfaces.
|
2020-05-21 03:04:09 +02:00
|
|
|
* This function does not respect keyboard grabs: you probably want
|
|
|
|
* `wlr_seat_keyboard_notify_clear_focus()` instead.
|
2017-09-22 23:09:47 +02:00
|
|
|
*/
|
2017-09-25 14:29:35 +02:00
|
|
|
void wlr_seat_keyboard_clear_focus(struct wlr_seat *wlr_seat);
|
2017-09-22 23:09:47 +02:00
|
|
|
|
2017-11-15 12:43:30 +01:00
|
|
|
/**
|
2020-05-21 05:00:13 +02:00
|
|
|
* Notify the seat that a key has been pressed on the keyboard. Defers to any
|
|
|
|
* keyboard grabs.
|
2017-11-15 12:43:30 +01:00
|
|
|
*/
|
2020-05-21 05:00:13 +02:00
|
|
|
void wlr_seat_keyboard_notify_key(struct wlr_seat *seat, uint32_t time_msec,
|
|
|
|
uint32_t key, uint32_t state);
|
2017-11-15 12:43:30 +01:00
|
|
|
|
2017-11-12 23:34:32 +01:00
|
|
|
/**
|
2020-05-21 05:00:13 +02:00
|
|
|
* Notify the seat that the modifiers for the keyboard have changed. Defers to
|
|
|
|
* any keyboard grabs.
|
2017-11-12 23:34:32 +01:00
|
|
|
*/
|
2020-05-21 05:00:13 +02:00
|
|
|
void wlr_seat_keyboard_notify_modifiers(struct wlr_seat *seat,
|
|
|
|
struct wlr_keyboard_modifiers *modifiers);
|
2017-11-12 23:34:32 +01:00
|
|
|
|
|
|
|
/**
|
2020-05-21 05:00:13 +02:00
|
|
|
* Notify the seat that the keyboard focus has changed and request it to be the
|
|
|
|
* focused surface for this keyboard. Defers to any current grab of the seat's
|
|
|
|
* keyboard.
|
2017-11-12 23:34:32 +01:00
|
|
|
*/
|
2020-05-21 05:00:13 +02:00
|
|
|
void wlr_seat_keyboard_notify_enter(struct wlr_seat *seat,
|
|
|
|
struct wlr_surface *surface, uint32_t keycodes[], size_t num_keycodes,
|
|
|
|
struct wlr_keyboard_modifiers *modifiers);
|
2017-11-12 23:34:32 +01:00
|
|
|
|
2020-05-21 03:04:09 +02:00
|
|
|
/**
|
|
|
|
* Notify the seat of a keyboard leave event to the currently-focused surface.
|
|
|
|
* Defers to any keyboard grabs.
|
|
|
|
*/
|
|
|
|
void wlr_seat_keyboard_notify_clear_focus(struct wlr_seat *wlr_seat);
|
|
|
|
|
2017-11-12 23:25:10 +01:00
|
|
|
/**
|
2020-05-21 05:00:13 +02:00
|
|
|
* Start a grab of the keyboard of this seat. The grabber is responsible for
|
|
|
|
* handling all keyboard events until the grab ends.
|
2017-11-12 23:25:10 +01:00
|
|
|
*/
|
2020-05-21 05:00:13 +02:00
|
|
|
void wlr_seat_keyboard_start_grab(struct wlr_seat *wlr_seat,
|
|
|
|
struct wlr_seat_keyboard_grab *grab);
|
2017-11-12 17:43:50 +01:00
|
|
|
|
2017-11-12 23:25:10 +01:00
|
|
|
/**
|
2020-05-21 05:00:13 +02:00
|
|
|
* End the grab of the keyboard of this seat. This reverts the grab back to the
|
|
|
|
* default grab for the keyboard.
|
2017-11-12 23:25:10 +01:00
|
|
|
*/
|
2020-05-21 05:00:13 +02:00
|
|
|
void wlr_seat_keyboard_end_grab(struct wlr_seat *wlr_seat);
|
2017-11-12 17:43:50 +01:00
|
|
|
|
2017-11-12 23:25:10 +01:00
|
|
|
/**
|
2020-05-21 05:00:13 +02:00
|
|
|
* Whether or not the keyboard has a grab other than the default grab
|
2017-11-12 23:25:10 +01:00
|
|
|
*/
|
2020-05-21 05:00:13 +02:00
|
|
|
bool wlr_seat_keyboard_has_grab(struct wlr_seat *seat);
|
2017-11-12 17:43:50 +01:00
|
|
|
|
2017-11-12 23:25:10 +01:00
|
|
|
/**
|
2020-05-21 05:00:13 +02:00
|
|
|
* Get the active touch point with the given `touch_id`. If the touch point does
|
|
|
|
* not exist or is no longer active, returns NULL.
|
2017-11-12 23:25:10 +01:00
|
|
|
*/
|
2020-05-21 05:00:13 +02:00
|
|
|
struct wlr_touch_point *wlr_seat_touch_get_point(struct wlr_seat *seat,
|
|
|
|
int32_t touch_id);
|
2017-11-14 14:51:37 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify the seat that the touch point given by `touch_id` has entered a new
|
|
|
|
* surface. The surface is required. To clear focus, use
|
|
|
|
* `wlr_seat_touch_point_clear_focus()`.
|
|
|
|
*/
|
|
|
|
void wlr_seat_touch_point_focus(struct wlr_seat *seat,
|
2019-03-01 10:57:49 +01:00
|
|
|
struct wlr_surface *surface, uint32_t time_msec,
|
|
|
|
int32_t touch_id, double sx, double sy);
|
2017-11-12 17:43:50 +01:00
|
|
|
|
2017-11-14 14:51:37 +01:00
|
|
|
/**
|
|
|
|
* Clear the focused surface for the touch point given by `touch_id`.
|
|
|
|
*/
|
2019-03-01 10:57:49 +01:00
|
|
|
void wlr_seat_touch_point_clear_focus(struct wlr_seat *seat, uint32_t time_msec,
|
2017-11-14 14:51:37 +01:00
|
|
|
int32_t touch_id);
|
|
|
|
|
2017-11-12 23:25:10 +01:00
|
|
|
/**
|
|
|
|
* Send a touch down event to the client of the given surface. All future touch
|
|
|
|
* events for this point will go to this surface. If the touch down is valid,
|
|
|
|
* this will add a new touch point with the given `touch_id`. The touch down may
|
|
|
|
* not be valid if the surface seat client does not accept touch input.
|
2020-05-21 05:05:24 +02:00
|
|
|
* Coordinates are surface-local. This function does not respect touch grabs:
|
|
|
|
* you probably want `wlr_seat_touch_notify_down()` instead.
|
2017-11-12 23:25:10 +01:00
|
|
|
*/
|
2017-11-16 23:34:38 +01:00
|
|
|
uint32_t wlr_seat_touch_send_down(struct wlr_seat *seat,
|
2019-03-01 10:57:49 +01:00
|
|
|
struct wlr_surface *surface, uint32_t time_msec,
|
|
|
|
int32_t touch_id, double sx, double sy);
|
2017-11-12 23:04:56 +01:00
|
|
|
|
2017-11-12 23:25:10 +01:00
|
|
|
/**
|
|
|
|
* Send a touch up event for the touch point given by the `touch_id`. The event
|
2019-11-23 13:04:06 +01:00
|
|
|
* will go to the client for the surface given in the corresponding touch down
|
2020-05-21 05:05:24 +02:00
|
|
|
* event. This will remove the touch point. This function does not respect touch
|
|
|
|
* grabs: you probably want `wlr_seat_touch_notify_up()` instead.
|
2017-11-12 23:25:10 +01:00
|
|
|
*/
|
2019-03-01 10:57:49 +01:00
|
|
|
void wlr_seat_touch_send_up(struct wlr_seat *seat, uint32_t time_msec,
|
2017-11-12 23:04:56 +01:00
|
|
|
int32_t touch_id);
|
|
|
|
|
2017-11-12 23:25:10 +01:00
|
|
|
/**
|
|
|
|
* Send a touch motion event for the touch point given by the `touch_id`. The
|
2017-11-14 01:16:34 +01:00
|
|
|
* event will go to the client for the surface given in the corresponding touch
|
2020-05-21 05:05:24 +02:00
|
|
|
* down event. This function does not respect touch grabs: you probably want
|
|
|
|
* `wlr_seat_touch_notify_motion()` instead.
|
2017-11-12 23:25:10 +01:00
|
|
|
*/
|
2019-03-01 10:57:49 +01:00
|
|
|
void wlr_seat_touch_send_motion(struct wlr_seat *seat, uint32_t time_msec,
|
2017-11-12 23:04:56 +01:00
|
|
|
int32_t touch_id, double sx, double sy);
|
|
|
|
|
2021-06-30 13:09:45 +02:00
|
|
|
void wlr_seat_touch_send_frame(struct wlr_seat *seat);
|
|
|
|
|
2020-05-21 05:00:13 +02:00
|
|
|
/**
|
|
|
|
* Notify the seat of a touch down on the given surface. Defers to any grab of
|
|
|
|
* the touch device.
|
|
|
|
*/
|
|
|
|
uint32_t wlr_seat_touch_notify_down(struct wlr_seat *seat,
|
|
|
|
struct wlr_surface *surface, uint32_t time_msec,
|
|
|
|
int32_t touch_id, double sx, double sy);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify the seat that the touch point given by `touch_id` is up. Defers to any
|
|
|
|
* grab of the touch device.
|
|
|
|
*/
|
|
|
|
void wlr_seat_touch_notify_up(struct wlr_seat *seat, uint32_t time_msec,
|
|
|
|
int32_t touch_id);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify the seat that the touch point given by `touch_id` has moved. Defers to
|
|
|
|
* any grab of the touch device. The seat should be notified of touch motion
|
|
|
|
* even if the surface is not the owner of the touch point for processing by
|
|
|
|
* grabs.
|
|
|
|
*/
|
|
|
|
void wlr_seat_touch_notify_motion(struct wlr_seat *seat, uint32_t time_msec,
|
|
|
|
int32_t touch_id, double sx, double sy);
|
|
|
|
|
2021-06-30 13:09:45 +02:00
|
|
|
void wlr_seat_touch_notify_frame(struct wlr_seat *seat);
|
|
|
|
|
2017-11-15 14:34:35 +01:00
|
|
|
/**
|
|
|
|
* How many touch points are currently down for the seat.
|
|
|
|
*/
|
|
|
|
int wlr_seat_touch_num_points(struct wlr_seat *seat);
|
|
|
|
|
2020-05-21 05:00:13 +02:00
|
|
|
/**
|
|
|
|
* Start a grab of the touch device of this seat. The grabber is responsible for
|
|
|
|
* handling all touch events until the grab ends.
|
|
|
|
*/
|
|
|
|
void wlr_seat_touch_start_grab(struct wlr_seat *wlr_seat,
|
|
|
|
struct wlr_seat_touch_grab *grab);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* End the grab of the touch device of this seat. This reverts the grab back to
|
|
|
|
* the default grab for the touch device.
|
|
|
|
*/
|
|
|
|
void wlr_seat_touch_end_grab(struct wlr_seat *wlr_seat);
|
|
|
|
|
2017-11-15 12:43:30 +01:00
|
|
|
/**
|
|
|
|
* Whether or not the seat has a touch grab other than the default grab.
|
|
|
|
*/
|
|
|
|
bool wlr_seat_touch_has_grab(struct wlr_seat *seat);
|
|
|
|
|
2017-12-27 14:04:01 +01:00
|
|
|
/**
|
|
|
|
* Check whether this serial is valid to start a grab action such as an
|
|
|
|
* interactive move or resize.
|
|
|
|
*/
|
|
|
|
bool wlr_seat_validate_grab_serial(struct wlr_seat *seat, uint32_t serial);
|
|
|
|
|
2019-01-30 18:36:19 +01:00
|
|
|
/**
|
|
|
|
* Check whether this serial is valid to start a pointer grab action.
|
|
|
|
*/
|
|
|
|
bool wlr_seat_validate_pointer_grab_serial(struct wlr_seat *seat,
|
|
|
|
struct wlr_surface *origin, uint32_t serial);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Check whether this serial is valid to start a touch grab action. If it's the
|
|
|
|
* case and point_ptr is non-NULL, *point_ptr is set to the touch point matching
|
|
|
|
* the serial.
|
|
|
|
*/
|
|
|
|
bool wlr_seat_validate_touch_grab_serial(struct wlr_seat *seat,
|
|
|
|
struct wlr_surface *origin, uint32_t serial,
|
|
|
|
struct wlr_touch_point **point_ptr);
|
|
|
|
|
2019-06-27 21:43:58 +02:00
|
|
|
/**
|
|
|
|
* Return a new serial (from wl_display_serial_next()) for the client, and
|
|
|
|
* update the seat client's set of valid serials. Use this for all input
|
2019-06-29 15:15:23 +02:00
|
|
|
* events; otherwise wlr_seat_client_validate_event_serial() may fail when
|
|
|
|
* handed a correctly functioning client's request serials.
|
2019-06-27 21:43:58 +02:00
|
|
|
*/
|
|
|
|
uint32_t wlr_seat_client_next_serial(struct wlr_seat_client *client);
|
|
|
|
|
2019-06-29 15:15:23 +02:00
|
|
|
/**
|
|
|
|
* Return true if the serial number could have been produced by
|
|
|
|
* wlr_seat_client_next_serial() and is "older" (by less than UINT32_MAX/2) than
|
|
|
|
* the current display serial value.
|
|
|
|
*
|
|
|
|
* This function should have no false negatives, and the only false positive
|
|
|
|
* responses allowed are for elements that are still "older" than the current
|
|
|
|
* display serial value and also older than all serial values remaining in
|
|
|
|
* the seat client's serial ring buffer, if that buffer is also full.
|
|
|
|
*/
|
|
|
|
bool wlr_seat_client_validate_event_serial(struct wlr_seat_client *client,
|
|
|
|
uint32_t serial);
|
|
|
|
|
2019-01-30 18:36:19 +01:00
|
|
|
/**
|
|
|
|
* Get a seat client from a seat resource. Returns NULL if inert.
|
|
|
|
*/
|
2018-04-03 18:50:05 +02:00
|
|
|
struct wlr_seat_client *wlr_seat_client_from_resource(
|
2018-08-08 12:39:33 +02:00
|
|
|
struct wl_resource *resource);
|
|
|
|
|
2019-01-30 18:36:19 +01:00
|
|
|
/**
|
|
|
|
* Get a seat client from a pointer resource. Returns NULL if inert.
|
|
|
|
*/
|
2018-08-08 12:39:33 +02:00
|
|
|
struct wlr_seat_client *wlr_seat_client_from_pointer_resource(
|
|
|
|
struct wl_resource *resource);
|
2018-02-13 23:48:46 +01:00
|
|
|
|
2020-05-02 15:09:36 +02:00
|
|
|
/**
|
|
|
|
* Check whether a surface has bound to touch events.
|
|
|
|
*/
|
|
|
|
bool wlr_surface_accepts_touch(struct wlr_seat *wlr_seat, struct wlr_surface *surface);
|
|
|
|
|
2017-08-16 14:50:43 +02:00
|
|
|
#endif
|