aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/types/wlr_output_layout.h9
-rw-r--r--include/wlr/util/direction.h11
2 files changed, 20 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_output_layout.h b/include/wlr/types/wlr_output_layout.h
index 7dd2b16a..ea96c6b8 100644
--- a/include/wlr/types/wlr_output_layout.h
+++ b/include/wlr/types/wlr_output_layout.h
@@ -5,6 +5,7 @@
#include <wayland-util.h>
#include <wlr/types/wlr_box.h>
#include <wlr/types/wlr_output.h>
+#include <wlr/util/direction.h>
struct wlr_output_layout_state;
@@ -96,4 +97,12 @@ void wlr_output_layout_add_auto(struct wlr_output_layout *layout,
struct wlr_output *wlr_output_layout_get_center_output(
struct wlr_output_layout *layout);
+/**
+ * Get the closest adjacent output to the reference output from the reference
+ * point in the given direction.
+ */
+struct wlr_output *wlr_output_layout_adjacent_output(
+ struct wlr_output_layout *layout, enum wlr_direction direction,
+ struct wlr_output *reference, double ref_x, double ref_y);
+
#endif
diff --git a/include/wlr/util/direction.h b/include/wlr/util/direction.h
new file mode 100644
index 00000000..b5f3a589
--- /dev/null
+++ b/include/wlr/util/direction.h
@@ -0,0 +1,11 @@
+#ifndef WLR_UTIL_DIRECTION_H
+#define WLR_UTIL_DIRECTION_H
+
+enum wlr_direction {
+ WLR_DIRECTION_UP = 0,
+ WLR_DIRECTION_DOWN = 1,
+ WLR_DIRECTION_LEFT = 2,
+ WLR_DIRECTION_RIGHT = 4,
+};
+
+#endif