aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-04-03 12:39:03 -0400
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-04-03 12:40:11 -0400
commitcba258e16ac4d37841b89f2b6a38e1056acae97b (patch)
tree5e74f59544d9150066ad85228ef10c0272e65117 /sway/desktop/output.c
parentunify container destroy functions (diff)
downloadsway-cba258e16ac4d37841b89f2b6a38e1056acae97b.tar.gz
sway-cba258e16ac4d37841b89f2b6a38e1056acae97b.tar.zst
sway-cba258e16ac4d37841b89f2b6a38e1056acae97b.zip
move output code out of the tree
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c11
1 files changed, 11 insertions, 0 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
25struct 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).