Merge branch 'master' into display-destroy

This commit is contained in:
emersion 2017-12-11 16:14:03 +01:00
commit c67a5824b8
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
25 changed files with 326 additions and 116 deletions

View file

@ -42,6 +42,7 @@ struct roots_keyboard_config {
char *layout;
char *variant;
char *options;
int repeat_rate, repeat_delay;
struct wl_list link;
};
@ -50,6 +51,7 @@ struct roots_cursor_config {
char *mapped_output;
struct wlr_box *mapped_box;
char *theme;
char *default_image;
struct wl_list link;
};

View file

@ -10,13 +10,6 @@ enum roots_cursor_mode {
ROOTS_CURSOR_ROTATE = 3,
};
enum roots_cursor_resize_edge {
ROOTS_CURSOR_RESIZE_EDGE_TOP = 1,
ROOTS_CURSOR_RESIZE_EDGE_BOTTOM = 2,
ROOTS_CURSOR_RESIZE_EDGE_LEFT = 4,
ROOTS_CURSOR_RESIZE_EDGE_RIGHT = 8,
};
struct roots_input_event {
uint32_t serial;
struct wlr_cursor *cursor;
@ -27,6 +20,8 @@ struct roots_cursor {
struct roots_seat *seat;
struct wlr_cursor *cursor;
const char *default_xcursor;
enum roots_cursor_mode mode;
// state from input (review if this is necessary)

View file

@ -3,12 +3,10 @@
#include <stdint.h>
#define ROOTS_XCURSOR_SIZE 16
#define ROOTS_XCURSOR_SIZE 24
#define ROOTS_XCURSOR_DEFAULT "left_ptr"
#define ROOTS_XCURSOR_MOVE "grabbing"
#define ROOTS_XCURSOR_ROTATE "grabbing"
const char *roots_xcursor_get_resize_name(uint32_t edges);
#endif

View file

@ -9,6 +9,8 @@
struct wlr_output_impl {
void (*enable)(struct wlr_output *output, bool enable);
bool (*set_mode)(struct wlr_output *output, struct wlr_output_mode *mode);
bool (*set_custom_mode)(struct wlr_output *output, int32_t width,
int32_t height, int32_t refresh);
void (*transform)(struct wlr_output *output,
enum wl_output_transform transform);
bool (*set_cursor)(struct wlr_output *output, const uint8_t *buf,

View file

@ -51,10 +51,16 @@ struct wlr_keyboard {
xkb_mod_mask_t group;
} modifiers;
struct {
int32_t rate;
int32_t delay;
} repeat_info;
struct {
struct wl_signal key;
struct wl_signal modifiers;
struct wl_signal keymap;
struct wl_signal repeat_info;
} events;
void *data;
@ -74,6 +80,12 @@ struct wlr_event_keyboard_key {
void wlr_keyboard_set_keymap(struct wlr_keyboard *kb,
struct xkb_keymap *keymap);
/**
* Sets the keyboard repeat info. `rate` is in key repeats/second and delay is
* in milliseconds.
*/
void wlr_keyboard_set_repeat_info(struct wlr_keyboard *kb, int32_t rate,
int32_t delay);
void wlr_keyboard_led_update(struct wlr_keyboard *keyboard, uint32_t leds);
uint32_t wlr_keyboard_get_modifiers(struct wlr_keyboard *keyboard);

View file

@ -16,6 +16,7 @@ struct wlr_output_cursor {
struct wlr_output *output;
double x, y;
bool enabled;
bool visible;
uint32_t width, height;
int32_t hotspot_x, hotspot_y;
struct wl_list link;
@ -84,6 +85,8 @@ struct wlr_surface;
void wlr_output_enable(struct wlr_output *output, bool enable);
bool wlr_output_set_mode(struct wlr_output *output,
struct wlr_output_mode *mode);
bool wlr_output_set_custom_mode(struct wlr_output *output, int32_t width,
int32_t height, int32_t refresh);
void wlr_output_transform(struct wlr_output *output,
enum wl_output_transform transform);
void wlr_output_set_position(struct wlr_output *output, int32_t lx, int32_t ly);
@ -100,6 +103,9 @@ void wlr_output_set_fullscreen_surface(struct wlr_output *output,
struct wlr_surface *surface);
struct wlr_output_cursor *wlr_output_cursor_create(struct wlr_output *output);
/**
* Sets the cursor image. The image must be already scaled for the output.
*/
bool wlr_output_cursor_set_image(struct wlr_output_cursor *cursor,
const uint8_t *pixels, int32_t stride, uint32_t width, uint32_t height,
int32_t hotspot_x, int32_t hotspot_y);

View file

@ -146,6 +146,7 @@ struct wlr_seat_keyboard_state {
struct wl_listener keyboard_destroy;
struct wl_listener keyboard_keymap;
struct wl_listener keyboard_repeat_info;
struct wl_listener surface_destroy;
struct wl_listener resource_destroy;

12
include/wlr/util/edges.h Normal file
View file

@ -0,0 +1,12 @@
#ifndef WLR_UTIL_EDGES_H
#define WLR_UTIL_EDGES_H
enum wlr_edges {
WLR_EDGE_NONE = 0,
WLR_EDGE_TOP = 1,
WLR_EDGE_BOTTOM = 2,
WLR_EDGE_LEFT = 4,
WLR_EDGE_RIGHT = 8,
};
#endif

View file

@ -32,6 +32,7 @@
#define WLR_XCURSOR_H
#include <stdint.h>
#include <wlr/util/edges.h>
struct wlr_xcursor_image {
uint32_t width; /* actual width */
@ -65,4 +66,9 @@ struct wlr_xcursor *wlr_xcursor_theme_get_cursor(
int wlr_xcursor_frame(struct wlr_xcursor *cursor, uint32_t time);
/**
* Get the name of the resize cursor image for the given edges.
*/
const char *wlr_xcursor_get_resize_name(enum wlr_edges edges);
#endif