GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_widget_class_bool.h
Go to the documentation of this file.
1//SPDX-License-Identifier: LGPL-2.0-or-later
2
3/*
4
5 Copyright (c) 2014-2024 Cyril Hrubis <metan@ucw.cz>
6
7 */
8
16#ifndef GP_WIDGET_CLASS_BOOL_H
17#define GP_WIDGET_CLASS_BOOL_H
18
19typedef struct gp_widget_bool {
21 bool val;
23 char payload[];
24} gp_widget_class_bool;
25
33#define GP_WIDGET_CLASS_BOOL(widget) ((gp_widget_class_bool *)GP_WIDGET_PAYLOAD(widget))
34
42#define GP_WIDGET_CLASS_BOOL_PAYLOAD(widget) \
43 ((void*)(((gp_widget_class_bool *)GP_WIDGET_PAYLOAD(widget))->payload))
44
52
59void gp_widget_bool_set(gp_widget *self, bool val);
60
66static inline void gp_widget_bool_toggle(gp_widget *self)
67{
69}
70
71#endif /* GP_WIDGET_CLASS_BOOL_H */
bool gp_widget_bool_get(gp_widget *self)
Returns a class bool widget value.
static void gp_widget_bool_toggle(gp_widget *self)
Toggles a class bool widget value.
void gp_widget_bool_set(gp_widget *self, bool val)
Sets a class bool widget value.
A widget base.
Definition gp_widget.h:28