2015-04-06 18:04:13 -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-15 17:51:04 -05:00
|
|
|
#import "../uipriv.h"
|
|
|
|
#import "../ui_darwin.h"
|
2015-04-06 18:04:13 -05:00
|
|
|
|
2015-04-06 19:01:14 -05:00
|
|
|
#define toNSString(str) [NSString stringWithUTF8String:(str)]
|
2015-04-09 10:54:02 -05:00
|
|
|
#define fromNSString(str) [(str) UTF8String]
|
2015-04-06 19:01:14 -05:00
|
|
|
|
2015-04-08 14:53:50 -05:00
|
|
|
#define uiLogObjCClassAllocations \
|
2015-04-08 01:28:42 -05:00
|
|
|
+ (id)alloc \
|
2015-04-07 23:26:49 -05:00
|
|
|
{ \
|
2015-04-08 01:28:42 -05:00
|
|
|
id thing; \
|
|
|
|
thing = [super alloc]; \
|
2015-04-09 21:38:11 -05:00
|
|
|
if (options.debugLogAllocations) \
|
|
|
|
fprintf(stderr, "%p alloc %s\n", thing, [[self className] UTF8String]); \
|
2015-04-08 01:28:42 -05:00
|
|
|
return thing; \
|
2015-04-07 23:26:49 -05:00
|
|
|
} \
|
|
|
|
- (void)dealloc \
|
|
|
|
{ \
|
|
|
|
[super dealloc]; \
|
2015-04-09 21:38:11 -05:00
|
|
|
if (options.debugLogAllocations) \
|
|
|
|
fprintf(stderr, "%p free\n", self); \
|
2015-04-07 23:26:49 -05:00
|
|
|
}
|
|
|
|
|
2015-04-17 17:20:14 -05:00
|
|
|
#define VIEW(c) uiControlHandle(uiControl(c))
|
|
|
|
|
2015-04-10 22:22:46 -05:00
|
|
|
// init_darwin.m
|
2015-04-10 22:24:21 -05:00
|
|
|
extern NSView *destroyedControlsView;
|
2015-04-10 22:22:46 -05:00
|
|
|
|
2015-04-07 15:12:28 -05:00
|
|
|
// util_darwin.m
|
|
|
|
extern void setStandardControlFont(NSControl *);
|
2015-04-10 16:06:59 -05:00
|
|
|
extern void disableAutocorrect(NSTextView *);
|
2015-04-07 15:12:28 -05:00
|
|
|
|
2015-04-13 11:53:05 -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
|
2015-04-11 22:49:34 -05:00
|
|
|
|
|
|
|
// entry_darwin.m
|
|
|
|
extern void finishNewTextField(NSTextField *, BOOL);
|