diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-11-12 11:43:50 -0500 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-11-15 08:34:48 -0500 |
commit | e5a31ae87054dacfbdea6ebf4ceba92dbd067e36 (patch) | |
tree | 7a1b19339e5fb38ddf0f80abb162e432959b3963 /include | |
parent | 0fe51b66e40e7016d42f00d539cbd3d382c2820c (diff) |
wlr-seat: basic touch
Diffstat (limited to 'include')
-rw-r--r-- | include/rootston/cursor.h | 1 | ||||
-rw-r--r-- | include/rootston/seat.h | 7 | ||||
-rw-r--r-- | include/wlr/types/wlr_cursor.h | 7 | ||||
-rw-r--r-- | include/wlr/types/wlr_seat.h | 31 |
4 files changed, 38 insertions, 8 deletions
diff --git a/include/rootston/cursor.h b/include/rootston/cursor.h index f49b6439..b5af7de3 100644 --- a/include/rootston/cursor.h +++ b/include/rootston/cursor.h @@ -39,7 +39,6 @@ struct roots_cursor { uint32_t resize_edges; // Ring buffer of input events that could trigger move/resize/rotate int input_events_idx; - struct wl_list touch_points; struct roots_input_event input_events[16]; struct wl_listener motion; diff --git a/include/rootston/seat.h b/include/rootston/seat.h index bef515a4..5fb2f196 100644 --- a/include/rootston/seat.h +++ b/include/rootston/seat.h @@ -43,13 +43,6 @@ struct roots_touch { struct wl_list link; }; -struct roots_touch_point { - struct roots_touch *device; - int32_t slot; - double x, y; - struct wl_list link; -}; - struct roots_tablet_tool { struct roots_seat *seat; struct wlr_input_device *device; diff --git a/include/wlr/types/wlr_cursor.h b/include/wlr/types/wlr_cursor.h index 0db32eb2..c73a4c8d 100644 --- a/include/wlr/types/wlr_cursor.h +++ b/include/wlr/types/wlr_cursor.h @@ -126,4 +126,11 @@ void wlr_cursor_map_to_region(struct wlr_cursor *cur, struct wlr_box *box); void wlr_cursor_map_input_to_region(struct wlr_cursor *cur, struct wlr_input_device *dev, struct wlr_box *box); +/** + * Convert absolute coordinates to layout coordinates for the device. + */ +bool wlr_cursor_absolute_to_layout_coords(struct wlr_cursor *cur, + struct wlr_input_device *device, double x_mm, double y_mm, + double width_mm, double height_mm, double *lx, double *ly); + #endif diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h index a5f00402..e8477b18 100644 --- a/include/wlr/types/wlr_seat.h +++ b/include/wlr/types/wlr_seat.h @@ -103,6 +103,23 @@ struct wlr_seat_keyboard_state { struct wlr_seat_keyboard_grab *default_grab; }; +struct wlr_touch_point { + int32_t touch_id; + struct wlr_surface *surface; + struct wlr_seat_client *client; + double sx, sy; + + struct wl_listener surface_destroy; + struct wl_listener resource_destroy; + + struct wl_list link; +}; + +struct wlr_seat_touch_state { + struct wlr_seat *seat; + struct wl_list touch_points; // wlr_touch_point::link +}; + struct wlr_seat { struct wl_global *wl_global; struct wl_display *display; @@ -117,6 +134,7 @@ struct wlr_seat { struct wlr_seat_pointer_state pointer_state; struct wlr_seat_keyboard_state keyboard_state; + struct wlr_seat_touch_state touch_state; struct wl_listener selection_data_source_destroy; @@ -328,4 +346,17 @@ void wlr_seat_keyboard_clear_focus(struct wlr_seat *wlr_seat); // TODO: May be useful to be able to simulate keyboard input events +struct wlr_touch_point *wlr_seat_touch_get_point(struct wlr_seat *seat, + int32_t touch_id); + +void wlr_seat_touch_notify_down(struct wlr_seat *seat, + struct wlr_surface *surface, uint32_t time, int32_t touch_id, double sx, + double sy); + +void wlr_seat_touch_notify_up(struct wlr_seat *seat, uint32_t time, + int32_t touch_id); + +void wlr_seat_touch_notify_motion(struct wlr_seat *seat, uint32_t time, + int32_t touch_id, double sx, double sy); + #endif |