2015-04-28 12:49:20 -05:00
|
|
|
// 6 january 2015
|
|
|
|
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_7
|
|
|
|
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_7
|
|
|
|
#import <Cocoa/Cocoa.h>
|
2015-04-28 13:40:51 -05:00
|
|
|
#import "../ui.h"
|
2015-04-28 12:49:20 -05:00
|
|
|
#import "../ui_darwin.h"
|
2015-04-28 13:40:51 -05:00
|
|
|
#import "../uipriv.h"
|
2015-04-28 12:49:20 -05:00
|
|
|
|
|
|
|
#define toNSString(str) [NSString stringWithUTF8String:(str)]
|
|
|
|
#define fromNSString(str) [(str) UTF8String]
|
|
|
|
|
2015-04-28 13:17:28 -05:00
|
|
|
// These are based on measurements from Interface Builder.
|
|
|
|
// These seem to be based on Auto Layout constants, but I don't see an API that exposes these...
|
|
|
|
#define macXMargin 20
|
|
|
|
#define macYMargin 20
|
|
|
|
|
|
|
|
// menu.m
|
2015-05-03 01:45:59 -05:00
|
|
|
@interface menuManager : NSObject {
|
2015-04-28 19:34:57 -05:00
|
|
|
// unfortunately NSMutableDictionary copies its keys, meaning we can't use it for pointers
|
|
|
|
NSMapTable *items;
|
2015-04-30 22:24:52 -05:00
|
|
|
BOOL hasQuit;
|
|
|
|
BOOL hasPreferences;
|
|
|
|
BOOL hasAbout;
|
2015-04-28 13:17:28 -05:00
|
|
|
}
|
2015-04-28 13:40:51 -05:00
|
|
|
@property (strong) NSMenuItem *quitItem;
|
|
|
|
@property (strong) NSMenuItem *preferencesItem;
|
|
|
|
@property (strong) NSMenuItem *aboutItem;
|
2015-05-03 12:39:54 -05:00
|
|
|
// NSMenuValidation is only informal
|
2015-05-03 01:45:59 -05:00
|
|
|
- (BOOL)validateMenuItem:(NSMenuItem *)item;
|
2015-04-28 13:17:28 -05:00
|
|
|
- (NSMenu *)makeMenubar;
|
|
|
|
@end
|
2015-05-03 20:28:21 -05:00
|
|
|
extern void finalizeMenus(void);
|
2015-05-08 19:31:19 -05:00
|
|
|
extern void uninitMenus(void);
|
2015-04-28 12:49:20 -05:00
|
|
|
|
|
|
|
// init.m
|
2015-05-10 13:27:25 -05:00
|
|
|
@interface applicationClass : NSApplication
|
|
|
|
@end
|
|
|
|
// this is needed because NSApp is of type id, confusing clang
|
|
|
|
#define realNSApp() ((applicationClass *) NSApp)
|
2015-04-28 13:17:28 -05:00
|
|
|
@interface appDelegate : NSObject <NSApplicationDelegate>
|
2015-04-28 13:40:51 -05:00
|
|
|
@property (strong) menuManager *menuManager;
|
2015-04-28 13:17:28 -05:00
|
|
|
@end
|
2015-05-10 13:27:25 -05:00
|
|
|
#define appDelegate() ((appDelegate *) [realNSApp() delegate])
|
2015-04-28 12:49:20 -05:00
|
|
|
|
|
|
|
// util.m
|
|
|
|
extern void setStandardControlFont(NSControl *);
|
|
|
|
extern void disableAutocorrect(NSTextView *);
|
|
|
|
|
|
|
|
// entry.m
|
2015-07-22 22:20:01 -05:00
|
|
|
extern void finishNewTextField(uiControl *, NSTextField *, BOOL);
|
2015-05-03 20:05:55 -05:00
|
|
|
|
|
|
|
// window.m
|
|
|
|
extern uiWindow *windowFromNSWindow(NSWindow *);
|
2015-05-04 19:07:34 -05:00
|
|
|
|
|
|
|
// alloc.m
|
|
|
|
extern void initAlloc(void);
|
2015-05-08 16:51:05 -05:00
|
|
|
extern void uninitAlloc(void);
|
2015-07-11 16:02:01 -05:00
|
|
|
|
|
|
|
// TODO
|
|
|
|
#define PUT_CODE_HERE 0
|