From e68c2fb4be6096f3dffbefe56696ba9e864446fc Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sat, 2 Jul 2022 00:52:59 +0200 Subject: gui: implement container Containers, somewhat inspired by GtkBox, allow to packed other GUI elements into a single row or column. --- src/gui/inc/gui/container.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/gui/inc/gui/container.h (limited to 'src/gui/inc') diff --git a/src/gui/inc/gui/container.h b/src/gui/inc/gui/container.h new file mode 100644 index 0000000..d290424 --- /dev/null +++ b/src/gui/inc/gui/container.h @@ -0,0 +1,34 @@ +#ifndef GUI_CONTAINER_H +#define GUI_CONTAINER_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +struct gui_container +{ + struct gui_common common; + short w, h; + + enum + { + GUI_CONTAINER_MODE_H, + GUI_CONTAINER_MODE_V + } mode; +}; + +UTIL_STATIC_ASSERT(!offsetof(struct gui_container, common), + "unexpected offset for struct gui_container"); + +void gui_container_init(struct gui_container *c); + +#ifdef __cplusplus +} +#endif + +#endif /* GUI_CONTAINER_H */ -- cgit v1.2.3