windowing/windowserver/test/tauto/TSCREENMODEPOSITIONING.H
author hgs
Tue, 22 Jun 2010 15:21:29 +0300
changeset 103 2717213c588a
permissions -rw-r--r--
201024
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
103
hgs
parents:
diff changeset
     1
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     2
// All rights reserved.
hgs
parents:
diff changeset
     3
// This component and the accompanying materials are made available
hgs
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     5
// which accompanies this distribution, and is available
hgs
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     7
//
hgs
parents:
diff changeset
     8
// Initial Contributors:
hgs
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    10
//
hgs
parents:
diff changeset
    11
// Contributors:
hgs
parents:
diff changeset
    12
//
hgs
parents:
diff changeset
    13
// Description:
hgs
parents:
diff changeset
    14
//
hgs
parents:
diff changeset
    15
hgs
parents:
diff changeset
    16
/**
hgs
parents:
diff changeset
    17
 @file
hgs
parents:
diff changeset
    18
 @test
hgs
parents:
diff changeset
    19
 @internalComponent - Internal Symbian test code
hgs
parents:
diff changeset
    20
*/
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
hgs
parents:
diff changeset
    23
#ifndef __TSCREENMODEPOSITIONING_H__
hgs
parents:
diff changeset
    24
#define __TSCREENMODEPOSITIONING_H__
hgs
parents:
diff changeset
    25
hgs
parents:
diff changeset
    26
#include <e32std.h>
hgs
parents:
diff changeset
    27
#include <w32std.h>
hgs
parents:
diff changeset
    28
#include "../tlib/testbase.h"
hgs
parents:
diff changeset
    29
#include "AUTO.H"
hgs
parents:
diff changeset
    30
#include "TScreenModeScaling.h"
hgs
parents:
diff changeset
    31
#include "TGraphicsHarness.h"
hgs
parents:
diff changeset
    32
hgs
parents:
diff changeset
    33
class CConnection2;
hgs
parents:
diff changeset
    34
hgs
parents:
diff changeset
    35
class CConnection2Group : public CTWindowGroup
hgs
parents:
diff changeset
    36
	{
hgs
parents:
diff changeset
    37
public:
hgs
parents:
diff changeset
    38
	CConnection2Group(CTClient *aClient, CConnection2 *aSecondConnection, CTestBase *aTest);
hgs
parents:
diff changeset
    39
private:
hgs
parents:
diff changeset
    40
	CTestBase* iTest;
hgs
parents:
diff changeset
    41
public:
hgs
parents:
diff changeset
    42
	CConnection2* iConnection2;
hgs
parents:
diff changeset
    43
	};
hgs
parents:
diff changeset
    44
hgs
parents:
diff changeset
    45
class CConnection2 : public CBase
hgs
parents:
diff changeset
    46
	{
hgs
parents:
diff changeset
    47
public:
hgs
parents:
diff changeset
    48
	~CConnection2();
hgs
parents:
diff changeset
    49
	void ConstructL(CTestBase *aTest,CFbsBitmap& aBitmap);
hgs
parents:
diff changeset
    50
	void DrawBitmapWin();
hgs
parents:
diff changeset
    51
	CBmpWin* BitmapWin() {return iBitmapWin;}
hgs
parents:
diff changeset
    52
public:
hgs
parents:
diff changeset
    53
	CTClient* iClient;
hgs
parents:
diff changeset
    54
	CFbsBitmap* iScreenBitmap;
hgs
parents:
diff changeset
    55
	CSpriteWin*	iSpriteWin;
hgs
parents:
diff changeset
    56
private:
hgs
parents:
diff changeset
    57
	CConnection2Group *iGroup;
hgs
parents:
diff changeset
    58
	CBmpWin* iBitmapWin;
hgs
parents:
diff changeset
    59
	};
hgs
parents:
diff changeset
    60
hgs
parents:
diff changeset
    61
hgs
parents:
diff changeset
    62
hgs
parents:
diff changeset
    63
class CTScreenModePositioning : public CTWsGraphicsBase
hgs
parents:
diff changeset
    64
	{
hgs
parents:
diff changeset
    65
public:
hgs
parents:
diff changeset
    66
	CTScreenModePositioning(CTestStep* aStep);
hgs
parents:
diff changeset
    67
	~CTScreenModePositioning();
hgs
parents:
diff changeset
    68
	void ConstructL();
hgs
parents:
diff changeset
    69
hgs
parents:
diff changeset
    70
	void WindowTestsL();
hgs
parents:
diff changeset
    71
	void SpriteTestL();
hgs
parents:
diff changeset
    72
	void RotationTestsL();
hgs
parents:
diff changeset
    73
	TBool ScalingSupportedByDisplayMode();
hgs
parents:
diff changeset
    74
hgs
parents:
diff changeset
    75
protected:
hgs
parents:
diff changeset
    76
	virtual void RunTestCaseL(TInt aCurTestCase);
hgs
parents:
diff changeset
    77
private:
hgs
parents:
diff changeset
    78
	TBool TestRect();
hgs
parents:
diff changeset
    79
	void CopyScreenAndChangeBackToDefScrModeL();
hgs
parents:
diff changeset
    80
	void PositionTest1L(TPoint aPosTSize);
hgs
parents:
diff changeset
    81
	void PositionTest2L(TPoint aPos);
hgs
parents:
diff changeset
    82
	void GetInvalidRegionTestL(TPoint aPos);
hgs
parents:
diff changeset
    83
	void DoWindowTestsL();
hgs
parents:
diff changeset
    84
	void CreateWindowsTestL(TPoint aPos);
hgs
parents:
diff changeset
    85
	void NextScreenModeTestL(TPoint aPos);
hgs
parents:
diff changeset
    86
	void ChangeScreenMode(CTClient* aClient,TPixelsAndRotation aPixelsAndRotation,TInt aMode);
hgs
parents:
diff changeset
    87
	void ChangeScreenMode(CTClient* aClient,TPixelsAndRotation aPixelsAndRotation,TScreenModeEnforcement aScreenModeEnforcement,TInt aMode);
hgs
parents:
diff changeset
    88
	void SetScreenMode(CTClient* aClient,TInt aMode,TScreenModeEnforcement aScreenModeEnforcement);
hgs
parents:
diff changeset
    89
	void SetUpSpriteLC(RWsSprite &aSprite, RWsSession &aSession, RWindowTreeNode &aWindow,TInt aFlags=ESpriteNoShadows);
hgs
parents:
diff changeset
    90
	void CompareRegionsL(const TRegion &aRegion1,const TRegion &aRegion2);
hgs
parents:
diff changeset
    91
	void TestGetInvalidRegionL(TRect& aRect);
hgs
parents:
diff changeset
    92
	void TestTopClientWindowPositionAPIs(TPoint aPos,RWindowBase* aWin);
hgs
parents:
diff changeset
    93
	void TestChildWindowPositionAPIs(TPoint aPos,TPoint aParentPos,RWindowBase* aWin,RWindowBase* aParentWin);
hgs
parents:
diff changeset
    94
	void CopyAndCompareL(TPoint aPos);
hgs
parents:
diff changeset
    95
	void RestoreScreenMode();
hgs
parents:
diff changeset
    96
private:
hgs
parents:
diff changeset
    97
	CFbsBitmap iSpriteBitmap;
hgs
parents:
diff changeset
    98
	CConnection2* iConnection2;
hgs
parents:
diff changeset
    99
	CBasicWin *iTestWin;
hgs
parents:
diff changeset
   100
	CTBackedUpWin* iBackedUpWin;
hgs
parents:
diff changeset
   101
	CTBlankWindow* iBlankWin;
hgs
parents:
diff changeset
   102
	CTBlankWindow* iTestChildWin;
hgs
parents:
diff changeset
   103
	TInt iCurrentMode;
hgs
parents:
diff changeset
   104
	TSize iTestWinSize;
hgs
parents:
diff changeset
   105
	TPoint iCurrentScreenModeOrigin;
hgs
parents:
diff changeset
   106
	TSize iCurrentScreenModeScale;
hgs
parents:
diff changeset
   107
	TSize iCurrentScreenModeSize;
hgs
parents:
diff changeset
   108
	TInt iScalingSupported;
hgs
parents:
diff changeset
   109
 	};
hgs
parents:
diff changeset
   110
hgs
parents:
diff changeset
   111
class CTScreenModePositioningStep : public CTGraphicsStep
hgs
parents:
diff changeset
   112
	{
hgs
parents:
diff changeset
   113
public:
hgs
parents:
diff changeset
   114
	CTScreenModePositioningStep();
hgs
parents:
diff changeset
   115
protected:	
hgs
parents:
diff changeset
   116
	//from CTGraphicsStep
hgs
parents:
diff changeset
   117
	virtual CTGraphicsBase* CreateTestL();
hgs
parents:
diff changeset
   118
	};
hgs
parents:
diff changeset
   119
hgs
parents:
diff changeset
   120
_LIT(KTScreenModePositioningStep,"TScreenModePositioning");
hgs
parents:
diff changeset
   121
hgs
parents:
diff changeset
   122
hgs
parents:
diff changeset
   123
#endif