michael@0: michael@0: /* michael@0: * Copyright 2011 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #import michael@0: #import michael@0: #import "SkWindow.h" michael@0: class SkEvent; michael@0: @class SkNSView; michael@0: michael@0: @protocol SkNSViewOptionsDelegate michael@0: @optional michael@0: // Called when the view needs to handle adding an SkOSMenu michael@0: - (void) view:(SkNSView*)view didAddMenu:(const SkOSMenu*)menu; michael@0: - (void) view:(SkNSView*)view didUpdateMenu:(const SkOSMenu*)menu; michael@0: @end michael@0: michael@0: @interface SkNSView : NSView { michael@0: BOOL fRedrawRequestPending; michael@0: michael@0: NSString* fTitle; michael@0: SkOSWindow* fWind; michael@0: #if SK_SUPPORT_GPU michael@0: NSOpenGLContext* fGLContext; michael@0: #endif michael@0: id fOptionsDelegate; michael@0: } michael@0: michael@0: @property (nonatomic, readonly) SkOSWindow *fWind; michael@0: @property (nonatomic, retain) NSString* fTitle; michael@0: #if SK_SUPPORT_GPU michael@0: @property (nonatomic, retain) NSOpenGLContext* fGLContext; michael@0: #endif michael@0: @property (nonatomic, assign) id fOptionsDelegate; michael@0: michael@0: - (id)initWithDefaults; michael@0: - (void)setUpWindow; michael@0: - (void)resizeSkView:(NSSize)newSize; michael@0: - (void)setSkTitle:(const char*)title; michael@0: - (void)onAddMenu:(const SkOSMenu*)menu; michael@0: - (void)onUpdateMenu:(const SkOSMenu*)menu; michael@0: - (void)postInvalWithRect:(const SkIRect*)rectOrNil; michael@0: - (BOOL)onHandleEvent:(const SkEvent&)event; michael@0: michael@0: - (bool)attach:(SkOSWindow::SkBackEndTypes)attachType withMSAASampleCount:(int) sampleCount andGetInfo:(SkOSWindow::AttachmentInfo*) info; michael@0: - (void)detach; michael@0: - (void)present; michael@0: @end