1 /* |
|
2 * Copyright (c) 2002 - 2007 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: |
|
13 * |
|
14 * Description: For test alf core toolkit api modules |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <uiacceltk/huigc.h> |
|
20 #include <uiacceltk/huidisplaycoecontrol.h> |
|
21 #include <uiacceltk/huiskin.h> |
|
22 #include <uiacceltk/HuiTexture.h> |
|
23 #include <uiacceltk/huiTransformation.h> |
|
24 |
|
25 #include "testuiaifcoretoolkit.h" |
|
26 |
|
27 // ----------------------------------------------------------------------------- |
|
28 // Ctestplatalfcoretoolkit::TestHuiGcTHuiPathPoint |
|
29 // ----------------------------------------------------------------------------- |
|
30 // |
|
31 TInt CTestUiAifCoreToolkit::TestHuiGcTHuiPathPoint( CStifItemParser& /*aItem*/ ) |
|
32 { |
|
33 |
|
34 // Print to UI |
|
35 _LIT( Ktestplatalfcoretoolkit, "testplatalfcoretoolkit" ); |
|
36 _LIT( KTestHuiGcTHuiPathPoint, "TestHuiGcTHuiPathPoint" ); |
|
37 TestModuleIf().Printf( 0, Ktestplatalfcoretoolkit, KTestHuiGcTHuiPathPoint ); |
|
38 // Print to log file |
|
39 iLog->Log( KTestHuiGcTHuiPathPoint ); |
|
40 |
|
41 TPoint point( 0, 0 ); |
|
42 THuiPathPoint tHuiPahtPoint( point, 0 ); |
|
43 |
|
44 return KErrNone; |
|
45 |
|
46 } |
|
47 // ----------------------------------------------------------------------------- |
|
48 // Ctestplatalfcoretoolkit::TestHuiGcDrawImageL |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 TInt CTestUiAifCoreToolkit::TestHuiGcDrawImageL( CStifItemParser& /*aItem*/ ) |
|
52 { |
|
53 |
|
54 // Print to UI |
|
55 _LIT( Ktestplatalfcoretoolkit, "testplatalfcoretoolkit" ); |
|
56 _LIT( KTestHuiGcDrawImageL, "TestHuiGcDrawImageL" ); |
|
57 TestModuleIf().Printf( 0, Ktestplatalfcoretoolkit, KTestHuiGcDrawImageL ); |
|
58 // Print to log file |
|
59 iLog->Log( KTestHuiGcDrawImageL ); |
|
60 |
|
61 THuiRealPoint pos; |
|
62 TRect rect = CEikonEnv::Static()->AppUiFactory()->ClientRect(); |
|
63 CHuiDisplayCoeControl* ctrl = CHuiDisplayCoeControl::NewL( *iHuiEnv, rect ); |
|
64 CleanupStack::PushL( ctrl ); |
|
65 CHuiEnv::RefreshCallBack( iHuiEnv ); |
|
66 CHuiGc& huiGc = iHuiEnv->Skin().Context(); |
|
67 // Acquire background texture |
|
68 const CHuiTexture* backgroundTexture = NULL; |
|
69 TInt err = iHuiEnv->Skin().GetTexture(EHuiSkinBackgroundTexture, backgroundTexture); |
|
70 ASSERT(backgroundTexture!=NULL); |
|
71 __ASSERT_ALWAYS( err== KErrNone, User::Invariant() ); |
|
72 |
|
73 // Apply background texture |
|
74 THuiImage background(*backgroundTexture); |
|
75 |
|
76 TPoint screenOrigin(0, 0); |
|
77 // The origin is used to offset the background in the display's |
|
78 // rendering surface, so that the background's origin is in the |
|
79 // top left screen corner. |
|
80 screenOrigin.iX = -screenOrigin.iX; |
|
81 screenOrigin.iY = -screenOrigin.iY; |
|
82 |
|
83 huiGc.DrawImage( background, screenOrigin, background.Texture().Size() ); |
|
84 huiGc.DrawImage( background, rect ); |
|
85 huiGc.DrawImage( background, background.Texture().Size(), rect ); |
|
86 CleanupStack::PopAndDestroy( ctrl ); |
|
87 |
|
88 return KErrNone; |
|
89 |
|
90 } |
|
91 // ----------------------------------------------------------------------------- |
|
92 // Ctestplatalfcoretoolkit::TestHuiGcDrawImagesL |
|
93 // ----------------------------------------------------------------------------- |
|
94 // |
|
95 TInt CTestUiAifCoreToolkit::TestHuiGcDrawImagesL( CStifItemParser& /*aItem*/ ) |
|
96 { |
|
97 |
|
98 // Print to UI |
|
99 _LIT( Ktestplatalfcoretoolkit, "testplatalfcoretoolkit" ); |
|
100 _LIT( KTestHuiGcDrawImagesL, "TestHuiGcDrawImagesL" ); |
|
101 TestModuleIf().Printf( 0, Ktestplatalfcoretoolkit, KTestHuiGcDrawImagesL ); |
|
102 // Print to log file |
|
103 iLog->Log( KTestHuiGcDrawImagesL ); |
|
104 |
|
105 THuiRealPoint pos; |
|
106 TRect rect = CEikonEnv::Static()->AppUiFactory()->ClientRect(); |
|
107 CHuiDisplayCoeControl* ctrl = CHuiDisplayCoeControl::NewL( *iHuiEnv, rect ); |
|
108 CleanupStack::PushL( ctrl ); |
|
109 CHuiEnv::RefreshCallBack( iHuiEnv ); |
|
110 CHuiGc& huiGc = iHuiEnv->Skin().Context(); |
|
111 // Acquire background texture |
|
112 const CHuiTexture* backgroundTexture = NULL; |
|
113 TInt err = iHuiEnv->Skin().GetTexture(EHuiSkinBackgroundTexture, backgroundTexture); |
|
114 ASSERT(backgroundTexture!=NULL); |
|
115 __ASSERT_ALWAYS( err== KErrNone, User::Invariant() ); |
|
116 |
|
117 // Apply background texture |
|
118 THuiImage background(*backgroundTexture); |
|
119 |
|
120 TPoint screenOrigin(0, 0); |
|
121 |
|
122 huiGc.DrawImages( background, background, pos, background.Texture().Size() ); |
|
123 huiGc.DrawImages( background, background, background.Texture().Size(), rect); |
|
124 CleanupStack::PopAndDestroy( ctrl ); |
|
125 |
|
126 return KErrNone; |
|
127 |
|
128 } |
|
129 // ----------------------------------------------------------------------------- |
|
130 // Ctestplatalfcoretoolkit::TestHuiGcFontL |
|
131 // ----------------------------------------------------------------------------- |
|
132 // |
|
133 TInt CTestUiAifCoreToolkit::TestHuiGcFontL( CStifItemParser& /*aItem*/ ) |
|
134 { |
|
135 |
|
136 // Print to UI |
|
137 _LIT( Ktestplatalfcoretoolkit, "testplatalfcoretoolkit" ); |
|
138 _LIT( KTestHuiGcFontL, "TestHuiGcFontL" ); |
|
139 TestModuleIf().Printf( 0, Ktestplatalfcoretoolkit, KTestHuiGcFontL ); |
|
140 // Print to log file |
|
141 iLog->Log( KTestHuiGcFontL ); |
|
142 |
|
143 TRect rect = CEikonEnv::Static()->AppUiFactory()->ClientRect(); |
|
144 CHuiDisplayCoeControl* ctrl = CHuiDisplayCoeControl::NewL( *iHuiEnv, rect ); |
|
145 CleanupStack::PushL( ctrl ); |
|
146 CHuiEnv::RefreshCallBack( iHuiEnv ); |
|
147 CHuiGc& huiGc = iHuiEnv->Skin().Context(); |
|
148 // THuiFont* font= huiGc.Font(); |
|
149 |
|
150 // CleanupStack::PushL( font ); |
|
151 // CleanupStack::PopAndDestroy( font ); |
|
152 CleanupStack::PopAndDestroy( ctrl ); |
|
153 |
|
154 return KErrNone; |
|
155 |
|
156 } |
|
157 // ----------------------------------------------------------------------------- |
|
158 // Ctestplatalfcoretoolkit::TestHuiGcNearClipDistanceL |
|
159 // ----------------------------------------------------------------------------- |
|
160 // |
|
161 TInt CTestUiAifCoreToolkit::TestHuiGcNearClipDistanceL( CStifItemParser& /*aItem*/ ) |
|
162 { |
|
163 |
|
164 // Print to UI |
|
165 _LIT( Ktestplatalfcoretoolkit, "testplatalfcoretoolkit" ); |
|
166 _LIT( KTestHuiGcNearClipDistanceL, "TestHuiGcNearClipDistanceL" ); |
|
167 TestModuleIf().Printf( 0, Ktestplatalfcoretoolkit, KTestHuiGcNearClipDistanceL ); |
|
168 // Print to log file |
|
169 iLog->Log( KTestHuiGcNearClipDistanceL ); |
|
170 |
|
171 TRect rect = CEikonEnv::Static()->AppUiFactory()->ClientRect(); |
|
172 CHuiDisplayCoeControl* ctrl = CHuiDisplayCoeControl::NewL( *iHuiEnv, rect ); |
|
173 CleanupStack::PushL( ctrl ); |
|
174 CHuiEnv::RefreshCallBack( iHuiEnv ); |
|
175 CHuiGc& huiGc = iHuiEnv->Skin().Context(); |
|
176 // TReal32 real; |
|
177 // real = huiGc.NearClipDistance(); |
|
178 CleanupStack::PopAndDestroy( ctrl ); |
|
179 |
|
180 return KErrNone; |
|
181 |
|
182 } |
|
183 // ----------------------------------------------------------------------------- |
|
184 // Ctestplatalfcoretoolkit::TestHuiGcFarClipDistanceL |
|
185 // ----------------------------------------------------------------------------- |
|
186 // |
|
187 TInt CTestUiAifCoreToolkit::TestHuiGcFarClipDistanceL( CStifItemParser& /*aItem*/ ) |
|
188 { |
|
189 |
|
190 // Print to UI |
|
191 _LIT( Ktestplatalfcoretoolkit, "testplatalfcoretoolkit" ); |
|
192 _LIT( KTestHuiGcFarClipDistanceL, "TestHuiGcFarClipDistanceL" ); |
|
193 TestModuleIf().Printf( 0, Ktestplatalfcoretoolkit, KTestHuiGcFarClipDistanceL ); |
|
194 // Print to log file |
|
195 iLog->Log( KTestHuiGcFarClipDistanceL ); |
|
196 |
|
197 TRect rect = CEikonEnv::Static()->AppUiFactory()->ClientRect(); |
|
198 CHuiDisplayCoeControl* ctrl = CHuiDisplayCoeControl::NewL( *iHuiEnv, rect ); |
|
199 CleanupStack::PushL( ctrl ); |
|
200 CHuiEnv::RefreshCallBack( iHuiEnv ); |
|
201 CHuiGc& huiGc = iHuiEnv->Skin().Context(); |
|
202 // TReal32 real = huiGc.FarClipDistance(); |
|
203 CleanupStack::PopAndDestroy( ctrl ); |
|
204 |
|
205 return KErrNone; |
|
206 |
|
207 } |
|
208 // ----------------------------------------------------------------------------- |
|
209 // Ctestplatalfcoretoolkit::TestHuiGcFovFactorL |
|
210 // ----------------------------------------------------------------------------- |
|
211 // |
|
212 TInt CTestUiAifCoreToolkit::TestHuiGcFovFactorL( CStifItemParser& /*aItem*/ ) |
|
213 { |
|
214 |
|
215 // Print to UI |
|
216 _LIT( Ktestplatalfcoretoolkit, "testplatalfcoretoolkit" ); |
|
217 _LIT( KTestHuiGcFovFactorL, "TestHuiGcFovFactorL" ); |
|
218 TestModuleIf().Printf( 0, Ktestplatalfcoretoolkit, KTestHuiGcFovFactorL ); |
|
219 // Print to log file |
|
220 iLog->Log( KTestHuiGcFovFactorL ); |
|
221 |
|
222 TRect rect = CEikonEnv::Static()->AppUiFactory()->ClientRect(); |
|
223 CHuiDisplayCoeControl* ctrl = CHuiDisplayCoeControl::NewL( *iHuiEnv, rect ); |
|
224 CleanupStack::PushL( ctrl ); |
|
225 CHuiEnv::RefreshCallBack( iHuiEnv ); |
|
226 CHuiGc& huiGc = iHuiEnv->Skin().Context(); |
|
227 // TReal32 real = huiGc.FovFactor(); |
|
228 CleanupStack::PopAndDestroy( ctrl ); |
|
229 |
|
230 return KErrNone; |
|
231 |
|
232 } |
|
233 // ----------------------------------------------------------------------------- |
|
234 // Ctestplatalfcoretoolkit::TestHuiGcOffset2DL |
|
235 // ----------------------------------------------------------------------------- |
|
236 // |
|
237 TInt CTestUiAifCoreToolkit::TestHuiGcOffset2DL( CStifItemParser& /*aItem*/ ) |
|
238 { |
|
239 |
|
240 // Print to UI |
|
241 _LIT( Ktestplatalfcoretoolkit, "testplatalfcoretoolkit" ); |
|
242 _LIT( KTestHuiGcOffset2DL, "TestHuiGcOffset2DL" ); |
|
243 TestModuleIf().Printf( 0, Ktestplatalfcoretoolkit, KTestHuiGcOffset2DL ); |
|
244 // Print to log file |
|
245 iLog->Log( KTestHuiGcOffset2DL ); |
|
246 |
|
247 TRect rect = CEikonEnv::Static()->AppUiFactory()->ClientRect(); |
|
248 CHuiDisplayCoeControl* ctrl = CHuiDisplayCoeControl::NewL( *iHuiEnv, rect ); |
|
249 CleanupStack::PushL( ctrl ); |
|
250 CHuiEnv::RefreshCallBack( iHuiEnv ); |
|
251 CHuiGc& huiGc = iHuiEnv->Skin().Context(); |
|
252 // TReal32 real = huiGc.Offset2D(); |
|
253 CleanupStack::PopAndDestroy( ctrl ); |
|
254 |
|
255 return KErrNone; |
|
256 |
|
257 } |
|
258 // ----------------------------------------------------------------------------- |
|
259 // Ctestplatalfcoretoolkit::TestHuiGcSetWindowTransformationL |
|
260 // ----------------------------------------------------------------------------- |
|
261 // |
|
262 TInt CTestUiAifCoreToolkit::TestHuiGcSetWindowTransformationL( CStifItemParser& /*aItem*/ ) |
|
263 { |
|
264 |
|
265 // Print to UI |
|
266 _LIT( Ktestplatalfcoretoolkit, "testplatalfcoretoolkit" ); |
|
267 _LIT( KTestHuiGcSetWindowTransformationL, "TestHuiGcSetWindowTransformationL" ); |
|
268 TestModuleIf().Printf( 0, Ktestplatalfcoretoolkit, KTestHuiGcSetWindowTransformationL ); |
|
269 // Print to log file |
|
270 iLog->Log( KTestHuiGcSetWindowTransformationL ); |
|
271 |
|
272 TRect rect = CEikonEnv::Static()->AppUiFactory()->ClientRect(); |
|
273 CHuiDisplayCoeControl* ctrl = CHuiDisplayCoeControl::NewL( *iHuiEnv, rect ); |
|
274 CleanupStack::PushL( ctrl ); |
|
275 CHuiEnv::RefreshCallBack( iHuiEnv ); |
|
276 CHuiGc& huiGc = iHuiEnv->Skin().Context(); |
|
277 CHuiTransformation* windowTransformation = CHuiTransformation::NewL(); |
|
278 CleanupStack::PushL( windowTransformation ); |
|
279 // huiGc.SetWindowTransformation( windowTransformation ); |
|
280 CleanupStack::PopAndDestroy( windowTransformation ); |
|
281 CleanupStack::PopAndDestroy( ctrl ); |
|
282 |
|
283 return KErrNone; |
|
284 |
|
285 } |
|
286 // ----------------------------------------------------------------------------- |
|
287 // Ctestplatalfcoretoolkit::TestHuiGcLocaleTextAlignmentL |
|
288 // ----------------------------------------------------------------------------- |
|
289 // |
|
290 TInt CTestUiAifCoreToolkit::TestHuiGcLocaleTextAlignmentL( CStifItemParser& /*aItem*/ ) |
|
291 { |
|
292 |
|
293 // Print to UI |
|
294 _LIT( Ktestplatalfcoretoolkit, "testplatalfcoretoolkit" ); |
|
295 _LIT( KTestHuiGcLocaleTextAlignmentL, "TestHuiGcLocaleTextAlignmentL" ); |
|
296 TestModuleIf().Printf( 0, Ktestplatalfcoretoolkit, KTestHuiGcLocaleTextAlignmentL ); |
|
297 // Print to log file |
|
298 iLog->Log( KTestHuiGcLocaleTextAlignmentL ); |
|
299 |
|
300 TRect rect = CEikonEnv::Static()->AppUiFactory()->ClientRect(); |
|
301 CHuiDisplayCoeControl* ctrl = CHuiDisplayCoeControl::NewL( *iHuiEnv, rect ); |
|
302 CleanupStack::PushL( ctrl ); |
|
303 CHuiEnv::RefreshCallBack( iHuiEnv ); |
|
304 CHuiGc& huiGc = iHuiEnv->Skin().Context(); |
|
305 // THuiAlignHorizontal alignHorizontal = huiGc.LocaleTextAlignment(); |
|
306 CleanupStack::PopAndDestroy( ctrl ); |
|
307 |
|
308 return KErrNone; |
|
309 |
|
310 } |
|
311 |
|
312 //End of file. |
|