From f10d68879e358a2642573d408bbc47f1c759d387 Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Sat, 13 Jul 2024 00:12:09 +0200 Subject: Separate block infos --- src/blocks/group.c | 15 +++++++++++++++ src/blocks/info.h | 10 ++++++++++ src/blocks/text.c | 16 ++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 src/blocks/group.c create mode 100644 src/blocks/info.h create mode 100644 src/blocks/text.c (limited to 'src/blocks') diff --git a/src/blocks/group.c b/src/blocks/group.c new file mode 100644 index 0000000..00afb00 --- /dev/null +++ b/src/blocks/group.c @@ -0,0 +1,15 @@ +#include "info.h" + +static const config_entry_t block_group_entries[] = { + { "spacing", CONFIG_INT, offsetof(block_t, group.spacing) }, + { 0 }, +}; + +// TODO +const config_block_t block_group_info = { + .type_name = "group", + .type_size = 0, + .base = { 0 }, + .entries = block_group_entries, + .apply = NULL, +}; diff --git a/src/blocks/info.h b/src/blocks/info.h new file mode 100644 index 0000000..c5ea38e --- /dev/null +++ b/src/blocks/info.h @@ -0,0 +1,10 @@ +#ifndef COMET_BLOCKS_H +#define COMET_BLOCKS_H + +#include "../config.h" + +extern const config_block_t block_text_info; + +extern const config_block_t block_group_info; + +#endif diff --git a/src/blocks/text.c b/src/blocks/text.c new file mode 100644 index 0000000..74df3c3 --- /dev/null +++ b/src/blocks/text.c @@ -0,0 +1,16 @@ +#include "info.h" + +static const config_entry_t block_text_entries[] = { + { "text", CONFIG_STRING, offsetof(block_t, text.text) }, + { "text-color", CONFIG_COLOR, offsetof(block_t, text.text_color) }, + { "text-size", CONFIG_INT, offsetof(block_t, text.text_size) }, + { 0 }, +}; + +const config_block_t block_text_info = { + .type_name = "text", + .type_size = 0, + .base = { 0 }, + .entries = block_text_entries, + .apply = NULL, +}; -- cgit v1.2.3