os/graphics/windowing/windowserver/test/tauto/TScreenModeScaling.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
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
// Definitions common for both scren mode positioning and scaling
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
/**
sl@0
    19
 @file
sl@0
    20
 @test
sl@0
    21
 @internalComponent - Internal Symbian test code
sl@0
    22
*/
sl@0
    23
sl@0
    24
#ifndef __TSCREENMODESCALING_H__
sl@0
    25
#define __TSCREENMODESCALING_H__
sl@0
    26
sl@0
    27
sl@0
    28
#include <e32std.h>
sl@0
    29
#include <w32std.h>
sl@0
    30
#include "../tlib/testbase.h"
sl@0
    31
#include "AUTO.H"
sl@0
    32
#include "TGraphicsHarness.h"
sl@0
    33
sl@0
    34
_LIT(ScalingTestName,"Screen Mode Scaling");
sl@0
    35
sl@0
    36
GLREF_C void ClearBitmap(CFbsBitmap* aBitMap);
sl@0
    37
sl@0
    38
class CBasicWin : public CTWin
sl@0
    39
	{
sl@0
    40
public:
sl@0
    41
	//Virtual Function from CTBaseWin
sl@0
    42
	void Draw();
sl@0
    43
	TInt iDrawn;
sl@0
    44
	};
sl@0
    45
sl@0
    46
class CBmpWin : public CTWin
sl@0
    47
	{
sl@0
    48
public:
sl@0
    49
	inline CBmpWin(CFbsBitmap& aScreenBmp) :iScreenBmp(aScreenBmp) {}
sl@0
    50
	//Virtual Function from CTBaseWin
sl@0
    51
	void Draw();
sl@0
    52
private:
sl@0
    53
	CFbsBitmap& iScreenBmp;
sl@0
    54
	};
sl@0
    55
sl@0
    56
class CSpriteWin : public CTWin
sl@0
    57
	{
sl@0
    58
public:
sl@0
    59
	inline CSpriteWin(CFbsBitmap& aSpriteBitmap) :iSpriteBitmap(aSpriteBitmap) {}
sl@0
    60
	~CSpriteWin();
sl@0
    61
	inline void SetState(TInt aState) {iState=aState;}
sl@0
    62
	void UpdateState(TInt aState);
sl@0
    63
	//Virtual Function from CTBaseWin
sl@0
    64
	void Draw();
sl@0
    65
private:
sl@0
    66
	CFbsBitmap& iSpriteBitmap;
sl@0
    67
	TInt iState;
sl@0
    68
	};
sl@0
    69
sl@0
    70
class CTestSpriteWin : public CTWin
sl@0
    71
	{
sl@0
    72
public:
sl@0
    73
	inline CTestSpriteWin(CFbsBitmap& aSpriteBitmap) :iSpriteBitmap(aSpriteBitmap) {}
sl@0
    74
	~CTestSpriteWin();
sl@0
    75
	inline void SetOrigin(TPoint aOrigin) {iOrigin=aOrigin;}
sl@0
    76
	void UpdateWin(TPoint aOrigin);
sl@0
    77
	//Virtual Function from CTBaseWin
sl@0
    78
	void Draw();
sl@0
    79
private:
sl@0
    80
	CFbsBitmap& iSpriteBitmap;
sl@0
    81
	TPoint iOrigin;
sl@0
    82
	};
sl@0
    83
sl@0
    84
class CBitMapWin : public CTWin
sl@0
    85
	{
sl@0
    86
public:
sl@0
    87
	inline CBitMapWin(CBitmap* aBackupBitmap) :iBackup(aBackupBitmap) {}
sl@0
    88
	//Virtual Function from CTBaseWin
sl@0
    89
	void Draw();
sl@0
    90
private:
sl@0
    91
	CBitmap* iBackup;
sl@0
    92
	};
sl@0
    93
sl@0
    94
sl@0
    95
sl@0
    96
class CTScreenModeScaling : public CTWsGraphicsBase
sl@0
    97
	{
sl@0
    98
public:
sl@0
    99
	CTScreenModeScaling(CTestStep* aStep);
sl@0
   100
	~CTScreenModeScaling();
sl@0
   101
	void ConstructL();
sl@0
   102
	void WindowTestsL();
sl@0
   103
	void SpriteTestL();
sl@0
   104
	void RotationTestsL();
sl@0
   105
	void TransparentTestsL();
sl@0
   106
	void AppScreenModeTestL();
sl@0
   107
	
sl@0
   108
protected:
sl@0
   109
	virtual void RunTestCaseL(TInt aCurTestCase);
sl@0
   110
sl@0
   111
private:
sl@0
   112
	void DoWindowTestsL();
sl@0
   113
	void TestTopClientWindowPositionAPIs(TPoint aPos,RWindowBase* aWin);
sl@0
   114
	void TestChildWindowPositionAPIs(TPoint aPos,TPoint aParentPos,RWindowBase* aWin,RWindowBase* aParentWin);
sl@0
   115
	void TestRect();
sl@0
   116
	void CompareRegionsL(const TRegion &aRegion1,const TRegion &aRegion2);
sl@0
   117
	void TestGetInvalidRegionL(TRect& aRect);
sl@0
   118
	void CopyAndCompareL();
sl@0
   119
	void PositionTestL(TPoint aPostion);
sl@0
   120
	void BackedUpChildWindowTestL(TPoint aPostion);
sl@0
   121
	void NextScreenModeTestL(TPoint aPos);
sl@0
   122
	void GetInvalidRegionTestL(TPoint aPos);
sl@0
   123
	void TestDifferentScales(TInt aLastMode);
sl@0
   124
	void TestDifferentOrigin(TSizeMode &aMode,TPoint aOrigin);
sl@0
   125
	void DoSpriteTestsL();
sl@0
   126
	void TestDifferentOriginAndScaleForSpritesL(TSizeMode &aMode,TPoint aOrigin);
sl@0
   127
	void SetUpSpriteLC(RWsSprite &aSprite,RWsSession &aSession,RWindowTreeNode &aWindow,TInt aFlags=ESpriteNoShadows);
sl@0
   128
	void DrawTransparentWindows();
sl@0
   129
	void TestDifferentOriginAndScaleForTranspWin(TSizeMode &aMode,TPoint aOrigin);
sl@0
   130
private:
sl@0
   131
	CFbsBitmap iSpriteBitmap;
sl@0
   132
	CBmpWin* iBitmapWin;
sl@0
   133
	CFbsBitmap* iScreenBitmap;
sl@0
   134
	CBasicWin *iTestWin;
sl@0
   135
	CTBackedUpWin* iBackedUpWin;
sl@0
   136
	CTBlankWindow* iBlankWin;
sl@0
   137
	CTBlankWindow* iTestChildWin;
sl@0
   138
	TInt iCurrentMode;
sl@0
   139
	TSize iTestWinSize;
sl@0
   140
	TPoint iCurrentScreenModeOrigin;
sl@0
   141
	TSize iCurrentScreenModeScale;
sl@0
   142
	CTBackedUpWin* iCheckWin;
sl@0
   143
	CBitmap* iCheckBitmap;
sl@0
   144
	CBitmap* iTransparencyBitmap;
sl@0
   145
	CBitmap* iBackgroundBitmap;
sl@0
   146
	CBitmap* iForegroundBitmap;
sl@0
   147
	CBitMapWin* iTransWin;
sl@0
   148
	CBitMapWin* iBackgroundWin;
sl@0
   149
	TSize iWinSize;
sl@0
   150
	TDisplayMode iDisplayMode;
sl@0
   151
	};
sl@0
   152
sl@0
   153
class CTScreenModeScalingStep : public CTGraphicsStep
sl@0
   154
	{
sl@0
   155
public:
sl@0
   156
	CTScreenModeScalingStep();
sl@0
   157
protected:	
sl@0
   158
	//from CTGraphicsStep
sl@0
   159
	virtual CTGraphicsBase* CreateTestL();
sl@0
   160
	};
sl@0
   161
sl@0
   162
_LIT(KTScreenModeScalingStep,"TScreenModeScaling");
sl@0
   163
sl@0
   164
#endif