diff options
Diffstat (limited to 'include/config.h')
-rw-r--r-- | include/config.h | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/include/config.h b/include/config.h index 636d3ec0..8338033c 100644 --- a/include/config.h +++ b/include/config.h | |||
@@ -8,22 +8,36 @@ | |||
8 | #include "layout.h" | 8 | #include "layout.h" |
9 | #include "container.h" | 9 | #include "container.h" |
10 | 10 | ||
11 | /** | ||
12 | * Describes a variable created via the `set` command. | ||
13 | */ | ||
11 | struct sway_variable { | 14 | struct sway_variable { |
12 | char *name; | 15 | char *name; |
13 | char *value; | 16 | char *value; |
14 | }; | 17 | }; |
15 | 18 | ||
19 | /** | ||
20 | * A key binding and an associated command. | ||
21 | */ | ||
16 | struct sway_binding { | 22 | struct sway_binding { |
17 | list_t *keys; | 23 | list_t *keys; |
18 | uint32_t modifiers; | 24 | uint32_t modifiers; |
19 | char *command; | 25 | char *command; |
20 | }; | 26 | }; |
21 | 27 | ||
28 | /** | ||
29 | * A "mode" of keybindings created via the `mode` command. | ||
30 | */ | ||
22 | struct sway_mode { | 31 | struct sway_mode { |
23 | char *name; | 32 | char *name; |
24 | list_t *bindings; | 33 | list_t *bindings; |
25 | }; | 34 | }; |
26 | 35 | ||
36 | /** | ||
37 | * Size and position configuration for a particular output. | ||
38 | * | ||
39 | * This is set via the `output` command. | ||
40 | */ | ||
27 | struct output_config { | 41 | struct output_config { |
28 | char *name; | 42 | char *name; |
29 | bool enabled; | 43 | bool enabled; |
@@ -31,11 +45,19 @@ struct output_config { | |||
31 | int x, y; | 45 | int x, y; |
32 | }; | 46 | }; |
33 | 47 | ||
48 | /** | ||
49 | * Maps a workspace name to an output name. | ||
50 | * | ||
51 | * Set via `workspace <x> output <y>` | ||
52 | */ | ||
34 | struct workspace_output { | 53 | struct workspace_output { |
35 | char *output; | 54 | char *output; |
36 | char *workspace; | 55 | char *workspace; |
37 | }; | 56 | }; |
38 | 57 | ||
58 | /** | ||
59 | * The configuration struct. The result of loading a config file. | ||
60 | */ | ||
39 | struct sway_config { | 61 | struct sway_config { |
40 | list_t *symbols; | 62 | list_t *symbols; |
41 | list_t *modes; | 63 | list_t *modes; |
@@ -62,12 +84,24 @@ struct sway_config { | |||
62 | int gaps_outer; | 84 | int gaps_outer; |
63 | }; | 85 | }; |
64 | 86 | ||
87 | /** | ||
88 | * Loads the config from the given path. | ||
89 | */ | ||
65 | bool load_config(const char *file); | 90 | bool load_config(const char *file); |
91 | /** Reads the config from the given FILE. | ||
92 | */ | ||
66 | bool read_config(FILE *file, bool is_active); | 93 | bool read_config(FILE *file, bool is_active); |
94 | /** | ||
95 | * Does variable replacement for a string based on the config's currently loaded variables. | ||
96 | */ | ||
67 | char *do_var_replacement(char *str); | 97 | char *do_var_replacement(char *str); |
68 | // Setup output container by applying given config | 98 | /** Sets up a WLC output handle based on a given output_config. |
99 | */ | ||
69 | void apply_output_config(struct output_config *oc, swayc_t *output); | 100 | void apply_output_config(struct output_config *oc, swayc_t *output); |
70 | 101 | ||
102 | /** | ||
103 | * Global config singleton. | ||
104 | */ | ||
71 | extern struct sway_config *config; | 105 | extern struct sway_config *config; |
72 | 106 | ||
73 | #endif | 107 | #endif |