#import "toolkit.h"
#import "../ui/container.h"
#define ui_lb2bool(b) ((b) == UI_LAYOUT_TRUE ? TRUE : FALSE)
#define ui_bool2lb(b) ((b) ? UI_LAYOUT_TRUE : UI_LAYOUT_FALSE)
typedef struct UiLayout UiLayout;
typedef enum UiLayoutBool UiLayoutBool;
enum UiLayoutBool {
UI_LAYOUT_UNDEFINED = 0,
UI_LAYOUT_TRUE,
UI_LAYOUT_FALSE,
};
struct UiLayout {
UiTri fill;
UiBool hexpand;
UiBool vexpand;
UiBool hfill;
UiBool vfill;
int colspan;
int rowspan;
};
#define UI_INIT_LAYOUT(args) (UiLayout) {\
.fill = args.fill, \
.hexpand = args.hexpand, \
.vexpand = args.vexpand, \
.hfill = args.hfill, \
.vfill = args.vfill, \
.colspan = args.colspan, \
.rowspan = args.rowspan }
@protocol Container
@property UiLayout uilayout;
@property const char *label;
@property UiBool newline;
- (void) addView:(NSView*)view fill:(BOOL)fill;
@end
@interface BoxContainer : NSStackView<Container>
- (BoxContainer*)init:(NSUserInterfaceLayoutOrientation)orientation spacing:(int)spacing;
@end
UiContainerX* ui_create_container(UiObject *obj, id<Container> container);
void ui_container_add(UiObject *obj, NSView *view, UiLayout *layout, UiBool fill);