mirror of
https://github.com/swaywm/sway.git
synced 2024-11-29 19:31:29 +00:00
move output code out of the tree
This commit is contained in:
parent
09d448ea2d
commit
cba258e16a
|
@ -2,6 +2,7 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <wayland-server.h>
|
#include <wayland-server.h>
|
||||||
#include <wlr/render/wlr_renderer.h>
|
#include <wlr/render/wlr_renderer.h>
|
||||||
#include <wlr/types/wlr_box.h>
|
#include <wlr/types/wlr_box.h>
|
||||||
|
@ -21,6 +22,16 @@
|
||||||
#include "sway/tree/layout.h"
|
#include "sway/tree/layout.h"
|
||||||
#include "sway/tree/view.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),
|
* 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).
|
* the child position is (*sx, *sy) and its size is (sw, sh).
|
||||||
|
|
|
@ -86,7 +86,6 @@ sway_sources = files(
|
||||||
'security.c',
|
'security.c',
|
||||||
'tree/container.c',
|
'tree/container.c',
|
||||||
'tree/layout.c',
|
'tree/layout.c',
|
||||||
'tree/output.c',
|
|
||||||
'tree/view.c',
|
'tree/view.c',
|
||||||
'tree/workspace.c',
|
'tree/workspace.c',
|
||||||
)
|
)
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
Loading…
Reference in a new issue