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
19#include <core/gp_compiler.h>
20
21typedef struct gp_widget_bool {
23 bool val;
25 char payload[] GP_ALIGNED;
26} gp_widget_class_bool;
27
35#define GP_WIDGET_CLASS_BOOL(widget) ((gp_widget_class_bool *)GP_WIDGET_PAYLOAD(widget))
36
44#define GP_WIDGET_CLASS_BOOL_PAYLOAD(widget) \
45 ((void*)(((gp_widget_class_bool *)GP_WIDGET_PAYLOAD(widget))->payload))
46
54
61void gp_widget_bool_set(gp_widget *self, bool val);
62
68static inline void gp_widget_bool_toggle(gp_widget *self)
69{
71}
72
73#endif /* GP_WIDGET_CLASS_BOOL_H */
A compiler dependent macros.
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:29