|
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(TRequestStatus& aStatus); |
|
56 |
|
57 /* |
|
58 * This updates the new image. |
|
59 */ |
|
60 void UpdateNewImageL(const TDesC& aImageFile, |
|
61 TInt aFrameCount,TSize aImageDimensions); |
|
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 |
|
76 /* |
|
77 ShiftToCloningMOde |
|
78 */ |
|
79 void ShiftToCloningMode(); |
|
80 |
|
81 /* |
|
82 ShiftToPostingMode |
|
83 */ |
|
84 void ShiftToPostingMode(); |
|
85 |
|
86 private: |
|
87 /* |
|
88 * Ctor |
|
89 */ |
|
90 CGlxHdmiSurfaceUpdater(RWindow* aWindow, const TDesC& aImageFile, |
|
91 TSize aOrigImageDimensions, TInt aFrameCount, MGlxGenCallback* aCallBack); |
|
92 |
|
93 /* |
|
94 * ConstructL() |
|
95 */ |
|
96 void ConstructL(TSize aImageDimensions); |
|
97 |
|
98 /* |
|
99 * Create a New surface with given size |
|
100 */ |
|
101 void CreateSurfaceL(); |
|
102 /* |
|
103 * @param1 size |
|
104 */ |
|
105 void MapSurfaceL(); |
|
106 |
|
107 static TInt SurfBuffer0Ready(TAny* aObject); |
|
108 /* |
|
109 * Call a refresh on the screen |
|
110 */ |
|
111 void Refresh(); |
|
112 |
|
113 /* |
|
114 * Dump the buffer on to the surface stride |
|
115 */ |
|
116 void SwapBuffers(); |
|
117 |
|
118 /* |
|
119 * Release contents |
|
120 */ |
|
121 void ReleaseContent(); |
|
122 |
|
123 /* |
|
124 * Create bitmap |
|
125 */ |
|
126 void CreateBitmapAndStartDecodingL(); |
|
127 |
|
128 /* |
|
129 * Create an image decoder with given file |
|
130 * @param1 - Image file |
|
131 */ |
|
132 void CreateImageDecoderL(const TDesC& aImageFile); |
|
133 |
|
134 /* |
|
135 * Creating all enablers for HDMI |
|
136 * @param1 if creating a surface is required, |
|
137 * by default it is not required |
|
138 */ |
|
139 void CreateHdmiL(TBool aCreateSurface = ETrue); |
|
140 |
|
141 static TInt TimeOut(TAny* aSelf); |
|
142 |
|
143 /* |
|
144 * ModifySurface positions of the surface to be displayed on screen |
|
145 */ |
|
146 void ModifySurfacePostion(); |
|
147 |
|
148 static TInt TimerCallbackL(TAny* aThis); |
|
149 |
|
150 /* |
|
151 * |
|
152 */ |
|
153 void ProcessTimerEventL(); |
|
154 |
|
155 /* |
|
156 * |
|
157 */ |
|
158 void ProcessTvImageL(); |
|
159 private: |
|
160 RWindow* iWindow; |
|
161 const TDesC& iImagePath; |
|
162 TSize iOrigImageDimensions; |
|
163 TInt iFrameCount; |
|
164 MGlxGenCallback* iCallBack; |
|
165 |
|
166 // GCE Surface |
|
167 RSurfaceUpdateSession iSurfUpdateSession; |
|
168 TSurfaceId iSurfId; // TSurfaceId |
|
169 RSurfaceManager* iSurfManager; // RSurfaceManager |
|
170 RChunk* iSurfChunk; // RChunk |
|
171 TInt iSurfaceStride; // surface stride |
|
172 TSurfaceConfiguration iConfig; // surface configuration for zoom |
|
173 |
|
174 TSize iZoomRectSz ; |
|
175 CFbsBitmap* iDecodedBitmap[15]; //Decoded bitmap of the focussed image |
|
176 |
|
177 void* iSurfBuffer; // Surface buffer |
|
178 CGlxActiveCallBack* iSurfBufferAO; // Surface buffer AO |
|
179 |
|
180 //ICL |
|
181 CGlxHdmiDecoderAO* iGlxDecoderAO; // Internal Image decoder AO |
|
182 CImageDecoder* iImageDecoder; // Image Decoder |
|
183 TInt iAnimCount; // animation count |
|
184 RFs iFsSession; // RFs |
|
185 |
|
186 TPoint iLeftCornerForZoom; |
|
187 CPeriodic* iTimer; |
|
188 CPeriodic* iAnimationTimer; |
|
189 TBool iZoom; |
|
190 TBool iBitmapReady; |
|
191 #ifdef _DEBUG |
|
192 TTime iStartTime; |
|
193 TTime iStopTime; |
|
194 #endif |
|
195 |
|
196 }; |
|
197 #endif /* GLXHDMISURFACEUPDATER_H_ */ |