mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
cursor-shape-v1: new protocol implementation
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/194
This commit is contained in:
parent
fd540f6d07
commit
04e4e06986
4 changed files with 291 additions and 1 deletions
58
include/wlr/types/wlr_cursor_shape_v1.h
Normal file
58
include/wlr/types/wlr_cursor_shape_v1.h
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue