aboutsummaryrefslogtreecommitdiff
path: root/src/block.h
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2024-07-11 13:08:26 +0200
committerFederico Angelilli <code@fedang.net>2024-07-11 13:08:26 +0200
commit226c6b5bf79912b657c7cb4c5a679891030fa453 (patch)
treea465033a13d4d14cb886334f154f8f7af81a3b3e /src/block.h
parent39e0f4e90dccbfb38db14a0cd4f596c1b5006b19 (diff)
Start working on block config
Diffstat (limited to 'src/block.h')
-rw-r--r--src/block.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/block.h b/src/block.h
index 1a91596..b65fa6d 100644
--- a/src/block.h
+++ b/src/block.h
@@ -6,12 +6,7 @@
#include <time.h>
#include "event.h"
-
-// Color representation normalized to [0, 1]
-//
-typedef struct {
- double r, g, b, a;
-} color_t;
+#include "util.h"
// Element or text alignment
//
@@ -51,11 +46,11 @@ struct block {
struct timespec update_last;
block_update_t update_cb;
block_event_t event_cb;
- const char *label;
+ char *label;
block_type_t type;
union {
struct {
- const char *text;
+ char *text;
color_t text_color;
align_t text_align;
int text_size;
@@ -70,4 +65,6 @@ struct block {
void block_update(block_t *block);
+void block_free(block_t *block);
+
#endif