2015-07-31 21:33:49 -05:00
|
|
|
// 31 july 2015
|
|
|
|
#import <Cocoa/Cocoa.h>
|
2015-07-31 22:06:29 -05:00
|
|
|
#import <stdint.h>
|
|
|
|
|
2015-08-02 10:25:39 -05:00
|
|
|
typedef struct tAutoLayoutParams tAutoLayoutParams;
|
|
|
|
|
2015-08-02 17:43:50 -05:00
|
|
|
// TODO stretchy across both dimensions
|
|
|
|
// for a vertical box, the horizontal width should be variable
|
2015-08-02 10:25:39 -05:00
|
|
|
struct tAutoLayoutParams {
|
2015-08-02 20:34:54 -05:00
|
|
|
NSView *view;
|
|
|
|
BOOL attachLeft;
|
|
|
|
BOOL attachTop;
|
|
|
|
BOOL attachRight;
|
|
|
|
BOOL attachBottom;
|
2015-08-02 10:25:39 -05:00
|
|
|
};
|
|
|
|
|
2015-07-31 22:06:29 -05:00
|
|
|
@protocol tControl
|
|
|
|
@required
|
2015-08-02 17:16:44 -05:00
|
|
|
- (void)tSetParent:(id<tControl>)p addToView:(NSView *)v relayout:(BOOL)relayout;
|
2015-08-02 10:25:39 -05:00
|
|
|
- (void)tFillAutoLayout:(tAutoLayoutParams *)p;
|
2015-08-01 21:13:41 -05:00
|
|
|
- (void)tRelayout;
|
2015-07-31 22:06:29 -05:00
|
|
|
@end
|
|
|
|
|
2015-08-01 14:21:03 -05:00
|
|
|
@interface tWindow : NSObject<tControl>
|
2015-08-01 13:22:45 -05:00
|
|
|
- (void)tSetControl:(id<tControl>)cc;
|
2015-08-01 14:44:06 -05:00
|
|
|
- (void)tSetMargined:(BOOL)m;
|
2015-08-01 14:21:03 -05:00
|
|
|
- (void)tShow;
|
2015-08-01 11:43:54 -05:00
|
|
|
@end
|
|
|
|
|
2015-08-01 13:22:45 -05:00
|
|
|
@interface tBox : NSObject<tControl>
|
2015-08-03 10:22:14 -05:00
|
|
|
- (id)tInitVertical:(BOOL)vert spaced:(BOOL)sp;
|
2015-08-01 13:22:45 -05:00
|
|
|
- (void)tAddControl:(id<tControl>)c stretchy:(BOOL)s;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface tButton : NSObject<tControl>
|
|
|
|
- (id)tInitWithText:(NSString *)text;
|
|
|
|
@end
|
|
|
|
|
2015-08-03 10:14:05 -05:00
|
|
|
@interface tEntry : NSObject<tControl>
|
|
|
|
@end
|
|
|
|
|
2015-08-01 16:19:45 -05:00
|
|
|
@interface tSpinbox : NSObject<tControl>
|
|
|
|
@end
|
|
|
|
|
2015-07-31 22:06:29 -05:00
|
|
|
extern NSString *tAutoLayoutKey(uintmax_t);
|