--- a/ui/cocoa/container.h Sat Oct 04 14:54:25 2025 +0200 +++ b/ui/cocoa/container.h Sun Oct 19 21:20:08 2025 +0200 @@ -30,30 +30,9 @@ #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 { - UiBool fill; - //UiBool newline; - //char *label; - UiBool hexpand; - UiBool vexpand; - UiBool hfill; - UiBool vfill; - //int width; - int colspan; - int rowspan; -}; #define UI_INIT_LAYOUT(args) (UiLayout) {\ .fill = args->fill, \ @@ -61,21 +40,38 @@ .vexpand = args->vexpand, \ .hfill = args->hfill, \ .vfill = args->vfill, \ + .margin = args->margin, \ + .margin_left = args->margin_left, \ + .margin_right = args->margin_right, \ + .margin_top = args->margin_top, \ + .margin_bottom = args->margin_bottom, \ .colspan = args->colspan, \ .rowspan = args->rowspan } @protocol Container -@property UiLayout uilayout; -@property const char *label; -@property UiBool newline; +@property UiContainerX *container; -- (void) addView:(NSView*)view; +- (void) addView:(NSView*)view layout:(UiLayout*)layout; @end +@interface FrameContainer : NSBox<Container> + +- (id)init:(NSString*)title; + +@end + +@interface ScrollViewContainer : NSScrollView<Container> + +@property NSView<Container> *child; + +- (id)init:(UiSubContainerType)subContainer columnSpacing:(int)columnSpacing rowSpacing:(int)rowSpacing; + +@end + UiContainerX* ui_create_container(UiObject *obj, id<Container> container);