aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/types/wlr_output_layout.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_output_layout.h b/include/wlr/types/wlr_output_layout.h
new file mode 100644
index 00000000..f6a1efdd
--- /dev/null
+++ b/include/wlr/types/wlr_output_layout.h
@@ -0,0 +1,49 @@
+#ifndef _WLR_TYPES_OUTPUT_LAYOUT_H
+#define _WLR_TYPES_OUTPUT_LAYOUT_H
+#include <wlr/types/wlr_output.h>
+#include <wayland-util.h>
+#include <stdbool.h>
+
+struct wlr_output_layout {
+ struct wl_list outputs;
+};
+
+struct wlr_output_layout_output {
+ struct wlr_output *output;
+ int x, y;
+ struct wl_list link;
+};
+
+struct wlr_output_layout *wlr_output_layout_init();
+
+void wlr_output_layout_destroy(struct wlr_output_layout *layout);
+
+struct wlr_output_layout_output *wlr_output_layout_get(
+ struct wlr_output_layout *layout, struct wlr_output *reference);
+
+struct wlr_output *wlr_output_layout_output_at(struct wlr_output_layout *layout,
+ double x, double y);
+
+void wlr_output_layout_add(struct wlr_output_layout *layout,
+ struct wlr_output *output, int x, int y);
+
+void wlr_output_layout_move(struct wlr_output_layout *layout,
+ struct wlr_output *output, int x, int y);
+
+void wlr_output_layout_remove(struct wlr_output_layout *layout,
+ struct wlr_output *output);
+
+/**
+ * Given x and y as pointers to global coordinates, adjusts them to local output
+ * coordinates relative to the given reference output.
+ */
+void wlr_output_layout_output_coords(struct wlr_output_layout *layout,
+ struct wlr_output *reference, int *x, int *y);
+
+bool wlr_output_layout_contains_point(struct wlr_output_layout *layout,
+ struct wlr_output *reference, int x, int y);
+
+bool wlr_output_layout_intersects(struct wlr_output_layout *layout,
+ struct wlr_output *reference, int x1, int y1, int x2, int y2);
+
+#endif