diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-12-01 19:38:36 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2016-12-01 19:38:36 -0500 |
commit | 44cc0ef125332f1fe3dad7d16ed0a78a25cd1974 (patch) | |
tree | 834a20ac4bc2982dda46f144932dd16177b04224 /include/sway/config.h | |
parent | Write example security config, start on code (diff) | |
download | sway-44cc0ef125332f1fe3dad7d16ed0a78a25cd1974.tar.gz sway-44cc0ef125332f1fe3dad7d16ed0a78a25cd1974.tar.zst sway-44cc0ef125332f1fe3dad7d16ed0a78a25cd1974.zip |
Add config related code and initial headers
Diffstat (limited to 'include/sway/config.h')
-rw-r--r-- | include/sway/config.h | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/include/sway/config.h b/include/sway/config.h index 8d077ee7..3744386c 100644 --- a/include/sway/config.h +++ b/include/sway/config.h | |||
@@ -103,9 +103,6 @@ struct pid_workspace { | |||
103 | time_t *time_added; | 103 | time_t *time_added; |
104 | }; | 104 | }; |
105 | 105 | ||
106 | void pid_workspace_add(struct pid_workspace *pw); | ||
107 | void free_pid_workspace(struct pid_workspace *pw); | ||
108 | |||
109 | struct bar_config { | 106 | struct bar_config { |
110 | /** | 107 | /** |
111 | * One of "dock", "hide", "invisible" | 108 | * One of "dock", "hide", "invisible" |
@@ -184,6 +181,35 @@ enum edge_border_types { | |||
184 | E_BOTH /**< hide vertical and horizontal edge borders */ | 181 | E_BOTH /**< hide vertical and horizontal edge borders */ |
185 | }; | 182 | }; |
186 | 183 | ||
184 | enum command_context { | ||
185 | CONTEXT_CONFIG = 1, | ||
186 | CONTEXT_BINDING = 2, | ||
187 | CONTEXT_IPC = 4, | ||
188 | CONTEXT_CRITERIA = 8, | ||
189 | CONTEXT_ALL = 0xFFFFFFFF, | ||
190 | }; | ||
191 | |||
192 | struct command_policy { | ||
193 | char *command; | ||
194 | enum command_context context; | ||
195 | }; | ||
196 | |||
197 | enum secure_feature { | ||
198 | FEATURE_LOCK = 1, | ||
199 | FEATURE_PANEL = 2, | ||
200 | FEATURE_BACKGROUND = 4, | ||
201 | FEATURE_SCREENSHOT = 8, | ||
202 | FEATURE_FULLSCREEN = 16, | ||
203 | FEATURE_KEYBOARD = 32, | ||
204 | FEATURE_MOUSE = 64, | ||
205 | }; | ||
206 | |||
207 | struct feature_policy { | ||
208 | char *program; | ||
209 | bool permit; | ||
210 | enum secure_feature features; | ||
211 | }; | ||
212 | |||
187 | /** | 213 | /** |
188 | * The configuration struct. The result of loading a config file. | 214 | * The configuration struct. The result of loading a config file. |
189 | */ | 215 | */ |
@@ -252,8 +278,15 @@ struct sway_config { | |||
252 | int32_t floating_maximum_height; | 278 | int32_t floating_maximum_height; |
253 | int32_t floating_minimum_width; | 279 | int32_t floating_minimum_width; |
254 | int32_t floating_minimum_height; | 280 | int32_t floating_minimum_height; |
281 | |||
282 | // Security | ||
283 | list_t *command_policies; | ||
284 | list_t *feature_policies; | ||
255 | }; | 285 | }; |
256 | 286 | ||
287 | void pid_workspace_add(struct pid_workspace *pw); | ||
288 | void free_pid_workspace(struct pid_workspace *pw); | ||
289 | |||
257 | /** | 290 | /** |
258 | * Loads the main config from the given path. is_active should be true when | 291 | * Loads the main config from the given path. is_active should be true when |
259 | * reloading the config. | 292 | * reloading the config. |