os/graphics/windowing/windowserver/test/tdynamicres/inc/wsdynamicresbasic.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) 2008-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
*/
sl@0
    19
sl@0
    20
#ifndef __WSDYNAMICRESBASIC_H__
sl@0
    21
#define __WSDYNAMICRESBASIC_H__
sl@0
    22
sl@0
    23
#include "wsdynamicresbase.h"
sl@0
    24
#include <graphics/displayconfiguration.h>
sl@0
    25
#include <graphics/displaycontrol.h>
sl@0
    26
#include <graphics/displaymapping.h>
sl@0
    27
#include <e32math.h>
sl@0
    28
/**
sl@0
    29
 *
sl@0
    30
 **/
sl@0
    31
sl@0
    32
static TBool cSCLogged =EFalse;
sl@0
    33
sl@0
    34
sl@0
    35
class CWsDynamicResBasic : public CWsDynamicResBase
sl@0
    36
{
sl@0
    37
	typedef CWsDynamicResBase MyBase;
sl@0
    38
private:
sl@0
    39
	struct TBitmapRegionPair
sl@0
    40
		{
sl@0
    41
		CFbsBitmap* bitmap;
sl@0
    42
		RRegion* region;
sl@0
    43
		TRect drawRect;
sl@0
    44
		};
sl@0
    45
sl@0
    46
public:
sl@0
    47
	CWsDynamicResBasic();
sl@0
    48
	virtual ~CWsDynamicResBasic();
sl@0
    49
	virtual void SetupL();
sl@0
    50
	virtual void TearDownL();
sl@0
    51
	virtual void TearDownFromDeleteL();
sl@0
    52
	
sl@0
    53
	static CTestSuite* CreateSuiteL( const TDesC& aName );
sl@0
    54
	
sl@0
    55
	void ResetScreens();
sl@0
    56
	
sl@0
    57
protected:
sl@0
    58
//tests
sl@0
    59
	
sl@0
    60
	//BASIC
sl@0
    61
	void	GRAPHICS_WSERV_DYNAMICRES_0001L();
sl@0
    62
	void	GRAPHICS_WSERV_DYNAMICRES_0002L();
sl@0
    63
	void	GRAPHICS_WSERV_DYNAMICRES_0003L();
sl@0
    64
	void	GRAPHICS_WSERV_DYNAMICRES_0004L();
sl@0
    65
	void	GRAPHICS_WSERV_DYNAMICRES_0005L();
sl@0
    66
	void	GRAPHICS_WSERV_DYNAMICRES_0006L();
sl@0
    67
	void	GRAPHICS_WSERV_DYNAMICRES_0007L();
sl@0
    68
	void	GRAPHICS_WSERV_DYNAMICRES_0008L();
sl@0
    69
	void	GRAPHICS_WSERV_DYNAMICRES_0009L();
sl@0
    70
	void	GRAPHICS_WSERV_DYNAMICRES_0010L();
sl@0
    71
	void	GRAPHICS_WSERV_DYNAMICRES_0011L();
sl@0
    72
	void	GRAPHICS_WSERV_DYNAMICRES_0012L();
sl@0
    73
	void	GRAPHICS_WSERV_DYNAMICRES_0013L();
sl@0
    74
	void	GRAPHICS_WSERV_DYNAMICRES_0014L();
sl@0
    75
	void	GRAPHICS_WSERV_DYNAMICRES_0015L();
sl@0
    76
	void	GRAPHICS_WSERV_DYNAMICRES_0016L();
sl@0
    77
	void	GRAPHICS_WSERV_DYNAMICRES_0017L();
sl@0
    78
	void	GRAPHICS_WSERV_DYNAMICRES_0018L();
sl@0
    79
sl@0
    80
	//NEGATIVE
sl@0
    81
	void	GRAPHICS_WSERV_DYNAMICRES_0021L(TBool aScaleMode);
sl@0
    82
	
sl@0
    83
	//OOM
sl@0
    84
	void	GRAPHICS_WSERV_DYNAMICRES_0031L();
sl@0
    85
	void	GRAPHICS_WSERV_DYNAMICRES_0032L();
sl@0
    86
	void	GRAPHICS_WSERV_DYNAMICRES_0033L();
sl@0
    87
	void	GRAPHICS_WSERV_DYNAMICRES_0034L();
sl@0
    88
	
sl@0
    89
	//SCREEN CAPTURE
sl@0
    90
	void	GRAPHICS_WSERV_DYNAMICRES_0041L(TBool aIsSurface);
sl@0
    91
	void	GRAPHICS_WSERV_DYNAMICRES_0042L(TBool aIsSurface);
sl@0
    92
	
sl@0
    93
	//DYNAMIC SCREEN MODE
sl@0
    94
	void	GRAPHICS_WSERV_DYNAMICRES_0051L();
sl@0
    95
	void	GRAPHICS_WSERV_DYNAMICRES_0052L();
sl@0
    96
	void	GRAPHICS_WSERV_DYNAMICRES_0053L();
sl@0
    97
sl@0
    98
	//DEFECT
sl@0
    99
	void	GRAPHICS_WSERV_DYNAMICRES_0101L();
sl@0
   100
	void	GRAPHICS_WSERV_DYNAMICRES_0102L();
sl@0
   101
	
sl@0
   102
	
sl@0
   103
	void SetRotation (TDisplayConfiguration& aConfig, const MDisplayControl::TResolution& aResolution);
sl@0
   104
	TBool Compare(const CFbsBitmap& aBitmap, const TRect& aRect1,
sl@0
   105
			const TRect& aRect2, RArray<TBitmapRegionPair>& aRegionArray, TBool aIsSurface);
sl@0
   106
	TRgb GreatestColor(TRgb& aColor) const;
sl@0
   107
sl@0
   108
//data members:
sl@0
   109
private:
sl@0
   110
	CActiveScheduler	iScheduler;
sl@0
   111
};
sl@0
   112
sl@0
   113
class CWsDisplayEvent : public CActive
sl@0
   114
	{
sl@0
   115
	
sl@0
   116
public:
sl@0
   117
	CWsDisplayEvent(RWsSession *aWs);
sl@0
   118
	~CWsDisplayEvent();
sl@0
   119
	void Request();
sl@0
   120
	TInt ConfigSpinner()	{return iConfigSpinner;}
sl@0
   121
	TInt ResListSpinner()	{return iResListSpinner;}
sl@0
   122
	TInt ReceivedEventCount()	{return iReceivedEventCount;}
sl@0
   123
	TInt ReceivedDeviceEventCount()	{return iReceivedDeviceEventCount;}
sl@0
   124
	TInt ReceivedPointerEventCount() {return iReceivedPointerEventCount;}
sl@0
   125
	void SetExpectedPointPos(const TPoint& aPos) {iPointerPos = aPos;}
sl@0
   126
	TBool PointerTestPassed() {return iPointerPosTestPass;}
sl@0
   127
protected:
sl@0
   128
	void DoCancel();
sl@0
   129
	void RunL();
sl@0
   130
	
sl@0
   131
private:
sl@0
   132
	RWsSession *iWs;
sl@0
   133
	TInt iConfigSpinner;
sl@0
   134
	TInt iResListSpinner;
sl@0
   135
	TInt iReceivedEventCount;
sl@0
   136
	TInt iReceivedDeviceEventCount;
sl@0
   137
	TInt iReceivedPointerEventCount;	
sl@0
   138
	TPoint iPointerPos;
sl@0
   139
	TBool iPointerPosTestPass;
sl@0
   140
	};
sl@0
   141
sl@0
   142
class CEventTimer : public CActive
sl@0
   143
	{
sl@0
   144
public:
sl@0
   145
	static CEventTimer* NewL();
sl@0
   146
	~CEventTimer();
sl@0
   147
	void Wait(TInt aDelay);
sl@0
   148
	// From CActive:
sl@0
   149
	void RunL();
sl@0
   150
	void DoCancel();
sl@0
   151
	
sl@0
   152
protected:
sl@0
   153
	CEventTimer();
sl@0
   154
	void ConstructL();
sl@0
   155
	protected:
sl@0
   156
RTimer iTimer;
sl@0
   157
};
sl@0
   158
sl@0
   159
sl@0
   160
sl@0
   161
class CDSATestDrawing: public CTimer, public MDirectScreenAccess
sl@0
   162
	{
sl@0
   163
public:
sl@0
   164
sl@0
   165
	void Draw();
sl@0
   166
sl@0
   167
	
sl@0
   168
	
sl@0
   169
	static CDSATestDrawing* NewL();
sl@0
   170
	void ConstructL();
sl@0
   171
	//from MDirectScreenAccess
sl@0
   172
	void Restart(RDirectScreenAccess::TTerminationReasons aReason);
sl@0
   173
	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
sl@0
   174
	~CDSATestDrawing();
sl@0
   175
	void SetDSA(CDirectScreenAccess *aDSA){iDSA = aDSA;}
sl@0
   176
	void SetWindow(RWindow &aWindow){iWin = &aWindow;}
sl@0
   177
	void StartDrawingL(CDirectScreenAccess *aDSA);
sl@0
   178
	void RunL();
sl@0
   179
	
sl@0
   180
private:
sl@0
   181
	CDSATestDrawing();
sl@0
   182
	TRect iRect;
sl@0
   183
	RWindow* iWin;
sl@0
   184
	CDirectScreenAccess *iDSA;
sl@0
   185
	};
sl@0
   186
sl@0
   187
#endif	/*__WSDYNAMICRESBASIC_H__*/