os/graphics/windowing/windowserver/test/tauto/TMulTran.CPP
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
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// Test multiple level transparent window
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
/**
sl@0
    19
 @file
sl@0
    20
 @test
sl@0
    21
 @internalComponent - Internal Symbian test code
sl@0
    22
*/
sl@0
    23
sl@0
    24
#include "TMulTran.H"
sl@0
    25
sl@0
    26
sl@0
    27
LOCAL_D TDisplayMode DisplayMode=EColor64K;
sl@0
    28
LOCAL_D TSize WinSize;
sl@0
    29
sl@0
    30
static const TRgb KRed=TRgb(255, 0, 0, 128);
sl@0
    31
static const TRgb KGreen=TRgb(0, 255, 0, 128);
sl@0
    32
static const TRgb KYellow=TRgb(255, 255, 0, 128);
sl@0
    33
static const TRgb KBlue=TRgb(0, 0, 255, 128);
sl@0
    34
static const TRgb KCyan=TRgb(0, 255, 255, 128);
sl@0
    35
sl@0
    36
/*CTransWindow*/
sl@0
    37
sl@0
    38
CTransWindow* CTransWindow::NewL(RPointerArray<CTransWindow>& aWindows,TRgb aColor,TRect aPos)
sl@0
    39
	{
sl@0
    40
	CTransWindow* self=NewL(TheClient->iGroup,aColor,aPos,&DisplayMode);
sl@0
    41
	aWindows.Insert(self,0);
sl@0
    42
	return self;
sl@0
    43
	}
sl@0
    44
sl@0
    45
CTransWindow* CTransWindow::NewL(CTWinBase* aParent,TRgb aColor,TRect aPos, TDisplayMode* aDisplayMode)
sl@0
    46
	{
sl@0
    47
	CTransWindow* self=new(ELeave) CTransWindow(aColor);
sl@0
    48
	CleanupStack::PushL(self);
sl@0
    49
	self->SetUpL(aPos.iTl,aPos.Size(),aParent,*TheClient->iGc,aDisplayMode);
sl@0
    50
	User::LeaveIfError(self->iError);
sl@0
    51
	CleanupStack::Pop(self);
sl@0
    52
	return self;
sl@0
    53
	}
sl@0
    54
sl@0
    55
//the following function doesn't activate a window
sl@0
    56
CTransWindow* CTransWindow::NewL(CTWinBase* aParent,TRgb aColor,TDisplayMode* aDisplayMode)
sl@0
    57
	{
sl@0
    58
	CTransWindow* self=new(ELeave) CTransWindow(aColor);
sl@0
    59
	CleanupStack::PushL(self);
sl@0
    60
	self->ConstructL(*aParent);
sl@0
    61
	if (aDisplayMode)
sl@0
    62
		{
sl@0
    63
		self->BaseWin()->SetRequiredDisplayMode(*aDisplayMode);
sl@0
    64
		}
sl@0
    65
	User::LeaveIfError((self->iError) && (self->iError != KErrNotSupported));
sl@0
    66
	CleanupStack::Pop(self);
sl@0
    67
	return self;
sl@0
    68
	}
sl@0
    69
sl@0
    70
void CTransWindow::InitWin()
sl@0
    71
	{
sl@0
    72
	AdjustShadow(-1);
sl@0
    73
	iShadowHight=0;
sl@0
    74
	iWin.SetShadowDisabled(ETrue);
sl@0
    75
	iShadowing=EFalse;
sl@0
    76
	iError = iWin.SetTransparencyAlphaChannel();
sl@0
    77
	iWin.SetBackgroundColor(iCol);
sl@0
    78
	iDrawOpaque=EFalse;
sl@0
    79
	}
sl@0
    80
sl@0
    81
void CTransWindow::ToggleVisibility()
sl@0
    82
	{
sl@0
    83
	iVisible=!iVisible;
sl@0
    84
	SetVisible(iVisible);
sl@0
    85
	}
sl@0
    86
sl@0
    87
void CTransWindow::SetOrdinal(RPointerArray<CTransWindow>& aWindows,TInt aOldPos,TInt aNewPos)
sl@0
    88
	{
sl@0
    89
	CTransWindow* win=aWindows[aOldPos];
sl@0
    90
	aWindows.Remove(aOldPos);
sl@0
    91
	aWindows.Insert(win,aNewPos);
sl@0
    92
	win->iWin.SetOrdinalPosition(aNewPos);
sl@0
    93
	}
sl@0
    94
sl@0
    95
void CTransWindow::SetShadowDisabled(TBool aState)
sl@0
    96
	{
sl@0
    97
	iWin.SetShadowDisabled(aState);
sl@0
    98
	iShadowing=!aState;
sl@0
    99
	}
sl@0
   100
sl@0
   101
void CTransWindow::AdjustShadow(TInt aAdjust)
sl@0
   102
	{
sl@0
   103
	CBlankWindow::AdjustShadow(aAdjust);
sl@0
   104
	iShadowHight+=aAdjust;
sl@0
   105
	}
sl@0
   106
sl@0
   107
TPoint CTransWindow::Position() const
sl@0
   108
	{
sl@0
   109
	return CBlankWindow::Position()+iPosOffset;
sl@0
   110
	}
sl@0
   111
sl@0
   112
void CTransWindow::Draw()
sl@0
   113
	{
sl@0
   114
	//don't call CBlankWindow::Draw() since the background is already drawn
sl@0
   115
sl@0
   116
	if(iDrawOpaque)
sl@0
   117
		{
sl@0
   118
		iGc->SetPenStyle(CGraphicsContext::ESolidPen);
sl@0
   119
		iGc->SetPenSize(TSize(4,4));
sl@0
   120
		iGc->SetBrushStyle(CGraphicsContext::ENullBrush);
sl@0
   121
		iGc->SetPenColor(~iCol);
sl@0
   122
		iGc->SetOpaque(ETrue);
sl@0
   123
		iGc->DrawLine(TPoint(0,0),TPoint(1000,1000));
sl@0
   124
		iGc->SetOpaque(EFalse);
sl@0
   125
		}
sl@0
   126
	}
sl@0
   127
sl@0
   128
/*CTMultipleTrans*/
sl@0
   129
sl@0
   130
CTMultipleTrans::CTMultipleTrans(CTestStep* aStep) : CTWsGraphicsBase(aStep), iWindows(5), iShadows(EFalse)
sl@0
   131
	{
sl@0
   132
	}
sl@0
   133
sl@0
   134
CTMultipleTrans::~CTMultipleTrans()
sl@0
   135
	{
sl@0
   136
	((CTMultipleTransStep*)iStep)->CloseTMSGraphicsStep();
sl@0
   137
	delete iBackgroundWin;
sl@0
   138
	delete iCheckWin;
sl@0
   139
	delete iCheckBitmap;
sl@0
   140
	iWindows.ResetAndDestroy();
sl@0
   141
	iBlankWin.Close();
sl@0
   142
	}
sl@0
   143
sl@0
   144
void CTMultipleTrans::ConstructL()
sl@0
   145
	{
sl@0
   146
	if(TransparencySupportedL() == KErrNotSupported)
sl@0
   147
		return;
sl@0
   148
	iMajorTest=0;
sl@0
   149
	const TSize scrSize(TheClient->iScreen->SizeInPixels());
sl@0
   150
	WinSize.SetSize(scrSize.iWidth/2,scrSize.iHeight);
sl@0
   151
	iBackgroundWin=new(ELeave) CTBlankWindow();
sl@0
   152
	iBackgroundWin->SetUpL(TPoint(),WinSize,TheClient->iGroup,*TheClient->iGc);
sl@0
   153
	TheClient->WaitForRedrawsToFinish();
sl@0
   154
	CTBackedUpWin* checkWin=new(ELeave) CTBackedUpWin(DisplayMode);
sl@0
   155
	checkWin->ConstructExtLD(*TheClient->iGroup,TPoint(WinSize.iWidth,0),WinSize);
sl@0
   156
	iCheckWin=checkWin;
sl@0
   157
	RBackedUpWindow& backWin=*iCheckWin->BackedUpWin();
sl@0
   158
	backWin.SetShadowHeight(0);
sl@0
   159
	iCheckWin->Activate();
sl@0
   160
	backWin.MaintainBackup();
sl@0
   161
	iCheckBitmap=CBitmap::NewL(backWin.BitmapHandle());
sl@0
   162
	iCheckBitmap->Gc().SetPenStyle(CGraphicsContext::ENullPen);
sl@0
   163
	iCheckBitmap->Gc().SetBrushStyle(CGraphicsContext::ESolidBrush);
sl@0
   164
	TheClient->Flush();
sl@0
   165
	TheClient->WaitForRedrawsToFinish();
sl@0
   166
	RecreateWindowsL();
sl@0
   167
	iBlankWin=RBlankWindow(TheClient->iWs);
sl@0
   168
	User::LeaveIfError(iBlankWin.Construct(*TheClient->iGroup->WinTreeNode(),ENullWsHandle));
sl@0
   169
	iBlankWinVis=EFalse;
sl@0
   170
	iBlankWin.SetVisible(iBlankWinVis);
sl@0
   171
	User::LeaveIfError(iBlankWin.SetRequiredDisplayMode(EColor256));
sl@0
   172
	iBlankWinCol=TRgb(170,170,170);		//Grey
sl@0
   173
	iBlankWin.SetColor(iBlankWinCol);
sl@0
   174
	iBlankWin.SetOrdinalPosition(0,1);		//Set the priority to 1 so that the 4 main windows are the first 4 with priory 0
sl@0
   175
	iBlankWin.Activate();
sl@0
   176
	iOpacitySupported=EFalse;
sl@0
   177
	}
sl@0
   178
sl@0
   179
void CTMultipleTrans::ShadowRegion(TRegion& aRegion,TInt aWin)
sl@0
   180
	{
sl@0
   181
	TRect rect;
sl@0
   182
	TInt height;
sl@0
   183
	TInt window;
sl@0
   184
	aRegion.Clear();
sl@0
   185
	RRegion single;
sl@0
   186
	RRegion noShadow1;
sl@0
   187
	RRegion noShadow2;
sl@0
   188
	RRegion temp;
sl@0
   189
	RRegion temp2;
sl@0
   190
	for (window=0;window<aWin;++window)
sl@0
   191
		{
sl@0
   192
		CTransWindow& win=*iWindows[window];
sl@0
   193
		if (win.IsVisible())
sl@0
   194
			{
sl@0
   195
			rect.SetRect(win.Position(),win.Size());
sl@0
   196
			height=win.ShadowHeight();
sl@0
   197
			temp.Copy(single);
sl@0
   198
			temp.ClipRect(rect);
sl@0
   199
			noShadow1.Union(temp);
sl@0
   200
			temp.Clear();
sl@0
   201
			temp.AddRect(rect);
sl@0
   202
			temp.SubRegion(noShadow1);
sl@0
   203
			temp.SubRegion(noShadow2);
sl@0
   204
			temp.SubRegion(aRegion,&temp2);
sl@0
   205
			noShadow2.Union(temp2);
sl@0
   206
			temp2.Clear();
sl@0
   207
			single.Union(temp);
sl@0
   208
			if (win.IsShadowing())
sl@0
   209
				aRegion.AddRect(rect);
sl@0
   210
			aRegion.Offset(2*height,2*height);
sl@0
   211
			aRegion.Tidy();
sl@0
   212
			noShadow1.Tidy();
sl@0
   213
			noShadow2.Tidy();
sl@0
   214
			single.Tidy();
sl@0
   215
			}
sl@0
   216
		}
sl@0
   217
	if (window<iWindows.Count())
sl@0
   218
		{
sl@0
   219
		CTransWindow& win=*iWindows[window];
sl@0
   220
		rect.SetRect(win.Position(),win.Size());
sl@0
   221
		aRegion.ClipRect(rect);
sl@0
   222
		}
sl@0
   223
	aRegion.SubRegion(noShadow1);
sl@0
   224
	aRegion.SubRegion(noShadow2);
sl@0
   225
	aRegion.Tidy();
sl@0
   226
	noShadow1.Close();
sl@0
   227
	noShadow2.Close();
sl@0
   228
	single.Close();
sl@0
   229
	temp.Close();
sl@0
   230
	temp2.Close();
sl@0
   231
	}
sl@0
   232
sl@0
   233
void CTMultipleTrans::CheckDisplay()
sl@0
   234
	{
sl@0
   235
	RRegion shadowRegion;
sl@0
   236
	CFbsBitGc& gc=iCheckBitmap->Gc();
sl@0
   237
	gc.SetBrushColor(KRgbWhite);
sl@0
   238
	gc.DrawRect(TRect(WinSize));
sl@0
   239
	TInt windows=iWindows.Count();
sl@0
   240
	if (iShadows)
sl@0
   241
		{
sl@0
   242
		ShadowRegion(shadowRegion,windows);
sl@0
   243
		gc.ShadowArea(&shadowRegion);
sl@0
   244
		}
sl@0
   245
	TInt window;
sl@0
   246
	for (window=windows;window>0;)
sl@0
   247
		{
sl@0
   248
		CTransWindow& win=*iWindows[--window];
sl@0
   249
		if (win.IsVisible())
sl@0
   250
			{
sl@0
   251
			gc.SetBrushColor(win.Color());
sl@0
   252
			const TPoint& winTopLeft=win.Position();
sl@0
   253
			gc.DrawRect(TRect(winTopLeft, win.Size()));
sl@0
   254
sl@0
   255
			if(win.DrawOpaque())
sl@0
   256
				{
sl@0
   257
				gc.SetPenColor(~(win.Color()));
sl@0
   258
				gc.SetPenSize(TSize(4,4));
sl@0
   259
				gc.SetPenStyle(CGraphicsContext::ESolidPen);
sl@0
   260
				gc.SetClippingRect(TRect(TPoint(winTopLeft.iX,winTopLeft.iY),TPoint(winTopLeft.iX + win.Size().iWidth, winTopLeft.iY + win.Size().iHeight)));
sl@0
   261
				gc.DrawLine(TPoint(winTopLeft.iX,winTopLeft.iY),TPoint(winTopLeft.iX+1000, winTopLeft.iY+1000));
sl@0
   262
				gc.SetPenStyle(CGraphicsContext::ENullPen);
sl@0
   263
				gc.SetClippingRect(TRect(WinSize));
sl@0
   264
				}
sl@0
   265
			
sl@0
   266
			if (iShadows)
sl@0
   267
				{
sl@0
   268
				ShadowRegion(shadowRegion,window);
sl@0
   269
				gc.ShadowArea(&shadowRegion);
sl@0
   270
				}
sl@0
   271
			}
sl@0
   272
		}
sl@0
   273
	iCheckWin->BackedUpWin()->UpdateScreen();
sl@0
   274
	TheClient->Flush();
sl@0
   275
	if (windows>=4)
sl@0
   276
		{
sl@0
   277
		AdvancedCheckRect();
sl@0
   278
		}
sl@0
   279
	_LIT(KTest,"Multiple Transparent Test, SubTest %d, OpacityOn=%d");
sl@0
   280
	TBuf<128> buf;
sl@0
   281
	buf.Format(KTest,iTest->iState,iMajorTest);
sl@0
   282
	CheckRect(iBackgroundWin,iCheckWin,TRect(WinSize),buf);
sl@0
   283
	shadowRegion.Close();
sl@0
   284
	}
sl@0
   285
sl@0
   286
#define OFFSET 2
sl@0
   287
void CTMultipleTrans::AdvancedCheckRect()
sl@0
   288
	{
sl@0
   289
	const TSize compareSize(5,5);
sl@0
   290
	const TInt OFFSET2=OFFSET+compareSize.iWidth;
sl@0
   291
	TPoint comparePos=iCheckWin->Position();
sl@0
   292
	TPoint checkPos;
sl@0
   293
	//Check Single Level for Top Left Win
sl@0
   294
	checkPos=iTopLeft->Position()+TPoint(OFFSET,OFFSET);
sl@0
   295
	CheckRect(checkPos,checkPos+comparePos,compareSize);
sl@0
   296
	//Check Single Level for Top Right Win
sl@0
   297
	checkPos=iTopRight->Position()+TPoint(iTopRight->Size().iWidth-OFFSET2,OFFSET);
sl@0
   298
	CheckRect(checkPos,checkPos+comparePos,compareSize);
sl@0
   299
	//Check Single Level for Bottom Left Win
sl@0
   300
	checkPos=iBotLeft->Position()+TPoint(OFFSET,iBotLeft->Size().iHeight-OFFSET2);
sl@0
   301
	CheckRect(checkPos,checkPos+comparePos,compareSize);
sl@0
   302
	//Check Single Level for Bottom Right Win
sl@0
   303
	checkPos=iBotRight->Position()+TPoint(iBotRight->Size().iWidth-OFFSET2,iBotRight->Size().iHeight-OFFSET2);
sl@0
   304
	CheckRect(checkPos,checkPos+comparePos,compareSize);
sl@0
   305
	//Double level top 2 windows
sl@0
   306
	checkPos=iTopRight->Position()+TPoint(OFFSET,OFFSET);
sl@0
   307
	CheckRect(checkPos,checkPos+comparePos,compareSize);
sl@0
   308
	//Double level left 2 windows
sl@0
   309
	checkPos=iBotLeft->Position()+TPoint(OFFSET,OFFSET);
sl@0
   310
	CheckRect(checkPos,checkPos+comparePos,compareSize);
sl@0
   311
	//Double level bot 2 windows
sl@0
   312
	checkPos=iBotRight->Position()+TPoint(OFFSET,iBotRight->Size().iHeight-OFFSET2);
sl@0
   313
	CheckRect(checkPos,checkPos+comparePos,compareSize);
sl@0
   314
	//Double level right 2 windows
sl@0
   315
	checkPos=iBotRight->Position()+TPoint(iBotRight->Size().iWidth-OFFSET2,OFFSET);
sl@0
   316
	CheckRect(checkPos,checkPos+comparePos,compareSize);
sl@0
   317
	//Triple level all but bot right
sl@0
   318
	checkPos=iTopRight->Position()+TPoint(OFFSET,iTopRight->Size().iHeight-OFFSET2);
sl@0
   319
	CheckRect(checkPos,checkPos+comparePos,compareSize);
sl@0
   320
	//Triple level all but bot left
sl@0
   321
	checkPos=iBotRight->Position()+TPoint(OFFSET,OFFSET);
sl@0
   322
	CheckRect(checkPos,checkPos+comparePos,compareSize);
sl@0
   323
	//Triple level all but top right
sl@0
   324
	checkPos=iTopLeft->Position()+TPoint(iTopLeft->Size().iWidth-OFFSET2,iTopLeft->Size().iHeight-OFFSET2);
sl@0
   325
	CheckRect(checkPos,checkPos+comparePos,compareSize);
sl@0
   326
	//Triple level all but top left
sl@0
   327
	checkPos=iBotLeft->Position()+TPoint(iBotLeft->Size().iWidth-OFFSET2,OFFSET);
sl@0
   328
	CheckRect(checkPos,checkPos+comparePos,compareSize);
sl@0
   329
	//Quad level
sl@0
   330
	checkPos=TPoint(iBotRight->Position().iX,iBotLeft->Position().iY)+TPoint(OFFSET,OFFSET);
sl@0
   331
	CheckRect(checkPos,checkPos+comparePos,compareSize);
sl@0
   332
	}
sl@0
   333
sl@0
   334
void CTMultipleTrans::SimpleTest()
sl@0
   335
	{
sl@0
   336
	CheckDisplay();
sl@0
   337
	}
sl@0
   338
sl@0
   339
void CTMultipleTrans::ChangeVisibility()
sl@0
   340
	{
sl@0
   341
	TUint toggle;
sl@0
   342
	TUint toggle2;
sl@0
   343
	TInt win;
sl@0
   344
	TInt ii=0;
sl@0
   345
	for (ii=2;ii>0;--ii)
sl@0
   346
		{
sl@0
   347
		for (toggle=1;toggle<16;++toggle)
sl@0
   348
			{
sl@0
   349
			win=0;
sl@0
   350
			toggle2=toggle;
sl@0
   351
			while ((toggle2&0x1)==0)
sl@0
   352
				{
sl@0
   353
				++win;
sl@0
   354
				toggle2/=2;
sl@0
   355
				}
sl@0
   356
			iWindows[win]->ToggleVisibility();
sl@0
   357
			CheckDisplay();
sl@0
   358
			}
sl@0
   359
		}
sl@0
   360
	}
sl@0
   361
sl@0
   362
void CTMultipleTrans::ChangeVisibility2()
sl@0
   363
	{
sl@0
   364
	iBlankWin.SetOrdinalPosition(0,0);
sl@0
   365
	iBlankWin.SetVisible(ETrue);
sl@0
   366
	iBlankWin.SetVisible(EFalse);
sl@0
   367
	CheckDisplay();
sl@0
   368
	const TInt xSteps=4;
sl@0
   369
	const TInt ySteps=3;
sl@0
   370
	iBlankWinSize.SetSize(WinSize.iWidth/xSteps,WinSize.iHeight/ySteps);
sl@0
   371
	iBlankWin.SetSize(iBlankWinSize);
sl@0
   372
	TInt ordPos,xx,yy;
sl@0
   373
	for (ordPos=0;ordPos<=4;++ordPos)
sl@0
   374
		{
sl@0
   375
		iBlankWin.SetOrdinalPosition(ordPos);
sl@0
   376
		for (xx=0;xx<xSteps;++xx)
sl@0
   377
			{
sl@0
   378
			TInt xPos=xx*WinSize.iWidth/xSteps;
sl@0
   379
			for (yy=0;yy<ySteps;++yy)
sl@0
   380
				{
sl@0
   381
				iBlankWin.SetPosition(TPoint(xPos,yy*WinSize.iHeight/ySteps));
sl@0
   382
				iBlankWin.SetVisible(ETrue);
sl@0
   383
				iBlankWin.SetVisible(EFalse);
sl@0
   384
				CheckDisplay();
sl@0
   385
				}
sl@0
   386
			}
sl@0
   387
		}
sl@0
   388
	iBlankWin.SetOrdinalPosition(0,1);
sl@0
   389
	}
sl@0
   390
sl@0
   391
void CTMultipleTrans::OrdinalPos()
sl@0
   392
	{
sl@0
   393
	TInt ii,jj,kk;
sl@0
   394
	for (kk=2;kk>=0;--kk)
sl@0
   395
		{
sl@0
   396
		for (jj=3;jj>kk;--jj)
sl@0
   397
			{
sl@0
   398
			for (ii=jj;ii>=kk;--ii)
sl@0
   399
				{
sl@0
   400
				CTransWindow::SetOrdinal(iWindows,jj,kk);
sl@0
   401
				CheckDisplay();
sl@0
   402
				}
sl@0
   403
			}
sl@0
   404
		}
sl@0
   405
	for (kk=2;kk>=0;--kk)
sl@0
   406
		{
sl@0
   407
		for (jj=3;jj>kk;--jj)
sl@0
   408
			{
sl@0
   409
			for (ii=jj;ii>=kk;--ii)
sl@0
   410
				{
sl@0
   411
				CTransWindow::SetOrdinal(iWindows,kk,jj);
sl@0
   412
				CheckDisplay();
sl@0
   413
				}
sl@0
   414
			}
sl@0
   415
		}
sl@0
   416
	}
sl@0
   417
sl@0
   418
TSize CTMultipleTrans::GetSize(TInt aPos)
sl@0
   419
	{		//Comments show values for 640x240 screen
sl@0
   420
	const TInt halfSize=40;
sl@0
   421
	const TPoint topLeft=iTopLeft->Position();	//10,10
sl@0
   422
	const TInt xLeft=WinSize.iWidth/2-topLeft.iX-halfSize;		//110
sl@0
   423
	const TInt xRight=xLeft+2*halfSize;		//190
sl@0
   424
	const TInt yTop=WinSize.iHeight/2-topLeft.iY-halfSize;		//70
sl@0
   425
	const TInt yBot=yTop+2*halfSize;		//150
sl@0
   426
	if (aPos<6)
sl@0
   427
		return TSize(xLeft+16*aPos-8,yTop);		//1->118, 5->182
sl@0
   428
	if (aPos<11)
sl@0
   429
		return TSize(xRight,yTop+16*aPos-88);		//6->78, 10->142
sl@0
   430
	if (aPos<16)
sl@0
   431
		return TSize(xRight-16*aPos+168,yBot);		//11->182, 15->118
sl@0
   432
	return TSize(xLeft,yBot-16*aPos+248);			//16->142, 20->78
sl@0
   433
	}
sl@0
   434
sl@0
   435
void CTMultipleTrans::SizeChange(TInt aJump)
sl@0
   436
	{
sl@0
   437
	TInt ii=aJump;
sl@0
   438
	TSize size;
sl@0
   439
	while (ii<20)
sl@0
   440
		{
sl@0
   441
		size=GetSize(ii);
sl@0
   442
		iTopLeft->SetSize(size);
sl@0
   443
		if(iTopLeft->DrawOpaque())
sl@0
   444
			{
sl@0
   445
			iTopLeft->CTWin::DrawNow();
sl@0
   446
			TheClient->Flush();
sl@0
   447
			}
sl@0
   448
		CheckDisplay();
sl@0
   449
		ii+=aJump;
sl@0
   450
		if (ii>20)
sl@0
   451
			ii-=20;	
sl@0
   452
		}
sl@0
   453
	}
sl@0
   454
sl@0
   455
void CTMultipleTrans::SizeChange()
sl@0
   456
	{
sl@0
   457
	CTransWindow::SetOrdinal(iWindows,2,1);
sl@0
   458
	TSize size=iBotLeft->Size();
sl@0
   459
	TInt change;
sl@0
   460
	for (change=70;change>=0;change-=14)
sl@0
   461
		{
sl@0
   462
		iBotLeft->SetSize(TSize(size.iWidth-change,size.iHeight));
sl@0
   463
		if(iBotLeft->DrawOpaque())
sl@0
   464
			{
sl@0
   465
			iBotLeft->CTWin::DrawNow();
sl@0
   466
			TheClient->Flush();
sl@0
   467
			}
sl@0
   468
		CheckDisplay();
sl@0
   469
		}
sl@0
   470
	size=iTopRight->Size();
sl@0
   471
	for (change=25;change>-50;change-=14)
sl@0
   472
		{
sl@0
   473
		iTopRight->SetSize(TSize(size.iWidth,size.iHeight+change));
sl@0
   474
		if(iTopRight->DrawOpaque())
sl@0
   475
			{
sl@0
   476
			iTopRight->CTWin::DrawNow();
sl@0
   477
			TheClient->Flush();
sl@0
   478
			}
sl@0
   479
		CheckDisplay();
sl@0
   480
		}
sl@0
   481
	iTopRight->SetSize(size);
sl@0
   482
	if(iTopRight->DrawOpaque())
sl@0
   483
		{
sl@0
   484
		iTopRight->CTWin::DrawNow();
sl@0
   485
		TheClient->Flush();
sl@0
   486
		}
sl@0
   487
	CTransWindow::SetOrdinal(iWindows,1,0);
sl@0
   488
	CheckDisplay();
sl@0
   489
	size=iTopLeft->Size();
sl@0
   490
	SizeChange(3);
sl@0
   491
	iTopLeft->SetSize(size);
sl@0
   492
	if(iTopLeft->DrawOpaque())
sl@0
   493
		{
sl@0
   494
		iTopLeft->CTWin::DrawNow();
sl@0
   495
		TheClient->Flush();
sl@0
   496
		}
sl@0
   497
	CheckDisplay();
sl@0
   498
	CTransWindow::SetOrdinal(iWindows,0,2);
sl@0
   499
	CheckDisplay();
sl@0
   500
	SizeChange(7);
sl@0
   501
	iTopLeft->SetSize(size);
sl@0
   502
	if(iTopLeft->DrawOpaque())
sl@0
   503
		{
sl@0
   504
		iTopLeft->CTWin::DrawNow();
sl@0
   505
		TheClient->Flush();
sl@0
   506
		}
sl@0
   507
	CheckDisplay();
sl@0
   508
	}
sl@0
   509
sl@0
   510
void CTMultipleTrans::MoveWin()
sl@0
   511
	{
sl@0
   512
	const TPoint topLeftPos=iTopLeft->Position();
sl@0
   513
	const TPoint topRightPos=iTopRight->Position();
sl@0
   514
	const TPoint botLeftPos=iBotLeft->Position();
sl@0
   515
	const TPoint botRightPos=iBotRight->Position();
sl@0
   516
	const TInt maxMove=Min(topRightPos.iX,botRightPos.iY)-10;
sl@0
   517
	TInt steps,move;
sl@0
   518
	for (steps=2;steps>=0;--steps)
sl@0
   519
		{
sl@0
   520
		move=maxMove*(3-steps)/3;
sl@0
   521
		iTopLeft->SetPos(TPoint(topLeftPos.iX+move,topLeftPos.iY+move));
sl@0
   522
		CheckDisplay();
sl@0
   523
		iTopRight->SetPos(TPoint(topRightPos.iX-move,topRightPos.iY+move));
sl@0
   524
		CheckDisplay();
sl@0
   525
		iBotRight->SetPos(TPoint(botRightPos.iX-move,botRightPos.iY-move));
sl@0
   526
		CheckDisplay();
sl@0
   527
		iBotLeft->SetPos(TPoint(botLeftPos.iX+move,botLeftPos.iY-move));
sl@0
   528
		CheckDisplay();
sl@0
   529
		}
sl@0
   530
	for (steps=4;steps>=0;--steps)
sl@0
   531
		{
sl@0
   532
		move=maxMove*steps/5;
sl@0
   533
		iBotLeft->SetPos(TPoint(botLeftPos.iX+move,botLeftPos.iY-move));
sl@0
   534
		CheckDisplay();
sl@0
   535
		iTopLeft->SetPos(TPoint(topLeftPos.iX+move,topLeftPos.iY+move));
sl@0
   536
		CheckDisplay();
sl@0
   537
		iBotRight->SetPos(TPoint(botRightPos.iX-move,botRightPos.iY-move));
sl@0
   538
		CheckDisplay();
sl@0
   539
		iTopRight->SetPos(TPoint(topRightPos.iX-move,topRightPos.iY+move));
sl@0
   540
		CheckDisplay();
sl@0
   541
		}
sl@0
   542
	}
sl@0
   543
sl@0
   544
void CTMultipleTrans::GroupWinL()
sl@0
   545
	{
sl@0
   546
	CTWindowGroup* group=new(ELeave) CTWindowGroup(TheClient);
sl@0
   547
	CleanupStack::PushL(group);
sl@0
   548
	group->ConstructL();
sl@0
   549
	CTransWindow* win=CTransWindow::NewL(group,KCyan,TRect(40,40,WinSize.iWidth-40,WinSize.iHeight-40),&DisplayMode);
sl@0
   550
	win->CTWin::DrawNow();
sl@0
   551
	if(iMajorTest==1)
sl@0
   552
		{
sl@0
   553
		win->SetDrawOpaque(ETrue);
sl@0
   554
		win->Invalidate();
sl@0
   555
		TheClient->WaitForRedrawsToFinish();
sl@0
   556
		}
sl@0
   557
	iWindows.Insert(win,0);
sl@0
   558
	CheckDisplay();
sl@0
   559
	group->GroupWin()->SetOrdinalPosition(1);
sl@0
   560
	iWindows.Remove(0);
sl@0
   561
	CheckDisplay();
sl@0
   562
	group->GroupWin()->SetOrdinalPosition(0);
sl@0
   563
	iWindows.Insert(win,0);
sl@0
   564
	CheckDisplay();
sl@0
   565
	iWindows.Remove(0);
sl@0
   566
	delete win;		//Would be better to delete this after the group window but the test window don't support this behaviour currently.
sl@0
   567
	CleanupStack::PopAndDestroy(group);
sl@0
   568
	CheckDisplay();
sl@0
   569
	}
sl@0
   570
sl@0
   571
void CTMultipleTrans::FadeTranWin()
sl@0
   572
	{
sl@0
   573
	// system fade on
sl@0
   574
	TheClient->iWs.SetSystemFaded(ETrue);
sl@0
   575
	// system fade off
sl@0
   576
	TheClient->iWs.SetSystemFaded(EFalse);
sl@0
   577
	CheckDisplay();
sl@0
   578
	}
sl@0
   579
sl@0
   580
void CTMultipleTrans::StartShadows()
sl@0
   581
	{
sl@0
   582
	iShadows=ETrue;
sl@0
   583
	iTopLeft->SetShadowDisabled(EFalse);
sl@0
   584
	iTopLeft->AdjustShadow(1);
sl@0
   585
	iTopRight->SetShadowDisabled(EFalse);
sl@0
   586
	iTopRight->AdjustShadow(1);
sl@0
   587
	iBotLeft->SetShadowDisabled(EFalse);
sl@0
   588
	iBotLeft->AdjustShadow(1);
sl@0
   589
	iBotRight->SetShadowDisabled(EFalse);
sl@0
   590
	iBotRight->AdjustShadow(1);
sl@0
   591
	if(!iOpacitySupported)
sl@0
   592
		{
sl@0
   593
		iTopRight->ToggleVisibility();		// In 8.1 this isn't needed.
sl@0
   594
		iTopRight->ToggleVisibility();
sl@0
   595
		}
sl@0
   596
	CheckDisplay();
sl@0
   597
	}
sl@0
   598
sl@0
   599
void CTMultipleTrans::ShadowsOnOff()
sl@0
   600
	{
sl@0
   601
	if(!iOpacitySupported)
sl@0
   602
		return;								// In 8.1 this isn't needed.
sl@0
   603
	iBotRight->SetShadowDisabled(EFalse);
sl@0
   604
	iBotRight->AdjustShadow(1);
sl@0
   605
	CheckDisplay();
sl@0
   606
	iBotRight->SetShadowDisabled(ETrue);
sl@0
   607
	CheckDisplay();
sl@0
   608
	iTopLeft->SetShadowDisabled(EFalse);
sl@0
   609
	iTopLeft->AdjustShadow(1);
sl@0
   610
	CheckDisplay();
sl@0
   611
	iTopLeft->SetShadowDisabled(ETrue);
sl@0
   612
	CheckDisplay();
sl@0
   613
	iTopRight->SetShadowDisabled(ETrue);
sl@0
   614
	CheckDisplay();
sl@0
   615
	iBotLeft->SetShadowDisabled(EFalse);
sl@0
   616
	iBotLeft->AdjustShadow(1);
sl@0
   617
	CheckDisplay();
sl@0
   618
	iBotLeft->SetShadowDisabled(ETrue);
sl@0
   619
	CheckDisplay();
sl@0
   620
	iTopLeft->SetShadowDisabled(EFalse);
sl@0
   621
	iTopRight->SetShadowDisabled(EFalse);
sl@0
   622
	iBotLeft->SetShadowDisabled(EFalse);
sl@0
   623
	iBotRight->SetShadowDisabled(EFalse);
sl@0
   624
	iTopLeft->ToggleVisibility();
sl@0
   625
	CheckDisplay();
sl@0
   626
	iTopLeft->ToggleVisibility();
sl@0
   627
	CheckDisplay();
sl@0
   628
	iTopRight->ToggleVisibility();
sl@0
   629
	CheckDisplay();
sl@0
   630
	iTopRight->ToggleVisibility();
sl@0
   631
	CheckDisplay();
sl@0
   632
	iBotLeft->ToggleVisibility();
sl@0
   633
	CheckDisplay();
sl@0
   634
	iBotLeft->ToggleVisibility();
sl@0
   635
	CheckDisplay();
sl@0
   636
	iBotRight->ToggleVisibility();
sl@0
   637
	CheckDisplay();
sl@0
   638
	iBotRight->ToggleVisibility();
sl@0
   639
	CheckDisplay();
sl@0
   640
	}
sl@0
   641
sl@0
   642
void CTMultipleTrans::StartChildL()
sl@0
   643
	{
sl@0
   644
	CTransWindow* win;
sl@0
   645
	TInt windows=iWindows.Count();
sl@0
   646
	TInt window;
sl@0
   647
	//Delete the first 4 windows from the array, could use ResetAndDestroy but would be broken by other uses of the array
sl@0
   648
	for (window=windows;window>0;--window)
sl@0
   649
		{
sl@0
   650
		win=iWindows[0];
sl@0
   651
		iWindows.Remove(0);
sl@0
   652
		delete win;
sl@0
   653
		}
sl@0
   654
	RecreateWindowsL(iBackgroundWin);
sl@0
   655
	CheckDisplay();	
sl@0
   656
	}
sl@0
   657
sl@0
   658
void CTMultipleTrans::StartChild2L()
sl@0
   659
	{
sl@0
   660
	CTransWindow* win;
sl@0
   661
	TInt windows=iWindows.Count();
sl@0
   662
	TInt window;
sl@0
   663
	//Delete the first 4 windows from the array, could use ResetAndDestroy but would be broken by other uses of the array
sl@0
   664
	for (window=windows;window>0;--window)
sl@0
   665
		{
sl@0
   666
		win=iWindows[0];
sl@0
   667
		iWindows.Remove(0);
sl@0
   668
		delete win;
sl@0
   669
		}
sl@0
   670
	iShadows=EFalse;
sl@0
   671
	TRect rect=WinSize;
sl@0
   672
	rect.Shrink(10,10);
sl@0
   673
	iBotRight=CTransWindow::NewL(iBackgroundWin,KBlue,rect,&DisplayMode);
sl@0
   674
	iBotRight->CTWin::DrawNow();
sl@0
   675
	iWindows.Insert(iBotRight,0);
sl@0
   676
	CheckDisplay();	
sl@0
   677
	rect.Resize(-20,-20);
sl@0
   678
	iTopLeft=CTransWindow::NewL(iBotRight,KRed,rect,&DisplayMode);
sl@0
   679
	iTopLeft->CTWin::DrawNow();
sl@0
   680
	iTopLeft->SetPosOffset(TPoint(10,10));
sl@0
   681
	iWindows.Insert(iTopLeft,0);
sl@0
   682
	CheckDisplay();	
sl@0
   683
	rect.Resize(-20,-20);
sl@0
   684
	iTopRight=CTransWindow::NewL(iTopLeft,KGreen,rect,&DisplayMode);
sl@0
   685
	iTopRight->CTWin::DrawNow();
sl@0
   686
	iTopRight->SetPosOffset(TPoint(20,20));
sl@0
   687
	iWindows.Insert(iTopRight,0);
sl@0
   688
	CheckDisplay();	
sl@0
   689
	rect.Resize(-20,-20);
sl@0
   690
	iBotLeft=CTransWindow::NewL(iTopRight,KYellow,rect,&DisplayMode);
sl@0
   691
	iBotLeft->CTWin::DrawNow();
sl@0
   692
	iBotLeft->SetPosOffset(TPoint(30,30));
sl@0
   693
	iWindows.Insert(iBotLeft,0);
sl@0
   694
	if(iMajorTest==1)
sl@0
   695
		{
sl@0
   696
		for (TInt window = 0; window < iWindows.Count(); ++window)
sl@0
   697
			{
sl@0
   698
			iWindows[window]->SetDrawOpaque(ETrue);
sl@0
   699
			iWindows[window]->Invalidate();
sl@0
   700
			}
sl@0
   701
		TheClient->WaitForRedrawsToFinish();
sl@0
   702
		}
sl@0
   703
	CheckDisplay();	
sl@0
   704
	}
sl@0
   705
	
sl@0
   706
void CTMultipleTrans::RecreateWindowsL(CTWinBase *aParent)
sl@0
   707
	{
sl@0
   708
	CTransWindow* win;
sl@0
   709
	TInt windows=iWindows.Count();
sl@0
   710
	TInt window;
sl@0
   711
	//Delete existing windows:
sl@0
   712
	for (window=windows;window>0;--window)
sl@0
   713
		{
sl@0
   714
		win=iWindows[0];
sl@0
   715
		iWindows.Remove(0);
sl@0
   716
		delete win;
sl@0
   717
		}
sl@0
   718
sl@0
   719
	if(!aParent)
sl@0
   720
		aParent = TheClient->iGroup;
sl@0
   721
		
sl@0
   722
	iBotRight=CTransWindow::NewL(aParent,KBlue,TRect(WinSize.iWidth/2-10,WinSize.iHeight/2-30,WinSize.iWidth-20,WinSize.iHeight-20),&DisplayMode);
sl@0
   723
	iBotRight->CTWin::DrawNow();
sl@0
   724
	iWindows.Insert(iBotRight,0);
sl@0
   725
	iTopLeft=CTransWindow::NewL(aParent,KRed,TRect(10,10,WinSize.iWidth/2+10,WinSize.iHeight/2+30),&DisplayMode);
sl@0
   726
	iTopLeft->CTWin::DrawNow();
sl@0
   727
	iWindows.Insert(iTopLeft,0);
sl@0
   728
	iTopRight=CTransWindow::NewL(aParent,KGreen,TRect(WinSize.iWidth/2-30,20,WinSize.iWidth-10,WinSize.iHeight/2+10),&DisplayMode);
sl@0
   729
	iTopRight->CTWin::DrawNow();
sl@0
   730
	iWindows.Insert(iTopRight,0);
sl@0
   731
	iBotLeft=CTransWindow::NewL(aParent,KYellow,TRect(20,WinSize.iHeight/2-10,WinSize.iWidth/2+30,WinSize.iHeight-10),&DisplayMode);
sl@0
   732
	iBotLeft->CTWin::DrawNow();
sl@0
   733
	iWindows.Insert(iBotLeft,0);
sl@0
   734
	iShadows=EFalse;
sl@0
   735
sl@0
   736
	if(iMajorTest==1)
sl@0
   737
		{
sl@0
   738
		for (TInt window=0;window<iWindows.Count();++window)
sl@0
   739
			{
sl@0
   740
			iWindows[window]->SetDrawOpaque(ETrue);
sl@0
   741
			iWindows[window]->Invalidate();
sl@0
   742
			}
sl@0
   743
		TheClient->WaitForRedrawsToFinish();
sl@0
   744
		}
sl@0
   745
	}
sl@0
   746
sl@0
   747
void CTMultipleTrans::RunTestCaseL(TInt /*aCurTestCase*/)
sl@0
   748
	{
sl@0
   749
	_LIT(KCheck,"Check");
sl@0
   750
	_LIT(KSimple,"Simple Test");
sl@0
   751
	_LIT(KVisibility,"Change Visibility");
sl@0
   752
	_LIT(KVisibility2,"Change Visibility 2");
sl@0
   753
	_LIT(KOrdinal,"Ordinal Position");
sl@0
   754
	_LIT(KSizeChange,"Size Change");
sl@0
   755
	_LIT(KMoveWin,"Move Window");
sl@0
   756
	_LIT(KGroupWin,"Group Window Ordinal");
sl@0
   757
	_LIT(KBackground,"Background Color Changes");
sl@0
   758
	_LIT(KShadowsOnOff,"Shadows On Off");
sl@0
   759
	_LIT(KChild1,"Child 1");
sl@0
   760
	_LIT(KChild2,"Child 2");
sl@0
   761
	_LIT(KOpacity,"Opaque Drawing");
sl@0
   762
	_LIT(KTranWinFade,"Fading Transparent Windows");
sl@0
   763
	((CTMultipleTransStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
sl@0
   764
sl@0
   765
	switch(iTest->iState)
sl@0
   766
		{
sl@0
   767
		case 0:
sl@0
   768
/**
sl@0
   769
@SYMTestCaseID		GRAPHICS-WSERV-0500
sl@0
   770
*/
sl@0
   771
			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0500"));
sl@0
   772
			// Check to see if Transparency is enabled before running tests
sl@0
   773
			iTest->LogSubTest(KCheck);
sl@0
   774
			if (TransparencySupportedL()==KErrNotSupported)
sl@0
   775
				{
sl@0
   776
				LOG_MESSAGE(_L("Transparency is not supported\n"));
sl@0
   777
				TestComplete();
sl@0
   778
				return;
sl@0
   779
				}
sl@0
   780
			++iTest->iState;		//Fall Through
sl@0
   781
/**
sl@0
   782
@SYMTestCaseID		GRAPHICS-WSERV-0111
sl@0
   783
sl@0
   784
@SYMDEF             DEF081259
sl@0
   785
sl@0
   786
@SYMTestCaseDesc    Simple transparent windows test.
sl@0
   787
sl@0
   788
@SYMTestPriority    High
sl@0
   789
sl@0
   790
@SYMTestStatus      Implemented
sl@0
   791
sl@0
   792
@SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
sl@0
   793
					The test draws the windows on the screen's right side using FBS bitmaps direcly.
sl@0
   794
					The test does nothing if transparency is not enabled on the screen.
sl@0
   795
sl@0
   796
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
sl@0
   797
*/		
sl@0
   798
		case 1:
sl@0
   799
			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0111"));
sl@0
   800
			iTest->LogSubTest(KSimple);
sl@0
   801
			SimpleTest();
sl@0
   802
			break;
sl@0
   803
/**
sl@0
   804
@SYMTestCaseID		GRAPHICS-WSERV-0112
sl@0
   805
sl@0
   806
@SYMDEF             DEF081259
sl@0
   807
sl@0
   808
@SYMTestCaseDesc    On/off switching of visibility of transparent windows
sl@0
   809
sl@0
   810
@SYMTestPriority    High
sl@0
   811
sl@0
   812
@SYMTestStatus      Implemented
sl@0
   813
sl@0
   814
@SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
sl@0
   815
					The test toggles visibility of those four windows going through all
sl@0
   816
					combinations. For each combination it draws visible windows on the screen's right side using FBS bitmaps direcly.
sl@0
   817
					The test does nothing if transparency is not enabled on the screen.
sl@0
   818
sl@0
   819
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
sl@0
   820
*/		
sl@0
   821
		case 2:
sl@0
   822
		case 23:
sl@0
   823
		case 42:
sl@0
   824
			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0112"));
sl@0
   825
			iTest->LogSubTest(KVisibility);
sl@0
   826
			ChangeVisibility();
sl@0
   827
			break;
sl@0
   828
/**
sl@0
   829
@SYMTestCaseID		GRAPHICS-WSERV-0113
sl@0
   830
sl@0
   831
@SYMDEF             DEF081259
sl@0
   832
sl@0
   833
@SYMTestCaseDesc    On/off switching of visibility of a small transparent window on top of existing transparent windows
sl@0
   834
sl@0
   835
@SYMTestPriority    High
sl@0
   836
sl@0
   837
@SYMTestStatus      Implemented
sl@0
   838
sl@0
   839
@SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
sl@0
   840
					Toggles visibility of 5th blank little window making this appear in different places 
sl@0
   841
					with different ordinal position. Draws visible windows on the screen's right side using FBS bitmaps direcly
sl@0
   842
					each time when the 5th window becomes invisible.
sl@0
   843
					The test does nothing if transparency is not enabled on the screen.
sl@0
   844
sl@0
   845
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
sl@0
   846
*/		
sl@0
   847
		case 3:
sl@0
   848
			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0113"));
sl@0
   849
			iTest->LogSubTest(KVisibility2);
sl@0
   850
			ChangeVisibility2();
sl@0
   851
			break;
sl@0
   852
/**
sl@0
   853
@SYMTestCaseID		GRAPHICS-WSERV-0114
sl@0
   854
sl@0
   855
@SYMDEF             DEF081259
sl@0
   856
sl@0
   857
@SYMTestCaseDesc    Ordinal positions' switches of intersecting transparent windows
sl@0
   858
sl@0
   859
@SYMTestPriority    High
sl@0
   860
sl@0
   861
@SYMTestStatus      Implemented
sl@0
   862
sl@0
   863
@SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
sl@0
   864
					Switches ordinal positions of the four windows trying all combinations. Draws visible windows on the screen's right side
sl@0
   865
					using FBS bitmaps direcly each time when a new combination is applied.
sl@0
   866
					The test does nothing if transparency is not enabled on the screen.
sl@0
   867
sl@0
   868
sl@0
   869
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
sl@0
   870
*/		
sl@0
   871
		case 4:
sl@0
   872
		case 43:
sl@0
   873
			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0114"));
sl@0
   874
			iTest->LogSubTest(KOrdinal);
sl@0
   875
			OrdinalPos();
sl@0
   876
			break;
sl@0
   877
/**
sl@0
   878
@SYMTestCaseID		GRAPHICS-WSERV-0115
sl@0
   879
sl@0
   880
@SYMDEF             DEF081259
sl@0
   881
sl@0
   882
@SYMTestCaseDesc    Changing sizes of intersecting transparent windows
sl@0
   883
sl@0
   884
@SYMTestPriority    High
sl@0
   885
sl@0
   886
@SYMTestStatus      Implemented
sl@0
   887
sl@0
   888
@SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
sl@0
   889
					Plays with sizes of each of the four windows to affect overlapping. 
sl@0
   890
					Draws visible windows on the screen's right side using FBS bitmaps direcly
sl@0
   891
					each time when a new size for a particular window is applied.
sl@0
   892
					The test does nothing if transparency is not enabled on the screen.
sl@0
   893
sl@0
   894
sl@0
   895
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
sl@0
   896
*/		
sl@0
   897
		case 5:
sl@0
   898
		case 24:
sl@0
   899
			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0115"));
sl@0
   900
			iTest->LogSubTest(KSizeChange);
sl@0
   901
			SizeChange();
sl@0
   902
			break;
sl@0
   903
/**
sl@0
   904
@SYMTestCaseID		GRAPHICS-WSERV-0116
sl@0
   905
sl@0
   906
@SYMDEF             DEF081259
sl@0
   907
sl@0
   908
@SYMTestCaseDesc    Moving intersecting transparent windows
sl@0
   909
sl@0
   910
@SYMTestPriority    High
sl@0
   911
sl@0
   912
@SYMTestStatus      Implemented
sl@0
   913
sl@0
   914
@SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
sl@0
   915
					Performs moves of those windows one by one making little steps in direction of the center of intersection and backwards.
sl@0
   916
					Draws visible windows on the screen's right side using FBS bitmaps direcly
sl@0
   917
					each time when a position of a particular window changes.
sl@0
   918
					The test does nothing if transparency is not enabled on the screen.
sl@0
   919
sl@0
   920
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
sl@0
   921
*/		
sl@0
   922
		case 6:
sl@0
   923
			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0116"));
sl@0
   924
			iTest->LogSubTest(KMoveWin);
sl@0
   925
			MoveWin();
sl@0
   926
			break;
sl@0
   927
/**
sl@0
   928
@SYMTestCaseID		GRAPHICS-WSERV-0117
sl@0
   929
sl@0
   930
@SYMDEF             DEF081259
sl@0
   931
sl@0
   932
@SYMTestCaseDesc    Test with a second window group
sl@0
   933
sl@0
   934
@SYMTestPriority    High
sl@0
   935
sl@0
   936
@SYMTestStatus      Implemented
sl@0
   937
sl@0
   938
@SYMTestActions     Four overlapping transparent windows (RWindow, within the same group) are created before the test on the screen's left side.
sl@0
   939
					Creates a 5th transparent window in a separate window group
sl@0
   940
					on top of existing windows which covers the intersection area of initial 4 windows. 
sl@0
   941
					Changes the ordinal position of the group to 1, changes ordinal position 
sl@0
   942
					back to 0, removes the new group.
sl@0
   943
					Redraws visible windows on the screen's right side using FBS bitmaps direcly
sl@0
   944
					each time when any change on the screen's left side is performed.
sl@0
   945
					The test does nothing if transparency is not enabled on the screen.
sl@0
   946
sl@0
   947
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
sl@0
   948
*/		
sl@0
   949
		case 7:
sl@0
   950
			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0117"));
sl@0
   951
			iTest->LogSubTest(KGroupWin);
sl@0
   952
			GroupWinL();
sl@0
   953
			break;
sl@0
   954
		case 8:
sl@0
   955
			((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
sl@0
   956
			iTest->LogSubTest(KBackground);
sl@0
   957
			//Change the background color of the 4 test windows and the window behind them
sl@0
   958
			break;
sl@0
   959
/**
sl@0
   960
@SYMTestCaseID		GRAPHICS-WSERV-0118
sl@0
   961
sl@0
   962
@SYMDEF             DEF081259
sl@0
   963
sl@0
   964
@SYMTestCaseDesc    On/off switching of fading
sl@0
   965
sl@0
   966
@SYMTestPriority    High
sl@0
   967
sl@0
   968
@SYMTestStatus      Implemented
sl@0
   969
sl@0
   970
@SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
sl@0
   971
					Switches system fading on and right after that back to off.
sl@0
   972
					Draws visible windows on the screen's right side using FBS bitmaps direcly
sl@0
   973
					after that.
sl@0
   974
					The test does nothing if transparency is not enabled on the screen.
sl@0
   975
sl@0
   976
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
sl@0
   977
*/		
sl@0
   978
		case 9:
sl@0
   979
			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0118"));
sl@0
   980
			iTest->LogSubTest(KTranWinFade);
sl@0
   981
			FadeTranWin();
sl@0
   982
			break;
sl@0
   983
		case 10:
sl@0
   984
			((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
sl@0
   985
			iTest->iState=21-1;
sl@0
   986
			break;
sl@0
   987
/**
sl@0
   988
@SYMTestCaseID		GRAPHICS-WSERV-0120
sl@0
   989
sl@0
   990
@SYMDEF             DEF081259
sl@0
   991
sl@0
   992
@SYMTestCaseDesc    Shadows' on/off test.
sl@0
   993
sl@0
   994
@SYMTestPriority    High
sl@0
   995
sl@0
   996
@SYMTestStatus      Implemented
sl@0
   997
sl@0
   998
@SYMTestActions     Four overlapping transparent windows (RWindow) with shadowing enabled are created before the test on the screen's left side.
sl@0
   999
					The test plays with on/off-switching of shadowing and visibility for the windows.
sl@0
  1000
					The test redraws visible windows on the screen's right side using FBS bitmaps direcly
sl@0
  1001
					each time when state of ony window changes.
sl@0
  1002
					The test does nothing if transparency is not enabled on the screen.
sl@0
  1003
					The test also repeats GRAPHICS-WSERV-0111 - GRAPHICS-WSERV-015 foor the shadowed windows.
sl@0
  1004
sl@0
  1005
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
sl@0
  1006
*/		
sl@0
  1007
		case 22:
sl@0
  1008
			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0120"));
sl@0
  1009
			iTest->LogSubTest(KShadowsOnOff);
sl@0
  1010
			ShadowsOnOff();
sl@0
  1011
			break;
sl@0
  1012
		case 25:
sl@0
  1013
			((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
sl@0
  1014
			iTest->iState=41-1;
sl@0
  1015
			break;
sl@0
  1016
/**
sl@0
  1017
@SYMTestCaseID		GRAPHICS-WSERV-0121
sl@0
  1018
sl@0
  1019
@SYMDEF             DEF081259
sl@0
  1020
sl@0
  1021
@SYMTestCaseDesc    Transparent child-windows of a bacground window 
sl@0
  1022
sl@0
  1023
@SYMTestPriority    High
sl@0
  1024
sl@0
  1025
@SYMTestStatus      Implemented
sl@0
  1026
sl@0
  1027
@SYMTestActions     Four overlapping transparent windows (RWindow) with shadowing enabled are created before the test on the screen's left side.
sl@0
  1028
					The test removes those windows and creates new four overlapping transparent windows 
sl@0
  1029
					but as children of existing background window. After that the test redraws visible windows on the screen's right side using FBS bitmaps direcly.
sl@0
  1030
					The test does nothing if transparency is not enabled on the screen.
sl@0
  1031
					The test also repeats GRAPHICS-WSERV-0111 - GRAPHICS-WSERV-014 foor the shadowed windows.
sl@0
  1032
sl@0
  1033
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
sl@0
  1034
*/		
sl@0
  1035
		case 41:
sl@0
  1036
			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0121"));
sl@0
  1037
			iTest->LogSubTest(KChild1);
sl@0
  1038
			StartChildL();
sl@0
  1039
			break;
sl@0
  1040
		case 44:
sl@0
  1041
			((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
sl@0
  1042
			iTest->iState=61-1;
sl@0
  1043
			break;
sl@0
  1044
/**
sl@0
  1045
@SYMTestCaseID		GRAPHICS-WSERV-0122
sl@0
  1046
sl@0
  1047
@SYMDEF             DEF081259
sl@0
  1048
sl@0
  1049
@SYMTestCaseDesc    
sl@0
  1050
sl@0
  1051
@SYMTestPriority    High
sl@0
  1052
sl@0
  1053
@SYMTestStatus      Implemented
sl@0
  1054
sl@0
  1055
@SYMTestActions     Four overlapping transparent windows (RWindow) with shadowing enabled are created before the test on the screen's left side.
sl@0
  1056
					The test removes those windows and creates new four transparent windows 
sl@0
  1057
					so that each one (except first) is a child of prevoiusly created window. 
sl@0
  1058
					The test redraws visible windows on the screen's right side using FBS bitmaps direcly
sl@0
  1059
					after each window's creation.
sl@0
  1060
					The test does nothing if transparency is not enabled on the screen.
sl@0
  1061
sl@0
  1062
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
sl@0
  1063
*/		
sl@0
  1064
		case 61:
sl@0
  1065
			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0122"));
sl@0
  1066
			iTest->LogSubTest(KChild2);
sl@0
  1067
			StartChild2L();
sl@0
  1068
			break;
sl@0
  1069
		default:
sl@0
  1070
				((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0123"));
sl@0
  1071
/**
sl@0
  1072
@SYMTestCaseID		GRAPHICS-WSERV-0123
sl@0
  1073
sl@0
  1074
@SYMDEF             DEF081259
sl@0
  1075
sl@0
  1076
@SYMTestCaseDesc    
sl@0
  1077
sl@0
  1078
@SYMTestPriority    High
sl@0
  1079
sl@0
  1080
@SYMTestStatus      Implemented
sl@0
  1081
sl@0
  1082
@SYMTestActions     The test draws four overlapping transparent windows (RWindow) on the screen's left side.
sl@0
  1083
					Each window has an opaque diagonal line (\) which goes from the top-left corner of each window.
sl@0
  1084
					The test repeats all tests from GRAPHICS-WSERV-0111 to GRAPHICS-WSERV-0122 
sl@0
  1085
					with those four windows and diagonaly lines on them.
sl@0
  1086
sl@0
  1087
@SYMTestExpectedResults Expects that all tests will obtain results they expected. 
sl@0
  1088
*/		
sl@0
  1089
			if (iMajorTest==1 || !iOpacitySupported)
sl@0
  1090
				{
sl@0
  1091
				if (!iOpacitySupported)
sl@0
  1092
					{
sl@0
  1093
					_LIT(KNoOpacity,"Opacity is not supported");
sl@0
  1094
					LOG_MESSAGE(KNoOpacity);
sl@0
  1095
					}
sl@0
  1096
                		((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
sl@0
  1097
				TestComplete();
sl@0
  1098
				return;
sl@0
  1099
				}
sl@0
  1100
			LOG_MESSAGE(KOpacity);
sl@0
  1101
			iTest->iState=0;
sl@0
  1102
			iMajorTest=1;
sl@0
  1103
			RecreateWindowsL();
sl@0
  1104
			break;
sl@0
  1105
		}
sl@0
  1106
	((CTMultipleTransStep*)iStep)->RecordTestResultL();
sl@0
  1107
	++iTest->iState;
sl@0
  1108
	}
sl@0
  1109
sl@0
  1110
sl@0
  1111
__WS_CONSTRUCT_STEP__(MultipleTrans)