2011-07-28 14:26:00 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2011 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
2011-07-17 14:42:08 +00:00
|
|
|
#import <OpenGLES/EAGL.h>
|
|
|
|
#import <OpenGLES/ES1/gl.h>
|
|
|
|
#import <OpenGLES/ES1/glext.h>
|
|
|
|
#import <OpenGLES/ES2/gl.h>
|
|
|
|
#import <OpenGLES/ES2/glext.h>
|
2011-07-19 15:17:44 +00:00
|
|
|
#import <QuartzCore/QuartzCore.h>
|
|
|
|
#import <UIKit/UIKit.h>
|
2011-07-17 14:42:08 +00:00
|
|
|
#include "SkMatrix.h"
|
|
|
|
#include "FlingState.h"
|
|
|
|
#include "SampleApp.h"
|
2011-08-08 15:12:05 +00:00
|
|
|
|
|
|
|
class SkiOSDeviceManager;
|
2011-07-17 14:42:08 +00:00
|
|
|
class SkOSWindow;
|
|
|
|
class SkEvent;
|
|
|
|
struct FPSState;
|
2011-08-02 13:20:22 +00:00
|
|
|
@class SkUIView;
|
2011-07-17 14:42:08 +00:00
|
|
|
|
2011-08-02 13:20:22 +00:00
|
|
|
@protocol SkUIViewOptionsDelegate <NSObject>
|
|
|
|
@optional
|
|
|
|
// Called when the view needs to handle adding an SkOSMenu
|
|
|
|
- (void) view:(SkUIView*)view didAddMenu:(const SkOSMenu*)menu;
|
|
|
|
- (void) view:(SkUIView*)view didUpdateMenu:(const SkOSMenu*)menu;
|
|
|
|
@end
|
2011-07-17 14:42:08 +00:00
|
|
|
|
2011-08-02 13:20:22 +00:00
|
|
|
@interface SkUIView : UIView {
|
|
|
|
BOOL fRedrawRequestPending;
|
2011-08-08 15:12:05 +00:00
|
|
|
|
2011-07-17 14:42:08 +00:00
|
|
|
struct {
|
|
|
|
EAGLContext* fContext;
|
|
|
|
GLuint fRenderbuffer;
|
|
|
|
GLuint fStencilbuffer;
|
|
|
|
GLuint fFramebuffer;
|
|
|
|
GLint fWidth;
|
|
|
|
GLint fHeight;
|
|
|
|
} fGL;
|
2011-07-19 15:17:44 +00:00
|
|
|
|
2011-07-17 14:42:08 +00:00
|
|
|
NSString* fTitle;
|
|
|
|
UINavigationItem* fTitleItem;
|
2011-07-19 15:17:44 +00:00
|
|
|
CALayer* fRasterLayer;
|
|
|
|
CAEAGLLayer* fGLLayer;
|
2011-07-17 14:42:08 +00:00
|
|
|
|
2011-08-02 13:20:22 +00:00
|
|
|
FPSState* fFPSState;
|
|
|
|
SkOSWindow* fWind;
|
2011-07-17 14:42:08 +00:00
|
|
|
SkiOSDeviceManager* fDevManager;
|
2011-08-02 13:20:22 +00:00
|
|
|
|
|
|
|
id<SkUIViewOptionsDelegate> fOptionsDelegate;
|
2011-07-17 14:42:08 +00:00
|
|
|
}
|
|
|
|
|
2011-08-02 13:20:22 +00:00
|
|
|
@property (nonatomic, readonly) SkOSWindow *fWind;
|
2011-07-17 14:42:08 +00:00
|
|
|
@property (nonatomic, retain) UINavigationItem* fTitleItem;
|
|
|
|
@property (nonatomic, copy) NSString* fTitle;
|
2011-07-19 15:17:44 +00:00
|
|
|
@property (nonatomic, retain) CALayer* fRasterLayer;
|
|
|
|
@property (nonatomic, retain) CAEAGLLayer* fGLLayer;
|
2011-08-02 13:20:22 +00:00
|
|
|
@property (nonatomic, assign) id<SkUIViewOptionsDelegate> fOptionsDelegate;
|
2011-07-19 15:17:44 +00:00
|
|
|
|
|
|
|
- (void)forceRedraw;
|
2011-07-17 14:42:08 +00:00
|
|
|
|
|
|
|
- (void)setSkTitle:(const char*)title;
|
2011-08-02 13:20:22 +00:00
|
|
|
- (void)onAddMenu:(const SkOSMenu*)menu;
|
|
|
|
- (void)onUpdateMenu:(const SkOSMenu*)menu;
|
2011-07-17 14:42:08 +00:00
|
|
|
- (void)postInvalWithRect:(const SkIRect*)rectOrNil;
|
|
|
|
- (BOOL)onHandleEvent:(const SkEvent&)event;
|
2011-08-02 13:20:22 +00:00
|
|
|
@end
|