|
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: test api of alf_core_toolkit |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // [INCLUDE FILES] |
|
20 #include <e32svr.h> |
|
21 #include <gdi.h> |
|
22 #include <stifparser.h> |
|
23 #include <stiftestinterface.h> |
|
24 #include <uiacceltk/huienv.h> |
|
25 #include <uiacceltk/huistatic.h> |
|
26 #include <uiacceltk/huidisplay.h> |
|
27 #include <uiacceltk/huidisplaycoecontrol.h> |
|
28 #include <uiacceltk/huigc.h> |
|
29 |
|
30 #include "testuiaifcoretoolkit.h" |
|
31 |
|
32 // Test class |
|
33 |
|
34 NONSHARABLE_CLASS(CTestScreenBufferObserver) : public CBase, public MHuiScreenBufferObserver |
|
35 { |
|
36 public: |
|
37 |
|
38 TBool ScreenBufferComplete(TUid aBufferUid, TRect& aDisplayRect, TRect& aDirtyRect) |
|
39 { |
|
40 iScreenBufferComplete_Count++; |
|
41 iScreenBufferComplete_LastBufferUid = aBufferUid; |
|
42 iScreenBufferComplete_LastDisplayRect = aDisplayRect; |
|
43 iScreenBufferComplete_LastDirtyRect = aDirtyRect; |
|
44 |
|
45 return iScreenBufferComplete_ReturnValue; |
|
46 }; |
|
47 |
|
48 void HandleScreenBufferEvent(TUid aBufferUid, TInt aEvent) |
|
49 { |
|
50 iHandleScreenBufferEvent_LastBufferUid = aBufferUid; |
|
51 if ( aEvent == MHuiScreenBufferObserver::EDeleted ) |
|
52 iHandleScreenBufferEvent_DeleteEventCount++; |
|
53 else |
|
54 /*EUNIT_ASSERT_DESC( EFalse, "HandleScreenBufferEvent(). Error: Invalid event.")*/ |
|
55 ; |
|
56 |
|
57 }; |
|
58 public: |
|
59 TInt iScreenBufferComplete_Count; |
|
60 TUid iScreenBufferComplete_LastBufferUid; |
|
61 TRect iScreenBufferComplete_LastDisplayRect; |
|
62 TRect iScreenBufferComplete_LastDirtyRect; |
|
63 |
|
64 TBool iScreenBufferComplete_ReturnValue; |
|
65 |
|
66 TInt iHandleScreenBufferEvent_DeleteEventCount; |
|
67 TUid iHandleScreenBufferEvent_LastBufferUid; |
|
68 |
|
69 }; |
|
70 |
|
71 // ----------------------------------------------------------------------------- |
|
72 // CTestUiAifCoreToolkit::TestTHuiEnvL |
|
73 // ----------------------------------------------------------------------------- |
|
74 // |
|
75 TInt CTestUiAifCoreToolkit::TestTHuiEnvL( CStifItemParser& /*aItem*/ ) |
|
76 { |
|
77 |
|
78 // Print to UI |
|
79 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
80 _LIT( KTestTHuiEnvL, "In TestTHuiEnvL" ); |
|
81 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestTHuiEnvL ); |
|
82 // Print to log file |
|
83 iLog->Log( KTestTHuiEnvL ); |
|
84 |
|
85 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
86 CHuiDisplay::EDisplayNormal); |
|
87 huiDisplay->Env(); |
|
88 |
|
89 return KErrNone; |
|
90 |
|
91 } |
|
92 |
|
93 // ----------------------------------------------------------------------------- |
|
94 // CTestUiAifCoreToolkit::TestTDisplayActivateL |
|
95 // ----------------------------------------------------------------------------- |
|
96 // |
|
97 TInt CTestUiAifCoreToolkit::TestTDisplayActivateL( CStifItemParser& /*aItem*/ ) |
|
98 { |
|
99 |
|
100 // Print to UI |
|
101 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
102 _LIT( KTestTDisplayActivateL, "In TestTDisplayActivateL" ); |
|
103 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestTDisplayActivateL ); |
|
104 // Print to log file |
|
105 iLog->Log( KTestTDisplayActivateL ); |
|
106 |
|
107 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
108 CHuiDisplay::EDisplayNormal); |
|
109 huiDisplay->Activate( ETrue ); |
|
110 |
|
111 return KErrNone; |
|
112 |
|
113 } |
|
114 |
|
115 // ----------------------------------------------------------------------------- |
|
116 // CTestUiAifCoreToolkit::TestTDisplayActiveL |
|
117 // ----------------------------------------------------------------------------- |
|
118 // |
|
119 TInt CTestUiAifCoreToolkit::TestTDisplayActiveL( CStifItemParser& /*aItem*/ ) |
|
120 { |
|
121 |
|
122 // Print to UI |
|
123 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
124 _LIT( KTestTDisplayActiveL, "In TestTDisplayActive" ); |
|
125 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestTDisplayActiveL ); |
|
126 // Print to log file |
|
127 iLog->Log( KTestTDisplayActiveL ); |
|
128 |
|
129 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
130 CHuiDisplay::EDisplayNormal); |
|
131 huiDisplay->Active(); |
|
132 return KErrNone; |
|
133 |
|
134 } |
|
135 |
|
136 // ----------------------------------------------------------------------------- |
|
137 // CTestUiAifCoreToolkit::TestTDisplaySetSizeLL |
|
138 // ----------------------------------------------------------------------------- |
|
139 // |
|
140 TInt CTestUiAifCoreToolkit::TestTDisplaySetSizeLL( CStifItemParser& /*aItem*/ ) |
|
141 { |
|
142 |
|
143 // Print to UI |
|
144 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
145 _LIT( KTestTDisplaySetSizeLL, "In TestTDisplaySetSizeLL" ); |
|
146 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestTDisplaySetSizeLL ); |
|
147 // Print to log file |
|
148 iLog->Log( KTestTDisplaySetSizeLL ); |
|
149 |
|
150 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
151 CHuiDisplay::EDisplayNormal); |
|
152 TSize newSize = TSize(42,43); |
|
153 huiDisplay->SetSizeL( newSize ); |
|
154 |
|
155 STIF_ASSERT_EQUALS( huiDisplay->Size(), newSize ); |
|
156 |
|
157 return KErrNone; |
|
158 |
|
159 } |
|
160 |
|
161 // ----------------------------------------------------------------------------- |
|
162 // CTestUiAifCoreToolkit::TestTDisplaySizeL |
|
163 // ----------------------------------------------------------------------------- |
|
164 // |
|
165 TInt CTestUiAifCoreToolkit::TestTDisplaySizeL( CStifItemParser& /*aItem*/ ) |
|
166 { |
|
167 |
|
168 // Print to UI |
|
169 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
170 _LIT( KTestTDisplaySizeL, "In TestTDisplaySizeL" ); |
|
171 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestTDisplaySizeL ); |
|
172 // Print to log file |
|
173 iLog->Log( KTestTDisplaySizeL ); |
|
174 |
|
175 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
176 CHuiDisplay::EDisplayNormal); |
|
177 huiDisplay->Size(); |
|
178 |
|
179 return KErrNone; |
|
180 |
|
181 } |
|
182 |
|
183 // ----------------------------------------------------------------------------- |
|
184 // CTestUiAifCoreToolkit::TestTDisplaySetVisibleAreaL |
|
185 // ----------------------------------------------------------------------------- |
|
186 // |
|
187 TInt CTestUiAifCoreToolkit::TestTDisplaySetVisibleAreaL( CStifItemParser& /*aItem*/ ) |
|
188 { |
|
189 |
|
190 // Print to UI |
|
191 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
192 _LIT( KTestTDisplaySetVisibleAreaL, "In TestTDisplaySetVisibleAreaL" ); |
|
193 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestTDisplaySetVisibleAreaL ); |
|
194 // Print to log file |
|
195 iLog->Log( KTestTDisplaySetVisibleAreaL ); |
|
196 |
|
197 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
198 CHuiDisplay::EDisplayNormal); |
|
199 |
|
200 TRect newRect(1,2,30,40); |
|
201 huiDisplay->SetVisibleArea( newRect ); |
|
202 |
|
203 STIF_ASSERT_EQUALS( huiDisplay->VisibleArea(), newRect ); |
|
204 |
|
205 return KErrNone; |
|
206 |
|
207 } |
|
208 |
|
209 // ----------------------------------------------------------------------------- |
|
210 // CTestUiAifCoreToolkit::TestTDisplayVisibleAreaL |
|
211 // ----------------------------------------------------------------------------- |
|
212 // |
|
213 TInt CTestUiAifCoreToolkit::TestTDisplayVisibleAreaL( CStifItemParser& /*aItem*/ ) |
|
214 { |
|
215 |
|
216 // Print to UI |
|
217 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
218 _LIT( KTestTDisplayVisibleAreaL, "In TestTDisplayVisibleAreaL" ); |
|
219 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestTDisplayVisibleAreaL ); |
|
220 // Print to log file |
|
221 iLog->Log( KTestTDisplayVisibleAreaL ); |
|
222 |
|
223 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
224 CHuiDisplay::EDisplayNormal); |
|
225 TRect visibleArea = huiDisplay->VisibleArea(); |
|
226 |
|
227 return KErrNone; |
|
228 |
|
229 } |
|
230 |
|
231 // ----------------------------------------------------------------------------- |
|
232 // CTestUiAifCoreToolkit::TestTDisplaySetOrientationL |
|
233 // ----------------------------------------------------------------------------- |
|
234 // |
|
235 TInt CTestUiAifCoreToolkit::TestTDisplaySetOrientationL( CStifItemParser& /*aItem*/ ) |
|
236 { |
|
237 |
|
238 // Print to UI |
|
239 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
240 _LIT( KTestTDisplaySetOrientationL, "In TestTDisplaySetOrientationL" ); |
|
241 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
242 KTestTDisplaySetOrientationL ); |
|
243 // Print to log file |
|
244 iLog->Log( KTestTDisplaySetOrientationL ); |
|
245 |
|
246 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
247 CHuiDisplay::EDisplayNormal); |
|
248 |
|
249 huiDisplay->SetOrientation( CHuiGc::EOrientationCCW90 ); |
|
250 STIF_ASSERT_EQUALS( huiDisplay->Orientation( ), CHuiGc::EOrientationCCW90 ); |
|
251 huiDisplay->SetOrientation( CHuiGc::EOrientationNormal ); |
|
252 STIF_ASSERT_EQUALS( huiDisplay->Orientation( ), CHuiGc::EOrientationNormal ); |
|
253 huiDisplay->SetOrientation( CHuiGc::EOrientationCW90 ); |
|
254 STIF_ASSERT_EQUALS( huiDisplay->Orientation( ), CHuiGc::EOrientationCW90 ); |
|
255 |
|
256 return KErrNone; |
|
257 |
|
258 } |
|
259 |
|
260 // ----------------------------------------------------------------------------- |
|
261 // CTestUiAifCoreToolkit::TestTDisplayOrientationL |
|
262 // ----------------------------------------------------------------------------- |
|
263 // |
|
264 TInt CTestUiAifCoreToolkit::TestTDisplayOrientationL( CStifItemParser& /*aItem*/ ) |
|
265 { |
|
266 |
|
267 // Print to UI |
|
268 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
269 _LIT( KTestTDisplayOrientationL, "In TestTDisplayOrientationL" ); |
|
270 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
271 KTestTDisplayOrientationL ); |
|
272 // Print to log file |
|
273 iLog->Log( KTestTDisplayOrientationL ); |
|
274 |
|
275 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
276 CHuiDisplay::EDisplayNormal); |
|
277 huiDisplay->Orientation(); |
|
278 |
|
279 return KErrNone; |
|
280 |
|
281 } |
|
282 |
|
283 // ----------------------------------------------------------------------------- |
|
284 // CTestUiAifCoreToolkit::TestTDisplaySetUseDepthL |
|
285 // ----------------------------------------------------------------------------- |
|
286 // |
|
287 TInt CTestUiAifCoreToolkit::TestTDisplaySetUseDepthL( CStifItemParser& /*aItem*/ ) |
|
288 { |
|
289 |
|
290 // Print to UI |
|
291 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
292 _LIT( KTestTDisplaySetUseDepthL, "In TestTDisplaySetUseDepthL" ); |
|
293 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
294 KTestTDisplaySetUseDepthL ); |
|
295 // Print to log file |
|
296 iLog->Log( KTestTDisplaySetUseDepthL); |
|
297 |
|
298 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
299 CHuiDisplay::EDisplayNormal); |
|
300 huiDisplay->SetUseDepth( ETrue ); |
|
301 return KErrNone; |
|
302 |
|
303 } |
|
304 |
|
305 // ----------------------------------------------------------------------------- |
|
306 // CTestUiAifCoreToolkit::TestTDisplaySetClearBackgroundLL |
|
307 // ----------------------------------------------------------------------------- |
|
308 // |
|
309 TInt CTestUiAifCoreToolkit::TestTDisplaySetClearBackgroundLL( CStifItemParser& /*aItem*/ ) |
|
310 { |
|
311 |
|
312 // Print to UI |
|
313 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
314 _LIT( KTestTDisplaySetClearBackgroundLL, "In TestTDisplaySetClearBackgroundLL" ); |
|
315 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
316 KTestTDisplaySetClearBackgroundLL ); |
|
317 // Print to log file |
|
318 iLog->Log( KTestTDisplaySetClearBackgroundLL ); |
|
319 |
|
320 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
321 CHuiDisplay::EDisplayNormal); |
|
322 |
|
323 huiDisplay->SetClearBackgroundL( CHuiDisplay::EClearNone ); |
|
324 huiDisplay->SetClearBackgroundL( CHuiDisplay::EClearWithColor ); |
|
325 huiDisplay->SetClearBackgroundL( CHuiDisplay::EClearWithSkinBackground ); |
|
326 |
|
327 return KErrNone; |
|
328 |
|
329 } |
|
330 |
|
331 // ----------------------------------------------------------------------------- |
|
332 // CTestUiAifCoreToolkit::TestTDisplaySetBackgroundColorL |
|
333 // ----------------------------------------------------------------------------- |
|
334 // |
|
335 TInt CTestUiAifCoreToolkit::TestTDisplaySetBackgroundColorL( CStifItemParser& /*aItem*/ ) |
|
336 { |
|
337 |
|
338 // Print to UI |
|
339 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
340 _LIT( KTestTDisplaySetBackgroundColor, "In TestTDisplaySetBackgroundColor" ); |
|
341 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
342 KTestTDisplaySetBackgroundColor ); |
|
343 // Print to log file |
|
344 iLog->Log( KTestTDisplaySetBackgroundColor ); |
|
345 |
|
346 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
347 CHuiDisplay::EDisplayNormal); |
|
348 |
|
349 huiDisplay->SetBackgroundColor( KRgbBlue ); |
|
350 return KErrNone; |
|
351 |
|
352 } |
|
353 |
|
354 // ----------------------------------------------------------------------------- |
|
355 // CTestUiAifCoreToolkit::TestTDisplaySetBackgroundItemsL |
|
356 // ----------------------------------------------------------------------------- |
|
357 // |
|
358 TInt CTestUiAifCoreToolkit::TestTDisplaySetBackgroundItemsL( CStifItemParser& /*aItem*/ ) |
|
359 { |
|
360 |
|
361 // Print to UI |
|
362 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
363 _LIT( KTestTDisplaySetBackgroundItemsL, "In TestTDisplaySetBackgroundItemsL" ); |
|
364 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
365 KTestTDisplaySetBackgroundItemsL ); |
|
366 // Print to log file |
|
367 iLog->Log( KTestTDisplaySetBackgroundItemsL ); |
|
368 |
|
369 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
370 CHuiDisplay::EDisplayNormal); |
|
371 |
|
372 |
|
373 RArray<THuiDisplayBackgroundItem> backgroundItems; |
|
374 |
|
375 TRect rect = TRect(1,2,30,40); |
|
376 TRect rect2 = TRect(2,3,40,50); |
|
377 |
|
378 // Skin backgrounds |
|
379 |
|
380 TAknsItemID item = KAknsIIDQsnBgScreenIdle; |
|
381 TAknsItemID item2 = KAknsIIDQsnBgScreenMp; |
|
382 |
|
383 THuiDisplayBackgroundItem newItem1(rect, item); |
|
384 newItem1.SetRect(rect2); |
|
385 |
|
386 newItem1.SetSkinBackground(item2); |
|
387 backgroundItems.AppendL(newItem1); |
|
388 |
|
389 // Skin colors |
|
390 |
|
391 TAknsItemID skinnedColorGroup1 = KAknsIIDQsnTextColors; |
|
392 TInt skinnedColorIndex1 = 1; |
|
393 |
|
394 THuiDisplayBackgroundItem newItem2( |
|
395 rect, skinnedColorGroup1, skinnedColorIndex1); |
|
396 newItem2.SetRect(rect2); |
|
397 |
|
398 newItem2.SetColor(skinnedColorGroup1, skinnedColorIndex1); |
|
399 backgroundItems.AppendL(newItem2); |
|
400 |
|
401 // Colors |
|
402 THuiDisplayBackgroundItem newItem3(rect, KRgbBlack); |
|
403 newItem3.SetRect(rect2); |
|
404 newItem3.SetColor(KRgbBlue); |
|
405 backgroundItems.AppendL(newItem3); |
|
406 |
|
407 // Empty |
|
408 |
|
409 THuiDisplayBackgroundItem newItem4(rect); |
|
410 newItem4.SetRect(rect2); |
|
411 backgroundItems.AppendL(newItem4); |
|
412 |
|
413 // Finally set to display |
|
414 huiDisplay->SetBackgroundItemsL(backgroundItems); |
|
415 backgroundItems.Close(); |
|
416 |
|
417 return KErrNone; |
|
418 |
|
419 } |
|
420 |
|
421 // ----------------------------------------------------------------------------- |
|
422 // CTestUiAifCoreToolkit::TestTDisplayCaptureLCL |
|
423 // ----------------------------------------------------------------------------- |
|
424 // |
|
425 TInt CTestUiAifCoreToolkit::TestTDisplayCaptureLCL( CStifItemParser& /*aItem*/ ) |
|
426 { |
|
427 |
|
428 // Print to UI |
|
429 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
430 _LIT( KTestTDisplayCaptureLCL, "In TestTDisplayCaptureLCL" ); |
|
431 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
432 KTestTDisplayCaptureLCL ); |
|
433 // Print to log file |
|
434 iLog->Log( KTestTDisplayCaptureLCL ); |
|
435 |
|
436 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
437 CHuiDisplay::EDisplayNormal); |
|
438 |
|
439 TSize captureSize = TSize(42,55); |
|
440 TUint8* ptr = NULL; |
|
441 ptr = huiDisplay->CaptureLC( captureSize ); |
|
442 STIF_ASSERT_NOT_NULL( ptr ); |
|
443 CleanupStack::PopAndDestroy( ptr ); |
|
444 |
|
445 return KErrNone; |
|
446 |
|
447 } |
|
448 |
|
449 // ----------------------------------------------------------------------------- |
|
450 // CTestUiAifCoreToolkit::TestTDisplayTransformationL |
|
451 // ----------------------------------------------------------------------------- |
|
452 // |
|
453 TInt CTestUiAifCoreToolkit::TestTDisplayTransformationL( CStifItemParser& /*aItem*/ ) |
|
454 { |
|
455 |
|
456 // Print to UI |
|
457 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
458 _LIT( KTestTDisplayTransformationL, "In TestTDisplayTransformationL" ); |
|
459 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
460 KTestTDisplayTransformationL); |
|
461 // Print to log file |
|
462 iLog->Log( KTestTDisplayTransformationL ); |
|
463 |
|
464 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
465 CHuiDisplay::EDisplayNormal); |
|
466 huiDisplay->Transformation(); |
|
467 |
|
468 return KErrNone; |
|
469 |
|
470 } |
|
471 |
|
472 // ----------------------------------------------------------------------------- |
|
473 // CTestUiAifCoreToolkit::TestTDisplayRosterL |
|
474 // ----------------------------------------------------------------------------- |
|
475 // |
|
476 TInt CTestUiAifCoreToolkit::TestTDisplayRosterL( CStifItemParser& /*aItem*/ ) |
|
477 { |
|
478 |
|
479 // Print to UI |
|
480 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
481 _LIT( KTestTDisplayRosterL, "In TestTDisplayRosterL" ); |
|
482 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
483 KTestTDisplayRosterL); |
|
484 // Print to log file |
|
485 iLog->Log( KTestTDisplayRosterL ); |
|
486 |
|
487 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
488 CHuiDisplay::EDisplayNormal); |
|
489 huiDisplay->Roster(); |
|
490 |
|
491 return KErrNone; |
|
492 |
|
493 } |
|
494 |
|
495 // ----------------------------------------------------------------------------- |
|
496 // CTestUiAifCoreToolkit::TestTDisplayConstRosterL |
|
497 // ----------------------------------------------------------------------------- |
|
498 // |
|
499 TInt CTestUiAifCoreToolkit::TestTDisplayConstRosterL( CStifItemParser& /*aItem*/ ) |
|
500 { |
|
501 |
|
502 // Print to UI |
|
503 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
504 _LIT( KTestTDisplayConstRosterL, "In TestTDisplayConstRosterL" ); |
|
505 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
506 KTestTDisplayConstRosterL); |
|
507 // Print to log file |
|
508 iLog->Log( KTestTDisplayConstRosterL ); |
|
509 |
|
510 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
511 CHuiDisplay::EDisplayNormal); |
|
512 ( (const CHuiDisplay* )huiDisplay )->Roster(); |
|
513 |
|
514 return KErrNone; |
|
515 |
|
516 } |
|
517 |
|
518 // ----------------------------------------------------------------------------- |
|
519 // CTestUiAifCoreToolkit::TestTDisplayShowL |
|
520 // ----------------------------------------------------------------------------- |
|
521 // |
|
522 TInt CTestUiAifCoreToolkit::TestTDisplayShowL( CStifItemParser& /*aItem*/ ) |
|
523 { |
|
524 |
|
525 // Print to UI |
|
526 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
527 _LIT( KTestTDisplayShowL, "In TestTDisplayConstRosterL" ); |
|
528 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
529 KTestTDisplayShowL); |
|
530 // Print to log file |
|
531 iLog->Log( KTestTDisplayShowL ); |
|
532 |
|
533 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
534 CHuiDisplay::EDisplayNormal); |
|
535 |
|
536 huiDisplay->Show( ETrue ); |
|
537 |
|
538 return KErrNone; |
|
539 |
|
540 } |
|
541 |
|
542 // ----------------------------------------------------------------------------- |
|
543 // CTestUiAifCoreToolkit::TestTDisplaySetDirtyL |
|
544 // ----------------------------------------------------------------------------- |
|
545 // |
|
546 TInt CTestUiAifCoreToolkit::TestTDisplaySetDirtyL( CStifItemParser& /*aItem*/ ) |
|
547 { |
|
548 |
|
549 // Print to UI |
|
550 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
551 _LIT( KTestTDisplaySetDirtyL, "In TestTDisplaySetDirtyL" ); |
|
552 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
553 KTestTDisplaySetDirtyL); |
|
554 // Print to log file |
|
555 iLog->Log( KTestTDisplaySetDirtyL ); |
|
556 |
|
557 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
558 CHuiDisplay::EDisplayNormal); |
|
559 |
|
560 huiDisplay->SetDirty(); |
|
561 |
|
562 return KErrNone; |
|
563 |
|
564 } |
|
565 |
|
566 // ----------------------------------------------------------------------------- |
|
567 // CTestUiAifCoreToolkit::TestTDisplaySetQualityL |
|
568 // ----------------------------------------------------------------------------- |
|
569 // |
|
570 TInt CTestUiAifCoreToolkit::TestTDisplaySetQualityL( CStifItemParser& /*aItem*/ ) |
|
571 { |
|
572 |
|
573 // Print to UI |
|
574 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
575 _LIT( KTestTDisplaySetQualityL, "In TestTDisplaySetQualityL" ); |
|
576 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
577 KTestTDisplaySetQualityL); |
|
578 // Print to log file |
|
579 iLog->Log( KTestTDisplaySetQualityL ); |
|
580 |
|
581 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
582 CHuiDisplay::EDisplayNormal); |
|
583 |
|
584 huiDisplay->SetQuality( EHuiQualityAccurate ); |
|
585 |
|
586 return KErrNone; |
|
587 |
|
588 } |
|
589 |
|
590 // ----------------------------------------------------------------------------- |
|
591 // CTestUiAifCoreToolkit::TestTDisplayQualityL |
|
592 // ----------------------------------------------------------------------------- |
|
593 // |
|
594 TInt CTestUiAifCoreToolkit::TestTDisplayQualityL( CStifItemParser& /*aItem*/ ) |
|
595 { |
|
596 |
|
597 // Print to UI |
|
598 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
599 _LIT( KTestTDisplayQualityL, "In TestTDisplayQualityL" ); |
|
600 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
601 KTestTDisplayQualityL); |
|
602 // Print to log file |
|
603 iLog->Log( KTestTDisplayQualityL ); |
|
604 |
|
605 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
606 CHuiDisplay::EDisplayNormal); |
|
607 |
|
608 huiDisplay->Quality(); |
|
609 |
|
610 return KErrNone; |
|
611 |
|
612 } |
|
613 |
|
614 // ----------------------------------------------------------------------------- |
|
615 // CTestUiAifCoreToolkit::TestTDisplaySetUsageLL |
|
616 // ----------------------------------------------------------------------------- |
|
617 // |
|
618 TInt CTestUiAifCoreToolkit::TestTDisplaySetUsageLL( CStifItemParser& /*aItem*/ ) |
|
619 { |
|
620 |
|
621 // Print to UI |
|
622 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
623 _LIT( KTestTDisplaySetUsageLL, "In KTestTDisplaySetUsageLL" ); |
|
624 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
625 KTestTDisplaySetUsageLL); |
|
626 // Print to log file |
|
627 iLog->Log( KTestTDisplaySetUsageLL ); |
|
628 |
|
629 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
630 CHuiDisplay::EDisplayNormal); |
|
631 |
|
632 huiDisplay->SetUsageL( EHuiDisplayUsageGeneric ); |
|
633 |
|
634 return KErrNone; |
|
635 |
|
636 } |
|
637 |
|
638 // ----------------------------------------------------------------------------- |
|
639 // CTestUiAifCoreToolkit::TestTDisplayReleaseL |
|
640 // ----------------------------------------------------------------------------- |
|
641 // |
|
642 TInt CTestUiAifCoreToolkit::TestTDisplayReleaseL( CStifItemParser& /*aItem*/ ) |
|
643 { |
|
644 |
|
645 // Print to UI |
|
646 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
647 _LIT( KTestTDisplayReleaseL, "In TestTDisplayReleaseL" ); |
|
648 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
649 KTestTDisplayReleaseL); |
|
650 // Print to log file |
|
651 iLog->Log( KTestTDisplayReleaseL ); |
|
652 |
|
653 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
654 CHuiDisplay::EDisplayNormal); |
|
655 |
|
656 huiDisplay->Release(); |
|
657 |
|
658 return KErrNone; |
|
659 |
|
660 } |
|
661 |
|
662 // ----------------------------------------------------------------------------- |
|
663 // CTestUiAifCoreToolkit::TestTDisplayRestoreLL |
|
664 // ----------------------------------------------------------------------------- |
|
665 // |
|
666 TInt CTestUiAifCoreToolkit::TestTDisplayRestoreLL( CStifItemParser& /*aItem*/ ) |
|
667 { |
|
668 |
|
669 // Print to UI |
|
670 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
671 _LIT( KTestTDisplayRestoreLL, "In TestTDisplayRestoreLL" ); |
|
672 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
673 KTestTDisplayRestoreLL); |
|
674 // Print to log file |
|
675 iLog->Log( KTestTDisplayRestoreLL ); |
|
676 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
677 CHuiDisplay::EDisplayNormal); |
|
678 |
|
679 huiDisplay->RestoreL(); |
|
680 |
|
681 return KErrNone; |
|
682 |
|
683 } |
|
684 |
|
685 // ----------------------------------------------------------------------------- |
|
686 // CTestUiAifCoreToolkit::TestTDisplaySetScreenBufferLockL |
|
687 // ----------------------------------------------------------------------------- |
|
688 // |
|
689 TInt CTestUiAifCoreToolkit::TestTDisplaySetScreenBufferLockL( CStifItemParser& /*aItem*/ ) |
|
690 { |
|
691 |
|
692 // Print to UI |
|
693 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
694 _LIT( KTestTDisplaySetScreenBufferLockL, |
|
695 "In TestTDisplaySetScreenBufferLockL" ); |
|
696 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
697 KTestTDisplaySetScreenBufferLockL); |
|
698 // Print to log file |
|
699 iLog->Log( KTestTDisplaySetScreenBufferLockL ); |
|
700 |
|
701 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
702 CHuiDisplay::EDisplayNormal); |
|
703 |
|
704 huiDisplay->SetScreenBufferLock(ETrue); |
|
705 huiDisplay->SetScreenBufferLock(EFalse); |
|
706 |
|
707 return KErrNone; |
|
708 |
|
709 } |
|
710 |
|
711 // ----------------------------------------------------------------------------- |
|
712 // CTestUiAifCoreToolkit::TestTDisplayIsScreenBufferLockedL |
|
713 // ----------------------------------------------------------------------------- |
|
714 // |
|
715 TInt CTestUiAifCoreToolkit::TestTDisplayIsScreenBufferLockedL( CStifItemParser& /*aItem*/ ) |
|
716 { |
|
717 |
|
718 // Print to UI |
|
719 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
720 _LIT( KTestTDisplayIsScreenBufferLockedL, |
|
721 "In TestTDisplaySetScreenBufferLockL" ); |
|
722 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
723 KTestTDisplayIsScreenBufferLockedL ); |
|
724 // Print to log file |
|
725 iLog->Log( KTestTDisplayIsScreenBufferLockedL ); |
|
726 |
|
727 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
728 CHuiDisplay::EDisplayNormal); |
|
729 |
|
730 huiDisplay->SetScreenBufferLock(ETrue); |
|
731 TBool result = huiDisplay->IsScreenBufferLocked(); |
|
732 STIF_ASSERT_TRUE( result ); |
|
733 |
|
734 huiDisplay->SetScreenBufferLock(EFalse); |
|
735 result = huiDisplay->IsScreenBufferLocked(); |
|
736 STIF_ASSERT_TRUE( !result ); |
|
737 |
|
738 return KErrNone; |
|
739 |
|
740 } |
|
741 |
|
742 // ----------------------------------------------------------------------------- |
|
743 // CTestUiAifCoreToolkit::TestTDisplayGetDrawingInterfaceL |
|
744 // ----------------------------------------------------------------------------- |
|
745 // |
|
746 TInt CTestUiAifCoreToolkit::TestTDisplayGetDrawingInterfaceL( CStifItemParser& /*aItem*/ ) |
|
747 { |
|
748 |
|
749 // Print to UI |
|
750 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
751 _LIT( KTestTDisplayGetDrawingInterfaceL, |
|
752 "In TestTDisplayGetDrawingInterfaceL" ); |
|
753 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
754 KTestTDisplayGetDrawingInterfaceL ); |
|
755 // Print to log file |
|
756 iLog->Log( KTestTDisplayGetDrawingInterfaceL ); |
|
757 |
|
758 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
759 CHuiDisplay::EDisplayNormal); |
|
760 |
|
761 TUid dummyUid = {0x1234}; |
|
762 MHuiBufferDrawer* result = huiDisplay->GetDrawingInterface( dummyUid ); |
|
763 STIF_ASSERT_EQUALS( result, (MHuiBufferDrawer*)NULL ); |
|
764 |
|
765 return KErrNone; |
|
766 |
|
767 } |
|
768 |
|
769 // ----------------------------------------------------------------------------- |
|
770 // CTestUiAifCoreToolkit::TestTDisplayGetGraphicsContextL |
|
771 // ----------------------------------------------------------------------------- |
|
772 // |
|
773 TInt CTestUiAifCoreToolkit::TestTDisplayGetGraphicsContextL( CStifItemParser& /*aItem*/ ) |
|
774 { |
|
775 |
|
776 // Print to UI |
|
777 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
778 _LIT( KTestTDisplayGetDrawingInterfaceL, |
|
779 "In TestTDisplayGetDrawingInterfaceL" ); |
|
780 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
781 KTestTDisplayGetDrawingInterfaceL ); |
|
782 // Print to log file |
|
783 iLog->Log( KTestTDisplayGetDrawingInterfaceL ); |
|
784 |
|
785 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
786 CHuiDisplay::EDisplayNormal); |
|
787 |
|
788 TUid dummyUid = {0x1234}; |
|
789 MHuiGc* result = huiDisplay->GetGraphicsContext( dummyUid ); |
|
790 STIF_ASSERT_EQUALS( result, (MHuiGc*)NULL ); |
|
791 |
|
792 TUid KHuiInternalFbsBitmapBufferGcUid = {0x2000e5a3}; |
|
793 result = huiDisplay->GetGraphicsContext( KHuiInternalFbsBitmapBufferGcUid ); |
|
794 result->ReleaseGc(); |
|
795 STIF_ASSERT_NOT_EQUALS( result , (MHuiGc*)NULL ); |
|
796 |
|
797 // *** Get internal bitmap handle |
|
798 |
|
799 MHuiFbsBitmapBufferGc* gc = |
|
800 (MHuiFbsBitmapBufferGc*)huiDisplay->GetGraphicsContext( |
|
801 KHuiInternalFbsBitmapBufferGcUid ); |
|
802 STIF_ASSERT_NOT_EQUALS( gc , (MHuiFbsBitmapBufferGc*)NULL ); |
|
803 CFbsBitmap* bitmap = gc->Bitmap(); |
|
804 STIF_ASSERT_NOT_EQUALS( bitmap , (CFbsBitmap*)NULL ); |
|
805 STIF_ASSERT_NOT_EQUALS( bitmap->Handle() , 0 ); |
|
806 result->ReleaseGc(); |
|
807 |
|
808 return KErrNone; |
|
809 |
|
810 } |
|
811 |
|
812 // ----------------------------------------------------------------------------- |
|
813 // CTestUiAifCoreToolkit::TestTDisplayAddScreenBufferObserverLL |
|
814 // ----------------------------------------------------------------------------- |
|
815 // |
|
816 TInt CTestUiAifCoreToolkit::TestTDisplayAddScreenBufferObserverLL( CStifItemParser& /*aItem*/ ) |
|
817 { |
|
818 |
|
819 // Print to UI |
|
820 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
821 _LIT( KTestTDisplayAddScreenBufferObserverLL, |
|
822 "In TestTDisplayAddScreenBufferObserverLL" ); |
|
823 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
824 KTestTDisplayAddScreenBufferObserverLL ); |
|
825 // Print to log file |
|
826 iLog->Log( KTestTDisplayAddScreenBufferObserverLL ); |
|
827 |
|
828 TUid bufferUid = {KTestScreenBufferUidValue}; |
|
829 |
|
830 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
831 CHuiDisplay::EDisplayOffScreenBuffer, bufferUid); |
|
832 |
|
833 huiDisplay->AddScreenBufferObserverL( NULL ); |
|
834 |
|
835 // Currently address is not checked in this method |
|
836 huiDisplay->AddScreenBufferObserverL( (MHuiScreenBufferObserver*)1234 ); |
|
837 huiDisplay->RemoveScreenBufferObserver(); |
|
838 |
|
839 // *** Delete display: Generate one EDeleted event |
|
840 |
|
841 CTestScreenBufferObserver* obs = new(ELeave) CTestScreenBufferObserver(); |
|
842 CleanupStack::PushL(obs); |
|
843 huiDisplay->AddScreenBufferObserverL( obs ); |
|
844 |
|
845 delete huiDisplay; |
|
846 huiDisplay = NULL; |
|
847 |
|
848 STIF_ASSERT_EQUALS( obs->iScreenBufferComplete_Count, 0 ); |
|
849 STIF_ASSERT_TRUE( obs->iScreenBufferComplete_LastBufferUid.iUid == 0 ); |
|
850 STIF_ASSERT_EQUALS( obs->iScreenBufferComplete_LastDisplayRect, TRect() ); |
|
851 STIF_ASSERT_EQUALS( obs->iScreenBufferComplete_LastDirtyRect.Size(), TSize() ); |
|
852 STIF_ASSERT_EQUALS( obs->iHandleScreenBufferEvent_DeleteEventCount, 1 ); |
|
853 STIF_ASSERT_TRUE( obs->iHandleScreenBufferEvent_LastBufferUid.iUid == |
|
854 KTestScreenBufferUidValue ); |
|
855 |
|
856 CleanupStack::PopAndDestroy(obs); |
|
857 |
|
858 return KErrNone; |
|
859 |
|
860 } |
|
861 |
|
862 // ----------------------------------------------------------------------------- |
|
863 // CTestUiAifCoreToolkit::TestTDisplayRemoveScreenBufferObserverL |
|
864 // ----------------------------------------------------------------------------- |
|
865 // |
|
866 TInt CTestUiAifCoreToolkit::TestTDisplayRemoveScreenBufferObserverL( CStifItemParser& /*aItem*/ ) |
|
867 { |
|
868 |
|
869 // Print to UI |
|
870 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
871 _LIT( KTestTDisplayRemoveScreenBufferObserverL, |
|
872 "In TestTDisplayRemoveScreenBufferObserverL" ); |
|
873 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
874 KTestTDisplayRemoveScreenBufferObserverL ); |
|
875 // Print to log file |
|
876 iLog->Log( KTestTDisplayRemoveScreenBufferObserverL ); |
|
877 |
|
878 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
879 CHuiDisplay::EDisplayNormal); |
|
880 |
|
881 CTestScreenBufferObserver* obs = new(ELeave) CTestScreenBufferObserver(); |
|
882 CleanupStack::PushL(obs); |
|
883 huiDisplay->AddScreenBufferObserverL( obs ); |
|
884 huiDisplay->RemoveScreenBufferObserver(); |
|
885 CleanupStack::PopAndDestroy(obs); |
|
886 |
|
887 return KErrNone; |
|
888 |
|
889 } |
|
890 |
|
891 // ----------------------------------------------------------------------------- |
|
892 // CTestUiAifCoreToolkit::TestTDisplayScreenBufferObserverL |
|
893 // ----------------------------------------------------------------------------- |
|
894 // |
|
895 TInt CTestUiAifCoreToolkit::TestTDisplayScreenBufferObserverL( CStifItemParser& /*aItem*/ ) |
|
896 { |
|
897 |
|
898 // Print to UI |
|
899 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
900 _LIT( KTestTDisplayScreenBufferObserverL, |
|
901 "In TestTDisplayScreenBufferObserverL" ); |
|
902 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
903 KTestTDisplayScreenBufferObserverL ); |
|
904 // Print to log file |
|
905 iLog->Log( KTestTDisplayScreenBufferObserverL ); |
|
906 |
|
907 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
908 CHuiDisplay::EDisplayNormal); |
|
909 |
|
910 huiDisplay->ScreenBufferObserver(); |
|
911 |
|
912 return KErrNone; |
|
913 |
|
914 } |
|
915 |
|
916 // ----------------------------------------------------------------------------- |
|
917 // CTestUiAifCoreToolkit::TestTDisplayScreenBufferUidL |
|
918 // ----------------------------------------------------------------------------- |
|
919 // |
|
920 TInt CTestUiAifCoreToolkit::TestTDisplayScreenBufferUidL( CStifItemParser& /*aItem*/ ) |
|
921 { |
|
922 |
|
923 // Print to UI |
|
924 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
925 _LIT( KTestTDisplayScreenBufferUidL, |
|
926 "In TestTDisplayScreenBufferUidL" ); |
|
927 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
928 KTestTDisplayScreenBufferUidL ); |
|
929 // Print to log file |
|
930 iLog->Log( KTestTDisplayScreenBufferUidL ); |
|
931 |
|
932 TUid bufferUid = {KTestScreenBufferUidValue}; |
|
933 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
934 CHuiDisplay::EDisplayOffScreenBuffer, bufferUid); |
|
935 |
|
936 TUid result = huiDisplay->ScreenBufferUid( ); |
|
937 STIF_ASSERT_TRUE( result.iUid == KTestScreenBufferUidValue ); |
|
938 |
|
939 return KErrNone; |
|
940 |
|
941 } |
|
942 |
|
943 // ----------------------------------------------------------------------------- |
|
944 // CTestUiAifCoreToolkit::TestTDisplayDisplayTypeL |
|
945 // ----------------------------------------------------------------------------- |
|
946 // |
|
947 TInt CTestUiAifCoreToolkit::TestTDisplayDisplayTypeL( CStifItemParser& /*aItem*/ ) |
|
948 { |
|
949 |
|
950 // Print to UI |
|
951 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
952 _LIT( KTestTDisplayDisplayTypeL, |
|
953 "In TestTDisplayDisplayTypeL" ); |
|
954 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
955 KTestTDisplayDisplayTypeL ); |
|
956 // Print to log file |
|
957 iLog->Log( KTestTDisplayDisplayTypeL ); |
|
958 |
|
959 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
960 CHuiDisplay::EDisplayOffScreenBuffer); |
|
961 |
|
962 TInt result = huiDisplay->DisplayType(); |
|
963 STIF_ASSERT_TRUE( result == CHuiDisplay::EDisplayOffScreenBuffer ); |
|
964 |
|
965 return KErrNone; |
|
966 |
|
967 } |
|
968 |
|
969 // ----------------------------------------------------------------------------- |
|
970 // CTestUiAifCoreToolkit::TestTDisplayShowDirtyRegionsL |
|
971 // ----------------------------------------------------------------------------- |
|
972 // |
|
973 TInt CTestUiAifCoreToolkit::TestTDisplayShowDirtyRegionsL( CStifItemParser& /*aItem*/ ) |
|
974 { |
|
975 |
|
976 // Print to UI |
|
977 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
978 _LIT( KTestTDisplayShowDirtyRegionsL, |
|
979 "In TestTDisplayShowDirtyRegionsL" ); |
|
980 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
981 KTestTDisplayShowDirtyRegionsL ); |
|
982 // Print to log file |
|
983 iLog->Log( KTestTDisplayShowDirtyRegionsL ); |
|
984 |
|
985 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
986 CHuiDisplay::EDisplayNormal); |
|
987 |
|
988 huiDisplay->ShowDirtyRegions(); |
|
989 |
|
990 return KErrNone; |
|
991 |
|
992 } |
|
993 |
|
994 // ----------------------------------------------------------------------------- |
|
995 // CTestUiAifCoreToolkit::TestTDisplayGetPreferredTextureFormatsL |
|
996 // ----------------------------------------------------------------------------- |
|
997 // |
|
998 TInt CTestUiAifCoreToolkit::TestTDisplayGetPreferredTextureFormatsL( CStifItemParser& /*aItem*/ ) |
|
999 { |
|
1000 |
|
1001 // Print to UI |
|
1002 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1003 _LIT( KTestTDisplayGetPreferredTextureFormatsL, |
|
1004 "In TestTDisplayGetPreferredTextureFormatsL" ); |
|
1005 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
1006 KTestTDisplayGetPreferredTextureFormatsL ); |
|
1007 // Print to log file |
|
1008 iLog->Log( KTestTDisplayGetPreferredTextureFormatsL ); |
|
1009 |
|
1010 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
1011 CHuiDisplay::EDisplayNormal); |
|
1012 RPointerArray<CHuiDisplay::CTextureBitmapFormat> textureFormats; |
|
1013 huiDisplay->GetPreferredTextureFormats( textureFormats ); |
|
1014 |
|
1015 return KErrNone; |
|
1016 |
|
1017 } |
|
1018 |
|
1019 // ----------------------------------------------------------------------------- |
|
1020 // CTestUiAifCoreToolkit::TestTDisplaySetDrawVisualOutlineL |
|
1021 // ----------------------------------------------------------------------------- |
|
1022 // |
|
1023 TInt CTestUiAifCoreToolkit::TestTDisplaySetDrawVisualOutlineL( CStifItemParser& /*aItem*/ ) |
|
1024 { |
|
1025 |
|
1026 // Print to UI |
|
1027 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1028 _LIT( KTestTDisplaySetDrawVisualOutlineL, |
|
1029 "In TestTDisplaySetDrawVisualOutlineL" ); |
|
1030 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
1031 KTestTDisplaySetDrawVisualOutlineL ); |
|
1032 // Print to log file |
|
1033 iLog->Log( KTestTDisplaySetDrawVisualOutlineL ); |
|
1034 |
|
1035 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
1036 CHuiDisplay::EDisplayNormal); |
|
1037 TUint temp = 0; |
|
1038 huiDisplay->SetDrawVisualOutline( temp ); |
|
1039 |
|
1040 return KErrNone; |
|
1041 |
|
1042 } |
|
1043 |
|
1044 // ----------------------------------------------------------------------------- |
|
1045 // CTestUiAifCoreToolkit::TestTDisplaySetVisibleAreaClippingRectL |
|
1046 // ----------------------------------------------------------------------------- |
|
1047 // |
|
1048 TInt CTestUiAifCoreToolkit::TestTDisplaySetVisibleAreaClippingRectL( CStifItemParser& /*aItem*/ ) |
|
1049 { |
|
1050 |
|
1051 // Print to UI |
|
1052 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1053 _LIT( KTestTDisplaySetVisibleAreaClippingRectL, |
|
1054 "In TestTDisplaySetVisibleAreaClippingRectL" ); |
|
1055 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
1056 KTestTDisplaySetVisibleAreaClippingRectL ); |
|
1057 // Print to log file |
|
1058 iLog->Log( KTestTDisplaySetVisibleAreaClippingRectL ); |
|
1059 |
|
1060 CHuiDisplay* huiDisplay = &iHuiEnv->NewDisplayL(iDisplayRect, NULL, 0, NULL, |
|
1061 CHuiDisplay::EDisplayNormal); |
|
1062 |
|
1063 huiDisplay->SetVisibleAreaClippingRect( iDisplayRect ); |
|
1064 |
|
1065 return KErrNone; |
|
1066 |
|
1067 } |
|
1068 |
|
1069 // [End of File] |