BSB Developer Docs
Loading...
Searching...
No Matches
flex_layout.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <gui/widget.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
16typedef struct FlexLayout FlexLayout;
17
24
34
44
50void flex_layout_free(FlexLayout* instance);
51
61
68void flex_layout_set_spacing(FlexLayout* instance, int32_t spacing);
69
76void flex_layout_set_wrap(FlexLayout* instance, bool wrap);
77
86void flex_layout_set_reverse(FlexLayout* instance, bool reverse);
87
101 FlexLayout* instance,
102 FlexLayoutAlign main,
103 FlexLayoutAlign cross,
104 FlexLayoutAlign track_cross);
105
113void flex_layout_set_child_widget_grow(FlexLayout* instance, Widget* child, uint8_t grow);
114#ifdef __cplusplus
115}
116#endif
void flex_layout_set_align(FlexLayout *instance, FlexLayoutAlign main, FlexLayoutAlign cross, FlexLayoutAlign track_cross)
Sets alignment, distribution and placement of child items.
Definition flex_layout.c:100
Widget * flex_layout_get_base(FlexLayout *instance)
Get a pointer to the base class instance.
Definition flex_layout.c:53
void flex_layout_set_child_widget_grow(FlexLayout *instance, Widget *child, uint8_t grow)
Set how much space child widget will take in flex layout.
Definition flex_layout.c:121
void flex_layout_set_reverse(FlexLayout *instance, bool reverse)
Set the order of elements a FlexLayout instance.
Definition flex_layout.c:85
void flex_layout_free(FlexLayout *instance)
Delete a FlexLayout instance.
Definition flex_layout.c:48
FlexLayout * flex_layout_alloc(Widget *parent, FlexLayoutType type)
Create a new FlexLayout instance.
Definition flex_layout.c:36
void flex_layout_set_spacing(FlexLayout *instance, int32_t spacing)
Set the spacing between child elements.
Definition flex_layout.c:58
FlexLayoutAlign
Enumeration of possible item alignments.
Definition flex_layout.h:26
@ FlexLayoutAlignStart
Align items to start of axis.
Definition flex_layout.h:27
@ FlexLayoutAlignEnd
Align items to start of axis.
Definition flex_layout.h:28
@ FlexLayoutAlignSpaceBetween
Distribute items evenly along axis, with equal spacing between them, and zero spacing between them an...
Definition flex_layout.h:32
@ FlexLayoutAlignCenter
Align items to middle of axis.
Definition flex_layout.h:29
@ FlexLayoutAlignSpaceEvenly
Distribute items evenly along axis, with equal spacing between them, and equal spacing between them a...
Definition flex_layout.h:30
@ FlexLayoutAlignSpaceAround
Distribute items evenly along axis, with equal spacing between them, and half spacing between them an...
Definition flex_layout.h:31
FlexLayoutType
Enumeration of possible flow types.
Definition flex_layout.h:19
@ FlexLayoutTypeMax
Special value, not to be used in user code.
Definition flex_layout.h:22
@ FlexLayoutTypeColumn
Arrange elements in a column.
Definition flex_layout.h:21
@ FlexLayoutTypeRow
Arrange elements in a row.
Definition flex_layout.h:20
void flex_layout_set_wrap(FlexLayout *instance, bool wrap)
Set the wrap behaviour of a FlexLayout instance.
Definition flex_layout.c:70
struct FlexLayout FlexLayout
FlexLayout opaque structure.
Definition flex_layout.h:16
Definition widget_i.h:35
Base widget class.