summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2017-12-13 20:36:06 -0500
committerLibravatar GitHub <noreply@github.com>2017-12-13 20:36:06 -0500
commit1aab9ae3e74d15e2c346acbab2ef2def59db72eb (patch)
tree6a3479fef295dc673c6bcdaac822f44523f94d8e /include
parentMerge pull request #1501 from emersion/command-include (diff)
parentUse strtol instead of atoi in output command (diff)
downloadsway-1aab9ae3e74d15e2c346acbab2ef2def59db72eb.tar.gz
sway-1aab9ae3e74d15e2c346acbab2ef2def59db72eb.tar.zst
sway-1aab9ae3e74d15e2c346acbab2ef2def59db72eb.zip
Merge pull request #1503 from emersion/output-config
Add output config
Diffstat (limited to 'include')
-rw-r--r--include/sway/config.h6
-rw-r--r--include/sway/container.h5
-rw-r--r--include/sway/layout.h8
-rw-r--r--include/sway/output.h2
4 files changed, 16 insertions, 5 deletions
diff --git a/include/sway/config.h b/include/sway/config.h
index 7de85ab7..139d7800 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -80,8 +80,11 @@ struct output_config {
80 char *name; 80 char *name;
81 int enabled; 81 int enabled;
82 int width, height; 82 int width, height;
83 float refresh_rate;
83 int x, y; 84 int x, y;
84 int scale; 85 int scale;
86 int32_t transform;
87
85 char *background; 88 char *background;
86 char *background_option; 89 char *background_option;
87}; 90};
@@ -360,9 +363,8 @@ void apply_input_config(struct input_config *ic, struct libinput_device *dev);
360void free_input_config(struct input_config *ic); 363void free_input_config(struct input_config *ic);
361 364
362int output_name_cmp(const void *item, const void *data); 365int output_name_cmp(const void *item, const void *data);
366struct output_config *new_output_config();
363void merge_output_config(struct output_config *dst, struct output_config *src); 367void merge_output_config(struct output_config *dst, struct output_config *src);
364/** Sets up a WLC output handle based on a given output_config.
365 */
366void apply_output_config(struct output_config *oc, swayc_t *output); 368void apply_output_config(struct output_config *oc, swayc_t *output);
367void free_output_config(struct output_config *oc); 369void free_output_config(struct output_config *oc);
368 370
diff --git a/include/sway/container.h b/include/sway/container.h
index 08a98ed9..b15e0428 100644
--- a/include/sway/container.h
+++ b/include/sway/container.h
@@ -57,9 +57,9 @@ enum swayc_border_types {
57 B_NORMAL, /**< Normal border with title bar */ 57 B_NORMAL, /**< Normal border with title bar */
58}; 58};
59 59
60struct sway_root;
60struct sway_output; 61struct sway_output;
61struct sway_view; 62struct sway_view;
62struct wlr_output_layout;
63 63
64/** 64/**
65 * Stores information about a container. 65 * Stores information about a container.
@@ -69,7 +69,7 @@ struct wlr_output_layout;
69struct sway_container { 69struct sway_container {
70 union { 70 union {
71 // TODO: Encapsulate state for other node types as well like C_CONTAINER 71 // TODO: Encapsulate state for other node types as well like C_CONTAINER
72 struct wlr_output_layout *output_layout; // C_ROOT 72 struct sway_root *sway_root; // C_ROOT
73 struct sway_output *sway_output; // C_OUTPUT 73 struct sway_output *sway_output; // C_OUTPUT
74 struct sway_view *sway_view; // C_VIEW 74 struct sway_view *sway_view; // C_VIEW
75 }; 75 };
@@ -132,6 +132,7 @@ swayc_t *new_output(struct sway_output *sway_output);
132swayc_t *new_workspace(swayc_t *output, const char *name); 132swayc_t *new_workspace(swayc_t *output, const char *name);
133swayc_t *new_view(swayc_t *sibling, struct sway_view *sway_view); 133swayc_t *new_view(swayc_t *sibling, struct sway_view *sway_view);
134 134
135swayc_t *destroy_output(swayc_t *output);
135swayc_t *destroy_view(swayc_t *view); 136swayc_t *destroy_view(swayc_t *view);
136 137
137swayc_t *swayc_parent_by_type(swayc_t *container, enum swayc_types type); 138swayc_t *swayc_parent_by_type(swayc_t *container, enum swayc_types type);
diff --git a/include/sway/layout.h b/include/sway/layout.h
index f3b62b05..bfd96a02 100644
--- a/include/sway/layout.h
+++ b/include/sway/layout.h
@@ -1,8 +1,16 @@
1#ifndef _SWAY_LAYOUT_H 1#ifndef _SWAY_LAYOUT_H
2#define _SWAY_LAYOUT_H 2#define _SWAY_LAYOUT_H
3 3
4#include <wlr/types/wlr_output_layout.h>
5
4struct sway_container; 6struct sway_container;
5 7
8struct sway_root {
9 struct wlr_output_layout *output_layout;
10
11 struct wl_listener output_layout_change;
12};
13
6void init_layout(void); 14void init_layout(void);
7void add_child(struct sway_container *parent, struct sway_container *child); 15void add_child(struct sway_container *parent, struct sway_container *child);
8struct sway_container *remove_child(struct sway_container *child); 16struct sway_container *remove_child(struct sway_container *child);
diff --git a/include/sway/output.h b/include/sway/output.h
index 895cb07d..7ca02d7b 100644
--- a/include/sway/output.h
+++ b/include/sway/output.h
@@ -12,8 +12,8 @@ struct sway_output {
12 struct sway_container *swayc; 12 struct sway_container *swayc;
13 struct sway_server *server; 13 struct sway_server *server;
14 struct timespec last_frame; 14 struct timespec last_frame;
15
15 struct wl_listener frame; 16 struct wl_listener frame;
16 struct wl_listener resolution;
17}; 17};
18 18
19#endif 19#endif