testonly = true
}
- if (is_linux || is_win) {
+ if (is_linux || is_win || is_mac) {
executable("SampleApp") {
sources = [
"samplecode/SampleApp.cpp",
#import <QuartzCore/QuartzCore.h>
#import <Cocoa/Cocoa.h>
#import "SkWindow.h"
+
class SkEvent;
@class SkNSView;
- (void) view:(SkNSView*)view didUpdateMenu:(const SkOSMenu*)menu;
@end
-@interface SkNSView : NSView {
- BOOL fRedrawRequestPending;
-
- NSString* fTitle;
- SkOSWindow* fWind;
-#if SK_SUPPORT_GPU
- NSOpenGLContext* fGLContext;
-#endif
- id<SkNSViewOptionsDelegate> fOptionsDelegate;
-}
-
-@property (nonatomic, readonly) SkOSWindow *fWind;
+@interface SkNSView : NSView
@property (nonatomic, retain) NSString* fTitle;
#if SK_SUPPORT_GPU
@property (nonatomic, retain) NSOpenGLContext* fGLContext;
- (void)freeNativeWind;
@end
+
+@interface SkNSView()
+ @property (nonatomic, readwrite) SkOSWindow *fWind;
+@end
@implementation SkNSView
@synthesize fWind, fTitle, fOptionsDelegate, fGLContext;
+BOOL fRedrawRequestPending;
+
- (id)initWithCoder:(NSCoder*)coder {
if ((self = [super initWithCoder:coder])) {
self = [self initWithDefaults];
* found in the LICENSE file.
*/
-#if defined(SK_BUILD_FOR_MAC)
-
#import <Cocoa/Cocoa.h>
#include "SkOSWindow_Mac.h"
#include "SkOSMenu.h"
return true;
}
-
-#endif
}
- (void)dealloc {
- delete fWind;
+ delete self.fWind;
[super dealloc];
}
- (void)begin {
- fWind = create_sk_window(self, *_NSGetArgc(), *_NSGetArgv());
+ self.fWind = create_sk_window(self, *_NSGetArgc(), *_NSGetArgv());
[self setUpWindow];
}
@end