os/graphics/windowing/windowserver/test/tauto/TSCROLL.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
sl@0
     2
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
// All rights reserved.
sl@0
     4
// This component and the accompanying materials are made available
sl@0
     5
// under the terms of "Eclipse Public License v1.0"
sl@0
     6
// which accompanies this distribution, and is available
sl@0
     7
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
//
sl@0
     9
// Initial Contributors:
sl@0
    10
// Nokia Corporation - initial contribution.
sl@0
    11
//
sl@0
    12
// Contributors:
sl@0
    13
//
sl@0
    14
// Description:
sl@0
    15
//
sl@0
    16
sl@0
    17
/**
sl@0
    18
 @file
sl@0
    19
 @test
sl@0
    20
 @internalComponent - Internal Symbian test code
sl@0
    21
*/
sl@0
    22
sl@0
    23
#ifndef __TSCROLL_H__
sl@0
    24
#define __TSCROLL_H__
sl@0
    25
sl@0
    26
#include <e32std.h>
sl@0
    27
#include <w32std.h>
sl@0
    28
#include "../tlib/testbase.h"
sl@0
    29
#include <bitstd.h>
sl@0
    30
#include "AUTO.H"
sl@0
    31
#include "TGraphicsHarness.h"
sl@0
    32
sl@0
    33
class CTScroll;
sl@0
    34
class CScrollTestBase;
sl@0
    35
sl@0
    36
class CScrollWindowNorm : public CTWin
sl@0
    37
	{
sl@0
    38
public:
sl@0
    39
	CScrollWindowNorm();
sl@0
    40
	void Draw();
sl@0
    41
	void SetScrollTest(CScrollTestBase *aScrollTest);
sl@0
    42
private:
sl@0
    43
	CScrollTestBase *iScrollTest;
sl@0
    44
	};
sl@0
    45
sl@0
    46
class CScrollWindowBackedUp : public CTBackedUpWin
sl@0
    47
	{
sl@0
    48
public:
sl@0
    49
	CScrollWindowBackedUp(TDisplayMode aDisplayMode);
sl@0
    50
	void Draw();
sl@0
    51
	void SetScrollTest(CScrollTestBase *aScrollTest);
sl@0
    52
private:
sl@0
    53
	CScrollTestBase *iScrollTest;
sl@0
    54
	};
sl@0
    55
sl@0
    56
class CScrollTestBase : public CBase
sl@0
    57
	{
sl@0
    58
public:
sl@0
    59
	~CScrollTestBase();
sl@0
    60
	virtual void ConstructL(const TPoint &aPos, const TSize &aSize)=0;
sl@0
    61
	virtual void DoTestScroll(const TPoint &aOffset)=0;
sl@0
    62
	virtual void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset)=0;
sl@0
    63
	virtual void DoTestScroll(const TPoint &aOffset, const TRect &aRect)=0;
sl@0
    64
	virtual void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect)=0;
sl@0
    65
	virtual void Reset();
sl@0
    66
	TPoint Offset() const;
sl@0
    67
	virtual CTDrawableWin *ScrollWin() const=0;
sl@0
    68
	virtual void DoInvalidate();
sl@0
    69
	virtual void Redraw()=0;
sl@0
    70
protected:
sl@0
    71
	TSize iSize;
sl@0
    72
	TPoint iOffset;
sl@0
    73
	friend class CTScroll;
sl@0
    74
	RRegion iInvalid;
sl@0
    75
	CTBlankWindow *iBlankWin;
sl@0
    76
	};
sl@0
    77
sl@0
    78
class CScrollTestBaseNorm : public CScrollTestBase
sl@0
    79
	{
sl@0
    80
public:
sl@0
    81
	void ConstructL(const TPoint &aPos, const TSize &aSize);
sl@0
    82
	~CScrollTestBaseNorm();
sl@0
    83
	virtual CTDrawableWin *ScrollWin() const;
sl@0
    84
	virtual void Reset();
sl@0
    85
	void VisibleRegion(RRegion &aRegion);
sl@0
    86
	void AdjustTestScrollRegion(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
sl@0
    87
	void DrawScrollWin(const TPoint &aOffset, const TSize &aSize);
sl@0
    88
	void Redraw();
sl@0
    89
protected:
sl@0
    90
	CScrollWindowNorm *iScrollWin;
sl@0
    91
	};
sl@0
    92
sl@0
    93
class CScrollWindow1 : public CScrollTestBaseNorm
sl@0
    94
//
sl@0
    95
// Used as control window for a normal redraw window
sl@0
    96
//
sl@0
    97
	{
sl@0
    98
public:
sl@0
    99
	void DoTestScroll(const TPoint &aOffset);
sl@0
   100
	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset);
sl@0
   101
	void DoTestScroll(const TPoint &aOffset, const TRect &aRect);
sl@0
   102
	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
sl@0
   103
	void DoInvalidate();
sl@0
   104
	};
sl@0
   105
sl@0
   106
class CScrollWindow2 : public CScrollTestBaseNorm
sl@0
   107
//
sl@0
   108
// Used to test a normal redraw window
sl@0
   109
//
sl@0
   110
	{
sl@0
   111
public:
sl@0
   112
	CScrollWindow2(CTScroll *aTest);
sl@0
   113
	virtual void Draw();
sl@0
   114
	virtual void Reset();
sl@0
   115
	void DoTestScroll(const TPoint &aOffset);
sl@0
   116
	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset);
sl@0
   117
	void DoTestScroll(const TPoint &aOffset, const TRect &aRect);
sl@0
   118
	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
sl@0
   119
private:
sl@0
   120
	TBool iClipped;
sl@0
   121
	CTScroll *iTest;
sl@0
   122
	};
sl@0
   123
sl@0
   124
class CScrollWindow3 : public CScrollTestBaseNorm
sl@0
   125
//
sl@0
   126
// Used as control window for testing backed up windows
sl@0
   127
//
sl@0
   128
	{
sl@0
   129
public:
sl@0
   130
	void ConstructL(const TPoint &aPos, const TSize &aSize);
sl@0
   131
	~CScrollWindow3();
sl@0
   132
	virtual void Reset();
sl@0
   133
	void Draw();
sl@0
   134
	void DoTestScroll(const TPoint &aOffset);
sl@0
   135
	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset);
sl@0
   136
	void DoTestScroll(const TPoint &aOffset, const TRect &aRect);
sl@0
   137
	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
sl@0
   138
	void DoInvalidate();
sl@0
   139
	void DrawScrollBit();
sl@0
   140
private:
sl@0
   141
	CFbsBitmap *iBitmap;
sl@0
   142
	CFbsDevice *iBitmapDevice;
sl@0
   143
	CFbsBitGc *iBitmapGc;
sl@0
   144
	};
sl@0
   145
sl@0
   146
class CScrollWindow4 : public CScrollTestBase
sl@0
   147
//
sl@0
   148
// Tests a backed up window
sl@0
   149
//
sl@0
   150
	{
sl@0
   151
public:
sl@0
   152
	~CScrollWindow4();
sl@0
   153
	void ConstructL(const TPoint &aPos, const TSize &aSize);
sl@0
   154
	void DoTestScroll(const TPoint &aOffset);
sl@0
   155
	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset);
sl@0
   156
	void DoTestScroll(const TPoint &aOffset, const TRect &aRect);
sl@0
   157
	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
sl@0
   158
	virtual CTDrawableWin *ScrollWin() const;
sl@0
   159
	virtual void Reset();
sl@0
   160
	void Redraw();
sl@0
   161
protected:
sl@0
   162
	CScrollWindowBackedUp *iScrollWin;
sl@0
   163
	};
sl@0
   164
sl@0
   165
class CTScroll : public CTWsGraphicsBase
sl@0
   166
	{
sl@0
   167
public:
sl@0
   168
	CTScroll(CTestStep* aStep);
sl@0
   169
	~CTScroll();
sl@0
   170
	void ConstructL();
sl@0
   171
	void CheckScrollWindows();
sl@0
   172
	void DoTestScroll(const TPoint &aOffset);
sl@0
   173
	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset);
sl@0
   174
	void DoTestScroll(const TPoint &aOffset, const TRect &aRect);
sl@0
   175
	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
sl@0
   176
	void FinishedRectScrolls();
sl@0
   177
	void CheckOomScroll();
sl@0
   178
	void OomScrolling();
sl@0
   179
	void DemoWindowScrollL();
sl@0
   180
protected:
sl@0
   181
//from 	CTGraphicsStep
sl@0
   182
	virtual void RunTestCaseL(TInt aCurTestCase);
sl@0
   183
private:
sl@0
   184
	TSize iWinSize;
sl@0
   185
	TInt iMode;
sl@0
   186
	TBool iDoCheck;
sl@0
   187
	CScrollTestBase *iBaseScrollWin;
sl@0
   188
	CScrollTestBase *iTestScrollWin;
sl@0
   189
	};
sl@0
   190
sl@0
   191
class CTScrollStep : public CTGraphicsStep
sl@0
   192
	{
sl@0
   193
public:
sl@0
   194
	CTScrollStep();
sl@0
   195
protected:	
sl@0
   196
	//from CTGraphicsStep
sl@0
   197
	virtual CTGraphicsBase* CreateTestL();
sl@0
   198
	};
sl@0
   199
sl@0
   200
_LIT(KTScrollStep,"TScroll");
sl@0
   201
sl@0
   202
sl@0
   203
#endif