// 31 july 2015 #import #import typedef struct tAutoLayoutParams tAutoLayoutParams; // TODO stretchy across both dimensions // for a vertical box, the horizontal width should be variable struct tAutoLayoutParams { NSMutableArray *horz; NSMutableArray *horzAttachLeft; NSMutableArray *horzAttachRight; BOOL horzFirst; BOOL horzLast; NSMutableArray *vert; NSMutableArray *vertAttachTop; NSMutableArray *vertAttachBottom; BOOL vertFirst; BOOL vertLast; NSMutableDictionary *views; uintmax_t n; BOOL horzStretchy; BOOL horzFirstStretchy; uintmax_t horzStretchyTo; BOOL vertStretchy; BOOL vertFirstStretchy; uintmax_t vertStretchyTo; }; @protocol tControl @required - (void)tSetParent:(id)p addToView:(NSView *)v relayout:(BOOL)relayout; - (void)tFillAutoLayout:(tAutoLayoutParams *)p; - (void)tRelayout; @end @interface tWindow : NSObject - (void)tSetControl:(id)cc; - (void)tSetMargined:(BOOL)m; - (void)tShow; @end @interface tBox : NSObject - (id)tInitVertical:(BOOL)vert; - (void)tAddControl:(id)c stretchy:(BOOL)s; @end @interface tButton : NSObject - (id)tInitWithText:(NSString *)text; @end @interface tSpinbox : NSObject @end extern NSString *tAutoLayoutKey(uintmax_t);