gfx/skia/trunk/src/views/mac/SkNSView.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/src/views/mac/SkNSView.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,52 @@
     1.4 +
     1.5 +/*
     1.6 + * Copyright 2011 Google Inc.
     1.7 + *
     1.8 + * Use of this source code is governed by a BSD-style license that can be
     1.9 + * found in the LICENSE file.
    1.10 + */
    1.11 +
    1.12 +#import <QuartzCore/QuartzCore.h>
    1.13 +#import <Cocoa/Cocoa.h>
    1.14 +#import "SkWindow.h"
    1.15 +class SkEvent;
    1.16 +@class SkNSView;
    1.17 +
    1.18 +@protocol SkNSViewOptionsDelegate <NSObject>
    1.19 +@optional
    1.20 +// Called when the view needs to handle adding an SkOSMenu
    1.21 +- (void) view:(SkNSView*)view didAddMenu:(const SkOSMenu*)menu;
    1.22 +- (void) view:(SkNSView*)view didUpdateMenu:(const SkOSMenu*)menu;
    1.23 +@end
    1.24 +
    1.25 +@interface SkNSView : NSView {
    1.26 +    BOOL fRedrawRequestPending;
    1.27 +
    1.28 +    NSString* fTitle;
    1.29 +    SkOSWindow* fWind;
    1.30 +#if SK_SUPPORT_GPU
    1.31 +    NSOpenGLContext* fGLContext;
    1.32 +#endif
    1.33 +    id<SkNSViewOptionsDelegate> fOptionsDelegate;
    1.34 +}
    1.35 +
    1.36 +@property (nonatomic, readonly) SkOSWindow *fWind;
    1.37 +@property (nonatomic, retain) NSString* fTitle;
    1.38 +#if SK_SUPPORT_GPU
    1.39 +@property (nonatomic, retain) NSOpenGLContext* fGLContext;
    1.40 +#endif
    1.41 +@property (nonatomic, assign) id<SkNSViewOptionsDelegate> fOptionsDelegate;
    1.42 +
    1.43 +- (id)initWithDefaults;
    1.44 +- (void)setUpWindow;
    1.45 +- (void)resizeSkView:(NSSize)newSize;
    1.46 +- (void)setSkTitle:(const char*)title;
    1.47 +- (void)onAddMenu:(const SkOSMenu*)menu;
    1.48 +- (void)onUpdateMenu:(const SkOSMenu*)menu;
    1.49 +- (void)postInvalWithRect:(const SkIRect*)rectOrNil;
    1.50 +- (BOOL)onHandleEvent:(const SkEvent&)event;
    1.51 +
    1.52 +- (bool)attach:(SkOSWindow::SkBackEndTypes)attachType withMSAASampleCount:(int) sampleCount andGetInfo:(SkOSWindow::AttachmentInfo*) info;
    1.53 +- (void)detach;
    1.54 +- (void)present;
    1.55 +@end

mercurial