diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-07-02 00:52:59 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-07-02 00:53:03 +0200 |
| commit | e68c2fb4be6096f3dffbefe56696ba9e864446fc (patch) | |
| tree | 34ecb575a7f021f8144baa481bd17f254830d833 /src/gui/inc | |
| parent | 04b9219ee53c76bdde29a0e899c6affac72c430d (diff) | |
| download | rts-e68c2fb4be6096f3dffbefe56696ba9e864446fc.tar.gz | |
gui: implement container
Containers, somewhat inspired by GtkBox, allow to packed other GUI
elements into a single row or column.
Diffstat (limited to 'src/gui/inc')
| -rw-r--r-- | src/gui/inc/gui/container.h | 34 |
1 files changed, 34 insertions, 0 deletions
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 <gui.h> +#include <util.h> +#include <stddef.h> + +#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 */ |
