diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-10-09 17:56:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-09 17:56:05 -0400 |
commit | c39bfe7f84818be9d9901e30ba26db9e8f19c47e (patch) | |
tree | 39188d9396028b4c7f948fce6bf197db2a656bcf /include | |
parent | 1c3c2ff90a2d33543c5015a3067e792d887d7ea4 (diff) | |
parent | b1cba36aebb6629fc2019360197f34394abaf2ac (diff) |
Merge pull request #206 from emersion/client-cursor
Client provided cursors
Diffstat (limited to 'include')
-rw-r--r-- | include/rootston/input.h | 3 | ||||
-rw-r--r-- | include/wlr/types/wlr_output.h | 19 | ||||
-rw-r--r-- | include/wlr/types/wlr_seat.h | 9 |
3 files changed, 26 insertions, 5 deletions
diff --git a/include/rootston/input.h b/include/rootston/input.h index 9caf66c0..fbabbdb6 100644 --- a/include/rootston/input.h +++ b/include/rootston/input.h @@ -79,6 +79,7 @@ struct roots_input { struct wlr_xcursor_theme *theme; struct wlr_xcursor *xcursor; struct wlr_seat *wl_seat; + struct roots_view *client_cursor_view; enum roots_cursor_mode mode; struct roots_view *active_view, *last_active_view; @@ -107,6 +108,8 @@ struct roots_input { struct wl_listener cursor_tool_tip; struct wl_listener pointer_grab_end; + + struct wl_listener request_set_cursor; }; struct roots_input *input_create(struct roots_server *server, diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index 52d377e3..dc637e26 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -49,23 +49,32 @@ struct wlr_output { int32_t hotspot_x, hotspot_y; struct wlr_renderer *renderer; struct wlr_texture *texture; + + // only when using a cursor surface + struct wlr_surface *surface; + struct wl_listener surface_commit; + struct wl_listener surface_destroy; } cursor; void *data; }; +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); + struct wlr_output_mode *mode); void wlr_output_transform(struct wlr_output *output, - enum wl_output_transform transform); + enum wl_output_transform transform); bool wlr_output_set_cursor(struct wlr_output *output, - const uint8_t *buf, int32_t stride, uint32_t width, uint32_t height, - int32_t hotspot_x, int32_t hotspot_y); + const uint8_t *buf, int32_t stride, uint32_t width, uint32_t height, + int32_t hotspot_x, int32_t hotspot_y); +void wlr_output_set_cursor_surface(struct wlr_output *output, + struct wlr_surface *surface, int32_t hotspot_x, int32_t hotspot_y); bool wlr_output_move_cursor(struct wlr_output *output, int x, int y); void wlr_output_destroy(struct wlr_output *output); void wlr_output_effective_resolution(struct wlr_output *output, - int *width, int *height); + int *width, int *height); void wlr_output_make_current(struct wlr_output *output); void wlr_output_swap_buffers(struct wlr_output *output); void wlr_output_set_gamma(struct wlr_output *output, diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h index d3d3e00d..d267924c 100644 --- a/include/wlr/types/wlr_seat.h +++ b/include/wlr/types/wlr_seat.h @@ -125,11 +125,20 @@ struct wlr_seat { struct wl_signal keyboard_grab_begin; struct wl_signal keyboard_grab_end; + + struct wl_signal request_set_cursor; } events; void *data; }; +struct wlr_seat_pointer_request_set_cursor_event { + struct wl_client *client; + struct wlr_seat_handle *seat_handle; + struct wlr_surface *surface; + int32_t hotspot_x, hotspot_y; +}; + /** * Allocates a new wlr_seat and adds a wl_seat global to the display. */ |