| epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
| 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.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 8 | #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 | |
| 17 | class SkOSWindow; |
| 18 | class SkEvent; |
| 19 | |
| 20 | @interface SkUIView : UIView <UIAccelerometerDelegate> { |
| 21 | BOOL fRedrawRequestPending; |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 22 | 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.com | bd3e320 | 2011-07-13 22:05:00 +0000 | [diff] [blame] | 47 | UINavigationItem* fTitle; |
| 48 | SkOSWindow* fWind; |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | @property (nonatomic, assign) SkOSWindow *fWind; |
| yangsu@google.com | bd3e320 | 2011-07-13 22:05:00 +0000 | [diff] [blame] | 52 | @property (nonatomic, retain) UINavigationItem* fTitle; |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 53 | @property (nonatomic, assign) Backend fBackend; |
| 54 | @property (nonatomic, assign) bool fComplexClip; |
| 55 | @property (nonatomic, assign, setter=setWarpState) bool fUseWarp; |
| 56 | |
| yangsu@google.com | bd3e320 | 2011-07-13 22:05:00 +0000 | [diff] [blame] | 57 | - (void)initGestures; |
| 58 | - (void)flushLocalMatrix; |
| 59 | |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 60 | - (void)setSkTitle:(const char*)title; |
| 61 | - (void)postInvalWithRect:(const SkIRect*)rectOrNil; |
| 62 | - (BOOL)onHandleEvent:(const SkEvent&)event; |
| 63 | |
| 64 | @end |
| 65 | |