Update contrib.
1 // Copyright (c) 2000-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Definition of Direct Screen Access class
27 #include <e32msgqueue.h>
29 class CWsClientWindow;
30 class CWsDirectScreenAccess;
33 NONSHARABLE_CLASS(CWsAbortDirect) : public CActive
36 CWsAbortDirect(CWsDirectScreenAccess* aDirect,CDsaMsgQueue* aParent);
39 void Complete(TInt aReason);
41 //Pure virtual function from CActive
45 CWsDirectScreenAccess* iDirect;
46 CDsaMsgQueue* iParent;
49 NONSHARABLE_CLASS(CDsaMsgQueue) : public CBase
52 static CDsaMsgQueue* NewL(CWsDirectScreenAccess* aDirect);
54 TInt CreateSendQueue();
55 TInt CreateRecQueue();
56 RMsgQueueBase* SendQueue();
57 RMsgQueueBase* RecQueue();
62 TInt Send(TInt aData);
64 TRequestStatus& Status()
66 return iAborted->iStatus;
71 void ConstructL(CWsDirectScreenAccess* aDirect);
73 RMsgQueueBase iSendQueue;
74 RMsgQueueBase iRecQueue;
75 CWsAbortDirect* iAborted;
78 class CWsDirectScreenAccess : public CWsScreenObject
83 EDirectStatusTimeNotCreated,
85 EDirectStatusInitialising,
87 EDirectStatusCompleted,
88 EDirectStatusCanceling,
89 EDirectStatusAbortedWindow,
90 EDirectStatusAbortedGlobal,
91 EDirectStatusAborted=EDirectStatusAbortedWindow,
94 static CWsDirectScreenAccess* NewL(CWsClient* aOwner);
95 ~CWsDirectScreenAccess();
96 void Request(TInt handle);
97 void GetRegion(TInt aNumRects);
103 void SignalAbort(RDirectScreenAccess::TTerminationReasons aReason);
104 inline TRequestStatus& AbortStatus() {return iMsgQueue->Status();}
105 void CancelAbortObject();
107 //Pure virtual function from CWsObject
108 void CommandL(TInt aOpcode, const TAny* aCmdData);
109 inline TBool IsVisible() const;
110 TBool IsAbortRequired(const TRegion& aTopVisibleRegion) const;
111 inline RWsRegion& VisibleRegion();
112 inline CWsClientWindow* ClientWindow() const;
115 TSglQueLink iMultipleDSALink;
116 TSglQueLink iAbortLink; // Used to build a list of DSA objects that need to be aborted on a specific window
118 inline CWsDirectScreenAccess(CWsClient* aOwner): CWsScreenObject(aOwner,WS_HANDLE_DIRECT, aOwner->Screen()) {}
123 void CorrectScreen();
128 CWsClientWindow* iWin;
130 CDsaMsgQueue* iMsgQueue;
132 RDirectScreenAccess::TTerminationReasons iAbortReason;
134 TBool IsSyncTimeoutPending() const;
135 inline RRegion& RegionUnderSync();
137 class CDSARegionSyncTimer : public CTimer
143 KRegionSyncTimeoutMicrosec = 100000 // 0.1 sec
147 static CDSARegionSyncTimer* NewL(CWsDirectScreenAccess& aDSA);
151 CDSARegionSyncTimer(CWsDirectScreenAccess& aDSA);
154 CWsDirectScreenAccess& iDSA;
158 void DeleteRegionSyncWatchcat();
159 void CancelFrozenRegion();
160 void RegionSyncTimeout();
163 CDSARegionSyncTimer* iRegionSync;
164 RRegion iFrozenRegion;
166 friend class CWsDirectScreenAccess::CDSARegionSyncTimer;
169 inline TBool CWsDirectScreenAccess::IsVisible() const
171 return !iVisible.IsEmpty();
174 inline CWsClientWindow* CWsDirectScreenAccess::ClientWindow() const
179 inline RRegion& CWsDirectScreenAccess::RegionUnderSync()
181 return iFrozenRegion;