|
1 // Copyright (c) 2005-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: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent - Internal Symbian test code |
|
19 */ |
|
20 |
|
21 |
|
22 #include "TestRedrawHandler.h" |
|
23 #include "TestWindows.h" |
|
24 |
|
25 #include <w32std.h> |
|
26 |
|
27 CTestRedrawHandler::CTestRedrawHandler(RWsSession& aWs) : CActive(50), |
|
28 iWs(aWs) |
|
29 { |
|
30 } |
|
31 |
|
32 CTestRedrawHandler::~CTestRedrawHandler() |
|
33 { |
|
34 Cancel(); |
|
35 } |
|
36 |
|
37 void CTestRedrawHandler::Start() |
|
38 { |
|
39 CActiveScheduler::Add(this); |
|
40 iWs.RedrawReady(&iStatus); |
|
41 SetActive(); |
|
42 } |
|
43 |
|
44 void CTestRedrawHandler::RunL() |
|
45 { |
|
46 TWsRedrawEvent redraw; |
|
47 iWs.GetRedraw(redraw); |
|
48 |
|
49 iWs.RedrawReady(&iStatus); |
|
50 SetActive(); |
|
51 |
|
52 if (redraw.Handle()) |
|
53 { |
|
54 if(redraw.Rect().IsEmpty()) |
|
55 User::Leave(KErrGeneral); |
|
56 CTestWindowTreeNode* node = reinterpret_cast<CTestWindowTreeNode *>(redraw.Handle()); |
|
57 node->RedrawL(redraw); |
|
58 // reinterpret_cast<CTestWindowTreeNode *>(redraw.Handle())->RedrawL(redraw); |
|
59 } |
|
60 } |
|
61 |
|
62 void CTestRedrawHandler::DoCancel() |
|
63 { |
|
64 iWs.RedrawReadyCancel(); |
|
65 } |
|
66 |
|
67 TInt CTestRedrawHandler::RunError(TInt aError) |
|
68 { |
|
69 return(aError); |
|
70 } |
|
71 |