os/graphics/windowing/windowserver/test/tauto/TAUTODLL.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.
     1 // Copyright (c) 1996-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  @test
    19  @internalComponent - Internal Symbian test code
    20 */
    21 
    22 #ifndef __TAUTODLL_H__
    23 #define __TAUTODLL_H__
    24 
    25 #include <e32std.h>
    26 #include <w32std.h>
    27 #include "../tlib/testbase.h"
    28 #include "AUTO.H"
    29 #include "TGraphicsHarness.h"
    30 
    31 
    32 #include <w32adll.h>
    33 #include "AUTODLL.H"
    34 
    35 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
    36 #include "../nonnga/CLIENT/w32comm.h"
    37 #endif
    38 
    39 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
    40 #include "../nga/CLIENT/w32comm.h"
    41 #endif
    42 
    43 #include "tdirecta.h"
    44 
    45 
    46 class CAnimWindow;
    47 
    48 class CAnimRedrawWindow : public CTWin
    49 	{
    50 public:
    51 	CAnimRedrawWindow(CAnimWindow *aAnimWindow, TBool aIsBase);
    52 	~CAnimRedrawWindow();
    53 	void Draw();
    54 private:
    55 	CAnimWindow *iAnimWindow;
    56 	TBool iIsBase;
    57 	};
    58 
    59 class CAnimWindow : public CBase
    60 	{
    61 	friend class CTAnimDll;
    62 	friend class CAnimRedrawWindow;
    63 public:
    64 	enum TWinType
    65 		{
    66 		ERedraw,
    67 		EBlank,
    68 		EBackedUp,
    69 		};
    70 public:
    71 	CAnimWindow(TBool aIsBase, TWinType aWinType);
    72 	~CAnimWindow();
    73 	void ConstructL(const TPoint &aPos, const TSize &aSize);
    74 	void SetRect(const TRect &aRect);
    75 	static void Draw(CBitmapContext *aGc, const TSize &aSize, TBool aIsBase,const TRect &aRect, TBool aBlankIt);
    76 	static void DrawEllipse(CBitmapContext *aGc, const TRect &aRect);
    77 	void DoDraw(TBool aBlankIt=EFalse);
    78 	void DoDrawEllipse();
    79 	void DoDrawCoverage();
    80 	TSize Size();
    81 	RWindowBase *BaseWin() const;
    82 	CTBaseWin *CtBaseWin();
    83 	void Invalidate();
    84 	void Invalidate(const TRect &aRect);
    85 	static void SetEllipseDrawMode(CGraphicsContext::TDrawMode aEllipseDrawMode);
    86 	void DrawTestScreen(CFbsBitmap *aBitmap, CFbsBitmap *aMaskBitmap, CFbsFont *aFont);
    87 protected:
    88 	CTBaseWin *iCtWin;
    89 	TWinType iWinType;
    90 	TBool iIsBase;
    91 	TRect iRect;
    92 	static CGraphicsContext::TDrawMode iEllipseDrawMode;
    93 	};
    94 
    95 
    96 
    97 class CTAnimDll : public CTWsGraphicsBase
    98 	{
    99 public:
   100 	CTAnimDll(CTestStep* aStep);
   101 	~CTAnimDll();
   102 	void ConstructL();
   103 
   104 	void TestPanicsL();
   105 	void RemoteBuffer();
   106 	void Misc();
   107 	void ExtraCopyTest();
   108 	void SyncMode1();
   109 	void TestSyncModes(MAnimGeneralFunctions::TAnimSync aSyncMode);
   110 	void TestTimeChange();
   111 	void TestLoadApiL();
   112 	void KeyClickPriorityL();
   113 protected:	//Pure virtual from MTestCases
   114 	void RunTestCaseL(TInt aCurTestCase);
   115 private:
   116 	void InvalidatePauseAndRedraw(const TRect &aRect,TTimeIntervalMicroSeconds32 aInterval);	
   117 	void RedrawAndCheckWindows(TBool aBlankIt=EFalse);
   118 	void SetUpMember(TSpriteMember &aMember,TInt aType);
   119 	void DrawingTestL();
   120 	void ShadowDrawingTestL();
   121 	void GeneralDrawingTestL();
   122 	void CheckWindows();
   123 	void DestroyWindowTestL();
   124 	void SpriteAnimL();
   125 	void FreeTimerL();
   126 	void DisableTimerL();
   127 	void MultipleAnimsL();
   128 	void ClickPlugInL();
   129 	void WinFunctionsL();
   130 	void WinFunctions2L();
   131 	void TestNotificationsL();
   132 	void TestCoverageL();
   133 	void TestPanicCoverageL();
   134 	void TestWindowInfo(RTestAnim& aAnim,TInt aScreen,TInt aPos,TInt aId);
   135 	void TestEventHandlerRemovalL();
   136 	void ParameterValueTestL();
   137 	void TestSetIntervalL();
   138 	TInt CheckError(TInt aError,TInt aExpected);
   139 	TRgb PixelColour(const TPoint& aPoint) const;
   140 private:
   141 	RAnimDll iAnimDll;
   142 	TSize iWinSize;
   143 	CAnimWindow *iTestWin;
   144 	CAnimWindow *iRedrawWin;
   145 	CAnimWindow *iBaseWin;
   146 	CAnimWindow *iBackedUpTestWin;
   147 	CAnimWindow *iBlankTestWin;
   148 	};
   149 
   150 class CTAnimDllStep : public CTGraphicsStep
   151 	{
   152 public:
   153 	CTAnimDllStep();
   154 protected:
   155 	//from CTGraphicsStep
   156 	virtual CTGraphicsBase* CreateTestL();
   157 	};
   158 
   159 _LIT(KTAnimDllStep,"TAnimDll");
   160 
   161 
   162 #endif