From 0666c70c480c4a258a25802d8bfb87f368a599ea Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Fri, 23 Sep 2022 04:12:07 +0200 Subject: Implement checkbox GUI element --- src/gui/inc/gui/checkbox.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/gui/inc/gui/checkbox.h (limited to 'src/gui/inc') diff --git a/src/gui/inc/gui/checkbox.h b/src/gui/inc/gui/checkbox.h new file mode 100644 index 0000000..bf37f34 --- /dev/null +++ b/src/gui/inc/gui/checkbox.h @@ -0,0 +1,34 @@ +#ifndef GUI_CHECKBOX_H +#define GUI_CHECKBOX_H + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +struct gui_checkbox +{ + struct gui_common common; + bool active; + void *arg; + void (*on_pressed)(bool active, void *arg); +}; + +void gui_checkbox_init(struct gui_checkbox *c); + +extern struct sprite gui_checkbox_sprite; + +UTIL_STATIC_ASSERT(!offsetof(struct gui_checkbox, common), + "unexpected offset for struct gui_checkbox"); + +#ifdef __cplusplus +} +#endif + +#endif /* GUI_CHECKBOX_H */ -- cgit v1.2.3