From 0a97b68278a621882c712b55ffe851101e5902d0 Mon Sep 17 00:00:00 2001
From: Tony Crisci <tony@dubstepdish.com>
Date: Fri, 25 Aug 2017 13:26:13 -0400
Subject: implement cursor and device geometry mapping

---
 include/wlr/types/wlr_cursor.h   |  6 ++++--
 include/wlr/types/wlr_geometry.h | 12 ++++++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)
 create mode 100644 include/wlr/types/wlr_geometry.h

(limited to 'include/wlr')

diff --git a/include/wlr/types/wlr_cursor.h b/include/wlr/types/wlr_cursor.h
index 64a75e4f..30495d44 100644
--- a/include/wlr/types/wlr_cursor.h
+++ b/include/wlr/types/wlr_cursor.h
@@ -4,6 +4,7 @@
 #include <wlr/types/wlr_output.h>
 #include <wlr/types/wlr_output_layout.h>
 #include <wlr/types/wlr_input_device.h>
+#include <wlr/types/wlr_geometry.h>
 #include <wlr/xcursor.h>
 
 struct wlr_cursor_state;
@@ -87,12 +88,13 @@ void wlr_cursor_map_input_to_output(struct wlr_cursor *cur,
 /**
  * Maps this cursor to an arbitrary region on the associated wlr_output_layout.
  */
-//void wlr_cursor_map_to_region(struct wlr_cursor *cur, struct wlr_geometry *geo);
+void wlr_cursor_map_to_region(struct wlr_cursor *cur, struct wlr_geometry *geo);
 
 /**
  * Maps inputs from this input device to an arbitrary region on the associated
  * wlr_output_layout.
  */
-//void wlr_cursor_map_input_to_region(struct wlr_cursor *cur, struct wlr_input_device *dev, struct wlr_geometry *geo);
+void wlr_cursor_map_input_to_region(struct wlr_cursor *cur,
+		struct wlr_input_device *dev, struct wlr_geometry *geo);
 
 #endif
diff --git a/include/wlr/types/wlr_geometry.h b/include/wlr/types/wlr_geometry.h
new file mode 100644
index 00000000..3e218bed
--- /dev/null
+++ b/include/wlr/types/wlr_geometry.h
@@ -0,0 +1,12 @@
+#ifndef _WLR_TYPES_GEOMETRY_H
+#define _WLR_TYPES_GEOMETRY_H
+
+struct wlr_geometry {
+	int x, y;
+	int width, height;
+};
+
+void wlr_geometry_closest_boundary(struct wlr_geometry *geo, double x, double y,
+		int *dest_x, int *dest_y, double *distance);
+
+#endif
-- 
cgit v1.2.3