Update contrib.
1 // Copyright (c) 1996-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 // Definitions common for both scren mode positioning and scaling
21 @internalComponent - Internal Symbian test code
24 #ifndef __TSCREENMODESCALING_H__
25 #define __TSCREENMODESCALING_H__
30 #include "../tlib/testbase.h"
32 #include "TGraphicsHarness.h"
34 _LIT(ScalingTestName,"Screen Mode Scaling");
36 GLREF_C void ClearBitmap(CFbsBitmap* aBitMap);
38 class CBasicWin : public CTWin
41 //Virtual Function from CTBaseWin
46 class CBmpWin : public CTWin
49 inline CBmpWin(CFbsBitmap& aScreenBmp) :iScreenBmp(aScreenBmp) {}
50 //Virtual Function from CTBaseWin
53 CFbsBitmap& iScreenBmp;
56 class CSpriteWin : public CTWin
59 inline CSpriteWin(CFbsBitmap& aSpriteBitmap) :iSpriteBitmap(aSpriteBitmap) {}
61 inline void SetState(TInt aState) {iState=aState;}
62 void UpdateState(TInt aState);
63 //Virtual Function from CTBaseWin
66 CFbsBitmap& iSpriteBitmap;
70 class CTestSpriteWin : public CTWin
73 inline CTestSpriteWin(CFbsBitmap& aSpriteBitmap) :iSpriteBitmap(aSpriteBitmap) {}
75 inline void SetOrigin(TPoint aOrigin) {iOrigin=aOrigin;}
76 void UpdateWin(TPoint aOrigin);
77 //Virtual Function from CTBaseWin
80 CFbsBitmap& iSpriteBitmap;
84 class CBitMapWin : public CTWin
87 inline CBitMapWin(CBitmap* aBackupBitmap) :iBackup(aBackupBitmap) {}
88 //Virtual Function from CTBaseWin
96 class CTScreenModeScaling : public CTWsGraphicsBase
99 CTScreenModeScaling(CTestStep* aStep);
100 ~CTScreenModeScaling();
104 void RotationTestsL();
105 void TransparentTestsL();
106 void AppScreenModeTestL();
109 virtual void RunTestCaseL(TInt aCurTestCase);
112 void DoWindowTestsL();
113 void TestTopClientWindowPositionAPIs(TPoint aPos,RWindowBase* aWin);
114 void TestChildWindowPositionAPIs(TPoint aPos,TPoint aParentPos,RWindowBase* aWin,RWindowBase* aParentWin);
116 void CompareRegionsL(const TRegion &aRegion1,const TRegion &aRegion2);
117 void TestGetInvalidRegionL(TRect& aRect);
118 void CopyAndCompareL();
119 void PositionTestL(TPoint aPostion);
120 void BackedUpChildWindowTestL(TPoint aPostion);
121 void NextScreenModeTestL(TPoint aPos);
122 void GetInvalidRegionTestL(TPoint aPos);
123 void TestDifferentScales(TInt aLastMode);
124 void TestDifferentOrigin(TSizeMode &aMode,TPoint aOrigin);
125 void DoSpriteTestsL();
126 void TestDifferentOriginAndScaleForSpritesL(TSizeMode &aMode,TPoint aOrigin);
127 void SetUpSpriteLC(RWsSprite &aSprite,RWsSession &aSession,RWindowTreeNode &aWindow,TInt aFlags=ESpriteNoShadows);
128 void DrawTransparentWindows();
129 void TestDifferentOriginAndScaleForTranspWin(TSizeMode &aMode,TPoint aOrigin);
131 CFbsBitmap iSpriteBitmap;
133 CFbsBitmap* iScreenBitmap;
135 CTBackedUpWin* iBackedUpWin;
136 CTBlankWindow* iBlankWin;
137 CTBlankWindow* iTestChildWin;
140 TPoint iCurrentScreenModeOrigin;
141 TSize iCurrentScreenModeScale;
142 CTBackedUpWin* iCheckWin;
143 CBitmap* iCheckBitmap;
144 CBitmap* iTransparencyBitmap;
145 CBitmap* iBackgroundBitmap;
146 CBitmap* iForegroundBitmap;
147 CBitMapWin* iTransWin;
148 CBitMapWin* iBackgroundWin;
150 TDisplayMode iDisplayMode;
153 class CTScreenModeScalingStep : public CTGraphicsStep
156 CTScreenModeScalingStep();
158 //from CTGraphicsStep
159 virtual CTGraphicsBase* CreateTestL();
162 _LIT(KTScreenModeScalingStep,"TScreenModeScaling");