xcursor-configuration: initial protocol implementation

This commit is contained in:
emersion 2018-10-21 19:18:24 +02:00
parent be6210cf82
commit 57e8d2b125
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
10 changed files with 435 additions and 4 deletions

View file

@ -21,6 +21,7 @@
#include <wlr/types/wlr_text_input_v3.h>
#include <wlr/types/wlr_virtual_keyboard_v1.h>
#include <wlr/types/wlr_wl_shell.h>
#include <wlr/types/wlr_xcursor_configuration_v1.h>
#include <wlr/types/wlr_xcursor_manager.h>
#include <wlr/types/wlr_xdg_decoration_v1.h>
#include <wlr/types/wlr_xdg_shell_v6.h>
@ -63,6 +64,7 @@ struct roots_desktop {
struct wlr_tablet_manager_v2 *tablet_v2;
struct wlr_pointer_constraints_v1 *pointer_constraints;
struct wlr_presentation *presentation;
struct wlr_xcursor_configuration_manager_v1 *xcursor_configuration_manager;
struct wl_listener new_output;
struct wl_listener layout_change;

View file

@ -36,6 +36,7 @@ install_headers(
'wlr_touch.h',
'wlr_virtual_keyboard_v1.h',
'wlr_wl_shell.h',
'wlr_xcursor_configuration_v1.h',
'wlr_xcursor_manager.h',
'wlr_xdg_decoration_v1.h',
'wlr_xdg_output_v1.h',

View file

@ -0,0 +1,60 @@
/*
* 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_XCURSOR_CONFIGURATION_V1_H
#define WLR_TYPES_WLR_XCURSOR_CONFIGURATION_V1_H
#include <wayland-server.h>
#include <xcursor-configuration-unstable-v1-protocol.h>
struct wlr_xcursor_configuration_v1_attrs {
struct {
char *name;
uint32_t size;
} theme;
char *default_cursor;
};
struct wlr_xcursor_configuration_v1 {
struct wl_list resources; // wl_resource_get_link
struct wlr_seat *seat;
enum zwp_xcursor_configuration_manager_v1_device_type device_type;
struct wl_list link;
struct wlr_xcursor_configuration_v1_attrs attrs;
struct wl_listener seat_destroy;
void *data;
};
struct wlr_xcursor_configuration_manager_v1 {
struct wl_global *global;
struct wl_list resources; // wl_resource_get_link
struct wl_list configurations; // wlr_xcursor_configuration_v1::link
struct {
struct wl_signal destroy;
} events;
struct wl_listener display_destroy;
void *data;
};
struct wlr_xcursor_configuration_manager_v1 *
wlr_xcursor_configuration_manager_v1_create(struct wl_display *display);
void wlr_xcursor_configuration_manager_v1_destroy(
struct wlr_xcursor_configuration_manager_v1 *manager);
void wlr_xcursor_configuration_manager_v1_configure(
struct wlr_xcursor_configuration_manager_v1 *manager, struct wlr_seat *seat,
enum zwp_xcursor_configuration_manager_v1_device_type device_type,
const struct wlr_xcursor_configuration_v1_attrs *attrs);
#endif