aboutsummaryrefslogtreecommitdiff
path: root/src/gui/inc
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-09-23 04:12:07 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-09-23 04:12:07 +0200
commit0666c70c480c4a258a25802d8bfb87f368a599ea (patch)
tree34bd33e467648469289033adc791739dad7cf672 /src/gui/inc
parent22e89e8a409703dc64fa23b3fdc6975ef5fd04f5 (diff)
downloadjancity-0666c70c480c4a258a25802d8bfb87f368a599ea.tar.gz
Implement checkbox GUI element
Diffstat (limited to 'src/gui/inc')
-rw-r--r--src/gui/inc/gui/checkbox.h34
1 files changed, 34 insertions, 0 deletions
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 <gui.h>
+#include <gfx.h>
+#include <util.h>
+#include <stdbool.h>
+#include <stddef.h>
+
+#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 */