1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #import "toolkit.h"
30
31 #import "../ui/container.h"
32
33 #define ui_lb2bool(b) ((b) ==
UI_LAYOUT_TRUE ?
TRUE :
FALSE)
34 #define ui_bool2lb(b) ((b) ?
UI_LAYOUT_TRUE :
UI_LAYOUT_FALSE)
35
36 typedef struct UiLayout UiLayout;
37 typedef enum UiLayoutBool UiLayoutBool;
38
39 enum UiLayoutBool {
40 UI_LAYOUT_UNDEFINED =
0,
41 UI_LAYOUT_TRUE,
42 UI_LAYOUT_FALSE,
43 };
44
45 struct UiLayout {
46 UiTri fill;
47
48
49 UiBool hexpand;
50 UiBool vexpand;
51 UiBool hfill;
52 UiBool vfill;
53
54 int colspan;
55 int rowspan;
56 };
57
58 #define UI_INIT_LAYOUT(args) (UiLayout) {\
59 .fill = args.fill, \
60 .hexpand = args.hexpand, \
61 .vexpand = args.vexpand, \
62 .hfill = args.hfill, \
63 .vfill = args.vfill, \
64 .colspan = args.colspan, \
65 .rowspan = args.rowspan }
66
67
68 @protocol Container
69
70 @property UiLayout uilayout;
71 @property
const char *label;
72 @property UiBool newline;
73
74 - (
void) addView:(NSView*)view fill:(
BOOL)fill;
75
76 @end
77
78 @interface BoxContainer : NSStackView<Container>
79
80 - (BoxContainer*)init:(NSUserInterfaceLayoutOrientation)orientation spacing:(
int)spacing;
81
82 @end
83
84
85
86
87
88 UiContainerX* ui_create_container(UiObject *obj, id<Container> container);
89
90 void ui_container_add(UiObject *obj, NSView *view, UiLayout *layout, UiBool fill);
91