aboutsummaryrefslogtreecommitdiff
path: root/src/block.h
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2024-11-16 00:38:18 +0100
committerFederico Angelilli <code@fedang.net>2024-11-16 00:38:18 +0100
commit1d8910e9be1811996794cedb71996a9d2dc25fbc (patch)
tree4698ffb3e3101530d45ba4a5191092486e3dd187 /src/block.h
parent9843c8735a5a886252858a848c473cb877875ef4 (diff)
Change event_fn
Diffstat (limited to 'src/block.h')
-rw-r--r--src/block.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/block.h b/src/block.h
index 71db95e..09ef3fc 100644
--- a/src/block.h
+++ b/src/block.h
@@ -30,6 +30,10 @@ typedef struct block block_t;
typedef struct block_scheme block_scheme_t;
+// Regularly called depending on the inverval passed from the last update
+//
+typedef void (*block_update_t)(block_t *block);
+
// Called in layout_init
//
typedef void (*block_layout_t)(block_t *block, layout_t *layout, layout_info_t info);
@@ -42,10 +46,6 @@ typedef void (*block_render_t)(layout_t *layout, cairo_t *cr);
//
typedef void (*block_event_t)(block_t *block, event_t event);
-// Regularly called depending on the inverval passed from the last update
-//
-typedef void (*block_update_t)(block_t *block);
-
// The block struct
//
struct block {
@@ -58,7 +58,6 @@ struct block {
struct timespec update_interval;
struct timespec update_last;
block_update_t update_fn;
- block_event_t event_fn;
// TODO
//gradient_t bg_color;
//gradient_t line_color;
@@ -85,10 +84,13 @@ typedef struct {
bool collapse;
} block_group_t;
+// NOTE: I am not sure this is required anymore since we can just put
+// special function in the scheme
typedef struct {
block_t block;
block_layout_t layout_fn;
block_render_t render_fn;
+ block_event_t event_fn;
} block_spec_t;
// Called to allocate a block with its default state