|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: Juha Kauppinen, Mika Hokkanen |
|
13 * |
|
14 * Description: Photo Browser |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef LOADING_ANIMATION_H |
|
19 #define LOADING_ANIMATION_H |
|
20 |
|
21 /*--------------------------------------------------------------------------*/ |
|
22 |
|
23 //#include "DrawableInterface.h" |
|
24 #include "ImagicContainerBrowser.h" |
|
25 //#include "ImagicAppUi.h" |
|
26 #include <GLES\egl.h> |
|
27 |
|
28 class CImagicContainerBrowser; |
|
29 /*--------------------------------------------------------------------------*/ |
|
30 |
|
31 class CDrawUtility //: public CDrawableInterface |
|
32 { |
|
33 private: |
|
34 // 1st and 2nd stage constructors |
|
35 CDrawUtility(); |
|
36 void ConstructL(CImagicContainerBrowser* aContainer); |
|
37 public: |
|
38 // NewL and destructor |
|
39 //static CDrawableInterface* NewL(void); |
|
40 static CDrawUtility* NewL(CImagicContainerBrowser* aContainer); |
|
41 ~CDrawUtility(); |
|
42 |
|
43 // Update animation |
|
44 // Returns true if screen should be redrawn |
|
45 TBool Update(void); |
|
46 // Draw animation |
|
47 void Draw(const TSize &aScreenSize); |
|
48 void DrawIcon(const TSize &aScreenSize, GLuint aTexIndex); |
|
49 void DrawIcon2(const TSize &aScreenSize, GLuint aTexIndex, TReal aAlpha); |
|
50 void DrawZoomIcon(const CImageData* aImageData, |
|
51 const TSize aScreenSize, |
|
52 float aDrawOneByOneX, |
|
53 float aDrawOneByOneY, |
|
54 TReal aDrawOnebyOneW, |
|
55 TReal aDrawOnebyOneH, |
|
56 TBool aShowLocationRect); |
|
57 void DrawZoomFrame(float aRotationTarget); |
|
58 void DrawFrame(TInt aIndex); |
|
59 void DrawMovingArrow(TBool aPrevArrow, TBool aUpDownArrow, const TSize& aScreenSize); |
|
60 void DrawMenuIndicators(const TSize& aScreenSize); |
|
61 |
|
62 private: |
|
63 // Makes sure that angle is on valid range |
|
64 void LimitAngle(TInt &Angle); |
|
65 void SetPictureVertices(GLfixed* aVertices, TReal aAspectRatio); |
|
66 |
|
67 |
|
68 // Rotation angles |
|
69 TInt iAngleX; |
|
70 TInt iAngleY; |
|
71 TInt iAngleZ; |
|
72 |
|
73 // Mesh data |
|
74 static const TInt iTriCount; |
|
75 static const GLfixed iVertices[4*3]; |
|
76 static const GLfixed iNormals[4*3]; |
|
77 static const GLushort iIndices[4*3]; |
|
78 |
|
79 CImagicContainerBrowser* iContainer; |
|
80 float iRotation; |
|
81 float iRotationTarget; |
|
82 TSize iScrSize; |
|
83 TSize iThumbSize; |
|
84 TSize iZoomRectSize; |
|
85 TReal iAspectRatio; |
|
86 float iDrawOneByOneX; |
|
87 float iDrawOneByOneY; |
|
88 TReal iScrAspectratio; |
|
89 TReal iDrawOnebyOneW; |
|
90 TReal iDrawOnebyOneH; |
|
91 }; |
|
92 |
|
93 /*--------------------------------------------------------------------------*/ |
|
94 |
|
95 #endif // LOADING_ANIMATION_H |