103
|
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".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
/**
|
|
17 |
@file
|
|
18 |
@test
|
|
19 |
@internalComponent - Internal Symbian test code
|
|
20 |
*/
|
|
21 |
|
|
22 |
|
|
23 |
#ifndef __TSCREENMODEPOSITIONING_H__
|
|
24 |
#define __TSCREENMODEPOSITIONING_H__
|
|
25 |
|
|
26 |
#include <e32std.h>
|
|
27 |
#include <w32std.h>
|
|
28 |
#include "../tlib/testbase.h"
|
|
29 |
#include "AUTO.H"
|
|
30 |
#include "TScreenModeScaling.h"
|
|
31 |
#include "TGraphicsHarness.h"
|
|
32 |
|
|
33 |
class CConnection2;
|
|
34 |
|
|
35 |
class CConnection2Group : public CTWindowGroup
|
|
36 |
{
|
|
37 |
public:
|
|
38 |
CConnection2Group(CTClient *aClient, CConnection2 *aSecondConnection, CTestBase *aTest);
|
|
39 |
private:
|
|
40 |
CTestBase* iTest;
|
|
41 |
public:
|
|
42 |
CConnection2* iConnection2;
|
|
43 |
};
|
|
44 |
|
|
45 |
class CConnection2 : public CBase
|
|
46 |
{
|
|
47 |
public:
|
|
48 |
~CConnection2();
|
|
49 |
void ConstructL(CTestBase *aTest,CFbsBitmap& aBitmap);
|
|
50 |
void DrawBitmapWin();
|
|
51 |
CBmpWin* BitmapWin() {return iBitmapWin;}
|
|
52 |
public:
|
|
53 |
CTClient* iClient;
|
|
54 |
CFbsBitmap* iScreenBitmap;
|
|
55 |
CSpriteWin* iSpriteWin;
|
|
56 |
private:
|
|
57 |
CConnection2Group *iGroup;
|
|
58 |
CBmpWin* iBitmapWin;
|
|
59 |
};
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
class CTScreenModePositioning : public CTWsGraphicsBase
|
|
64 |
{
|
|
65 |
public:
|
|
66 |
CTScreenModePositioning(CTestStep* aStep);
|
|
67 |
~CTScreenModePositioning();
|
|
68 |
void ConstructL();
|
|
69 |
|
|
70 |
void WindowTestsL();
|
|
71 |
void SpriteTestL();
|
|
72 |
void RotationTestsL();
|
|
73 |
TBool ScalingSupportedByDisplayMode();
|
|
74 |
|
|
75 |
protected:
|
|
76 |
virtual void RunTestCaseL(TInt aCurTestCase);
|
|
77 |
private:
|
|
78 |
TBool TestRect();
|
|
79 |
void CopyScreenAndChangeBackToDefScrModeL();
|
|
80 |
void PositionTest1L(TPoint aPosTSize);
|
|
81 |
void PositionTest2L(TPoint aPos);
|
|
82 |
void GetInvalidRegionTestL(TPoint aPos);
|
|
83 |
void DoWindowTestsL();
|
|
84 |
void CreateWindowsTestL(TPoint aPos);
|
|
85 |
void NextScreenModeTestL(TPoint aPos);
|
|
86 |
void ChangeScreenMode(CTClient* aClient,TPixelsAndRotation aPixelsAndRotation,TInt aMode);
|
|
87 |
void ChangeScreenMode(CTClient* aClient,TPixelsAndRotation aPixelsAndRotation,TScreenModeEnforcement aScreenModeEnforcement,TInt aMode);
|
|
88 |
void SetScreenMode(CTClient* aClient,TInt aMode,TScreenModeEnforcement aScreenModeEnforcement);
|
|
89 |
void SetUpSpriteLC(RWsSprite &aSprite, RWsSession &aSession, RWindowTreeNode &aWindow,TInt aFlags=ESpriteNoShadows);
|
|
90 |
void CompareRegionsL(const TRegion &aRegion1,const TRegion &aRegion2);
|
|
91 |
void TestGetInvalidRegionL(TRect& aRect);
|
|
92 |
void TestTopClientWindowPositionAPIs(TPoint aPos,RWindowBase* aWin);
|
|
93 |
void TestChildWindowPositionAPIs(TPoint aPos,TPoint aParentPos,RWindowBase* aWin,RWindowBase* aParentWin);
|
|
94 |
void CopyAndCompareL(TPoint aPos);
|
|
95 |
void RestoreScreenMode();
|
|
96 |
private:
|
|
97 |
CFbsBitmap iSpriteBitmap;
|
|
98 |
CConnection2* iConnection2;
|
|
99 |
CBasicWin *iTestWin;
|
|
100 |
CTBackedUpWin* iBackedUpWin;
|
|
101 |
CTBlankWindow* iBlankWin;
|
|
102 |
CTBlankWindow* iTestChildWin;
|
|
103 |
TInt iCurrentMode;
|
|
104 |
TSize iTestWinSize;
|
|
105 |
TPoint iCurrentScreenModeOrigin;
|
|
106 |
TSize iCurrentScreenModeScale;
|
|
107 |
TSize iCurrentScreenModeSize;
|
|
108 |
TInt iScalingSupported;
|
|
109 |
};
|
|
110 |
|
|
111 |
class CTScreenModePositioningStep : public CTGraphicsStep
|
|
112 |
{
|
|
113 |
public:
|
|
114 |
CTScreenModePositioningStep();
|
|
115 |
protected:
|
|
116 |
//from CTGraphicsStep
|
|
117 |
virtual CTGraphicsBase* CreateTestL();
|
|
118 |
};
|
|
119 |
|
|
120 |
_LIT(KTScreenModePositioningStep,"TScreenModePositioning");
|
|
121 |
|
|
122 |
|
|
123 |
#endif
|