3 * Copyright 2011 Google Inc.
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
9 #import <QuartzCore/QuartzCore.h>
10 #import <Cocoa/Cocoa.h>
15 @protocol SkNSViewOptionsDelegate <NSObject>
17 // Called when the view needs to handle adding an SkOSMenu
18 - (void) view:(SkNSView*)view didAddMenu:(const SkOSMenu*)menu;
19 - (void) view:(SkNSView*)view didUpdateMenu:(const SkOSMenu*)menu;
22 @interface SkNSView : NSView {
23 BOOL fRedrawRequestPending;
28 NSOpenGLContext* fGLContext;
30 id<SkNSViewOptionsDelegate> fOptionsDelegate;
33 @property (nonatomic, readonly) SkOSWindow *fWind;
34 @property (nonatomic, retain) NSString* fTitle;
36 @property (nonatomic, retain) NSOpenGLContext* fGLContext;
38 @property (nonatomic, assign) id<SkNSViewOptionsDelegate> fOptionsDelegate;
40 - (id)initWithDefaults;
42 - (void)resizeSkView:(NSSize)newSize;
43 - (void)setSkTitle:(const char*)title;
44 - (void)onAddMenu:(const SkOSMenu*)menu;
45 - (void)onUpdateMenu:(const SkOSMenu*)menu;
46 - (void)postInvalWithRect:(const SkIRect*)rectOrNil;
47 - (BOOL)onHandleEvent:(const SkEvent&)event;
49 - (bool)attach:(SkOSWindow::SkBackEndTypes)attachType withMSAASampleCount:(int) sampleCount andGetInfo:(SkOSWindow::AttachmentInfo*) info;
53 - (void)freeNativeWind;