blob: a3d05e37db383da89a88ef944f8d31dcd71f041d [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001/*
2 * Copyright 2011 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
yangsu@google.comc5aeccd2011-07-17 14:42:08 +00007#import <OpenGLES/EAGL.h>
8#import <OpenGLES/ES1/gl.h>
9#import <OpenGLES/ES1/glext.h>
10#import <OpenGLES/ES2/gl.h>
11#import <OpenGLES/ES2/glext.h>
yangsu@google.com2ba30c02011-07-19 15:17:44 +000012#import <QuartzCore/QuartzCore.h>
13#import <UIKit/UIKit.h>
yangsu@google.com688823f2011-08-30 19:14:13 +000014#include "SkWindow.h"
yangsu@google.comc5aeccd2011-07-17 14:42:08 +000015class SkOSWindow;
16class SkEvent;
yangsu@google.com59870452011-08-02 13:20:22 +000017@class SkUIView;
18
19@protocol SkUIViewOptionsDelegate <NSObject>
20@optional
21// Called when the view needs to handle adding an SkOSMenu
22- (void) view:(SkUIView*)view didAddMenu:(const SkOSMenu*)menu;
caryclark@google.com867cbd82012-09-20 15:45:41 +000023- (void) view:(SkUIView*)view didUpdateMenu:(SkOSMenu*)menu;
yangsu@google.com59870452011-08-02 13:20:22 +000024@end
25
26@interface SkUIView : UIView {
yangsu@google.comc5aeccd2011-07-17 14:42:08 +000027 UINavigationItem* fTitleItem;
yangsu@google.com59870452011-08-02 13:20:22 +000028 SkOSWindow* fWind;
yangsu@google.com59870452011-08-02 13:20:22 +000029 id<SkUIViewOptionsDelegate> fOptionsDelegate;
yangsu@google.comc5aeccd2011-07-17 14:42:08 +000030}
31
yangsu@google.com59870452011-08-02 13:20:22 +000032@property (nonatomic, readonly) SkOSWindow *fWind;
yangsu@google.comc5aeccd2011-07-17 14:42:08 +000033@property (nonatomic, retain) UINavigationItem* fTitleItem;
yangsu@google.com59870452011-08-02 13:20:22 +000034@property (nonatomic, assign) id<SkUIViewOptionsDelegate> fOptionsDelegate;
yangsu@google.com2ba30c02011-07-19 15:17:44 +000035
yangsu@google.com688823f2011-08-30 19:14:13 +000036- (id)initWithDefaults;
37- (void)setUpWindow;
yangsu@google.com2ba30c02011-07-19 15:17:44 +000038- (void)forceRedraw;
yangsu@google.com688823f2011-08-30 19:14:13 +000039- (void)drawInRaster;
yangsu@google.comc5aeccd2011-07-17 14:42:08 +000040
41- (void)setSkTitle:(const char*)title;
yangsu@google.com59870452011-08-02 13:20:22 +000042- (void)onAddMenu:(const SkOSMenu*)menu;
caryclark@google.com867cbd82012-09-20 15:45:41 +000043- (void)onUpdateMenu:(SkOSMenu*)menu;
yangsu@google.comc5aeccd2011-07-17 14:42:08 +000044- (void)postInvalWithRect:(const SkIRect*)rectOrNil;
45- (BOOL)onHandleEvent:(const SkEvent&)event;
rmistry@google.combda03db2012-08-14 20:27:54 +000046@end