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