1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicsdeviceinterface/screendriver/tsrc/tscdvdevorientation.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,119 @@
1.4 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#if !defined(__TSCDVDEVORIENTATION_H__)
1.20 +#define __TSCDVDEVORIENTATION_H__
1.21 +
1.22 +#include "TGraphicsHarness.h"
1.23 +#include <graphics/surface.h>
1.24 +#include <pixelformats.h>
1.25 +#include <bitdrawsurface.h>
1.26 +
1.27 +
1.28 +LOCAL_D const TUint KPanicThreadHeapSize=0x4000;
1.29 +_LIT(KSCDVPanicCategory,"SCDV");
1.30 +
1.31 +//
1.32 +// Panic testing //
1.33 +//
1.34 +typedef TInt (*TPanicFunction)(TDeviceOrientation aOrientation, TDisplayMode aDisplayMode,TInt aScreenNo);
1.35 +
1.36 +struct SPanicParams
1.37 + {
1.38 + TPanicFunction functionName;
1.39 + TDeviceOrientation* pointerDeviceOrientation;
1.40 + TDisplayMode* pointerDisplayMode;
1.41 + TInt* pointerScreenNo;
1.42 + };
1.43 +
1.44 +enum TPanicExitReasons
1.45 + {
1.46 + EWsExitReasonBad=0x12345678,
1.47 + EWsExitReasonFinished
1.48 + };
1.49 +
1.50 +enum TAutoPanics
1.51 + {
1.52 + EAutoPanicTestFailed=0xBAADF00D,
1.53 + EAutoPanicPanicFailed=0xF00DBAAD
1.54 + };
1.55 +
1.56 +class CPanicTest : public CBase
1.57 + {
1.58 +public:
1.59 + CPanicTest();
1.60 + ~CPanicTest();
1.61 + TInt LaunchPanicThread(RThread &aThread, SPanicParams *aPtr);
1.62 + TInt TestInvalidModePanicL(TPanicFunction aFunction, TScreenDriverPanic aExitReason,TDisplayMode* aPtr2, TDeviceOrientation* aPtr, TInt* aPtrScreenNo, TBool* aTestFinished = NULL);
1.63 +
1.64 + TInt TestPanicL(SPanicParams *aPtr, TInt aExitReason, const TDesC &aCategory, TBool* aTestFinished=NULL);
1.65 + TInt TestPanicL(TPanicFunction aFunction, TInt aExitReason, const TDesC &aCategory, TDisplayMode* aPtr2,TDeviceOrientation* aPtr, TInt* aPtrScreenNo, TBool* aTestFinished=NULL);
1.66 + TInt iActualPanicCode;
1.67 + TInt iThreadNumber;
1.68 + };
1.69 +
1.70 +
1.71 +
1.72 +class CTDevOrientation: public CTGraphicsBase
1.73 + {
1.74 +public:
1.75 +
1.76 + CTDevOrientation(CTestStep *aTest, RArray<TInt> aArrayDispModes);
1.77 + CTDevOrientation(CTestStep *aTest);
1.78 + ~CTDevOrientation();
1.79 + void RunTestCaseL(TInt aCurTestCase);
1.80 +
1.81 + TBool GetSurfaceIdInterfaceL(const TInt& aScreenNo,const TDisplayMode& aDisplayMode, CFbsDrawDevice*& aDrawScreenDevice, MSurfaceId*& aSurfaceIdInterface );
1.82 +
1.83 + TBool ChooseOrientationMode( MSurfaceId* aSurfaceIdInterface);
1.84 +
1.85 + void TestValidButUnavailableOrientationL(MSurfaceId* aSurfaceIdInterface,TDisplayMode aDisplayMode);
1.86 + void TestSetDeviceOrientationWithInvalidModeL(TDisplayMode aDisplayMode);
1.87 + void TestGetSurfaceWithValidDispModeL( const MSurfaceId* aSurfaceIdInterface, const TDisplayMode& aDisplayMode, TInt aScreenNo);
1.88 + void TestGetDeviceOrientation(MSurfaceId* aSurfaceIdInterface);
1.89 + void TestDeviceOrientationSettingandGetting( MSurfaceId* aSurfaceIdInterface);
1.90 + void TestHorizontalVerticalTwips(const CFbsDrawDevice* aDrawScreenDevice, MSurfaceId* aSurfaceIdInterface, TDisplayMode aDisplayMode, TInt aScreenNo);
1.91 + void TestSetDeviceOrientationWithValidMode(const CFbsDrawDevice* aDrawScreenDevice, MSurfaceId* aSurfaceIdInterface, TDisplayMode aDisplayMode, TInt aScreenNo);
1.92 + void TestSetDisplayMode(CFbsDrawDevice* aDrawScreenDevice,MSurfaceId* aSurfaceIdInterface);
1.93 +
1.94 +
1.95 +private:
1.96 + void ConstructL();
1.97 + TBool ReqBppAndPixelFormat(TDisplayMode aDisplayMode, TInt& aBpp, TUint32& aPixelFormat);
1.98 +
1.99 +private:
1.100 + TSize iPhysSize;
1.101 + RArray<TDeviceOrientation> iArrayOrientation;
1.102 + // handle to initiate the panic tests
1.103 + CPanicTest *iPanicTest;
1.104 + RArray<TInt> iArrayDispModesPerScreen;
1.105 + TInt iCurrScreen;
1.106 + };
1.107 +
1.108 +
1.109 +class CTDevOrientationStep : public CTGraphicsStep
1.110 + {
1.111 +public:
1.112 + CTDevOrientationStep();
1.113 +protected:
1.114 + //from CTGraphicsStep
1.115 + virtual CTGraphicsBase* CreateTestL();
1.116 + virtual void TestSetupL();
1.117 + };
1.118 +
1.119 +_LIT(KTDevOrientationStep,"TDevOrientation");
1.120 +
1.121 +
1.122 +#endif