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".
 
     8 // Initial Contributors:
 
     9 // Nokia Corporation - initial contribution.
 
    14 // Test multiple level transparent window
 
    21  @internalComponent - Internal Symbian test code
 
    27 LOCAL_D TDisplayMode DisplayMode=EColor64K;
 
    28 LOCAL_D TSize WinSize;
 
    30 static const TRgb KRed=TRgb(255, 0, 0, 128);
 
    31 static const TRgb KGreen=TRgb(0, 255, 0, 128);
 
    32 static const TRgb KYellow=TRgb(255, 255, 0, 128);
 
    33 static const TRgb KBlue=TRgb(0, 0, 255, 128);
 
    34 static const TRgb KCyan=TRgb(0, 255, 255, 128);
 
    38 CTransWindow* CTransWindow::NewL(RPointerArray<CTransWindow>& aWindows,TRgb aColor,TRect aPos)
 
    40 	CTransWindow* self=NewL(TheClient->iGroup,aColor,aPos,&DisplayMode);
 
    41 	aWindows.Insert(self,0);
 
    45 CTransWindow* CTransWindow::NewL(CTWinBase* aParent,TRgb aColor,TRect aPos, TDisplayMode* aDisplayMode)
 
    47 	CTransWindow* self=new(ELeave) CTransWindow(aColor);
 
    48 	CleanupStack::PushL(self);
 
    49 	self->SetUpL(aPos.iTl,aPos.Size(),aParent,*TheClient->iGc,aDisplayMode);
 
    50 	User::LeaveIfError(self->iError);
 
    51 	CleanupStack::Pop(self);
 
    55 //the following function doesn't activate a window
 
    56 CTransWindow* CTransWindow::NewL(CTWinBase* aParent,TRgb aColor,TDisplayMode* aDisplayMode)
 
    58 	CTransWindow* self=new(ELeave) CTransWindow(aColor);
 
    59 	CleanupStack::PushL(self);
 
    60 	self->ConstructL(*aParent);
 
    63 		self->BaseWin()->SetRequiredDisplayMode(*aDisplayMode);
 
    65 	User::LeaveIfError((self->iError) && (self->iError != KErrNotSupported));
 
    66 	CleanupStack::Pop(self);
 
    70 void CTransWindow::InitWin()
 
    74 	iWin.SetShadowDisabled(ETrue);
 
    76 	iError = iWin.SetTransparencyAlphaChannel();
 
    77 	iWin.SetBackgroundColor(iCol);
 
    81 void CTransWindow::ToggleVisibility()
 
    87 void CTransWindow::SetOrdinal(RPointerArray<CTransWindow>& aWindows,TInt aOldPos,TInt aNewPos)
 
    89 	CTransWindow* win=aWindows[aOldPos];
 
    90 	aWindows.Remove(aOldPos);
 
    91 	aWindows.Insert(win,aNewPos);
 
    92 	win->iWin.SetOrdinalPosition(aNewPos);
 
    95 void CTransWindow::SetShadowDisabled(TBool aState)
 
    97 	iWin.SetShadowDisabled(aState);
 
   101 void CTransWindow::AdjustShadow(TInt aAdjust)
 
   103 	CBlankWindow::AdjustShadow(aAdjust);
 
   104 	iShadowHight+=aAdjust;
 
   107 TPoint CTransWindow::Position() const
 
   109 	return CBlankWindow::Position()+iPosOffset;
 
   112 void CTransWindow::Draw()
 
   114 	//don't call CBlankWindow::Draw() since the background is already drawn
 
   118 		iGc->SetPenStyle(CGraphicsContext::ESolidPen);
 
   119 		iGc->SetPenSize(TSize(4,4));
 
   120 		iGc->SetBrushStyle(CGraphicsContext::ENullBrush);
 
   121 		iGc->SetPenColor(~iCol);
 
   122 		iGc->SetOpaque(ETrue);
 
   123 		iGc->DrawLine(TPoint(0,0),TPoint(1000,1000));
 
   124 		iGc->SetOpaque(EFalse);
 
   130 CTMultipleTrans::CTMultipleTrans(CTestStep* aStep) : CTWsGraphicsBase(aStep), iWindows(5), iShadows(EFalse)
 
   134 CTMultipleTrans::~CTMultipleTrans()
 
   136 	((CTMultipleTransStep*)iStep)->CloseTMSGraphicsStep();
 
   137 	delete iBackgroundWin;
 
   140 	iWindows.ResetAndDestroy();
 
   144 void CTMultipleTrans::ConstructL()
 
   146 	if(TransparencySupportedL() == KErrNotSupported)
 
   149 	const TSize scrSize(TheClient->iScreen->SizeInPixels());
 
   150 	WinSize.SetSize(scrSize.iWidth/2,scrSize.iHeight);
 
   151 	iBackgroundWin=new(ELeave) CTBlankWindow();
 
   152 	iBackgroundWin->SetUpL(TPoint(),WinSize,TheClient->iGroup,*TheClient->iGc);
 
   153 	TheClient->WaitForRedrawsToFinish();
 
   154 	CTBackedUpWin* checkWin=new(ELeave) CTBackedUpWin(DisplayMode);
 
   155 	checkWin->ConstructExtLD(*TheClient->iGroup,TPoint(WinSize.iWidth,0),WinSize);
 
   157 	RBackedUpWindow& backWin=*iCheckWin->BackedUpWin();
 
   158 	backWin.SetShadowHeight(0);
 
   159 	iCheckWin->Activate();
 
   160 	backWin.MaintainBackup();
 
   161 	iCheckBitmap=CBitmap::NewL(backWin.BitmapHandle());
 
   162 	iCheckBitmap->Gc().SetPenStyle(CGraphicsContext::ENullPen);
 
   163 	iCheckBitmap->Gc().SetBrushStyle(CGraphicsContext::ESolidBrush);
 
   165 	TheClient->WaitForRedrawsToFinish();
 
   167 	iBlankWin=RBlankWindow(TheClient->iWs);
 
   168 	User::LeaveIfError(iBlankWin.Construct(*TheClient->iGroup->WinTreeNode(),ENullWsHandle));
 
   170 	iBlankWin.SetVisible(iBlankWinVis);
 
   171 	User::LeaveIfError(iBlankWin.SetRequiredDisplayMode(EColor256));
 
   172 	iBlankWinCol=TRgb(170,170,170);		//Grey
 
   173 	iBlankWin.SetColor(iBlankWinCol);
 
   174 	iBlankWin.SetOrdinalPosition(0,1);		//Set the priority to 1 so that the 4 main windows are the first 4 with priory 0
 
   175 	iBlankWin.Activate();
 
   176 	iOpacitySupported=EFalse;
 
   179 void CTMultipleTrans::ShadowRegion(TRegion& aRegion,TInt aWin)
 
   190 	for (window=0;window<aWin;++window)
 
   192 		CTransWindow& win=*iWindows[window];
 
   195 			rect.SetRect(win.Position(),win.Size());
 
   196 			height=win.ShadowHeight();
 
   199 			noShadow1.Union(temp);
 
   202 			temp.SubRegion(noShadow1);
 
   203 			temp.SubRegion(noShadow2);
 
   204 			temp.SubRegion(aRegion,&temp2);
 
   205 			noShadow2.Union(temp2);
 
   208 			if (win.IsShadowing())
 
   209 				aRegion.AddRect(rect);
 
   210 			aRegion.Offset(2*height,2*height);
 
   217 	if (window<iWindows.Count())
 
   219 		CTransWindow& win=*iWindows[window];
 
   220 		rect.SetRect(win.Position(),win.Size());
 
   221 		aRegion.ClipRect(rect);
 
   223 	aRegion.SubRegion(noShadow1);
 
   224 	aRegion.SubRegion(noShadow2);
 
   233 void CTMultipleTrans::CheckDisplay()
 
   235 	RRegion shadowRegion;
 
   236 	CFbsBitGc& gc=iCheckBitmap->Gc();
 
   237 	gc.SetBrushColor(KRgbWhite);
 
   238 	gc.DrawRect(TRect(WinSize));
 
   239 	TInt windows=iWindows.Count();
 
   242 		ShadowRegion(shadowRegion,windows);
 
   243 		gc.ShadowArea(&shadowRegion);
 
   246 	for (window=windows;window>0;)
 
   248 		CTransWindow& win=*iWindows[--window];
 
   251 			gc.SetBrushColor(win.Color());
 
   252 			const TPoint& winTopLeft=win.Position();
 
   253 			gc.DrawRect(TRect(winTopLeft, win.Size()));
 
   257 				gc.SetPenColor(~(win.Color()));
 
   258 				gc.SetPenSize(TSize(4,4));
 
   259 				gc.SetPenStyle(CGraphicsContext::ESolidPen);
 
   260 				gc.SetClippingRect(TRect(TPoint(winTopLeft.iX,winTopLeft.iY),TPoint(winTopLeft.iX + win.Size().iWidth, winTopLeft.iY + win.Size().iHeight)));
 
   261 				gc.DrawLine(TPoint(winTopLeft.iX,winTopLeft.iY),TPoint(winTopLeft.iX+1000, winTopLeft.iY+1000));
 
   262 				gc.SetPenStyle(CGraphicsContext::ENullPen);
 
   263 				gc.SetClippingRect(TRect(WinSize));
 
   268 				ShadowRegion(shadowRegion,window);
 
   269 				gc.ShadowArea(&shadowRegion);
 
   273 	iCheckWin->BackedUpWin()->UpdateScreen();
 
   279 	_LIT(KTest,"Multiple Transparent Test, SubTest %d, OpacityOn=%d");
 
   281 	buf.Format(KTest,iTest->iState,iMajorTest);
 
   282 	CheckRect(iBackgroundWin,iCheckWin,TRect(WinSize),buf);
 
   283 	shadowRegion.Close();
 
   287 void CTMultipleTrans::AdvancedCheckRect()
 
   289 	const TSize compareSize(5,5);
 
   290 	const TInt OFFSET2=OFFSET+compareSize.iWidth;
 
   291 	TPoint comparePos=iCheckWin->Position();
 
   293 	//Check Single Level for Top Left Win
 
   294 	checkPos=iTopLeft->Position()+TPoint(OFFSET,OFFSET);
 
   295 	CheckRect(checkPos,checkPos+comparePos,compareSize);
 
   296 	//Check Single Level for Top Right Win
 
   297 	checkPos=iTopRight->Position()+TPoint(iTopRight->Size().iWidth-OFFSET2,OFFSET);
 
   298 	CheckRect(checkPos,checkPos+comparePos,compareSize);
 
   299 	//Check Single Level for Bottom Left Win
 
   300 	checkPos=iBotLeft->Position()+TPoint(OFFSET,iBotLeft->Size().iHeight-OFFSET2);
 
   301 	CheckRect(checkPos,checkPos+comparePos,compareSize);
 
   302 	//Check Single Level for Bottom Right Win
 
   303 	checkPos=iBotRight->Position()+TPoint(iBotRight->Size().iWidth-OFFSET2,iBotRight->Size().iHeight-OFFSET2);
 
   304 	CheckRect(checkPos,checkPos+comparePos,compareSize);
 
   305 	//Double level top 2 windows
 
   306 	checkPos=iTopRight->Position()+TPoint(OFFSET,OFFSET);
 
   307 	CheckRect(checkPos,checkPos+comparePos,compareSize);
 
   308 	//Double level left 2 windows
 
   309 	checkPos=iBotLeft->Position()+TPoint(OFFSET,OFFSET);
 
   310 	CheckRect(checkPos,checkPos+comparePos,compareSize);
 
   311 	//Double level bot 2 windows
 
   312 	checkPos=iBotRight->Position()+TPoint(OFFSET,iBotRight->Size().iHeight-OFFSET2);
 
   313 	CheckRect(checkPos,checkPos+comparePos,compareSize);
 
   314 	//Double level right 2 windows
 
   315 	checkPos=iBotRight->Position()+TPoint(iBotRight->Size().iWidth-OFFSET2,OFFSET);
 
   316 	CheckRect(checkPos,checkPos+comparePos,compareSize);
 
   317 	//Triple level all but bot right
 
   318 	checkPos=iTopRight->Position()+TPoint(OFFSET,iTopRight->Size().iHeight-OFFSET2);
 
   319 	CheckRect(checkPos,checkPos+comparePos,compareSize);
 
   320 	//Triple level all but bot left
 
   321 	checkPos=iBotRight->Position()+TPoint(OFFSET,OFFSET);
 
   322 	CheckRect(checkPos,checkPos+comparePos,compareSize);
 
   323 	//Triple level all but top right
 
   324 	checkPos=iTopLeft->Position()+TPoint(iTopLeft->Size().iWidth-OFFSET2,iTopLeft->Size().iHeight-OFFSET2);
 
   325 	CheckRect(checkPos,checkPos+comparePos,compareSize);
 
   326 	//Triple level all but top left
 
   327 	checkPos=iBotLeft->Position()+TPoint(iBotLeft->Size().iWidth-OFFSET2,OFFSET);
 
   328 	CheckRect(checkPos,checkPos+comparePos,compareSize);
 
   330 	checkPos=TPoint(iBotRight->Position().iX,iBotLeft->Position().iY)+TPoint(OFFSET,OFFSET);
 
   331 	CheckRect(checkPos,checkPos+comparePos,compareSize);
 
   334 void CTMultipleTrans::SimpleTest()
 
   339 void CTMultipleTrans::ChangeVisibility()
 
   347 		for (toggle=1;toggle<16;++toggle)
 
   351 			while ((toggle2&0x1)==0)
 
   356 			iWindows[win]->ToggleVisibility();
 
   362 void CTMultipleTrans::ChangeVisibility2()
 
   364 	iBlankWin.SetOrdinalPosition(0,0);
 
   365 	iBlankWin.SetVisible(ETrue);
 
   366 	iBlankWin.SetVisible(EFalse);
 
   370 	iBlankWinSize.SetSize(WinSize.iWidth/xSteps,WinSize.iHeight/ySteps);
 
   371 	iBlankWin.SetSize(iBlankWinSize);
 
   373 	for (ordPos=0;ordPos<=4;++ordPos)
 
   375 		iBlankWin.SetOrdinalPosition(ordPos);
 
   376 		for (xx=0;xx<xSteps;++xx)
 
   378 			TInt xPos=xx*WinSize.iWidth/xSteps;
 
   379 			for (yy=0;yy<ySteps;++yy)
 
   381 				iBlankWin.SetPosition(TPoint(xPos,yy*WinSize.iHeight/ySteps));
 
   382 				iBlankWin.SetVisible(ETrue);
 
   383 				iBlankWin.SetVisible(EFalse);
 
   388 	iBlankWin.SetOrdinalPosition(0,1);
 
   391 void CTMultipleTrans::OrdinalPos()
 
   394 	for (kk=2;kk>=0;--kk)
 
   396 		for (jj=3;jj>kk;--jj)
 
   398 			for (ii=jj;ii>=kk;--ii)
 
   400 				CTransWindow::SetOrdinal(iWindows,jj,kk);
 
   405 	for (kk=2;kk>=0;--kk)
 
   407 		for (jj=3;jj>kk;--jj)
 
   409 			for (ii=jj;ii>=kk;--ii)
 
   411 				CTransWindow::SetOrdinal(iWindows,kk,jj);
 
   418 TSize CTMultipleTrans::GetSize(TInt aPos)
 
   419 	{		//Comments show values for 640x240 screen
 
   420 	const TInt halfSize=40;
 
   421 	const TPoint topLeft=iTopLeft->Position();	//10,10
 
   422 	const TInt xLeft=WinSize.iWidth/2-topLeft.iX-halfSize;		//110
 
   423 	const TInt xRight=xLeft+2*halfSize;		//190
 
   424 	const TInt yTop=WinSize.iHeight/2-topLeft.iY-halfSize;		//70
 
   425 	const TInt yBot=yTop+2*halfSize;		//150
 
   427 		return TSize(xLeft+16*aPos-8,yTop);		//1->118, 5->182
 
   429 		return TSize(xRight,yTop+16*aPos-88);		//6->78, 10->142
 
   431 		return TSize(xRight-16*aPos+168,yBot);		//11->182, 15->118
 
   432 	return TSize(xLeft,yBot-16*aPos+248);			//16->142, 20->78
 
   435 void CTMultipleTrans::SizeChange(TInt aJump)
 
   442 		iTopLeft->SetSize(size);
 
   443 		if(iTopLeft->DrawOpaque())
 
   445 			iTopLeft->CTWin::DrawNow();
 
   455 void CTMultipleTrans::SizeChange()
 
   457 	CTransWindow::SetOrdinal(iWindows,2,1);
 
   458 	TSize size=iBotLeft->Size();
 
   460 	for (change=70;change>=0;change-=14)
 
   462 		iBotLeft->SetSize(TSize(size.iWidth-change,size.iHeight));
 
   463 		if(iBotLeft->DrawOpaque())
 
   465 			iBotLeft->CTWin::DrawNow();
 
   470 	size=iTopRight->Size();
 
   471 	for (change=25;change>-50;change-=14)
 
   473 		iTopRight->SetSize(TSize(size.iWidth,size.iHeight+change));
 
   474 		if(iTopRight->DrawOpaque())
 
   476 			iTopRight->CTWin::DrawNow();
 
   481 	iTopRight->SetSize(size);
 
   482 	if(iTopRight->DrawOpaque())
 
   484 		iTopRight->CTWin::DrawNow();
 
   487 	CTransWindow::SetOrdinal(iWindows,1,0);
 
   489 	size=iTopLeft->Size();
 
   491 	iTopLeft->SetSize(size);
 
   492 	if(iTopLeft->DrawOpaque())
 
   494 		iTopLeft->CTWin::DrawNow();
 
   498 	CTransWindow::SetOrdinal(iWindows,0,2);
 
   501 	iTopLeft->SetSize(size);
 
   502 	if(iTopLeft->DrawOpaque())
 
   504 		iTopLeft->CTWin::DrawNow();
 
   510 void CTMultipleTrans::MoveWin()
 
   512 	const TPoint topLeftPos=iTopLeft->Position();
 
   513 	const TPoint topRightPos=iTopRight->Position();
 
   514 	const TPoint botLeftPos=iBotLeft->Position();
 
   515 	const TPoint botRightPos=iBotRight->Position();
 
   516 	const TInt maxMove=Min(topRightPos.iX,botRightPos.iY)-10;
 
   518 	for (steps=2;steps>=0;--steps)
 
   520 		move=maxMove*(3-steps)/3;
 
   521 		iTopLeft->SetPos(TPoint(topLeftPos.iX+move,topLeftPos.iY+move));
 
   523 		iTopRight->SetPos(TPoint(topRightPos.iX-move,topRightPos.iY+move));
 
   525 		iBotRight->SetPos(TPoint(botRightPos.iX-move,botRightPos.iY-move));
 
   527 		iBotLeft->SetPos(TPoint(botLeftPos.iX+move,botLeftPos.iY-move));
 
   530 	for (steps=4;steps>=0;--steps)
 
   532 		move=maxMove*steps/5;
 
   533 		iBotLeft->SetPos(TPoint(botLeftPos.iX+move,botLeftPos.iY-move));
 
   535 		iTopLeft->SetPos(TPoint(topLeftPos.iX+move,topLeftPos.iY+move));
 
   537 		iBotRight->SetPos(TPoint(botRightPos.iX-move,botRightPos.iY-move));
 
   539 		iTopRight->SetPos(TPoint(topRightPos.iX-move,topRightPos.iY+move));
 
   544 void CTMultipleTrans::GroupWinL()
 
   546 	CTWindowGroup* group=new(ELeave) CTWindowGroup(TheClient);
 
   547 	CleanupStack::PushL(group);
 
   549 	CTransWindow* win=CTransWindow::NewL(group,KCyan,TRect(40,40,WinSize.iWidth-40,WinSize.iHeight-40),&DisplayMode);
 
   550 	win->CTWin::DrawNow();
 
   553 		win->SetDrawOpaque(ETrue);
 
   555 		TheClient->WaitForRedrawsToFinish();
 
   557 	iWindows.Insert(win,0);
 
   559 	group->GroupWin()->SetOrdinalPosition(1);
 
   562 	group->GroupWin()->SetOrdinalPosition(0);
 
   563 	iWindows.Insert(win,0);
 
   566 	delete win;		//Would be better to delete this after the group window but the test window don't support this behaviour currently.
 
   567 	CleanupStack::PopAndDestroy(group);
 
   571 void CTMultipleTrans::FadeTranWin()
 
   574 	TheClient->iWs.SetSystemFaded(ETrue);
 
   576 	TheClient->iWs.SetSystemFaded(EFalse);
 
   580 void CTMultipleTrans::StartShadows()
 
   583 	iTopLeft->SetShadowDisabled(EFalse);
 
   584 	iTopLeft->AdjustShadow(1);
 
   585 	iTopRight->SetShadowDisabled(EFalse);
 
   586 	iTopRight->AdjustShadow(1);
 
   587 	iBotLeft->SetShadowDisabled(EFalse);
 
   588 	iBotLeft->AdjustShadow(1);
 
   589 	iBotRight->SetShadowDisabled(EFalse);
 
   590 	iBotRight->AdjustShadow(1);
 
   591 	if(!iOpacitySupported)
 
   593 		iTopRight->ToggleVisibility();		// In 8.1 this isn't needed.
 
   594 		iTopRight->ToggleVisibility();
 
   599 void CTMultipleTrans::ShadowsOnOff()
 
   601 	if(!iOpacitySupported)
 
   602 		return;								// In 8.1 this isn't needed.
 
   603 	iBotRight->SetShadowDisabled(EFalse);
 
   604 	iBotRight->AdjustShadow(1);
 
   606 	iBotRight->SetShadowDisabled(ETrue);
 
   608 	iTopLeft->SetShadowDisabled(EFalse);
 
   609 	iTopLeft->AdjustShadow(1);
 
   611 	iTopLeft->SetShadowDisabled(ETrue);
 
   613 	iTopRight->SetShadowDisabled(ETrue);
 
   615 	iBotLeft->SetShadowDisabled(EFalse);
 
   616 	iBotLeft->AdjustShadow(1);
 
   618 	iBotLeft->SetShadowDisabled(ETrue);
 
   620 	iTopLeft->SetShadowDisabled(EFalse);
 
   621 	iTopRight->SetShadowDisabled(EFalse);
 
   622 	iBotLeft->SetShadowDisabled(EFalse);
 
   623 	iBotRight->SetShadowDisabled(EFalse);
 
   624 	iTopLeft->ToggleVisibility();
 
   626 	iTopLeft->ToggleVisibility();
 
   628 	iTopRight->ToggleVisibility();
 
   630 	iTopRight->ToggleVisibility();
 
   632 	iBotLeft->ToggleVisibility();
 
   634 	iBotLeft->ToggleVisibility();
 
   636 	iBotRight->ToggleVisibility();
 
   638 	iBotRight->ToggleVisibility();
 
   642 void CTMultipleTrans::StartChildL()
 
   645 	TInt windows=iWindows.Count();
 
   647 	//Delete the first 4 windows from the array, could use ResetAndDestroy but would be broken by other uses of the array
 
   648 	for (window=windows;window>0;--window)
 
   654 	RecreateWindowsL(iBackgroundWin);
 
   658 void CTMultipleTrans::StartChild2L()
 
   661 	TInt windows=iWindows.Count();
 
   663 	//Delete the first 4 windows from the array, could use ResetAndDestroy but would be broken by other uses of the array
 
   664 	for (window=windows;window>0;--window)
 
   673 	iBotRight=CTransWindow::NewL(iBackgroundWin,KBlue,rect,&DisplayMode);
 
   674 	iBotRight->CTWin::DrawNow();
 
   675 	iWindows.Insert(iBotRight,0);
 
   677 	rect.Resize(-20,-20);
 
   678 	iTopLeft=CTransWindow::NewL(iBotRight,KRed,rect,&DisplayMode);
 
   679 	iTopLeft->CTWin::DrawNow();
 
   680 	iTopLeft->SetPosOffset(TPoint(10,10));
 
   681 	iWindows.Insert(iTopLeft,0);
 
   683 	rect.Resize(-20,-20);
 
   684 	iTopRight=CTransWindow::NewL(iTopLeft,KGreen,rect,&DisplayMode);
 
   685 	iTopRight->CTWin::DrawNow();
 
   686 	iTopRight->SetPosOffset(TPoint(20,20));
 
   687 	iWindows.Insert(iTopRight,0);
 
   689 	rect.Resize(-20,-20);
 
   690 	iBotLeft=CTransWindow::NewL(iTopRight,KYellow,rect,&DisplayMode);
 
   691 	iBotLeft->CTWin::DrawNow();
 
   692 	iBotLeft->SetPosOffset(TPoint(30,30));
 
   693 	iWindows.Insert(iBotLeft,0);
 
   696 		for (TInt window = 0; window < iWindows.Count(); ++window)
 
   698 			iWindows[window]->SetDrawOpaque(ETrue);
 
   699 			iWindows[window]->Invalidate();
 
   701 		TheClient->WaitForRedrawsToFinish();
 
   706 void CTMultipleTrans::RecreateWindowsL(CTWinBase *aParent)
 
   709 	TInt windows=iWindows.Count();
 
   711 	//Delete existing windows:
 
   712 	for (window=windows;window>0;--window)
 
   720 		aParent = TheClient->iGroup;
 
   722 	iBotRight=CTransWindow::NewL(aParent,KBlue,TRect(WinSize.iWidth/2-10,WinSize.iHeight/2-30,WinSize.iWidth-20,WinSize.iHeight-20),&DisplayMode);
 
   723 	iBotRight->CTWin::DrawNow();
 
   724 	iWindows.Insert(iBotRight,0);
 
   725 	iTopLeft=CTransWindow::NewL(aParent,KRed,TRect(10,10,WinSize.iWidth/2+10,WinSize.iHeight/2+30),&DisplayMode);
 
   726 	iTopLeft->CTWin::DrawNow();
 
   727 	iWindows.Insert(iTopLeft,0);
 
   728 	iTopRight=CTransWindow::NewL(aParent,KGreen,TRect(WinSize.iWidth/2-30,20,WinSize.iWidth-10,WinSize.iHeight/2+10),&DisplayMode);
 
   729 	iTopRight->CTWin::DrawNow();
 
   730 	iWindows.Insert(iTopRight,0);
 
   731 	iBotLeft=CTransWindow::NewL(aParent,KYellow,TRect(20,WinSize.iHeight/2-10,WinSize.iWidth/2+30,WinSize.iHeight-10),&DisplayMode);
 
   732 	iBotLeft->CTWin::DrawNow();
 
   733 	iWindows.Insert(iBotLeft,0);
 
   738 		for (TInt window=0;window<iWindows.Count();++window)
 
   740 			iWindows[window]->SetDrawOpaque(ETrue);
 
   741 			iWindows[window]->Invalidate();
 
   743 		TheClient->WaitForRedrawsToFinish();
 
   747 void CTMultipleTrans::RunTestCaseL(TInt /*aCurTestCase*/)
 
   749 	_LIT(KCheck,"Check");
 
   750 	_LIT(KSimple,"Simple Test");
 
   751 	_LIT(KVisibility,"Change Visibility");
 
   752 	_LIT(KVisibility2,"Change Visibility 2");
 
   753 	_LIT(KOrdinal,"Ordinal Position");
 
   754 	_LIT(KSizeChange,"Size Change");
 
   755 	_LIT(KMoveWin,"Move Window");
 
   756 	_LIT(KGroupWin,"Group Window Ordinal");
 
   757 	_LIT(KBackground,"Background Color Changes");
 
   758 	_LIT(KShadowsOnOff,"Shadows On Off");
 
   759 	_LIT(KChild1,"Child 1");
 
   760 	_LIT(KChild2,"Child 2");
 
   761 	_LIT(KOpacity,"Opaque Drawing");
 
   762 	_LIT(KTranWinFade,"Fading Transparent Windows");
 
   763 	((CTMultipleTransStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
 
   765 	switch(iTest->iState)
 
   769 @SYMTestCaseID		GRAPHICS-WSERV-0500
 
   771 			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0500"));
 
   772 			// Check to see if Transparency is enabled before running tests
 
   773 			iTest->LogSubTest(KCheck);
 
   774 			if (TransparencySupportedL()==KErrNotSupported)
 
   776 				LOG_MESSAGE(_L("Transparency is not supported\n"));
 
   780 			++iTest->iState;		//Fall Through
 
   782 @SYMTestCaseID		GRAPHICS-WSERV-0111
 
   786 @SYMTestCaseDesc    Simple transparent windows test.
 
   788 @SYMTestPriority    High
 
   790 @SYMTestStatus      Implemented
 
   792 @SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
 
   793 					The test draws the windows on the screen's right side using FBS bitmaps direcly.
 
   794 					The test does nothing if transparency is not enabled on the screen.
 
   796 @SYMTestExpectedResults Expects that left and rightside bitmaps are identical
 
   799 			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0111"));
 
   800 			iTest->LogSubTest(KSimple);
 
   804 @SYMTestCaseID		GRAPHICS-WSERV-0112
 
   808 @SYMTestCaseDesc    On/off switching of visibility of transparent windows
 
   810 @SYMTestPriority    High
 
   812 @SYMTestStatus      Implemented
 
   814 @SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
 
   815 					The test toggles visibility of those four windows going through all
 
   816 					combinations. For each combination it draws visible windows on the screen's right side using FBS bitmaps direcly.
 
   817 					The test does nothing if transparency is not enabled on the screen.
 
   819 @SYMTestExpectedResults Expects that left and rightside bitmaps are identical
 
   824 			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0112"));
 
   825 			iTest->LogSubTest(KVisibility);
 
   829 @SYMTestCaseID		GRAPHICS-WSERV-0113
 
   833 @SYMTestCaseDesc    On/off switching of visibility of a small transparent window on top of existing transparent windows
 
   835 @SYMTestPriority    High
 
   837 @SYMTestStatus      Implemented
 
   839 @SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
 
   840 					Toggles visibility of 5th blank little window making this appear in different places 
 
   841 					with different ordinal position. Draws visible windows on the screen's right side using FBS bitmaps direcly
 
   842 					each time when the 5th window becomes invisible.
 
   843 					The test does nothing if transparency is not enabled on the screen.
 
   845 @SYMTestExpectedResults Expects that left and rightside bitmaps are identical
 
   848 			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0113"));
 
   849 			iTest->LogSubTest(KVisibility2);
 
   853 @SYMTestCaseID		GRAPHICS-WSERV-0114
 
   857 @SYMTestCaseDesc    Ordinal positions' switches of intersecting transparent windows
 
   859 @SYMTestPriority    High
 
   861 @SYMTestStatus      Implemented
 
   863 @SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
 
   864 					Switches ordinal positions of the four windows trying all combinations. Draws visible windows on the screen's right side
 
   865 					using FBS bitmaps direcly each time when a new combination is applied.
 
   866 					The test does nothing if transparency is not enabled on the screen.
 
   869 @SYMTestExpectedResults Expects that left and rightside bitmaps are identical
 
   873 			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0114"));
 
   874 			iTest->LogSubTest(KOrdinal);
 
   878 @SYMTestCaseID		GRAPHICS-WSERV-0115
 
   882 @SYMTestCaseDesc    Changing sizes of intersecting transparent windows
 
   884 @SYMTestPriority    High
 
   886 @SYMTestStatus      Implemented
 
   888 @SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
 
   889 					Plays with sizes of each of the four windows to affect overlapping. 
 
   890 					Draws visible windows on the screen's right side using FBS bitmaps direcly
 
   891 					each time when a new size for a particular window is applied.
 
   892 					The test does nothing if transparency is not enabled on the screen.
 
   895 @SYMTestExpectedResults Expects that left and rightside bitmaps are identical
 
   899 			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0115"));
 
   900 			iTest->LogSubTest(KSizeChange);
 
   904 @SYMTestCaseID		GRAPHICS-WSERV-0116
 
   908 @SYMTestCaseDesc    Moving intersecting transparent windows
 
   910 @SYMTestPriority    High
 
   912 @SYMTestStatus      Implemented
 
   914 @SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
 
   915 					Performs moves of those windows one by one making little steps in direction of the center of intersection and backwards.
 
   916 					Draws visible windows on the screen's right side using FBS bitmaps direcly
 
   917 					each time when a position of a particular window changes.
 
   918 					The test does nothing if transparency is not enabled on the screen.
 
   920 @SYMTestExpectedResults Expects that left and rightside bitmaps are identical
 
   923 			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0116"));
 
   924 			iTest->LogSubTest(KMoveWin);
 
   928 @SYMTestCaseID		GRAPHICS-WSERV-0117
 
   932 @SYMTestCaseDesc    Test with a second window group
 
   934 @SYMTestPriority    High
 
   936 @SYMTestStatus      Implemented
 
   938 @SYMTestActions     Four overlapping transparent windows (RWindow, within the same group) are created before the test on the screen's left side.
 
   939 					Creates a 5th transparent window in a separate window group
 
   940 					on top of existing windows which covers the intersection area of initial 4 windows. 
 
   941 					Changes the ordinal position of the group to 1, changes ordinal position 
 
   942 					back to 0, removes the new group.
 
   943 					Redraws visible windows on the screen's right side using FBS bitmaps direcly
 
   944 					each time when any change on the screen's left side is performed.
 
   945 					The test does nothing if transparency is not enabled on the screen.
 
   947 @SYMTestExpectedResults Expects that left and rightside bitmaps are identical
 
   950 			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0117"));
 
   951 			iTest->LogSubTest(KGroupWin);
 
   955 			((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
 
   956 			iTest->LogSubTest(KBackground);
 
   957 			//Change the background color of the 4 test windows and the window behind them
 
   960 @SYMTestCaseID		GRAPHICS-WSERV-0118
 
   964 @SYMTestCaseDesc    On/off switching of fading
 
   966 @SYMTestPriority    High
 
   968 @SYMTestStatus      Implemented
 
   970 @SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
 
   971 					Switches system fading on and right after that back to off.
 
   972 					Draws visible windows on the screen's right side using FBS bitmaps direcly
 
   974 					The test does nothing if transparency is not enabled on the screen.
 
   976 @SYMTestExpectedResults Expects that left and rightside bitmaps are identical
 
   979 			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0118"));
 
   980 			iTest->LogSubTest(KTranWinFade);
 
   984 			((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
 
   988 @SYMTestCaseID		GRAPHICS-WSERV-0120
 
   992 @SYMTestCaseDesc    Shadows' on/off test.
 
   994 @SYMTestPriority    High
 
   996 @SYMTestStatus      Implemented
 
   998 @SYMTestActions     Four overlapping transparent windows (RWindow) with shadowing enabled are created before the test on the screen's left side.
 
   999 					The test plays with on/off-switching of shadowing and visibility for the windows.
 
  1000 					The test redraws visible windows on the screen's right side using FBS bitmaps direcly
 
  1001 					each time when state of ony window changes.
 
  1002 					The test does nothing if transparency is not enabled on the screen.
 
  1003 					The test also repeats GRAPHICS-WSERV-0111 - GRAPHICS-WSERV-015 foor the shadowed windows.
 
  1005 @SYMTestExpectedResults Expects that left and rightside bitmaps are identical
 
  1008 			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0120"));
 
  1009 			iTest->LogSubTest(KShadowsOnOff);
 
  1013 			((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
 
  1017 @SYMTestCaseID		GRAPHICS-WSERV-0121
 
  1021 @SYMTestCaseDesc    Transparent child-windows of a bacground window 
 
  1023 @SYMTestPriority    High
 
  1025 @SYMTestStatus      Implemented
 
  1027 @SYMTestActions     Four overlapping transparent windows (RWindow) with shadowing enabled are created before the test on the screen's left side.
 
  1028 					The test removes those windows and creates new four overlapping transparent windows 
 
  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.
 
  1030 					The test does nothing if transparency is not enabled on the screen.
 
  1031 					The test also repeats GRAPHICS-WSERV-0111 - GRAPHICS-WSERV-014 foor the shadowed windows.
 
  1033 @SYMTestExpectedResults Expects that left and rightside bitmaps are identical
 
  1036 			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0121"));
 
  1037 			iTest->LogSubTest(KChild1);
 
  1041 			((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
 
  1045 @SYMTestCaseID		GRAPHICS-WSERV-0122
 
  1051 @SYMTestPriority    High
 
  1053 @SYMTestStatus      Implemented
 
  1055 @SYMTestActions     Four overlapping transparent windows (RWindow) with shadowing enabled are created before the test on the screen's left side.
 
  1056 					The test removes those windows and creates new four transparent windows 
 
  1057 					so that each one (except first) is a child of prevoiusly created window. 
 
  1058 					The test redraws visible windows on the screen's right side using FBS bitmaps direcly
 
  1059 					after each window's creation.
 
  1060 					The test does nothing if transparency is not enabled on the screen.
 
  1062 @SYMTestExpectedResults Expects that left and rightside bitmaps are identical
 
  1065 			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0122"));
 
  1066 			iTest->LogSubTest(KChild2);
 
  1070 				((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0123"));
 
  1072 @SYMTestCaseID		GRAPHICS-WSERV-0123
 
  1078 @SYMTestPriority    High
 
  1080 @SYMTestStatus      Implemented
 
  1082 @SYMTestActions     The test draws four overlapping transparent windows (RWindow) on the screen's left side.
 
  1083 					Each window has an opaque diagonal line (\) which goes from the top-left corner of each window.
 
  1084 					The test repeats all tests from GRAPHICS-WSERV-0111 to GRAPHICS-WSERV-0122 
 
  1085 					with those four windows and diagonaly lines on them.
 
  1087 @SYMTestExpectedResults Expects that all tests will obtain results they expected. 
 
  1089 			if (iMajorTest==1 || !iOpacitySupported)
 
  1091 				if (!iOpacitySupported)
 
  1093 					_LIT(KNoOpacity,"Opacity is not supported");
 
  1094 					LOG_MESSAGE(KNoOpacity);
 
  1096                 		((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
 
  1100 			LOG_MESSAGE(KOpacity);
 
  1106 	((CTMultipleTransStep*)iStep)->RecordTestResultL();
 
  1111 __WS_CONSTRUCT_STEP__(MultipleTrans)