From e01acb6097b583fcf2f6d0e0afe1bd878dd9b683 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Sun, 29 Jul 2018 22:42:03 -0400 Subject: swaynag: allow more config options --- include/swaynag/config.h | 2 +- include/swaynag/swaynag.h | 11 ----------- include/swaynag/types.h | 18 ++++++++++++++++-- 3 files changed, 17 insertions(+), 14 deletions(-) (limited to 'include/swaynag') diff --git a/include/swaynag/config.h b/include/swaynag/config.h index 3fd5b3ce..0d8889de 100644 --- a/include/swaynag/config.h +++ b/include/swaynag/config.h @@ -4,7 +4,7 @@ #include "list.h" int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag, - list_t *types, char **config, bool *debug); + list_t *types, struct swaynag_type *type, char **config, bool *debug); char *swaynag_get_config_path(void); diff --git a/include/swaynag/swaynag.h b/include/swaynag/swaynag.h index 6a56f14f..dd6fe0cd 100644 --- a/include/swaynag/swaynag.h +++ b/include/swaynag/swaynag.h @@ -7,15 +7,6 @@ #include "swaynag/types.h" #include "xdg-output-unstable-v1-client-protocol.h" -#define SWAYNAG_BAR_BORDER_THICKNESS 2 -#define SWAYNAG_MESSAGE_PADDING 8 -#define SWAYNAG_DETAILS_BORDER_THICKNESS 3 -#define SWAYNAG_BUTTON_BORDER_THICKNESS 3 -#define SWAYNAG_BUTTON_GAP 20 -#define SWAYNAG_BUTTON_GAP_CLOSE 15 -#define SWAYNAG_BUTTON_MARGIN_RIGHT 2 -#define SWAYNAG_BUTTON_PADDING 3 - #define SWAYNAG_MAX_HEIGHT 500 enum swaynag_action_type { @@ -88,9 +79,7 @@ struct swaynag { struct pool_buffer *current_buffer; struct swaynag_type *type; - uint32_t anchors; char *message; - char *font; list_t *buttons; struct swaynag_details details; }; diff --git a/include/swaynag/types.h b/include/swaynag/types.h index af83bd83..2183ce22 100644 --- a/include/swaynag/types.h +++ b/include/swaynag/types.h @@ -3,11 +3,25 @@ struct swaynag_type { char *name; + + char *font; + char *output; + uint32_t anchors; + uint32_t button_background; uint32_t background; uint32_t text; uint32_t border; uint32_t border_bottom; + + uint32_t bar_border_thickness; + uint32_t message_padding; + uint32_t details_border_thickness; + uint32_t button_border_thickness; + uint32_t button_gap; + uint32_t button_gap_close; + uint32_t button_margin_right; + uint32_t button_padding; }; void swaynag_types_add_default(list_t *types); @@ -16,10 +30,10 @@ struct swaynag_type *swaynag_type_get(list_t *types, char *name); struct swaynag_type *swaynag_type_clone(struct swaynag_type *type); +void swaynag_type_merge(struct swaynag_type *dest, struct swaynag_type *src); + void swaynag_type_free(struct swaynag_type *type); void swaynag_types_free(list_t *types); -int swaynag_parse_type(int argc, char **argv, struct swaynag_type *type); - #endif -- cgit v1.2.3-54-g00ecf