aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/types/wlr_cursor.h7
-rw-r--r--include/wlr/types/wlr_seat.h31
2 files changed, 38 insertions, 0 deletions
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