diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-12-13 20:36:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-13 20:36:06 -0500 |
commit | 1aab9ae3e74d15e2c346acbab2ef2def59db72eb (patch) | |
tree | 6a3479fef295dc673c6bcdaac822f44523f94d8e /include | |
parent | Merge pull request #1501 from emersion/command-include (diff) | |
parent | Use strtol instead of atoi in output command (diff) | |
download | sway-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.h | 6 | ||||
-rw-r--r-- | include/sway/container.h | 5 | ||||
-rw-r--r-- | include/sway/layout.h | 8 | ||||
-rw-r--r-- | include/sway/output.h | 2 |
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); | |||
360 | void free_input_config(struct input_config *ic); | 363 | void free_input_config(struct input_config *ic); |
361 | 364 | ||
362 | int output_name_cmp(const void *item, const void *data); | 365 | int output_name_cmp(const void *item, const void *data); |
366 | struct output_config *new_output_config(); | ||
363 | void merge_output_config(struct output_config *dst, struct output_config *src); | 367 | void 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 | */ | ||
366 | void apply_output_config(struct output_config *oc, swayc_t *output); | 368 | void apply_output_config(struct output_config *oc, swayc_t *output); |
367 | void free_output_config(struct output_config *oc); | 369 | void 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 | ||
60 | struct sway_root; | ||
60 | struct sway_output; | 61 | struct sway_output; |
61 | struct sway_view; | 62 | struct sway_view; |
62 | struct 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; | |||
69 | struct sway_container { | 69 | struct 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); | |||
132 | swayc_t *new_workspace(swayc_t *output, const char *name); | 132 | swayc_t *new_workspace(swayc_t *output, const char *name); |
133 | swayc_t *new_view(swayc_t *sibling, struct sway_view *sway_view); | 133 | swayc_t *new_view(swayc_t *sibling, struct sway_view *sway_view); |
134 | 134 | ||
135 | swayc_t *destroy_output(swayc_t *output); | ||
135 | swayc_t *destroy_view(swayc_t *view); | 136 | swayc_t *destroy_view(swayc_t *view); |
136 | 137 | ||
137 | swayc_t *swayc_parent_by_type(swayc_t *container, enum swayc_types type); | 138 | swayc_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 | |||
4 | struct sway_container; | 6 | struct sway_container; |
5 | 7 | ||
8 | struct sway_root { | ||
9 | struct wlr_output_layout *output_layout; | ||
10 | |||
11 | struct wl_listener output_layout_change; | ||
12 | }; | ||
13 | |||
6 | void init_layout(void); | 14 | void init_layout(void); |
7 | void add_child(struct sway_container *parent, struct sway_container *child); | 15 | void add_child(struct sway_container *parent, struct sway_container *child); |
8 | struct sway_container *remove_child(struct sway_container *child); | 16 | struct 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 |