1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/tauto/TSCROLL.H Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,203 @@
1.4 +
1.5 +// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of "Eclipse Public License v1.0"
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +/**
1.21 + @file
1.22 + @test
1.23 + @internalComponent - Internal Symbian test code
1.24 +*/
1.25 +
1.26 +#ifndef __TSCROLL_H__
1.27 +#define __TSCROLL_H__
1.28 +
1.29 +#include <e32std.h>
1.30 +#include <w32std.h>
1.31 +#include "../tlib/testbase.h"
1.32 +#include <bitstd.h>
1.33 +#include "AUTO.H"
1.34 +#include "TGraphicsHarness.h"
1.35 +
1.36 +class CTScroll;
1.37 +class CScrollTestBase;
1.38 +
1.39 +class CScrollWindowNorm : public CTWin
1.40 + {
1.41 +public:
1.42 + CScrollWindowNorm();
1.43 + void Draw();
1.44 + void SetScrollTest(CScrollTestBase *aScrollTest);
1.45 +private:
1.46 + CScrollTestBase *iScrollTest;
1.47 + };
1.48 +
1.49 +class CScrollWindowBackedUp : public CTBackedUpWin
1.50 + {
1.51 +public:
1.52 + CScrollWindowBackedUp(TDisplayMode aDisplayMode);
1.53 + void Draw();
1.54 + void SetScrollTest(CScrollTestBase *aScrollTest);
1.55 +private:
1.56 + CScrollTestBase *iScrollTest;
1.57 + };
1.58 +
1.59 +class CScrollTestBase : public CBase
1.60 + {
1.61 +public:
1.62 + ~CScrollTestBase();
1.63 + virtual void ConstructL(const TPoint &aPos, const TSize &aSize)=0;
1.64 + virtual void DoTestScroll(const TPoint &aOffset)=0;
1.65 + virtual void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset)=0;
1.66 + virtual void DoTestScroll(const TPoint &aOffset, const TRect &aRect)=0;
1.67 + virtual void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect)=0;
1.68 + virtual void Reset();
1.69 + TPoint Offset() const;
1.70 + virtual CTDrawableWin *ScrollWin() const=0;
1.71 + virtual void DoInvalidate();
1.72 + virtual void Redraw()=0;
1.73 +protected:
1.74 + TSize iSize;
1.75 + TPoint iOffset;
1.76 + friend class CTScroll;
1.77 + RRegion iInvalid;
1.78 + CTBlankWindow *iBlankWin;
1.79 + };
1.80 +
1.81 +class CScrollTestBaseNorm : public CScrollTestBase
1.82 + {
1.83 +public:
1.84 + void ConstructL(const TPoint &aPos, const TSize &aSize);
1.85 + ~CScrollTestBaseNorm();
1.86 + virtual CTDrawableWin *ScrollWin() const;
1.87 + virtual void Reset();
1.88 + void VisibleRegion(RRegion &aRegion);
1.89 + void AdjustTestScrollRegion(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
1.90 + void DrawScrollWin(const TPoint &aOffset, const TSize &aSize);
1.91 + void Redraw();
1.92 +protected:
1.93 + CScrollWindowNorm *iScrollWin;
1.94 + };
1.95 +
1.96 +class CScrollWindow1 : public CScrollTestBaseNorm
1.97 +//
1.98 +// Used as control window for a normal redraw window
1.99 +//
1.100 + {
1.101 +public:
1.102 + void DoTestScroll(const TPoint &aOffset);
1.103 + void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset);
1.104 + void DoTestScroll(const TPoint &aOffset, const TRect &aRect);
1.105 + void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
1.106 + void DoInvalidate();
1.107 + };
1.108 +
1.109 +class CScrollWindow2 : public CScrollTestBaseNorm
1.110 +//
1.111 +// Used to test a normal redraw window
1.112 +//
1.113 + {
1.114 +public:
1.115 + CScrollWindow2(CTScroll *aTest);
1.116 + virtual void Draw();
1.117 + virtual void Reset();
1.118 + void DoTestScroll(const TPoint &aOffset);
1.119 + void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset);
1.120 + void DoTestScroll(const TPoint &aOffset, const TRect &aRect);
1.121 + void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
1.122 +private:
1.123 + TBool iClipped;
1.124 + CTScroll *iTest;
1.125 + };
1.126 +
1.127 +class CScrollWindow3 : public CScrollTestBaseNorm
1.128 +//
1.129 +// Used as control window for testing backed up windows
1.130 +//
1.131 + {
1.132 +public:
1.133 + void ConstructL(const TPoint &aPos, const TSize &aSize);
1.134 + ~CScrollWindow3();
1.135 + virtual void Reset();
1.136 + void Draw();
1.137 + void DoTestScroll(const TPoint &aOffset);
1.138 + void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset);
1.139 + void DoTestScroll(const TPoint &aOffset, const TRect &aRect);
1.140 + void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
1.141 + void DoInvalidate();
1.142 + void DrawScrollBit();
1.143 +private:
1.144 + CFbsBitmap *iBitmap;
1.145 + CFbsDevice *iBitmapDevice;
1.146 + CFbsBitGc *iBitmapGc;
1.147 + };
1.148 +
1.149 +class CScrollWindow4 : public CScrollTestBase
1.150 +//
1.151 +// Tests a backed up window
1.152 +//
1.153 + {
1.154 +public:
1.155 + ~CScrollWindow4();
1.156 + void ConstructL(const TPoint &aPos, const TSize &aSize);
1.157 + void DoTestScroll(const TPoint &aOffset);
1.158 + void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset);
1.159 + void DoTestScroll(const TPoint &aOffset, const TRect &aRect);
1.160 + void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
1.161 + virtual CTDrawableWin *ScrollWin() const;
1.162 + virtual void Reset();
1.163 + void Redraw();
1.164 +protected:
1.165 + CScrollWindowBackedUp *iScrollWin;
1.166 + };
1.167 +
1.168 +class CTScroll : public CTWsGraphicsBase
1.169 + {
1.170 +public:
1.171 + CTScroll(CTestStep* aStep);
1.172 + ~CTScroll();
1.173 + void ConstructL();
1.174 + void CheckScrollWindows();
1.175 + void DoTestScroll(const TPoint &aOffset);
1.176 + void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset);
1.177 + void DoTestScroll(const TPoint &aOffset, const TRect &aRect);
1.178 + void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
1.179 + void FinishedRectScrolls();
1.180 + void CheckOomScroll();
1.181 + void OomScrolling();
1.182 + void DemoWindowScrollL();
1.183 +protected:
1.184 +//from CTGraphicsStep
1.185 + virtual void RunTestCaseL(TInt aCurTestCase);
1.186 +private:
1.187 + TSize iWinSize;
1.188 + TInt iMode;
1.189 + TBool iDoCheck;
1.190 + CScrollTestBase *iBaseScrollWin;
1.191 + CScrollTestBase *iTestScrollWin;
1.192 + };
1.193 +
1.194 +class CTScrollStep : public CTGraphicsStep
1.195 + {
1.196 +public:
1.197 + CTScrollStep();
1.198 +protected:
1.199 + //from CTGraphicsStep
1.200 + virtual CTGraphicsBase* CreateTestL();
1.201 + };
1.202 +
1.203 +_LIT(KTScrollStep,"TScroll");
1.204 +
1.205 +
1.206 +#endif