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 MGlxGenCallback* aCallBack); |
|
46 |
|
47 /* |
|
48 * destructor |
|
49 */ |
|
50 ~CGlxHdmiSurfaceUpdater(); |
|
51 |
|
52 public: |
|
53 /* |
|
54 * This is to cancel the active object from decoding |
|
55 */ |
|
56 void HandleRunL(TRequestStatus& aStatus); |
|
57 |
|
58 /* |
|
59 * This updates the new image. |
|
60 */ |
|
61 void UpdateNewImageL(const TDesC& aImageFile); |
|
62 |
|
63 /* |
|
64 * Activate Zoom |
|
65 */ |
|
66 void ActivateZoom(TBool aAutoZoomOut); |
|
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 MGlxGenCallback* aCallBack); |
|
92 |
|
93 /* |
|
94 * ConstructL() |
|
95 */ |
|
96 void ConstructL(); |
|
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 CreateBitmapL(); |
|
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 private: |
|
148 RWindow* iWindow; |
|
149 const TDesC& iImagePath; |
|
150 MGlxGenCallback* iCallBack; |
|
151 |
|
152 // GCE Surface |
|
153 RSurfaceUpdateSession iSurfUpdateSession; |
|
154 TSurfaceId iSurfId; // TSurfaceId |
|
155 RSurfaceManager* iSurfManager; // RSurfaceManager |
|
156 RChunk* iSurfChunk; // RChunk |
|
157 TInt iSurfaceStride; // surface stride |
|
158 TSurfaceConfiguration iConfig; // surface configuration for zoom |
|
159 |
|
160 TSize iZoomRectSz ; |
|
161 CFbsBitmap* iDecodedBitmap; //Decoded bitmap of the focussed image |
|
162 |
|
163 void* iSurfBuffer; // Surface buffer |
|
164 CGlxActiveCallBack* iSurfBufferAO; // Surface buffer AO |
|
165 |
|
166 //ICL |
|
167 CGlxHdmiDecoderAO* iGlxDecoderAO; // Internal Image decoder AO |
|
168 CImageDecoder* iImageDecoder; // Image Decoder |
|
169 RFs iFsSession; // RFs |
|
170 |
|
171 TPoint iLeftCornerForZoom; |
|
172 CPeriodic* iTimer; |
|
173 TBool iZoom; |
|
174 TBool iBitmapReady; |
|
175 TBool iAutoZoomOut; |
|
176 TBool iSurfSessionConnected; |
|
177 #ifdef _DEBUG |
|
178 TTime iStartTime; |
|
179 TTime iStopTime; |
|
180 #endif |
|
181 |
|
182 }; |
|
183 #endif /* GLXHDMISURFACEUPDATER_H_ */ |
|