diff options
Diffstat (limited to 'include/rootston')
-rw-r--r-- | include/rootston/cursor.h | 41 | ||||
-rw-r--r-- | include/rootston/desktop.h | 2 | ||||
-rw-r--r-- | include/rootston/input.h | 2 | ||||
-rw-r--r-- | include/rootston/output.h | 3 | ||||
-rw-r--r-- | include/rootston/seat.h | 8 |
5 files changed, 43 insertions, 13 deletions
diff --git a/include/rootston/cursor.h b/include/rootston/cursor.h index 2c687a39..b5bb682f 100644 --- a/include/rootston/cursor.h +++ b/include/rootston/cursor.h @@ -1,6 +1,7 @@ #ifndef ROOTSTON_CURSOR_H #define ROOTSTON_CURSOR_H +#include <wlr/types/wlr_pointer_constraints_v1.h> #include "rootston/seat.h" enum roots_cursor_mode { @@ -14,6 +15,9 @@ struct roots_cursor { struct roots_seat *seat; struct wlr_cursor *cursor; + struct wlr_pointer_constraint_v1 *active_constraint; + pixman_region32_t confine; // invalid if active_constraint == NULL + const char *default_xcursor; enum roots_cursor_mode mode; @@ -28,6 +32,7 @@ struct roots_cursor { uint32_t resize_edges; struct roots_seat_view *pointer_view; + struct wlr_surface *wlr_surface; struct wl_listener motion; struct wl_listener motion_absolute; @@ -44,6 +49,10 @@ struct roots_cursor { struct wl_listener tool_button; struct wl_listener request_set_cursor; + + struct wl_listener focus_change; + + struct wl_listener constraint_commit; }; struct roots_cursor *roots_cursor_create(struct roots_seat *seat); @@ -51,36 +60,46 @@ struct roots_cursor *roots_cursor_create(struct roots_seat *seat); void roots_cursor_destroy(struct roots_cursor *cursor); void roots_cursor_handle_motion(struct roots_cursor *cursor, - struct wlr_event_pointer_motion *event); + struct wlr_event_pointer_motion *event); void roots_cursor_handle_motion_absolute(struct roots_cursor *cursor, - struct wlr_event_pointer_motion_absolute *event); + struct wlr_event_pointer_motion_absolute *event); void roots_cursor_handle_button(struct roots_cursor *cursor, - struct wlr_event_pointer_button *event); + struct wlr_event_pointer_button *event); void roots_cursor_handle_axis(struct roots_cursor *cursor, - struct wlr_event_pointer_axis *event); + struct wlr_event_pointer_axis *event); void roots_cursor_handle_touch_down(struct roots_cursor *cursor, - struct wlr_event_touch_down *event); + struct wlr_event_touch_down *event); void roots_cursor_handle_touch_up(struct roots_cursor *cursor, - struct wlr_event_touch_up *event); + struct wlr_event_touch_up *event); void roots_cursor_handle_touch_motion(struct roots_cursor *cursor, - struct wlr_event_touch_motion *event); + struct wlr_event_touch_motion *event); void roots_cursor_handle_tool_axis(struct roots_cursor *cursor, - struct wlr_event_tablet_tool_axis *event); + struct wlr_event_tablet_tool_axis *event); void roots_cursor_handle_tool_tip(struct roots_cursor *cursor, - struct wlr_event_tablet_tool_tip *event); + struct wlr_event_tablet_tool_tip *event); void roots_cursor_handle_request_set_cursor(struct roots_cursor *cursor, - struct wlr_seat_pointer_request_set_cursor_event *event); + struct wlr_seat_pointer_request_set_cursor_event *event); + +void roots_cursor_handle_focus_change(struct roots_cursor *cursor, + struct wlr_seat_pointer_focus_change_event *event); + +void roots_cursor_handle_constraint_commit(struct roots_cursor *cursor); void roots_cursor_update_position(struct roots_cursor *cursor, - uint32_t time); + uint32_t time); + +void roots_cursor_update_focus(struct roots_cursor *cursor); + +void roots_cursor_constrain(struct roots_cursor *cursor, + struct wlr_pointer_constraint_v1 *constraint, double sx, double sy); #endif diff --git a/include/rootston/desktop.h b/include/rootston/desktop.h index 89d8af4a..90851a17 100644 --- a/include/rootston/desktop.h +++ b/include/rootston/desktop.h @@ -56,6 +56,7 @@ struct roots_desktop { struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard; struct wlr_screencopy_manager_v1 *screencopy; struct wlr_tablet_manager_v2 *tablet_v2; + struct wlr_pointer_constraints_v1 *pointer_constraints; struct wl_listener new_output; struct wl_listener layout_change; @@ -67,6 +68,7 @@ struct roots_desktop { struct wl_listener input_inhibit_activate; struct wl_listener input_inhibit_deactivate; struct wl_listener virtual_keyboard_new; + struct wl_listener pointer_constraint; #ifdef WLR_HAS_XWAYLAND struct wlr_xwayland *xwayland; diff --git a/include/rootston/input.h b/include/rootston/input.h index 2cdb13e6..31810b4d 100644 --- a/include/rootston/input.h +++ b/include/rootston/input.h @@ -16,7 +16,7 @@ struct roots_input { struct wl_listener new_input; - struct wl_list seats; + struct wl_list seats; // roots_seat::link }; struct roots_input *input_create(struct roots_server *server, diff --git a/include/rootston/output.h b/include/rootston/output.h index f78ee81d..69bc5126 100644 --- a/include/rootston/output.h +++ b/include/rootston/output.h @@ -28,6 +28,9 @@ struct roots_output { struct wl_listener damage_destroy; }; +void rotate_child_position(double *sx, double *sy, double sw, double sh, + double pw, double ph, float rotation); + void handle_new_output(struct wl_listener *listener, void *data); struct roots_view; diff --git a/include/rootston/seat.h b/include/rootston/seat.h index c5e584b6..1248918a 100644 --- a/include/rootston/seat.h +++ b/include/rootston/seat.h @@ -10,7 +10,7 @@ struct roots_seat { struct roots_input *input; struct wlr_seat *seat; struct roots_cursor *cursor; - struct wl_list link; + struct wl_list link; // roots_input::seats // coordinates of the first touch point if it exists int32_t touch_id; @@ -122,6 +122,12 @@ struct roots_tablet_tool { struct wl_listener tablet_destroy; }; +struct roots_pointer_constraint { + struct wlr_pointer_constraint_v1 *constraint; + + struct wl_listener destroy; +}; + struct roots_seat *roots_seat_create(struct roots_input *input, char *name); void roots_seat_destroy(struct roots_seat *seat); |