rootston: add roots_xcursor_theme

roots_xcursor_theme loads multiple wlr_xcursor_theme at different scales.
This commit is contained in:
emersion 2017-11-11 18:42:14 +01:00
parent ac1573b0e7
commit aaf0691883
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
8 changed files with 170 additions and 77 deletions

View file

@ -30,7 +30,6 @@ struct roots_cursor {
enum roots_cursor_mode mode;
// state from input (review if this is necessary)
struct wlr_xcursor_theme *xcursor_theme;
struct wlr_seat *wl_seat;
struct wl_client *cursor_client;
int offs_x, offs_y;

View file

@ -12,6 +12,7 @@
#include <wlr/types/wlr_list.h>
#include "rootston/view.h"
#include "rootston/config.h"
#include "rootston/xcursor.h"
struct roots_output {
struct roots_desktop *desktop;
@ -29,6 +30,7 @@ struct roots_desktop {
struct roots_server *server;
struct roots_config *config;
struct roots_xcursor_theme *xcursor_theme;
struct wlr_output_layout *layout;

View file

@ -1,15 +1,44 @@
#ifndef _ROOTSTON_XCURSOR_H
#define _ROOTSTON_XCURSOR_H
#include <wayland-server.h>
#include <wlr/xcursor.h>
#include <wlr/xwayland.h>
#include <wlr/types/wlr_cursor.h>
struct wlr_xcursor *get_default_xcursor(struct wlr_xcursor_theme *theme);
#define ROOTS_XCURSOR_SIZE 16
struct wlr_xcursor *get_move_xcursor(struct wlr_xcursor_theme *theme);
struct roots_xcursor_scaled_theme {
uint32_t scale;
struct wlr_xcursor_theme *theme;
struct wl_list link;
};
struct wlr_xcursor *get_resize_xcursor(struct wlr_xcursor_theme *theme,
uint32_t edges);
struct roots_xcursor_theme {
char *name;
struct wl_list scaled_themes; // roots_xcursor_scaled_theme::link
};
struct wlr_xcursor *get_rotate_xcursor(struct wlr_xcursor_theme *theme);
struct roots_xcursor_theme *roots_xcursor_theme_create(const char *name);
void roots_xcursor_theme_destroy(struct roots_xcursor_theme *theme);
int roots_xcursor_theme_load(struct roots_xcursor_theme *theme,
uint32_t scale);
void roots_xcursor_theme_set_default(struct roots_xcursor_theme *theme,
struct wlr_cursor *cursor);
void roots_xcursor_theme_set_move(struct roots_xcursor_theme *theme,
struct wlr_cursor *cursor);
void roots_xcursor_theme_set_resize(struct roots_xcursor_theme *theme,
struct wlr_cursor *cursor, uint32_t edges);
void roots_xcursor_theme_set_rotate(struct roots_xcursor_theme *theme,
struct wlr_cursor *cursor);
void roots_xcursor_theme_xwayland_set_default(struct roots_xcursor_theme *theme,
struct wlr_xwayland *xwayland);
#endif