os/graphics/windowing/windowserver/test/tauto/tdirecta.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @test
sl@0
    19
 @internalComponent - Internal Symbian test code
sl@0
    20
*/
sl@0
    21
sl@0
    22
#ifndef __TDIRECTA_H__
sl@0
    23
#define __TDIRECTA_H__
sl@0
    24
sl@0
    25
#include "AUTO.H"
sl@0
    26
#include <e32msgqueue.h>
sl@0
    27
#include <time.h>
sl@0
    28
#include "TGraphicsHarness.h"
sl@0
    29
sl@0
    30
//#define LOGGING
sl@0
    31
sl@0
    32
class CColorAnimation;
sl@0
    33
class CScrollText;
sl@0
    34
class CScrollingTextDrawer;
sl@0
    35
class CDirectScreenAccessOld;
sl@0
    36
sl@0
    37
sl@0
    38
struct TDirectThreadParam
sl@0
    39
	{
sl@0
    40
	TRect iRect;
sl@0
    41
	TInt iScreenNumber;
sl@0
    42
	TBool iIsInFront;
sl@0
    43
	};
sl@0
    44
sl@0
    45
class MAnimCallBacks
sl@0
    46
	{
sl@0
    47
public:
sl@0
    48
	virtual void LogLeave(TInt aErr)=0;
sl@0
    49
	virtual void Fail()=0;
sl@0
    50
	virtual void Finished(TInt aId)=0;
sl@0
    51
	virtual TDisplayMode DisplayMode(TInt aId)=0;
sl@0
    52
	virtual TRgb BrushColorL(TInt aId,TInt& aColor,TBool& aFinished)=0;
sl@0
    53
	virtual TInt TimerInterval(TInt aId)=0;
sl@0
    54
	virtual void FailedReStart(TInt aId,TInt aReason)=0;
sl@0
    55
	virtual TInt SlowStopping(TInt aId,TInt aCount)=0;
sl@0
    56
	virtual void Log(const TText8* aFile, TInt aLine, TInt aSeverity,const TDesC& aString)=0;
sl@0
    57
public:
sl@0
    58
	CTBlankWindow* iCallBackWin;
sl@0
    59
	};
sl@0
    60
sl@0
    61
class CTDirect : public CTWsGraphicsBase, public MAbortDirectScreenAccess, public MAnimCallBacks
sl@0
    62
	{
sl@0
    63
public:
sl@0
    64
	enum
sl@0
    65
		{
sl@0
    66
		eDirectNumFrames=10
sl@0
    67
		};
sl@0
    68
	enum
sl@0
    69
		{
sl@0
    70
		eDirectControlSem=0x01,
sl@0
    71
		eDirectWindowSem=0x02,
sl@0
    72
		eFontSet=0x04,
sl@0
    73
		eMultiAnim=0x08,
sl@0
    74
		};
sl@0
    75
public:
sl@0
    76
	CTDirect(CTestStep* aStep);
sl@0
    77
	~CTDirect();
sl@0
    78
	void ConstructL();
sl@0
    79
	TBool DrawFrame();
sl@0
    80
	TBool Restart();
sl@0
    81
	void ChangeToNextScreenModeL();
sl@0
    82
	void ChangeScreenScale();
sl@0
    83
	//The Tests
sl@0
    84
	TestState AnimateWindowL();
sl@0
    85
	TestState AnimationDiesL();
sl@0
    86
	TestState PackagingClassL();
sl@0
    87
	TestState MultipleL();
sl@0
    88
	TestState FailCodesL();
sl@0
    89
	TestState ScrolingText1L();
sl@0
    90
	TestState RClassL();
sl@0
    91
	TestState ScrolingText2L();
sl@0
    92
	TestState ScrolingText3L();
sl@0
    93
	TestState ScrolingText4L();
sl@0
    94
	TestState DefectFix_KAA_5J3BLW_L();
sl@0
    95
	TestState KillAnimationL();
sl@0
    96
	TestState DSAWithScreenModeOffset1L();
sl@0
    97
	TestState DSAWithScreenModeOffset2L();
sl@0
    98
	TestState WindowPoistionRelativeToScreenL();
sl@0
    99
	TestState ScreenModeScalingTestL();
sl@0
   100
	TestState ScreenModeTestForScalingL();
sl@0
   101
	TestState MultipleDSAsOnSameWindowL();
sl@0
   102
	TestState TemporaryDeadlockL();
sl@0
   103
	TestState RegionTrackingOnlyNotificationsL(TUint aId);
sl@0
   104
	TestState MixDsaAndRegionTrackingOnlyL(TBool aWhoExitsLast);
sl@0
   105
	TestState TryDifferentSupportedModesL();
sl@0
   106
protected:
sl@0
   107
//from 	CTGraphicsStep
sl@0
   108
	virtual void RunTestCaseL(TInt aCurTestCase);
sl@0
   109
private:
sl@0
   110
	void ConstrucBlankWindowL();
sl@0
   111
	void ScanTypeFacesL();
sl@0
   112
	void InitialiseAnimationL();
sl@0
   113
	void DestroyAnimation();
sl@0
   114
	void ResetScreenSizeMode();
sl@0
   115
	void StartDirect();
sl@0
   116
	void SignalWindow();
sl@0
   117
	void ModeSwitch();
sl@0
   118
	void ScrolingTextL(TInt aId,TRect aWinRect,TBool aStartThread,TInt aScreenMode=0);
sl@0
   119
	void AnimTestL(TInt aId,TRect aWinRect,CTWinBase& aParent);
sl@0
   120
	//Pure virtual function from MAbortDirectScreenAccess
sl@0
   121
	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
sl@0
   122
	//Pure virtual functions from MAnimCallBacks
sl@0
   123
	void LogLeave(TInt aErr);
sl@0
   124
	void Fail();
sl@0
   125
	void Finished(TInt aId);
sl@0
   126
	void DeleteMoveWindow();
sl@0
   127
	void DeleteScroll();
sl@0
   128
	TDisplayMode DisplayMode(TInt aId);
sl@0
   129
	TRgb BrushColorL(TInt aId,TInt& aColor,TBool& aFinished);
sl@0
   130
	TInt TimerInterval(TInt aId);
sl@0
   131
	void FailedReStart(TInt aId,TInt aReason);
sl@0
   132
	TInt SlowStopping(TInt aId,TInt aCount);
sl@0
   133
	void Log(const TText8* aFile, TInt aLine, TInt aSeverity,const TDesC& aString);
sl@0
   134
	void SetScreenMode(TInt aMode,TPixelsAndRotation& aPixelsAndRotation);
sl@0
   135
	void CreateAnimForScreenModeL(TInt aAnimIndex,CTWinBase& aParent,TRect aRect,TInt aId);
sl@0
   136
	void BlankTopClientWindowL(CTBlankWindow& aBlankWindow,TRect aRect);
sl@0
   137
	void TestDifferentOriginAndScaleL(TSizeMode &aMode,TPoint aOrigin);
sl@0
   138
	void CheckForTemporaryDeadlock();
sl@0
   139
private:
sl@0
   140
	CProcess* iProcess;
sl@0
   141
	CProcess* iMoveWin;
sl@0
   142
	RSemaphore iControlSem;
sl@0
   143
	RMsgQueueBase iControlQueue;
sl@0
   144
	RSemaphore iWinSem;
sl@0
   145
	TRequestStatus iThreadStatus;
sl@0
   146
	TUint iFlags;
sl@0
   147
	CTBlankWindow* iWin;
sl@0
   148
	CTBlankWindow* iWin2;
sl@0
   149
	CFbsScreenDevice* iScrDev;
sl@0
   150
	CFbsBitGc* iGc;
sl@0
   151
	CFont* iFont;
sl@0
   152
	CPeriodic* iTimer;
sl@0
   153
	CIdle* iRestart;
sl@0
   154
	CDirectScreenAccessOld* iDirect;
sl@0
   155
	RRegion* iDrawingRegion;
sl@0
   156
	TSize iScrSize;
sl@0
   157
	TRect iDrawRect;
sl@0
   158
	TInt iDrawHeight;
sl@0
   159
	TInt iFrameNo;
sl@0
   160
	TInt iLastTextWidth;
sl@0
   161
	TInt iLastMaxTextWidth;
sl@0
   162
	TInt iFrameToSignalAfter;
sl@0
   163
	TBool iDelay;
sl@0
   164
	TBool iCancelNext;
sl@0
   165
	TBool iWindowDead;
sl@0
   166
	CColorAnimation* iAnim;
sl@0
   167
	CColorAnimation* iAnims[13];
sl@0
   168
	TInt iCount;
sl@0
   169
	CScrollText* iScroll;
sl@0
   170
	TInt iCycles;
sl@0
   171
	TScreenModeEnforcement iModeBackup;
sl@0
   172
	TThreadStartUp iFirstFunction;
sl@0
   173
	TInt iNumThreadHandles;
sl@0
   174
	CTBlankWindow* iBlankTopClientWin1;
sl@0
   175
	CTBlankWindow* iBlankTopClientWin2;
sl@0
   176
	CPeriodic* iChangeScreenModeTimer;
sl@0
   177
	TInt iCurrentMode;
sl@0
   178
	TInt iNumOfModes;
sl@0
   179
	TPoint iCurrentScreenModeOrigin;
sl@0
   180
	TSize iCurrentScreenModeScale;
sl@0
   181
	TInt iNumAnimation;
sl@0
   182
	TSizeMode iModeData;
sl@0
   183
	CPeriodic* iScreenModeTimer;
sl@0
   184
	TInt iIsScalingSupported;
sl@0
   185
	TInt iNumOfCallBack;
sl@0
   186
	TBool iTestJustFailed;
sl@0
   187
	TBool iTestJustCompleted;
sl@0
   188
	TInt iState;
sl@0
   189
	TBool iNextFrameFinished;
sl@0
   190
	TBool iPackagingFinished;
sl@0
   191
	TBool iTimerRunning;
sl@0
   192
	};
sl@0
   193
sl@0
   194
class CDirectScreenAccessOld : public CActive
sl@0
   195
	{
sl@0
   196
public:
sl@0
   197
	static CDirectScreenAccessOld* NewL(RWsSession& aWs,MAbortDirectScreenAccess& aAborter);
sl@0
   198
	~CDirectScreenAccessOld();
sl@0
   199
	TInt Request(RRegion*& aRegion, RWindowBase& aWindow);
sl@0
   200
private:
sl@0
   201
	inline CDirectScreenAccessOld(RWsSession& aWs,MAbortDirectScreenAccess& aAborter)
sl@0
   202
		: CActive(RDirectScreenAccess::EPriorityVeryHigh), iDirectAccess(aWs), iAborter(aAborter) {}
sl@0
   203
	void ConstructL();
sl@0
   204
	//Pure virtual functions from CActive
sl@0
   205
	void DoCancel();
sl@0
   206
	void RunL();
sl@0
   207
private:
sl@0
   208
	RDirectScreenAccess iDirectAccess;
sl@0
   209
	MAbortDirectScreenAccess& iAborter;
sl@0
   210
	TBool iAborting;
sl@0
   211
	};
sl@0
   212
sl@0
   213
class CColorAnimation : public CBase, public MDirectScreenAccess
sl@0
   214
	{
sl@0
   215
public:
sl@0
   216
	enum
sl@0
   217
		{
sl@0
   218
		eStopNow=EFalse,
sl@0
   219
		eStopDelayed=ETrue,
sl@0
   220
		eAbort=2,
sl@0
   221
		eAbortAll,
sl@0
   222
		};
sl@0
   223
public:
sl@0
   224
	static TInt DrawColorL(TAny* aAnimation);
sl@0
   225
	static TInt IdlingL(TAny* aAnimation);
sl@0
   226
	static CColorAnimation* NewL(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack,CTWinBase& aParent,TRect aExtent,TBool aStart,TBool aRegionTrackingOnly = EFalse);
sl@0
   227
	inline CColorAnimation(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack) :iId(aId), iCallBack(aCallBack), iScreenNumber(aScreenNumber) {}
sl@0
   228
	~CColorAnimation();
sl@0
   229
	void ConstructL(CTWinBase& aParent,TRect aExtent,TBool aRegionTrackingOnly,TInt aTypeWindow=0,TInt aSingleWinForMultipleDSA=0);
sl@0
   230
	void StartL(TBool aChildWindow=EFalse);
sl@0
   231
	void StartOrPanic();
sl@0
   232
	void Stop();
sl@0
   233
	void BringWindowToFront();
sl@0
   234
	void ChangeModeL(TDisplayMode aMode);
sl@0
   235
	TBool inline IsTimerActive() {return iTimer->IsActive();}
sl@0
   236
	inline MAnimCallBacks& CallBack() { return iCallBack; }
sl@0
   237
	TPoint AbsoluteWindowPosition(TInt aWindowId=0);
sl@0
   238
	inline CDirectScreenAccess* GetDrawer();
sl@0
   239
	void FinishTest();
sl@0
   240
	TBool TestGcAndScreenDeviceValues();
sl@0
   241
	//inline TBool IsReadyToAbort(){return (iDrawer->iStatus!=KRequestPending);}
sl@0
   242
protected:
sl@0
   243
	void DrawColorL();
sl@0
   244
	void IdlingL();
sl@0
   245
	/*pure virtual function from MAbortDirectScreenAccess*/
sl@0
   246
	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
sl@0
   247
	/*pure virtual function from MDirectScreenAccess*/
sl@0
   248
	void Restart(RDirectScreenAccess::TTerminationReasons aReason);
sl@0
   249
private:
sl@0
   250
	TInt iId;
sl@0
   251
	CTBlankWindow* iWindow;
sl@0
   252
	CTBlankWindow* iWindow2;
sl@0
   253
	TSize iWinSize;
sl@0
   254
	CDirectScreenAccess* iDrawer;
sl@0
   255
	CPeriodic* iTimer;
sl@0
   256
	MAnimCallBacks& iCallBack;
sl@0
   257
	TInt iColor;
sl@0
   258
	TInt iCount;
sl@0
   259
	TUint iIdling;
sl@0
   260
	TInt iScreenNumber;
sl@0
   261
	TInt iSingleWinForMultipleDSA;
sl@0
   262
	TBool iRegionTrackingOnly;
sl@0
   263
	};
sl@0
   264
sl@0
   265
class CScrollingTextDrawer : public CBase
sl@0
   266
	{
sl@0
   267
public:
sl@0
   268
	static CScrollingTextDrawer* NewL(TInt aScreenNumber,CFbsScreenDevice*& aDevice,CFbsBitGc& aGc);
sl@0
   269
	~CScrollingTextDrawer();
sl@0
   270
	inline void SetScrollJump(TInt aJump) {iJump=aJump;}
sl@0
   271
	void SetBottomOfTest(TInt aBottom);
sl@0
   272
	void Scroll();
sl@0
   273
private:
sl@0
   274
	inline CScrollingTextDrawer(CFbsScreenDevice*& aDevice,CFbsBitGc& aGc) : iDevice(aDevice), iGc(&aGc) {}
sl@0
   275
	void ConstructL(TInt aScreenNumber);
sl@0
   276
	void CreateFontL();
sl@0
   277
private:
sl@0
   278
	CFbsScreenDevice*& iDevice;
sl@0
   279
	CFbsScreenDevice* iFontDevice;
sl@0
   280
	CFbsBitGc* iGc;
sl@0
   281
	CFont* iFont;
sl@0
   282
	TBuf<32> iText;
sl@0
   283
	TRect iDrawRect;
sl@0
   284
	TInt iDrawHeight;
sl@0
   285
	TInt iCharWidth;
sl@0
   286
	TInt iFirstChar;
sl@0
   287
	TInt iJump;
sl@0
   288
#if defined(LOGGING)
sl@0
   289
	RWsSession iWs;
sl@0
   290
#endif
sl@0
   291
	};
sl@0
   292
sl@0
   293
class CScrollText : public CBase, public MDirectScreenAccess
sl@0
   294
	{
sl@0
   295
public:
sl@0
   296
	static TInt DrawText(TAny* aAnimation);
sl@0
   297
	static CScrollText* NewL(TInt aScreenNumber,TInt aId,CTWindowGroup& aParent,TInt aScrollJump,TBool aStart=EFalse);
sl@0
   298
	inline CScrollText(TInt aId,TInt aScrollJump,TInt aScreenNumber) :iId(aId), iScrollJump(aScrollJump), iScreenNumber(aScreenNumber) {}
sl@0
   299
	~CScrollText();
sl@0
   300
	void ConstructL(CTWindowGroup& aParent);
sl@0
   301
	void StartL();
sl@0
   302
	void Stop();
sl@0
   303
	void ContinueL();
sl@0
   304
	inline TBool IsRunning() {return iTimer->IsActive();}
sl@0
   305
	inline void SetCountDown(TInt aCountDown) {iAbortCountDown=aCountDown; iCounting=ETrue;}
sl@0
   306
	inline void SetBottomOfTest(TInt aBottom) {iTextDraw->SetBottomOfTest(aBottom);}
sl@0
   307
private:
sl@0
   308
	void ScrollText();
sl@0
   309
	void DoContinueL();
sl@0
   310
	/*pure virtual function from MAbortDirectScreenAccess*/
sl@0
   311
	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
sl@0
   312
	/*pure virtual function from MDirectScreenAccess*/
sl@0
   313
	void Restart(RDirectScreenAccess::TTerminationReasons aReason);
sl@0
   314
private:
sl@0
   315
	TInt iId;
sl@0
   316
	CTBlankWindow* iWindow;
sl@0
   317
	TSize iWinSize;
sl@0
   318
	CDirectScreenAccess* iDrawer;
sl@0
   319
	CScrollingTextDrawer* iTextDraw;
sl@0
   320
	CPeriodic* iTimer;
sl@0
   321
	TInt iScrollJump;
sl@0
   322
	TBool iCounting;
sl@0
   323
	TInt iAbortCountDown;
sl@0
   324
	TInt iScreenNumber;
sl@0
   325
	};
sl@0
   326
sl@0
   327
	
sl@0
   328
/**
sl@0
   329
 A simple class based on CScrollText constructs a blank window that has
sl@0
   330
 a blank window child, used for functional coverage testing of CWsClientWindow
sl@0
   331
 */
sl@0
   332
class CWindowWithChild : public CBase, public MDirectScreenAccess
sl@0
   333
	{
sl@0
   334
public:
sl@0
   335
	static CWindowWithChild* NewL(TInt aScreenNumber, CTWindowGroup& aParent,TBool aStart=EFalse);
sl@0
   336
	inline CWindowWithChild(TInt aScreenNumber) : iScreenNumber(aScreenNumber) {}
sl@0
   337
	~CWindowWithChild();
sl@0
   338
	void ConstructL(CTWindowGroup& aParent);
sl@0
   339
	void StartL();
sl@0
   340
	void Stop();
sl@0
   341
	void ContinueL();
sl@0
   342
	inline TBool IsRunning() {return iRunning;}
sl@0
   343
	void PerformCoverageCalls();
sl@0
   344
	RWindow *ChildWindow()    {return iChildWindow->Win();}
sl@0
   345
private:
sl@0
   346
	void DoContinueL();
sl@0
   347
	/*pure virtual function from MAbortDirectScreenAccess*/
sl@0
   348
	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
sl@0
   349
	/*pure virtual function from MDirectScreenAccess*/
sl@0
   350
	void Restart(RDirectScreenAccess::TTerminationReasons aReason);
sl@0
   351
private:
sl@0
   352
	CTBlankWindow* iWindow;
sl@0
   353
	CTWin * iChildWindow;
sl@0
   354
	TSize iWinSize;
sl@0
   355
	CDirectScreenAccess* iDrawer;
sl@0
   356
	TInt iScreenNumber;
sl@0
   357
	TBool iRunning;
sl@0
   358
	};
sl@0
   359
	
sl@0
   360
	
sl@0
   361
class CWsBase : public CBase
sl@0
   362
	{
sl@0
   363
public:
sl@0
   364
protected:
sl@0
   365
	~CWsBase();
sl@0
   366
	void ConstructL(TInt aScreenNumber,TInt aHandle);
sl@0
   367
	void CreateBlankWindowL(RBlankWindow& iWin,TInt aHandle);
sl@0
   368
protected:
sl@0
   369
	RWsSession iWs;
sl@0
   370
	CWsScreenDevice *iScrDev;
sl@0
   371
	RWindowGroup iGroup;
sl@0
   372
	};
sl@0
   373
sl@0
   374
class CAnimating : public CWsBase, public MAbortDirectScreenAccess
sl@0
   375
	{
sl@0
   376
public:
sl@0
   377
	static TInt StartLC(TAny* aScreenNumber);
sl@0
   378
	//static CAnimating* NewLC();
sl@0
   379
	void DrawFrame();
sl@0
   380
	/*pure virtual function from MAbortDirectScreenAccess*/
sl@0
   381
	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
sl@0
   382
private:
sl@0
   383
	void ConstructL(TInt aScreenNumber);
sl@0
   384
	~CAnimating();
sl@0
   385
	void StartAnimatingL();
sl@0
   386
private:
sl@0
   387
	RSemaphore iControlSem;
sl@0
   388
	RMsgQueueBase iControlQueue;
sl@0
   389
	TBool iSemCreated;
sl@0
   390
	RBlankWindow iWindow;
sl@0
   391
	CFbsScreenDevice* iScrDev;
sl@0
   392
	CFbsBitGc* iGc;
sl@0
   393
	TSize iScrSize;
sl@0
   394
	CDirectScreenAccessOld* iDirect;
sl@0
   395
	RRegion* iDrawingRegion;
sl@0
   396
	CPeriodic* iTimer;
sl@0
   397
	TInt iColor;
sl@0
   398
	};
sl@0
   399
sl@0
   400
class CMoveWindow : public CWsBase
sl@0
   401
	{
sl@0
   402
public:
sl@0
   403
	static TInt StartLC(TAny* aScreenNumber);
sl@0
   404
	static TInt StateChange(TAny* aMoveWin);
sl@0
   405
	static TInt FlipChange(TAny*);
sl@0
   406
	//Call Backs
sl@0
   407
	void MoveWindow();
sl@0
   408
private:
sl@0
   409
	inline static CMoveWindow* Cast(TAny* aMoveWin) {return STATIC_CAST(CMoveWindow*,aMoveWin);}
sl@0
   410
	~CMoveWindow();
sl@0
   411
	void ConstructL(TInt aScreenNumber);
sl@0
   412
	void CreateTimerL();
sl@0
   413
	void StateChange();
sl@0
   414
	void ToggleDisplayMode();
sl@0
   415
	void FlipChange();
sl@0
   416
private:
sl@0
   417
	CPeriodic* iFlipTimer;
sl@0
   418
	CPeriodic* iStateTimer;
sl@0
   419
	CPeriodic* iTimer;
sl@0
   420
	CWsScreenDevice* iDevice;
sl@0
   421
	RBlankWindow iWindow;
sl@0
   422
	TDisplayMode iDisplayMode;
sl@0
   423
	RBackedUpWindow iBackUpWin;
sl@0
   424
	CWindowGc* iGc;
sl@0
   425
	TRect iBounceArea;
sl@0
   426
	TSize iScrSize;
sl@0
   427
	TPoint iTl;
sl@0
   428
	TSize iSize;
sl@0
   429
	TSize iDelta;
sl@0
   430
	TInt iStateCountDown;
sl@0
   431
	TInt iNumOfModes;
sl@0
   432
	TInt iCurrentMode;
sl@0
   433
	};
sl@0
   434
sl@0
   435
class CBugFixColorAnimation : public CColorAnimation
sl@0
   436
	{
sl@0
   437
public:
sl@0
   438
	static CBugFixColorAnimation* NewL(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack,CTWindowGroup& aParent,TRect aExtent,TBool aStart=EFalse);
sl@0
   439
	~CBugFixColorAnimation();
sl@0
   440
	inline void Started() { iSem.Signal(); }
sl@0
   441
private:
sl@0
   442
	CBugFixColorAnimation(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack);
sl@0
   443
	void ConstructL(CTWindowGroup& aParent,TRect aExtent);
sl@0
   444
private:
sl@0
   445
	/*pure virtual function from MAbortDirectScreenAccess*/
sl@0
   446
	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
sl@0
   447
	/*pure virtual function from MDirectScreenAccess*/
sl@0
   448
	void Restart(RDirectScreenAccess::TTerminationReasons aReason);
sl@0
   449
private:
sl@0
   450
	CProcess* iThread;
sl@0
   451
	CIdle* iTestFailed;
sl@0
   452
	TRect iAnimRect;
sl@0
   453
	TDirectThreadParam iThreadParam;
sl@0
   454
	RSemaphore iSem;
sl@0
   455
	};
sl@0
   456
sl@0
   457
class CRegionTrackingOnly : public CColorAnimation
sl@0
   458
	{
sl@0
   459
public:
sl@0
   460
	static CRegionTrackingOnly* NewL(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack,CTWindowGroup& aParent,TRect aExtent,TBool aStart,TBool aOpenWindowInFrontDsa);
sl@0
   461
	void ConstructL(CTWindowGroup& aParent,TRect aExtent,TBool aOpenWindowInFrontDsa);
sl@0
   462
	~CRegionTrackingOnly();
sl@0
   463
	inline void Started() { iSem.Signal(); }
sl@0
   464
private:
sl@0
   465
	CRegionTrackingOnly(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack);
sl@0
   466
	/*Overriding of bases class virtual functions*/
sl@0
   467
	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
sl@0
   468
	void Restart(RDirectScreenAccess::TTerminationReasons aReason);
sl@0
   469
private:
sl@0
   470
	CProcess* iThread;
sl@0
   471
	TRect iAnimRect;
sl@0
   472
	TBool iExpectedToAbort;	
sl@0
   473
	TDirectThreadParam iThreadParam;
sl@0
   474
	RSemaphore iSem;
sl@0
   475
	};
sl@0
   476
sl@0
   477
/*CPanicDirect*/
sl@0
   478
 class CPanicDirect : public CBase
sl@0
   479
 	{
sl@0
   480
 public:
sl@0
   481
	static TInt DoTestOnNewScheduler(TInt aInt, TAny* aPtr);
sl@0
   482
	static TInt DoTestOnNewSchedulerL(TInt aInt, TAny* aPtr);
sl@0
   483
 private:
sl@0
   484
 	inline CPanicDirect() {}
sl@0
   485
 	~CPanicDirect();
sl@0
   486
 	void ConstructL(TInt aScreenNumber, TInt aInt);
sl@0
   487
	static void DoTestNowL(TInt aInt, TAny* aPtr);
sl@0
   488
 	void TestL();
sl@0
   489
 	void DoDrawingL();
sl@0
   490
private:
sl@0
   491
	TInt iTestNo;
sl@0
   492
	RWsSession iWs;
sl@0
   493
	CWsScreenDevice* iWsScrDev;
sl@0
   494
	RWindowGroup iGroup;
sl@0
   495
	RBlankWindow iBlankWin;
sl@0
   496
	RDirectScreenAccess iDirect;
sl@0
   497
	TRequestStatus iDirectStatus;
sl@0
   498
	RRegion* iRegion;
sl@0
   499
	RTimer iTimer;
sl@0
   500
	TRequestStatus iTimerStatus;
sl@0
   501
	TBool iDrawingAllowed;
sl@0
   502
	CFbsScreenDevice* iScreenDevice;
sl@0
   503
	CFbsBitGc* iGc;
sl@0
   504
	TDisplayMode iDisplayMode;
sl@0
   505
	CScrollingTextDrawer* iTextDraw;
sl@0
   506
	TInt iCount;
sl@0
   507
	TInt iScreenNumber;
sl@0
   508
	};
sl@0
   509
sl@0
   510
class CTDirectStep : public CTGraphicsStep
sl@0
   511
	{
sl@0
   512
public:
sl@0
   513
	CTDirectStep();
sl@0
   514
protected:
sl@0
   515
	//from CTGraphicsStep
sl@0
   516
	virtual CTGraphicsBase* CreateTestL();
sl@0
   517
	};
sl@0
   518
sl@0
   519
_LIT(KTDirectStep,"TDirect");
sl@0
   520
sl@0
   521
sl@0
   522
#endif