blob: b5a4cd8ed8ee335c2164565581b20f968176d98a [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
2/*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
reed@google.comac10a2d2010-12-22 21:39:39 +00008#import <UIKit/UIKit.h>
9
10#include "SkMatrix.h"
11#include "FlingState.h"
12
13#import <OpenGLES/EAGL.h>
14#import <OpenGLES/ES1/gl.h>
15#import <OpenGLES/ES1/glext.h>
16
17class SkOSWindow;
18class SkEvent;
19
20@interface SkUIView : UIView <UIAccelerometerDelegate> {
21 BOOL fRedrawRequestPending;
reed@google.comac10a2d2010-12-22 21:39:39 +000022 SkMatrix fMatrix, fLocalMatrix;
23 bool fNeedGestureEnded;
24
25 SkMatrix fRotateMatrix;
26
27 float fFirstPinchX, fFirstPinchY;
28 bool fNeedFirstPinch;
29
30 float fZoomAroundX, fZoomAroundY;
31 bool fZoomAround;
32
33 FlingState fFlingState;
34
35 GrAnimateFloat fWarpState;
36 bool fUseWarp;
37
38 struct {
39 EAGLContext* fContext;
40 GLuint fRenderbuffer;
41 GLuint fStencilbuffer;
42 GLuint fFramebuffer;
43 GLint fWidth;
44 GLint fHeight;
45 } fGL;
46
yangsu@google.combd3e3202011-07-13 22:05:00 +000047 UINavigationItem* fTitle;
48 SkOSWindow* fWind;
reed@google.comac10a2d2010-12-22 21:39:39 +000049}
50
51@property (nonatomic, assign) SkOSWindow *fWind;
yangsu@google.combd3e3202011-07-13 22:05:00 +000052@property (nonatomic, retain) UINavigationItem* fTitle;
reed@google.comac10a2d2010-12-22 21:39:39 +000053@property (nonatomic, assign) Backend fBackend;
54@property (nonatomic, assign) bool fComplexClip;
55@property (nonatomic, assign, setter=setWarpState) bool fUseWarp;
56
yangsu@google.combd3e3202011-07-13 22:05:00 +000057- (void)initGestures;
58- (void)flushLocalMatrix;
59
reed@google.comac10a2d2010-12-22 21:39:39 +000060- (void)setSkTitle:(const char*)title;
61- (void)postInvalWithRect:(const SkIRect*)rectOrNil;
62- (BOOL)onHandleEvent:(const SkEvent&)event;
63
64@end
65