|
1 /* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 * All rights reserved. |
|
3 * This component and the accompanying materials are made available |
|
4 * under the terms of "Eclipse Public License v1.0" |
|
5 * which accompanies this distribution, and is available |
|
6 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 * |
|
8 * Initial Contributors: |
|
9 * Nokia Corporation - initial contribution. |
|
10 * |
|
11 * Contributors: |
|
12 * |
|
13 * Description: Handles & propogates UI state change notifications. |
|
14 * |
|
15 */ |
|
16 |
|
17 #ifndef GLXHDMISURFACEUPDATER_H_ |
|
18 #define GLXHDMISURFACEUPDATER_H_ |
|
19 |
|
20 #include <w32std.h> |
|
21 #include <fbs.h> |
|
22 |
|
23 // GCE Surface |
|
24 #include "graphics/surfacemanager.h" |
|
25 #include "graphics/surface.h" |
|
26 #include "graphics/surfaceupdateclient.h" |
|
27 #include <graphics/surfaceconfiguration.h> |
|
28 class CGlxActiveCallBack; |
|
29 class CGlxHdmiDecoderAO; |
|
30 class CImageDecoder; |
|
31 class TSurfaceConfiguration; |
|
32 class MGlxGenCallback |
|
33 { |
|
34 public: |
|
35 virtual void DoGenCallback() = 0; |
|
36 }; |
|
37 |
|
38 class CGlxHdmiSurfaceUpdater: public CBase |
|
39 { |
|
40 public: |
|
41 /* |
|
42 * |
|
43 */ |
|
44 static CGlxHdmiSurfaceUpdater* NewL(RWindow* aWindow, const TDesC& aImageFile, |
|
45 TSize aImageDimensions, TInt aFrameCount, MGlxGenCallback* aCallBack); |
|
46 |
|
47 /* |
|
48 * destructor |
|
49 */ |
|
50 ~CGlxHdmiSurfaceUpdater(); |
|
51 public: |
|
52 /* |
|
53 * This is to cancel the active object from decoding |
|
54 */ |
|
55 void HandleRunL(); |
|
56 |
|
57 /* |
|
58 * This updates the new image. |
|
59 */ |
|
60 void UpdateNewImageL(const TDesC& aImageFile, |
|
61 TInt aFrameCount); |
|
62 |
|
63 /* |
|
64 * Activate Zoom |
|
65 */ |
|
66 void ActivateZoom(); |
|
67 /* |
|
68 * Deactivate Zoom |
|
69 */ |
|
70 void DeactivateZoom(); |
|
71 /* |
|
72 * Zoom in our out depending on parameter |
|
73 */ |
|
74 void Zoom(TBool aZoom); |
|
75 private: |
|
76 /* |
|
77 * Ctor |
|
78 */ |
|
79 CGlxHdmiSurfaceUpdater(RWindow* aWindow, const TDesC& aImageFile, |
|
80 TSize aOrigImageDimensions, TInt aFrameCount, MGlxGenCallback* aCallBack); |
|
81 |
|
82 /* |
|
83 * ConstructL() |
|
84 */ |
|
85 void ConstructL(TSize aImageDimensions); |
|
86 |
|
87 /* |
|
88 * Create a New surface with given size |
|
89 * @param1 size |
|
90 */ |
|
91 void CreateSurfaceL(TSize aSize); |
|
92 /* |
|
93 * Create surface manager with given size |
|
94 * @param1 size |
|
95 */ |
|
96 void MapSurfaceL(); |
|
97 |
|
98 static TInt SurfBuffer0Ready(TAny* aObject); |
|
99 /* |
|
100 * Call a refresh on the screen |
|
101 */ |
|
102 void Refresh(); |
|
103 |
|
104 /* |
|
105 * Dump the buffer on to the surface stride |
|
106 */ |
|
107 void SwapBuffers(); |
|
108 |
|
109 /* |
|
110 * Release contents |
|
111 */ |
|
112 void ReleaseContent(); |
|
113 |
|
114 /* |
|
115 * Create bitmap |
|
116 */ |
|
117 void CreateBitmapL(); |
|
118 |
|
119 /* |
|
120 * Create an image decoder with given file |
|
121 * @param1 - Image file |
|
122 */ |
|
123 void CreateImageDecoderL(const TDesC& aImageFile); |
|
124 |
|
125 /* |
|
126 * Creating all enablers for HDMI |
|
127 * @param1 if creating a surface is required, |
|
128 * by default it is not required |
|
129 */ |
|
130 void CreateHdmiL(TBool aCreateSurface = ETrue); |
|
131 |
|
132 static TInt TimeOut(TAny* aSelf); |
|
133 private: |
|
134 RWindow* iWindow; |
|
135 const TDesC& iImagePath; |
|
136 TSize iOrigImageDimensions; |
|
137 TInt iFrameCount; |
|
138 MGlxGenCallback* iCallBack; |
|
139 |
|
140 // GCE Surface |
|
141 RSurfaceUpdateSession iSurfUpdateSession; |
|
142 TSurfaceId iSurfId; // TSurfaceId |
|
143 RSurfaceManager* iSurfManager; // RSurfaceManager |
|
144 RChunk* iSurfChunk; // RChunk |
|
145 TInt iSurfaceStride; // surface stride |
|
146 TSurfaceConfiguration iConfig; // surface configuration for zoom |
|
147 |
|
148 TSize iZoomRectSz ; |
|
149 CFbsBitmap* iDecodedBitmap; //Decoded bitmap of the focussed image |
|
150 |
|
151 void* iSurfBuffer; // Surface buffer |
|
152 CGlxActiveCallBack* iSurfBufferAO; // Surface buffer AO |
|
153 |
|
154 //ICL |
|
155 CGlxHdmiDecoderAO* iGlxDecoderAO; // Internal Image decoder AO |
|
156 CImageDecoder* iImageDecoder; // Image Decoder |
|
157 TInt iAnimCount; // animation count |
|
158 RFs iFsSession; // RFs |
|
159 |
|
160 TBool iFirstTime; |
|
161 TPoint iLeftCornerForZoom; |
|
162 CPeriodic* iTimer; |
|
163 TBool iZoom; |
|
164 #ifdef _DEBUG |
|
165 TTime iStartTime; |
|
166 TTime iStopTime; |
|
167 #endif |
|
168 |
|
169 }; |
|
170 #endif /* GLXHDMISURFACEUPDATER_H_ */ |