aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-08-17 21:11:33 -0400
committerGitHub <noreply@github.com>2017-08-17 21:11:33 -0400
commit1873951f0ef769123a451c9ce694bd9ea3d09a29 (patch)
treed838f8a08ea4cdb333db3c5954ba15eda53579f8 /include/wlr
parent18f153810871d4d39d057bd6ceceda91c4353300 (diff)
parent3138c5ddf04441fb7572db8c1a80b3789c4cc563 (diff)
Merge pull request #97 from acrisci/feature/output-layout
Add wlr_output_layout implementation
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