|
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 the License "Symbian Foundation License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Test AknsDrawUtils.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <aknsdrawutils.h> |
|
20 #include <aknsbasicbackgroundcontrolcontext.h> |
|
21 |
|
22 #include "testsdkskins.h" |
|
23 #include "testsdkskinsobjectprovider.h" |
|
24 #include "testsdkskinscontrol.h" |
|
25 |
|
26 const TInt KLength = 10; |
|
27 |
|
28 // ============================ MEMBER FUNCTIONS =============================== |
|
29 // ----------------------------------------------------------------------------- |
|
30 // CTestSDKSkins::TestDUControlContextL |
|
31 // ----------------------------------------------------------------------------- |
|
32 TInt CTestSDKSkins::TestDUControlContextL( CStifItemParser& /*aItem*/ ) |
|
33 { |
|
34 CTestSDKSkinsObjectProvider* provider = new (ELeave) CTestSDKSkinsObjectProvider; |
|
35 CleanupStack::PushL( provider ); |
|
36 STIF_ASSERT_NOT_NULL( provider ); |
|
37 |
|
38 MAknsControlContext* context = AknsDrawUtils::ControlContext( provider ); |
|
39 CleanupStack::PushL( context ); |
|
40 |
|
41 CleanupStack::PopAndDestroy( context ); |
|
42 CleanupStack::PopAndDestroy( provider ); |
|
43 |
|
44 return KErrNone; |
|
45 |
|
46 } |
|
47 |
|
48 // ----------------------------------------------------------------------------- |
|
49 // CTestSDKSkins::TestDUControlContextOfParentL |
|
50 // ----------------------------------------------------------------------------- |
|
51 TInt CTestSDKSkins::TestDUControlContextOfParentL( CStifItemParser& /*aItem*/ ) |
|
52 { |
|
53 CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL(); |
|
54 CleanupStack::PushL( control ); |
|
55 STIF_ASSERT_NOT_NULL( control ); |
|
56 |
|
57 MAknsControlContext* context = AknsDrawUtils::ControlContextOfParent( control ); |
|
58 CleanupStack::PushL( context ); |
|
59 |
|
60 CleanupStack::PopAndDestroy( context ); |
|
61 CleanupStack::PopAndDestroy( control ); |
|
62 |
|
63 return KErrNone; |
|
64 |
|
65 } |
|
66 |
|
67 // ----------------------------------------------------------------------------- |
|
68 // CTestSDKSkins::TestDUBackgroundL |
|
69 // ----------------------------------------------------------------------------- |
|
70 TInt CTestSDKSkins::TestDUBackgroundL( CStifItemParser& /*aItem*/ ) |
|
71 { |
|
72 TAknsItemID itemID; |
|
73 TPoint pointTL( 0, 0 ); |
|
74 TPoint pointBR( KLength, KLength ); |
|
75 TRect rect( pointTL, pointBR ); |
|
76 CAknsBasicBackgroundControlContext* context = |
|
77 CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue ); |
|
78 CleanupStack::PushL( context ); |
|
79 STIF_ASSERT_NOT_NULL( context ); |
|
80 |
|
81 CWindowGc& gc = CCoeEnv::Static()->SystemGc(); |
|
82 |
|
83 CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL(); |
|
84 CleanupStack::PushL( control ); |
|
85 STIF_ASSERT_NOT_NULL( control ); |
|
86 control->ActivateGc(); |
|
87 |
|
88 MAknsSkinInstance* instance = AknsUtils::SkinInstance(); |
|
89 |
|
90 TBool draw = AknsDrawUtils::Background( instance, |
|
91 context, |
|
92 gc, |
|
93 rect ); |
|
94 |
|
95 control->DeactivateGc(); |
|
96 CleanupStack::PopAndDestroy( control ); |
|
97 CleanupStack::PopAndDestroy( context ); |
|
98 |
|
99 return KErrNone; |
|
100 |
|
101 } |
|
102 |
|
103 // ----------------------------------------------------------------------------- |
|
104 // CTestSDKSkins::TestDUBackgroundFPL |
|
105 // ----------------------------------------------------------------------------- |
|
106 TInt CTestSDKSkins::TestDUBackgroundFPL( CStifItemParser& /*aItem*/ ) |
|
107 { |
|
108 TAknsItemID itemID; |
|
109 TPoint pointTL( 0, 0 ); |
|
110 TPoint pointBR( KLength, KLength ); |
|
111 TRect rect( pointTL, pointBR ); |
|
112 CAknsBasicBackgroundControlContext* context = |
|
113 CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue ); |
|
114 CleanupStack::PushL( context ); |
|
115 STIF_ASSERT_NOT_NULL( context ); |
|
116 |
|
117 CWindowGc& gc = CCoeEnv::Static()->SystemGc(); |
|
118 |
|
119 CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL(); |
|
120 CleanupStack::PushL( control ); |
|
121 STIF_ASSERT_NOT_NULL( control ); |
|
122 control->ActivateGc(); |
|
123 |
|
124 MAknsSkinInstance* instance = AknsUtils::SkinInstance(); |
|
125 |
|
126 TBool draw = AknsDrawUtils::Background( instance, |
|
127 context, |
|
128 control, |
|
129 gc, |
|
130 rect ); |
|
131 |
|
132 control->DeactivateGc(); |
|
133 CleanupStack::PopAndDestroy( control ); |
|
134 CleanupStack::PopAndDestroy( context ); |
|
135 |
|
136 return KErrNone; |
|
137 |
|
138 } |
|
139 |
|
140 // ----------------------------------------------------------------------------- |
|
141 // CTestSDKSkins::TestDUBackgroundSPL |
|
142 // ----------------------------------------------------------------------------- |
|
143 TInt CTestSDKSkins::TestDUBackgroundSPL( CStifItemParser& /*aItem*/ ) |
|
144 { |
|
145 TAknsItemID itemID; |
|
146 TPoint pointTL( 0, 0 ); |
|
147 TPoint pointBR( KLength, KLength ); |
|
148 TRect rect( pointTL, pointBR ); |
|
149 CAknsBasicBackgroundControlContext* context = |
|
150 CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue ); |
|
151 CleanupStack::PushL( context ); |
|
152 STIF_ASSERT_NOT_NULL( context ); |
|
153 |
|
154 CWindowGc& gc = CCoeEnv::Static()->SystemGc(); |
|
155 |
|
156 CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL(); |
|
157 CleanupStack::PushL( control ); |
|
158 STIF_ASSERT_NOT_NULL( control ); |
|
159 |
|
160 MAknsSkinInstance* instance = AknsUtils::SkinInstance(); |
|
161 control->ActivateGc(); |
|
162 |
|
163 TBool draw = AknsDrawUtils::Background( instance, |
|
164 context, |
|
165 control, |
|
166 gc, |
|
167 rect, |
|
168 KAknsDrawParamDefault ); |
|
169 |
|
170 control->DeactivateGc(); |
|
171 CleanupStack::PopAndDestroy( control ); |
|
172 CleanupStack::PopAndDestroy( context ); |
|
173 |
|
174 return KErrNone; |
|
175 |
|
176 } |
|
177 |
|
178 // ----------------------------------------------------------------------------- |
|
179 // CTestSDKSkins::TestDUDrawBackgroundL |
|
180 // ----------------------------------------------------------------------------- |
|
181 TInt CTestSDKSkins::TestDUDrawBackgroundL( CStifItemParser& /*aItem*/ ) |
|
182 { |
|
183 TAknsItemID itemID; |
|
184 TPoint pointTL( 0, 0 ); |
|
185 TPoint pointBR( KLength, KLength ); |
|
186 TRect rect( pointTL, pointBR ); |
|
187 CAknsBasicBackgroundControlContext* context = |
|
188 CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue ); |
|
189 CleanupStack::PushL( context ); |
|
190 STIF_ASSERT_NOT_NULL( context ); |
|
191 |
|
192 CWindowGc& gc = CCoeEnv::Static()->SystemGc(); |
|
193 |
|
194 CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL(); |
|
195 CleanupStack::PushL( control ); |
|
196 STIF_ASSERT_NOT_NULL( control ); |
|
197 |
|
198 control->ActivateGc(); |
|
199 |
|
200 MAknsSkinInstance* instance = AknsUtils::SkinInstance(); |
|
201 |
|
202 TBool draw = AknsDrawUtils::DrawBackground( instance, |
|
203 context, |
|
204 control, |
|
205 gc, |
|
206 pointTL, |
|
207 rect, |
|
208 KAknsDrawParamDefault ); |
|
209 |
|
210 control->DeactivateGc(); |
|
211 CleanupStack::PopAndDestroy( control ); |
|
212 CleanupStack::PopAndDestroy( context ); |
|
213 |
|
214 return KErrNone; |
|
215 |
|
216 } |
|
217 |
|
218 // ----------------------------------------------------------------------------- |
|
219 // CTestSDKSkins::TestDUBackgroundBetweenRectsFPL |
|
220 // ----------------------------------------------------------------------------- |
|
221 TInt CTestSDKSkins::TestDUBackgroundBetweenRectsFPL( CStifItemParser& /*aItem*/ ) |
|
222 { |
|
223 TAknsItemID itemID; |
|
224 TPoint pointTL( 0, 0 ); |
|
225 TPoint pointBR( KLength, KLength ); |
|
226 TRect rect( pointTL, pointBR ); |
|
227 CAknsBasicBackgroundControlContext* context = |
|
228 CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue ); |
|
229 CleanupStack::PushL( context ); |
|
230 STIF_ASSERT_NOT_NULL( context ); |
|
231 |
|
232 CWindowGc& gc = CCoeEnv::Static()->SystemGc(); |
|
233 |
|
234 const TInt KOutPoint = 50; |
|
235 TPoint outPoint( KOutPoint, KOutPoint ); |
|
236 const TInt KInPoint = 40; |
|
237 TPoint inPoint( KInPoint, KInPoint ); |
|
238 TRect outRect( pointTL, outPoint ); |
|
239 TRect inRect( pointBR, inPoint ); |
|
240 |
|
241 CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL(); |
|
242 CleanupStack::PushL( control ); |
|
243 STIF_ASSERT_NOT_NULL( control ); |
|
244 |
|
245 control->ActivateGc(); |
|
246 |
|
247 TBool draw = AknsDrawUtils::BackgroundBetweenRects( AknsUtils::SkinInstance(), |
|
248 context, |
|
249 gc, |
|
250 outRect, |
|
251 inRect ); |
|
252 |
|
253 control->DeactivateGc(); |
|
254 CleanupStack::PopAndDestroy( control ); |
|
255 CleanupStack::PopAndDestroy( context ); |
|
256 |
|
257 return KErrNone; |
|
258 |
|
259 } |
|
260 |
|
261 // ----------------------------------------------------------------------------- |
|
262 // CTestSDKSkins::TestDUBackgroundBetweenRectsL |
|
263 // ----------------------------------------------------------------------------- |
|
264 TInt CTestSDKSkins::TestDUBackgroundBetweenRectsL( CStifItemParser& /*aItem*/ ) |
|
265 { |
|
266 TAknsItemID itemID; |
|
267 TPoint pointTL( 0, 0 ); |
|
268 TPoint pointBR( KLength, KLength ); |
|
269 TRect rect( pointTL, pointBR ); |
|
270 CAknsBasicBackgroundControlContext* context = |
|
271 CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue ); |
|
272 CleanupStack::PushL( context ); |
|
273 STIF_ASSERT_NOT_NULL( context ); |
|
274 |
|
275 CWindowGc& gc = CCoeEnv::Static()->SystemGc(); |
|
276 |
|
277 CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL(); |
|
278 CleanupStack::PushL( control ); |
|
279 STIF_ASSERT_NOT_NULL( control ); |
|
280 control->ActivateGc(); |
|
281 |
|
282 const TInt KOutPoint = 50; |
|
283 TPoint outPoint( KOutPoint, KOutPoint ); |
|
284 const TInt KInPoint = 40; |
|
285 TPoint inPoint( KInPoint, KInPoint ); |
|
286 TRect outRect( pointTL, outPoint ); |
|
287 TRect inRect( pointBR, inPoint ); |
|
288 |
|
289 TBool draw = AknsDrawUtils::BackgroundBetweenRects( AknsUtils::SkinInstance(), |
|
290 context, |
|
291 control, |
|
292 gc, |
|
293 outRect, |
|
294 inRect ); |
|
295 |
|
296 control->DeactivateGc(); |
|
297 CleanupStack::PopAndDestroy( control ); |
|
298 CleanupStack::PopAndDestroy( context ); |
|
299 |
|
300 return KErrNone; |
|
301 |
|
302 } |
|
303 |
|
304 // ----------------------------------------------------------------------------- |
|
305 // CTestSDKSkins::TestDUBackgroundBetweenRectsSPL |
|
306 // ----------------------------------------------------------------------------- |
|
307 TInt CTestSDKSkins::TestDUBackgroundBetweenRectsSPL( CStifItemParser& /*aItem*/ ) |
|
308 { |
|
309 TAknsItemID itemID; |
|
310 TPoint pointTL( 0, 0 ); |
|
311 TPoint pointBR( KLength, KLength ); |
|
312 TRect rect( pointTL, pointBR ); |
|
313 CAknsBasicBackgroundControlContext* context = |
|
314 CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue ); |
|
315 CleanupStack::PushL( context ); |
|
316 STIF_ASSERT_NOT_NULL( context ); |
|
317 |
|
318 CWindowGc& gc = CCoeEnv::Static()->SystemGc(); |
|
319 |
|
320 CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL(); |
|
321 CleanupStack::PushL( control ); |
|
322 STIF_ASSERT_NOT_NULL( control ); |
|
323 control->ActivateGc(); |
|
324 |
|
325 const TInt KOutPoint = 50; |
|
326 TPoint outPoint( KOutPoint, KOutPoint ); |
|
327 const TInt KInPoint = 40; |
|
328 TPoint inPoint( KInPoint, KInPoint ); |
|
329 TRect outRect( pointTL, outPoint ); |
|
330 TRect inRect( pointBR, inPoint ); |
|
331 |
|
332 TBool draw = AknsDrawUtils::BackgroundBetweenRects( AknsUtils::SkinInstance(), |
|
333 context, |
|
334 control, |
|
335 gc, |
|
336 outRect, |
|
337 inRect, |
|
338 KAknsDrawParamDefault ); |
|
339 |
|
340 control->DeactivateGc(); |
|
341 CleanupStack::PopAndDestroy( control ); |
|
342 CleanupStack::PopAndDestroy( context ); |
|
343 |
|
344 return KErrNone; |
|
345 |
|
346 } |
|
347 |
|
348 // ----------------------------------------------------------------------------- |
|
349 // CTestSDKSkins::TestDUHasBitmapBackgroundL |
|
350 // ----------------------------------------------------------------------------- |
|
351 TInt CTestSDKSkins::TestDUHasBitmapBackgroundL( CStifItemParser& /*aItem*/ ) |
|
352 { |
|
353 TAknsItemID itemID; |
|
354 TPoint pointTL( 0, 0 ); |
|
355 TPoint pointBR( KLength, KLength ); |
|
356 TRect rect( pointTL, pointBR ); |
|
357 CAknsBasicBackgroundControlContext* context = |
|
358 CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue ); |
|
359 CleanupStack::PushL( context ); |
|
360 STIF_ASSERT_NOT_NULL( context ); |
|
361 |
|
362 TBool draw = AknsDrawUtils::HasBitmapBackground( AknsUtils::SkinInstance(), |
|
363 context ); |
|
364 STIF_ASSERT_TRUE( draw ); |
|
365 |
|
366 CleanupStack::PopAndDestroy( context ); |
|
367 |
|
368 return KErrNone; |
|
369 |
|
370 } |
|
371 |
|
372 // ----------------------------------------------------------------------------- |
|
373 // CTestSDKSkins::TestDUDrawCachedImageL |
|
374 // ----------------------------------------------------------------------------- |
|
375 TInt CTestSDKSkins::TestDUDrawCachedImageL( CStifItemParser& /*aItem*/ ) |
|
376 { |
|
377 TAknsItemID itemID; |
|
378 |
|
379 CWindowGc& gc = CCoeEnv::Static()->SystemGc(); |
|
380 |
|
381 CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL(); |
|
382 CleanupStack::PushL( control ); |
|
383 STIF_ASSERT_NOT_NULL( control ); |
|
384 control->ActivateGc(); |
|
385 |
|
386 const TInt KOutPoint = 50; |
|
387 TPoint pointTL( 0, 0 ); |
|
388 TPoint outPoint( KOutPoint, KOutPoint ); |
|
389 TRect outRect( pointTL, outPoint ); |
|
390 |
|
391 AknsDrawUtils::DrawCachedImage( AknsUtils::SkinInstance(), |
|
392 gc, |
|
393 outRect, |
|
394 itemID ); |
|
395 |
|
396 control->DeactivateGc(); |
|
397 CleanupStack::PopAndDestroy( control ); |
|
398 |
|
399 return KErrNone; |
|
400 |
|
401 } |
|
402 |
|
403 // ----------------------------------------------------------------------------- |
|
404 // CTestSDKSkins::TestDUDrawCachedImageFBSL |
|
405 // ----------------------------------------------------------------------------- |
|
406 TInt CTestSDKSkins::TestDUDrawCachedImageFBSL( CStifItemParser& /*aItem*/ ) |
|
407 { |
|
408 TAknsItemID itemID; |
|
409 |
|
410 CFbsBitGc* gc = NULL; |
|
411 |
|
412 CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL(); |
|
413 CleanupStack::PushL( control ); |
|
414 STIF_ASSERT_NOT_NULL( control ); |
|
415 control->ActivateGc(); |
|
416 |
|
417 const TInt KOutPoint = 50; |
|
418 TPoint pointTL( 0, 0 ); |
|
419 TPoint outPoint( KOutPoint, KOutPoint ); |
|
420 TRect outRect( pointTL, outPoint ); |
|
421 |
|
422 AknsDrawUtils::DrawCachedImage( AknsUtils::SkinInstance(), |
|
423 *gc, |
|
424 outRect, |
|
425 itemID ); |
|
426 |
|
427 control->DeactivateGc(); |
|
428 CleanupStack::PopAndDestroy( control ); |
|
429 |
|
430 return KErrNone; |
|
431 |
|
432 } |
|
433 |
|
434 // ----------------------------------------------------------------------------- |
|
435 // CTestSDKSkins::TestDUDrawFrameL |
|
436 // ----------------------------------------------------------------------------- |
|
437 TInt CTestSDKSkins::TestDUDrawFrameL( CStifItemParser& /*aItem*/ ) |
|
438 { |
|
439 TAknsItemID frameID; |
|
440 TAknsItemID centerID; |
|
441 TPoint pointTL( 0, 0 ); |
|
442 TPoint pointBR( KLength, KLength ); |
|
443 |
|
444 CWindowGc& gc = CCoeEnv::Static()->SystemGc(); |
|
445 |
|
446 CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL(); |
|
447 CleanupStack::PushL( control ); |
|
448 STIF_ASSERT_NOT_NULL( control ); |
|
449 control->ActivateGc(); |
|
450 |
|
451 const TInt KOutPoint = 50; |
|
452 TPoint outPoint( KOutPoint, KOutPoint ); |
|
453 const TInt KInPoint = 40; |
|
454 TPoint inPoint( KInPoint, KInPoint ); |
|
455 TRect outRect( pointTL, outPoint ); |
|
456 TRect inRect( pointBR, inPoint ); |
|
457 |
|
458 TBool draw = AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), |
|
459 gc, |
|
460 outRect, |
|
461 inRect, |
|
462 frameID, |
|
463 centerID ); |
|
464 |
|
465 control->DeactivateGc(); |
|
466 CleanupStack::PopAndDestroy( control ); |
|
467 |
|
468 return KErrNone; |
|
469 |
|
470 } |
|
471 |
|
472 // ----------------------------------------------------------------------------- |
|
473 // CTestSDKSkins::TestDUPrepareFrameL |
|
474 // ----------------------------------------------------------------------------- |
|
475 TInt CTestSDKSkins::TestDUPrepareFrameL( CStifItemParser& /*aItem*/ ) |
|
476 { |
|
477 TAknsItemID frameID; |
|
478 TAknsItemID centerID; |
|
479 TPoint pointTL( 0, 0 ); |
|
480 TPoint pointBR( KLength, KLength ); |
|
481 |
|
482 CWindowGc& gc = CCoeEnv::Static()->SystemGc(); |
|
483 |
|
484 CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL(); |
|
485 CleanupStack::PushL( control ); |
|
486 STIF_ASSERT_NOT_NULL( control ); |
|
487 control->ActivateGc(); |
|
488 |
|
489 const TInt KOutPoint = 50; |
|
490 TPoint outPoint( KOutPoint, KOutPoint ); |
|
491 const TInt KInPoint = 40; |
|
492 TPoint inPoint( KInPoint, KInPoint ); |
|
493 TRect outRect( pointTL, outPoint ); |
|
494 TRect inRect( pointBR, inPoint ); |
|
495 |
|
496 TBool draw = AknsDrawUtils::PrepareFrame( AknsUtils::SkinInstance(), |
|
497 outRect, |
|
498 inRect, |
|
499 frameID, |
|
500 centerID ); |
|
501 |
|
502 control->DeactivateGc(); |
|
503 CleanupStack::PopAndDestroy( control ); |
|
504 |
|
505 return KErrNone; |
|
506 |
|
507 } |
|
508 |
|
509 // ----------------------------------------------------------------------------- |
|
510 // CTestSDKSkins::TestDUDrawFrameSPL |
|
511 // ----------------------------------------------------------------------------- |
|
512 TInt CTestSDKSkins::TestDUDrawFrameSPL( CStifItemParser& /*aItem*/ ) |
|
513 { |
|
514 TAknsItemID frameID; |
|
515 TAknsItemID centerID; |
|
516 TPoint pointTL( 0, 0 ); |
|
517 TPoint pointBR( KLength, KLength ); |
|
518 |
|
519 CFbsBitGc* gc = NULL; |
|
520 |
|
521 CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL(); |
|
522 CleanupStack::PushL( control ); |
|
523 STIF_ASSERT_NOT_NULL( control ); |
|
524 control->ActivateGc(); |
|
525 |
|
526 const TInt KOutPoint = 50; |
|
527 TPoint outPoint( KOutPoint, KOutPoint ); |
|
528 const TInt KInPoint = 40; |
|
529 TPoint inPoint( KInPoint, KInPoint ); |
|
530 TRect outRect( pointTL, outPoint ); |
|
531 TRect inRect( pointBR, inPoint ); |
|
532 |
|
533 TBool draw = AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), |
|
534 *gc, |
|
535 outRect, |
|
536 inRect, |
|
537 frameID, |
|
538 centerID, |
|
539 KAknsDrawParamDefault ); |
|
540 |
|
541 control->DeactivateGc(); |
|
542 CleanupStack::PopAndDestroy( control ); |
|
543 |
|
544 return KErrNone; |
|
545 |
|
546 } |
|
547 |
|
548 // ----------------------------------------------------------------------------- |
|
549 // CTestSDKSkins::TestDUDrawFrameFBSL |
|
550 // ----------------------------------------------------------------------------- |
|
551 TInt CTestSDKSkins::TestDUDrawFrameFBSL( CStifItemParser& /*aItem*/ ) |
|
552 { |
|
553 TAknsItemID frameID; |
|
554 TAknsItemID centerID; |
|
555 TPoint pointTL( 0, 0 ); |
|
556 TPoint pointBR( KLength, KLength ); |
|
557 |
|
558 CFbsBitGc* gc = NULL; |
|
559 |
|
560 CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL(); |
|
561 CleanupStack::PushL( control ); |
|
562 STIF_ASSERT_NOT_NULL( control ); |
|
563 control->ActivateGc(); |
|
564 |
|
565 const TInt KOutPoint = 50; |
|
566 TPoint outPoint( KOutPoint, KOutPoint ); |
|
567 const TInt KInPoint = 40; |
|
568 TPoint inPoint( KInPoint, KInPoint ); |
|
569 TRect outRect( pointTL, outPoint ); |
|
570 TRect inRect( pointBR, inPoint ); |
|
571 |
|
572 TBool draw = AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), |
|
573 *gc, |
|
574 outRect, |
|
575 inRect, |
|
576 frameID, |
|
577 centerID ); |
|
578 |
|
579 control->DeactivateGc(); |
|
580 CleanupStack::PopAndDestroy( control ); |
|
581 |
|
582 return KErrNone; |
|
583 |
|
584 } |
|
585 |
|
586 // ----------------------------------------------------------------------------- |
|
587 // CTestSDKSkins::TestDUDrawFramePartL |
|
588 // ----------------------------------------------------------------------------- |
|
589 TInt CTestSDKSkins::TestDUDrawFramePartL( CStifItemParser& /*aItem*/ ) |
|
590 { |
|
591 TAknsItemID itemID; |
|
592 |
|
593 TPoint pointTL( 0, 0 ); |
|
594 TPoint pointBR( KLength, KLength ); |
|
595 |
|
596 CWindowGc& gc = CCoeEnv::Static()->SystemGc(); |
|
597 |
|
598 CTestSDKSkinsControl* control = CTestSDKSkinsControl::NewL(); |
|
599 CleanupStack::PushL( control ); |
|
600 STIF_ASSERT_NOT_NULL( control ); |
|
601 control->ActivateGc(); |
|
602 |
|
603 const TInt KOutPoint = 50; |
|
604 TPoint outPoint( KOutPoint, KOutPoint ); |
|
605 TRect rect( pointTL, outPoint ); |
|
606 |
|
607 TBool draw = AknsDrawUtils::DrawFramePart( AknsUtils::SkinInstance(), |
|
608 gc, |
|
609 rect, |
|
610 itemID, |
|
611 EAknsFrameIndexTl ); |
|
612 |
|
613 control->DeactivateGc(); |
|
614 CleanupStack::PopAndDestroy( control ); |
|
615 |
|
616 return KErrNone; |
|
617 |
|
618 } |
|
619 |
|
620 // ----------------------------------------------------------------------------- |
|
621 // CTestSDKSkins::TestDUIsListSeperatorLines |
|
622 // ----------------------------------------------------------------------------- |
|
623 TInt CTestSDKSkins::TestDUIsListSeperatorLines( CStifItemParser& /*aItem*/ ) |
|
624 { |
|
625 TBool seperator = AknsDrawUtils::IsListSeperatorLines( AknsUtils::SkinInstance() ); |
|
626 STIF_ASSERT_TRUE( seperator ); |
|
627 |
|
628 return KErrNone; |
|
629 |
|
630 } |
|
631 |
|
632 // ----------------------------------------------------------------------------- |
|
633 // CTestSDKSkins::TestDUSlidingMode |
|
634 // ----------------------------------------------------------------------------- |
|
635 TInt CTestSDKSkins::TestDUSlidingMode( CStifItemParser& /*aItem*/ ) |
|
636 { |
|
637 TSlidingMode mode = AknsDrawUtils::SlidingMode( AknsUtils::SkinInstance() ); |
|
638 STIF_ASSERT_TRUE( mode == ESlidingDisabled ); |
|
639 |
|
640 return KErrNone; |
|
641 |
|
642 } |