From fe3ed50e1da2bb4ced3172e86a3b244a9c3d4f1c Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Fri, 17 Nov 2023 17:48:03 +0100 Subject: Add buttons and update draw --- src/button.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/button.h (limited to 'src/button.h') diff --git a/src/button.h b/src/button.h new file mode 100644 index 0000000..11b6507 --- /dev/null +++ b/src/button.h @@ -0,0 +1,26 @@ +#ifndef COMET_BUTTON_H +#define COMET_BUTTON_H + +#include + +// TODO: Generic button shapes/actions + +typedef struct Button Button; + +typedef void (* ButtonAction)(Button *btn); + +struct Button { + bool fixed_size; + ButtonAction action; + char *text; +}; + +Button *button_create(const char *text, bool fixed_size); + +void button_set_action(Button *btn, ButtonAction action); + +void button_destroy(Button *btn); + +#endif + +// vim: ts=4 sw=4 et -- cgit v1.2.3