diff options
author | Simon Ser <contact@emersion.fr> | 2023-05-05 16:33:56 +0200 |
---|---|---|
committer | Alexander Orzechowski <alex@ozal.ski> | 2023-07-24 01:00:19 +0000 |
commit | 04e4e06986d1aad35d3ab097f3f473b799a576e2 (patch) | |
tree | 7120c130ac6f06c1e45776cd3ad056d0b9c9bfa5 /include | |
parent | fd540f6d07169b78ab554ccbd83e77f88f8f26a6 (diff) |
cursor-shape-v1: new protocol implementation
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/194
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_cursor_shape_v1.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_cursor_shape_v1.h b/include/wlr/types/wlr_cursor_shape_v1.h new file mode 100644 index 00000000..2fef1e04 --- /dev/null +++ b/include/wlr/types/wlr_cursor_shape_v1.h @@ -0,0 +1,58 @@ +/* + * 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 + +#ifndef WLR_TYPES_WLR_CURSOR_SHAPE_V1_H +#define WLR_TYPES_WLR_CURSOR_SHAPE_V1_H + +#include <wayland-server-core.h> +#include "cursor-shape-v1-protocol.h" + +/** + * Manager for the cursor-shape-v1 protocol. + * + * Compositors should listen to the request_set_shape event and handle it in + * the same way as wlr_seat.events.request_set_cursor. + */ +struct wlr_cursor_shape_manager_v1 { + struct wl_global *global; + + struct { + struct wl_signal request_set_shape; // struct wlr_cursor_shape_manager_v1_request_set_shape_event + struct wl_signal destroy; + } events; + + void *data; + + // private state + + struct wl_listener display_destroy; +}; + +enum wlr_cursor_shape_manager_v1_device_type { + WLR_CURSOR_SHAPE_MANAGER_V1_DEVICE_TYPE_POINTER, + WLR_CURSOR_SHAPE_MANAGER_V1_DEVICE_TYPE_TABLET_TOOL, +}; + +struct wlr_cursor_shape_manager_v1_request_set_shape_event { + struct wlr_seat_client *seat_client; + enum wlr_cursor_shape_manager_v1_device_type device_type; + uint32_t serial; + enum wp_cursor_shape_device_v1_shape shape; +}; + +struct wlr_cursor_shape_manager_v1 *wlr_cursor_shape_manager_v1_create( + struct wl_display *display, uint32_t version); + +/** + * Get the name of a cursor shape. + * + * The name can be used to load a cursor from an XCursor theme. + */ +const char *wlr_cursor_shape_v1_name(enum wp_cursor_shape_device_v1_shape shape); + +#endif |