diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/rootston/config.h | 2 | ||||
-rw-r--r-- | include/rootston/cursor.h | 9 | ||||
-rw-r--r-- | include/rootston/xcursor.h | 4 | ||||
-rw-r--r-- | include/wlr/interfaces/wlr_output.h | 2 | ||||
-rw-r--r-- | include/wlr/types/wlr_keyboard.h | 12 | ||||
-rw-r--r-- | include/wlr/types/wlr_output.h | 6 | ||||
-rw-r--r-- | include/wlr/types/wlr_seat.h | 1 | ||||
-rw-r--r-- | include/wlr/util/edges.h | 12 | ||||
-rw-r--r-- | include/wlr/xcursor.h | 6 |
9 files changed, 44 insertions, 10 deletions
diff --git a/include/rootston/config.h b/include/rootston/config.h index de20fb8e..1d54314e 100644 --- a/include/rootston/config.h +++ b/include/rootston/config.h @@ -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; }; diff --git a/include/rootston/cursor.h b/include/rootston/cursor.h index e2a371bf..de6b7b92 100644 --- a/include/rootston/cursor.h +++ b/include/rootston/cursor.h @@ -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) diff --git a/include/rootston/xcursor.h b/include/rootston/xcursor.h index bc00f79c..a7d2b960 100644 --- a/include/rootston/xcursor.h +++ b/include/rootston/xcursor.h @@ -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 diff --git a/include/wlr/interfaces/wlr_output.h b/include/wlr/interfaces/wlr_output.h index b4f39d35..dc2a867b 100644 --- a/include/wlr/interfaces/wlr_output.h +++ b/include/wlr/interfaces/wlr_output.h @@ -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, diff --git a/include/wlr/types/wlr_keyboard.h b/include/wlr/types/wlr_keyboard.h index e2d50b03..450cd473 100644 --- a/include/wlr/types/wlr_keyboard.h +++ b/include/wlr/types/wlr_keyboard.h @@ -52,9 +52,15 @@ struct wlr_keyboard { } 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); diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index 04662820..abd7c285 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -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); diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h index fa2df530..00fd8da1 100644 --- a/include/wlr/types/wlr_seat.h +++ b/include/wlr/types/wlr_seat.h @@ -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; diff --git a/include/wlr/util/edges.h b/include/wlr/util/edges.h new file mode 100644 index 00000000..53268323 --- /dev/null +++ b/include/wlr/util/edges.h @@ -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 diff --git a/include/wlr/xcursor.h b/include/wlr/xcursor.h index b6362b06..42fcedb9 100644 --- a/include/wlr/xcursor.h +++ b/include/wlr/xcursor.h @@ -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 |