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 | c10ca65109c02f239e95ebaf20fde708bcf3dc38 (patch) | |
| tree | 00faa142ef96d3a17e19357ca4a32da9f8b4646e /src/gui/inc | |
| parent | fa766deaf43fd8bcd3e264d2bb9199f854036a8d (diff) | |
| download | jancity-c10ca65109c02f239e95ebaf20fde708bcf3dc38.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 */ |
