diff options
author | Erik Reider <[email protected]> | 2023-05-19 21:14:06 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2023-05-19 21:14:06 +0200 |
commit | 415e072a3af292937f0b4c41acadafaee6958437 (patch) | |
tree | 354de329d9cbf66054260d50aebefd86a26d5055 /include | |
parent | 67078429428f0a97333c107da8a3ad8fb678a602 (diff) |
Add blur, shadow, and corner radius to layer-shell surfaces (#144)
Co-authored-by: Will McKinnon <[email protected]>
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/commands.h | 6 | ||||
-rw-r--r-- | include/sway/config.h | 4 | ||||
-rw-r--r-- | include/sway/desktop/fx_renderer/fx_renderer.h | 1 | ||||
-rw-r--r-- | include/sway/layer_criteria.h | 20 | ||||
-rw-r--r-- | include/sway/layers.h | 4 | ||||
-rw-r--r-- | include/sway/output.h | 6 |
6 files changed, 41 insertions, 0 deletions
diff --git a/include/sway/commands.h b/include/sway/commands.h index b895d5f2..920e8596 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h @@ -98,6 +98,11 @@ struct sway_container *container_find_resize_parent(struct sway_container *con, uint32_t edge); /** + * Effect handlers value parsers + */ +bool cmd_corner_radius_parse_value(char *arg, int* result); + +/** * Handlers shared by exec and exec_always. */ sway_cmd cmd_exec_validate; @@ -157,6 +162,7 @@ sway_cmd cmd_input; sway_cmd cmd_seat; sway_cmd cmd_ipc; sway_cmd cmd_kill; +sway_cmd cmd_layer_effects; sway_cmd cmd_layout; sway_cmd cmd_log_colors; sway_cmd cmd_mark; diff --git a/include/sway/config.h b/include/sway/config.h index d84eef69..04e2969e 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -500,6 +500,8 @@ struct sway_config { bool titlebar_separator; bool scratchpad_minimize; + list_t *layer_criteria; + char *swaynag_command; struct swaynag_instance swaynag_config_errors; list_t *symbols; @@ -765,6 +767,8 @@ int config_get_blur_size(); bool config_should_parameters_blur(); +bool config_should_parameters_shadow(); + /* Global config singleton. */ extern struct sway_config *config; diff --git a/include/sway/desktop/fx_renderer/fx_renderer.h b/include/sway/desktop/fx_renderer/fx_renderer.h index 90b68f1c..51f60557 100644 --- a/include/sway/desktop/fx_renderer/fx_renderer.h +++ b/include/sway/desktop/fx_renderer/fx_renderer.h @@ -33,6 +33,7 @@ struct decoration_data { float *dim_color; bool has_titlebar; bool blur; + bool shadow; }; struct blur_shader { diff --git a/include/sway/layer_criteria.h b/include/sway/layer_criteria.h new file mode 100644 index 00000000..f0906460 --- /dev/null +++ b/include/sway/layer_criteria.h @@ -0,0 +1,20 @@ +#include <stdbool.h> +#include "sway/layers.h" +#include "sway/config.h" + +struct layer_criteria { + char *namespace; + char *cmdlist; +}; + +void layer_criteria_destroy(struct layer_criteria *criteria); + +bool layer_criteria_is_equal(struct layer_criteria *a, struct layer_criteria *b); + +bool layer_criteria_already_exists(struct layer_criteria *criteria); + +// Gathers all of the matching criterias for a specified `sway_layer_surface` +list_t *layer_criterias_for_sway_layer_surface(struct sway_layer_surface *sway_layer); + +// Parses the `layer_criteria` and applies the effects to the `sway_layer_surface` +void layer_criteria_parse(struct sway_layer_surface *sway_layer, struct layer_criteria *criteria); diff --git a/include/sway/layers.h b/include/sway/layers.h index f8508493..b04990dc 100644 --- a/include/sway/layers.h +++ b/include/sway/layers.h @@ -27,6 +27,10 @@ struct sway_layer_surface { enum zwlr_layer_shell_v1_layer layer; struct wl_list subsurfaces; + + bool has_shadow; + bool has_blur; + int corner_radius; }; struct sway_layer_popup { diff --git a/include/sway/output.h b/include/sway/output.h index 65f7ca1a..3215c853 100644 --- a/include/sway/output.h +++ b/include/sway/output.h @@ -13,6 +13,12 @@ struct sway_server; struct sway_container; +struct render_data { + pixman_region32_t *damage; + struct wlr_box *clip_box; + struct decoration_data deco_data; +}; + struct sway_output_state { list_t *workspaces; struct sway_workspace *active_workspace; |