aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-04-03 12:39:03 -0400
committerTony Crisci <tony@dubstepdish.com>2018-04-03 12:40:11 -0400
commitcba258e16ac4d37841b89f2b6a38e1056acae97b (patch)
tree5e74f59544d9150066ad85228ef10c0272e65117
parent09d448ea2df60b7e4504b1ec4728e7f1df0244b7 (diff)
downloadsway-cba258e16ac4d37841b89f2b6a38e1056acae97b.tar.xz
move output code out of the tree
-rw-r--r--sway/desktop/output.c11
-rw-r--r--sway/meson.build1
-rw-r--r--sway/tree/output.c15
3 files changed, 11 insertions, 16 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index a1f89cf9..e60fac5f 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -2,6 +2,7 @@
#include <assert.h>
#include <stdlib.h>
#include <time.h>
+#include <strings.h>
#include <wayland-server.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/types/wlr_box.h>
@@ -21,6 +22,16 @@
#include "sway/tree/layout.h"
#include "sway/tree/view.h"
+struct sway_container *output_by_name(const char *name) {
+ for (int i = 0; i < root_container.children->length; ++i) {
+ struct sway_container *output = root_container.children->items[i];
+ if (strcasecmp(output->name, name) == 0){
+ return output;
+ }
+ }
+ return NULL;
+}
+
/**
* Rotate a child's position relative to a parent. The parent size is (pw, ph),
* the child position is (*sx, *sy) and its size is (sw, sh).
diff --git a/sway/meson.build b/sway/meson.build
index a6a633a0..87d882d2 100644
--- a/sway/meson.build
+++ b/sway/meson.build
@@ -86,7 +86,6 @@ sway_sources = files(
'security.c',
'tree/container.c',
'tree/layout.c',
- 'tree/output.c',
'tree/view.c',
'tree/workspace.c',
)
diff --git a/sway/tree/output.c b/sway/tree/output.c
deleted file mode 100644
index af17b856..00000000
--- a/sway/tree/output.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <strings.h>
-#include "sway/tree/container.h"
-#include "sway/tree/layout.h"
-#include "sway/output.h"
-#include "log.h"
-
-struct sway_container *output_by_name(const char *name) {
- for (int i = 0; i < root_container.children->length; ++i) {
- struct sway_container *output = root_container.children->items[i];
- if (strcasecmp(output->name, name) == 0){
- return output;
- }
- }
- return NULL;
-}