diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-04-03 12:39:03 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-04-03 12:40:11 -0400 |
commit | cba258e16ac4d37841b89f2b6a38e1056acae97b (patch) | |
tree | 5e74f59544d9150066ad85228ef10c0272e65117 /sway | |
parent | unify container destroy functions (diff) | |
download | sway-cba258e16ac4d37841b89f2b6a38e1056acae97b.tar.gz sway-cba258e16ac4d37841b89f2b6a38e1056acae97b.tar.zst sway-cba258e16ac4d37841b89f2b6a38e1056acae97b.zip |
move output code out of the tree
Diffstat (limited to 'sway')
-rw-r--r-- | sway/desktop/output.c | 11 | ||||
-rw-r--r-- | sway/meson.build | 1 | ||||
-rw-r--r-- | sway/tree/output.c | 15 |
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 @@ | |||
2 | #include <assert.h> | 2 | #include <assert.h> |
3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
4 | #include <time.h> | 4 | #include <time.h> |
5 | #include <strings.h> | ||
5 | #include <wayland-server.h> | 6 | #include <wayland-server.h> |
6 | #include <wlr/render/wlr_renderer.h> | 7 | #include <wlr/render/wlr_renderer.h> |
7 | #include <wlr/types/wlr_box.h> | 8 | #include <wlr/types/wlr_box.h> |
@@ -21,6 +22,16 @@ | |||
21 | #include "sway/tree/layout.h" | 22 | #include "sway/tree/layout.h" |
22 | #include "sway/tree/view.h" | 23 | #include "sway/tree/view.h" |
23 | 24 | ||
25 | struct sway_container *output_by_name(const char *name) { | ||
26 | for (int i = 0; i < root_container.children->length; ++i) { | ||
27 | struct sway_container *output = root_container.children->items[i]; | ||
28 | if (strcasecmp(output->name, name) == 0){ | ||
29 | return output; | ||
30 | } | ||
31 | } | ||
32 | return NULL; | ||
33 | } | ||
34 | |||
24 | /** | 35 | /** |
25 | * Rotate a child's position relative to a parent. The parent size is (pw, ph), | 36 | * Rotate a child's position relative to a parent. The parent size is (pw, ph), |
26 | * the child position is (*sx, *sy) and its size is (sw, sh). | 37 | * 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( | |||
86 | 'security.c', | 86 | 'security.c', |
87 | 'tree/container.c', | 87 | 'tree/container.c', |
88 | 'tree/layout.c', | 88 | 'tree/layout.c', |
89 | 'tree/output.c', | ||
90 | 'tree/view.c', | 89 | 'tree/view.c', |
91 | 'tree/workspace.c', | 90 | 'tree/workspace.c', |
92 | ) | 91 | ) |
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 @@ | |||
1 | #include <strings.h> | ||
2 | #include "sway/tree/container.h" | ||
3 | #include "sway/tree/layout.h" | ||
4 | #include "sway/output.h" | ||
5 | #include "log.h" | ||
6 | |||
7 | struct sway_container *output_by_name(const char *name) { | ||
8 | for (int i = 0; i < root_container.children->length; ++i) { | ||
9 | struct sway_container *output = root_container.children->items[i]; | ||
10 | if (strcasecmp(output->name, name) == 0){ | ||
11 | return output; | ||
12 | } | ||
13 | } | ||
14 | return NULL; | ||
15 | } | ||