103
|
1 |
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// Test multiple level transparent window
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
@test
|
|
21 |
@internalComponent - Internal Symbian test code
|
|
22 |
*/
|
|
23 |
|
|
24 |
#include "TMulTran.H"
|
|
25 |
|
|
26 |
|
|
27 |
LOCAL_D TDisplayMode DisplayMode=EColor64K;
|
|
28 |
LOCAL_D TSize WinSize;
|
|
29 |
|
|
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);
|
|
35 |
|
|
36 |
/*CTransWindow*/
|
|
37 |
|
|
38 |
CTransWindow* CTransWindow::NewL(RPointerArray<CTransWindow>& aWindows,TRgb aColor,TRect aPos)
|
|
39 |
{
|
|
40 |
CTransWindow* self=NewL(TheClient->iGroup,aColor,aPos,&DisplayMode);
|
|
41 |
aWindows.Insert(self,0);
|
|
42 |
return self;
|
|
43 |
}
|
|
44 |
|
|
45 |
CTransWindow* CTransWindow::NewL(CTWinBase* aParent,TRgb aColor,TRect aPos, TDisplayMode* aDisplayMode)
|
|
46 |
{
|
|
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);
|
|
52 |
return self;
|
|
53 |
}
|
|
54 |
|
|
55 |
//the following function doesn't activate a window
|
|
56 |
CTransWindow* CTransWindow::NewL(CTWinBase* aParent,TRgb aColor,TDisplayMode* aDisplayMode)
|
|
57 |
{
|
|
58 |
CTransWindow* self=new(ELeave) CTransWindow(aColor);
|
|
59 |
CleanupStack::PushL(self);
|
|
60 |
self->ConstructL(*aParent);
|
|
61 |
if (aDisplayMode)
|
|
62 |
{
|
|
63 |
self->BaseWin()->SetRequiredDisplayMode(*aDisplayMode);
|
|
64 |
}
|
|
65 |
User::LeaveIfError((self->iError) && (self->iError != KErrNotSupported));
|
|
66 |
CleanupStack::Pop(self);
|
|
67 |
return self;
|
|
68 |
}
|
|
69 |
|
|
70 |
void CTransWindow::InitWin()
|
|
71 |
{
|
|
72 |
AdjustShadow(-1);
|
|
73 |
iShadowHight=0;
|
|
74 |
iWin.SetShadowDisabled(ETrue);
|
|
75 |
iShadowing=EFalse;
|
|
76 |
iError = iWin.SetTransparencyAlphaChannel();
|
|
77 |
iWin.SetBackgroundColor(iCol);
|
|
78 |
iDrawOpaque=EFalse;
|
|
79 |
}
|
|
80 |
|
|
81 |
void CTransWindow::ToggleVisibility()
|
|
82 |
{
|
|
83 |
iVisible=!iVisible;
|
|
84 |
SetVisible(iVisible);
|
|
85 |
}
|
|
86 |
|
|
87 |
void CTransWindow::SetOrdinal(RPointerArray<CTransWindow>& aWindows,TInt aOldPos,TInt aNewPos)
|
|
88 |
{
|
|
89 |
CTransWindow* win=aWindows[aOldPos];
|
|
90 |
aWindows.Remove(aOldPos);
|
|
91 |
aWindows.Insert(win,aNewPos);
|
|
92 |
win->iWin.SetOrdinalPosition(aNewPos);
|
|
93 |
}
|
|
94 |
|
|
95 |
void CTransWindow::SetShadowDisabled(TBool aState)
|
|
96 |
{
|
|
97 |
iWin.SetShadowDisabled(aState);
|
|
98 |
iShadowing=!aState;
|
|
99 |
}
|
|
100 |
|
|
101 |
void CTransWindow::AdjustShadow(TInt aAdjust)
|
|
102 |
{
|
|
103 |
CBlankWindow::AdjustShadow(aAdjust);
|
|
104 |
iShadowHight+=aAdjust;
|
|
105 |
}
|
|
106 |
|
|
107 |
TPoint CTransWindow::Position() const
|
|
108 |
{
|
|
109 |
return CBlankWindow::Position()+iPosOffset;
|
|
110 |
}
|
|
111 |
|
|
112 |
void CTransWindow::Draw()
|
|
113 |
{
|
|
114 |
//don't call CBlankWindow::Draw() since the background is already drawn
|
|
115 |
|
|
116 |
if(iDrawOpaque)
|
|
117 |
{
|
|
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);
|
|
125 |
}
|
|
126 |
}
|
|
127 |
|
|
128 |
/*CTMultipleTrans*/
|
|
129 |
|
|
130 |
CTMultipleTrans::CTMultipleTrans(CTestStep* aStep) : CTWsGraphicsBase(aStep), iWindows(5), iShadows(EFalse)
|
|
131 |
{
|
|
132 |
}
|
|
133 |
|
|
134 |
CTMultipleTrans::~CTMultipleTrans()
|
|
135 |
{
|
|
136 |
((CTMultipleTransStep*)iStep)->CloseTMSGraphicsStep();
|
|
137 |
delete iBackgroundWin;
|
|
138 |
delete iCheckWin;
|
|
139 |
delete iCheckBitmap;
|
|
140 |
iWindows.ResetAndDestroy();
|
|
141 |
iBlankWin.Close();
|
|
142 |
}
|
|
143 |
|
|
144 |
void CTMultipleTrans::ConstructL()
|
|
145 |
{
|
|
146 |
if(TransparencySupportedL() == KErrNotSupported)
|
|
147 |
return;
|
|
148 |
iMajorTest=0;
|
|
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);
|
|
156 |
iCheckWin=checkWin;
|
|
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);
|
|
164 |
TheClient->Flush();
|
|
165 |
TheClient->WaitForRedrawsToFinish();
|
|
166 |
RecreateWindowsL();
|
|
167 |
iBlankWin=RBlankWindow(TheClient->iWs);
|
|
168 |
User::LeaveIfError(iBlankWin.Construct(*TheClient->iGroup->WinTreeNode(),ENullWsHandle));
|
|
169 |
iBlankWinVis=EFalse;
|
|
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;
|
|
177 |
}
|
|
178 |
|
|
179 |
void CTMultipleTrans::ShadowRegion(TRegion& aRegion,TInt aWin)
|
|
180 |
{
|
|
181 |
TRect rect;
|
|
182 |
TInt height;
|
|
183 |
TInt window;
|
|
184 |
aRegion.Clear();
|
|
185 |
RRegion single;
|
|
186 |
RRegion noShadow1;
|
|
187 |
RRegion noShadow2;
|
|
188 |
RRegion temp;
|
|
189 |
RRegion temp2;
|
|
190 |
for (window=0;window<aWin;++window)
|
|
191 |
{
|
|
192 |
CTransWindow& win=*iWindows[window];
|
|
193 |
if (win.IsVisible())
|
|
194 |
{
|
|
195 |
rect.SetRect(win.Position(),win.Size());
|
|
196 |
height=win.ShadowHeight();
|
|
197 |
temp.Copy(single);
|
|
198 |
temp.ClipRect(rect);
|
|
199 |
noShadow1.Union(temp);
|
|
200 |
temp.Clear();
|
|
201 |
temp.AddRect(rect);
|
|
202 |
temp.SubRegion(noShadow1);
|
|
203 |
temp.SubRegion(noShadow2);
|
|
204 |
temp.SubRegion(aRegion,&temp2);
|
|
205 |
noShadow2.Union(temp2);
|
|
206 |
temp2.Clear();
|
|
207 |
single.Union(temp);
|
|
208 |
if (win.IsShadowing())
|
|
209 |
aRegion.AddRect(rect);
|
|
210 |
aRegion.Offset(2*height,2*height);
|
|
211 |
aRegion.Tidy();
|
|
212 |
noShadow1.Tidy();
|
|
213 |
noShadow2.Tidy();
|
|
214 |
single.Tidy();
|
|
215 |
}
|
|
216 |
}
|
|
217 |
if (window<iWindows.Count())
|
|
218 |
{
|
|
219 |
CTransWindow& win=*iWindows[window];
|
|
220 |
rect.SetRect(win.Position(),win.Size());
|
|
221 |
aRegion.ClipRect(rect);
|
|
222 |
}
|
|
223 |
aRegion.SubRegion(noShadow1);
|
|
224 |
aRegion.SubRegion(noShadow2);
|
|
225 |
aRegion.Tidy();
|
|
226 |
noShadow1.Close();
|
|
227 |
noShadow2.Close();
|
|
228 |
single.Close();
|
|
229 |
temp.Close();
|
|
230 |
temp2.Close();
|
|
231 |
}
|
|
232 |
|
|
233 |
void CTMultipleTrans::CheckDisplay()
|
|
234 |
{
|
|
235 |
RRegion shadowRegion;
|
|
236 |
CFbsBitGc& gc=iCheckBitmap->Gc();
|
|
237 |
gc.SetBrushColor(KRgbWhite);
|
|
238 |
gc.DrawRect(TRect(WinSize));
|
|
239 |
TInt windows=iWindows.Count();
|
|
240 |
if (iShadows)
|
|
241 |
{
|
|
242 |
ShadowRegion(shadowRegion,windows);
|
|
243 |
gc.ShadowArea(&shadowRegion);
|
|
244 |
}
|
|
245 |
TInt window;
|
|
246 |
for (window=windows;window>0;)
|
|
247 |
{
|
|
248 |
CTransWindow& win=*iWindows[--window];
|
|
249 |
if (win.IsVisible())
|
|
250 |
{
|
|
251 |
gc.SetBrushColor(win.Color());
|
|
252 |
const TPoint& winTopLeft=win.Position();
|
|
253 |
gc.DrawRect(TRect(winTopLeft, win.Size()));
|
|
254 |
|
|
255 |
if(win.DrawOpaque())
|
|
256 |
{
|
|
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));
|
|
264 |
}
|
|
265 |
|
|
266 |
if (iShadows)
|
|
267 |
{
|
|
268 |
ShadowRegion(shadowRegion,window);
|
|
269 |
gc.ShadowArea(&shadowRegion);
|
|
270 |
}
|
|
271 |
}
|
|
272 |
}
|
|
273 |
iCheckWin->BackedUpWin()->UpdateScreen();
|
|
274 |
TheClient->Flush();
|
|
275 |
if (windows>=4)
|
|
276 |
{
|
|
277 |
AdvancedCheckRect();
|
|
278 |
}
|
|
279 |
_LIT(KTest,"Multiple Transparent Test, SubTest %d, OpacityOn=%d");
|
|
280 |
TBuf<128> buf;
|
|
281 |
buf.Format(KTest,iTest->iState,iMajorTest);
|
|
282 |
CheckRect(iBackgroundWin,iCheckWin,TRect(WinSize),buf);
|
|
283 |
shadowRegion.Close();
|
|
284 |
}
|
|
285 |
|
|
286 |
#define OFFSET 2
|
|
287 |
void CTMultipleTrans::AdvancedCheckRect()
|
|
288 |
{
|
|
289 |
const TSize compareSize(5,5);
|
|
290 |
const TInt OFFSET2=OFFSET+compareSize.iWidth;
|
|
291 |
TPoint comparePos=iCheckWin->Position();
|
|
292 |
TPoint checkPos;
|
|
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);
|
|
329 |
//Quad level
|
|
330 |
checkPos=TPoint(iBotRight->Position().iX,iBotLeft->Position().iY)+TPoint(OFFSET,OFFSET);
|
|
331 |
CheckRect(checkPos,checkPos+comparePos,compareSize);
|
|
332 |
}
|
|
333 |
|
|
334 |
void CTMultipleTrans::SimpleTest()
|
|
335 |
{
|
|
336 |
CheckDisplay();
|
|
337 |
}
|
|
338 |
|
|
339 |
void CTMultipleTrans::ChangeVisibility()
|
|
340 |
{
|
|
341 |
TUint toggle;
|
|
342 |
TUint toggle2;
|
|
343 |
TInt win;
|
|
344 |
TInt ii=0;
|
|
345 |
for (ii=2;ii>0;--ii)
|
|
346 |
{
|
|
347 |
for (toggle=1;toggle<16;++toggle)
|
|
348 |
{
|
|
349 |
win=0;
|
|
350 |
toggle2=toggle;
|
|
351 |
while ((toggle2&0x1)==0)
|
|
352 |
{
|
|
353 |
++win;
|
|
354 |
toggle2/=2;
|
|
355 |
}
|
|
356 |
iWindows[win]->ToggleVisibility();
|
|
357 |
CheckDisplay();
|
|
358 |
}
|
|
359 |
}
|
|
360 |
}
|
|
361 |
|
|
362 |
void CTMultipleTrans::ChangeVisibility2()
|
|
363 |
{
|
|
364 |
iBlankWin.SetOrdinalPosition(0,0);
|
|
365 |
iBlankWin.SetVisible(ETrue);
|
|
366 |
iBlankWin.SetVisible(EFalse);
|
|
367 |
CheckDisplay();
|
|
368 |
const TInt xSteps=4;
|
|
369 |
const TInt ySteps=3;
|
|
370 |
iBlankWinSize.SetSize(WinSize.iWidth/xSteps,WinSize.iHeight/ySteps);
|
|
371 |
iBlankWin.SetSize(iBlankWinSize);
|
|
372 |
TInt ordPos,xx,yy;
|
|
373 |
for (ordPos=0;ordPos<=4;++ordPos)
|
|
374 |
{
|
|
375 |
iBlankWin.SetOrdinalPosition(ordPos);
|
|
376 |
for (xx=0;xx<xSteps;++xx)
|
|
377 |
{
|
|
378 |
TInt xPos=xx*WinSize.iWidth/xSteps;
|
|
379 |
for (yy=0;yy<ySteps;++yy)
|
|
380 |
{
|
|
381 |
iBlankWin.SetPosition(TPoint(xPos,yy*WinSize.iHeight/ySteps));
|
|
382 |
iBlankWin.SetVisible(ETrue);
|
|
383 |
iBlankWin.SetVisible(EFalse);
|
|
384 |
CheckDisplay();
|
|
385 |
}
|
|
386 |
}
|
|
387 |
}
|
|
388 |
iBlankWin.SetOrdinalPosition(0,1);
|
|
389 |
}
|
|
390 |
|
|
391 |
void CTMultipleTrans::OrdinalPos()
|
|
392 |
{
|
|
393 |
TInt ii,jj,kk;
|
|
394 |
for (kk=2;kk>=0;--kk)
|
|
395 |
{
|
|
396 |
for (jj=3;jj>kk;--jj)
|
|
397 |
{
|
|
398 |
for (ii=jj;ii>=kk;--ii)
|
|
399 |
{
|
|
400 |
CTransWindow::SetOrdinal(iWindows,jj,kk);
|
|
401 |
CheckDisplay();
|
|
402 |
}
|
|
403 |
}
|
|
404 |
}
|
|
405 |
for (kk=2;kk>=0;--kk)
|
|
406 |
{
|
|
407 |
for (jj=3;jj>kk;--jj)
|
|
408 |
{
|
|
409 |
for (ii=jj;ii>=kk;--ii)
|
|
410 |
{
|
|
411 |
CTransWindow::SetOrdinal(iWindows,kk,jj);
|
|
412 |
CheckDisplay();
|
|
413 |
}
|
|
414 |
}
|
|
415 |
}
|
|
416 |
}
|
|
417 |
|
|
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
|
|
426 |
if (aPos<6)
|
|
427 |
return TSize(xLeft+16*aPos-8,yTop); //1->118, 5->182
|
|
428 |
if (aPos<11)
|
|
429 |
return TSize(xRight,yTop+16*aPos-88); //6->78, 10->142
|
|
430 |
if (aPos<16)
|
|
431 |
return TSize(xRight-16*aPos+168,yBot); //11->182, 15->118
|
|
432 |
return TSize(xLeft,yBot-16*aPos+248); //16->142, 20->78
|
|
433 |
}
|
|
434 |
|
|
435 |
void CTMultipleTrans::SizeChange(TInt aJump)
|
|
436 |
{
|
|
437 |
TInt ii=aJump;
|
|
438 |
TSize size;
|
|
439 |
while (ii<20)
|
|
440 |
{
|
|
441 |
size=GetSize(ii);
|
|
442 |
iTopLeft->SetSize(size);
|
|
443 |
if(iTopLeft->DrawOpaque())
|
|
444 |
{
|
|
445 |
iTopLeft->CTWin::DrawNow();
|
|
446 |
TheClient->Flush();
|
|
447 |
}
|
|
448 |
CheckDisplay();
|
|
449 |
ii+=aJump;
|
|
450 |
if (ii>20)
|
|
451 |
ii-=20;
|
|
452 |
}
|
|
453 |
}
|
|
454 |
|
|
455 |
void CTMultipleTrans::SizeChange()
|
|
456 |
{
|
|
457 |
CTransWindow::SetOrdinal(iWindows,2,1);
|
|
458 |
TSize size=iBotLeft->Size();
|
|
459 |
TInt change;
|
|
460 |
for (change=70;change>=0;change-=14)
|
|
461 |
{
|
|
462 |
iBotLeft->SetSize(TSize(size.iWidth-change,size.iHeight));
|
|
463 |
if(iBotLeft->DrawOpaque())
|
|
464 |
{
|
|
465 |
iBotLeft->CTWin::DrawNow();
|
|
466 |
TheClient->Flush();
|
|
467 |
}
|
|
468 |
CheckDisplay();
|
|
469 |
}
|
|
470 |
size=iTopRight->Size();
|
|
471 |
for (change=25;change>-50;change-=14)
|
|
472 |
{
|
|
473 |
iTopRight->SetSize(TSize(size.iWidth,size.iHeight+change));
|
|
474 |
if(iTopRight->DrawOpaque())
|
|
475 |
{
|
|
476 |
iTopRight->CTWin::DrawNow();
|
|
477 |
TheClient->Flush();
|
|
478 |
}
|
|
479 |
CheckDisplay();
|
|
480 |
}
|
|
481 |
iTopRight->SetSize(size);
|
|
482 |
if(iTopRight->DrawOpaque())
|
|
483 |
{
|
|
484 |
iTopRight->CTWin::DrawNow();
|
|
485 |
TheClient->Flush();
|
|
486 |
}
|
|
487 |
CTransWindow::SetOrdinal(iWindows,1,0);
|
|
488 |
CheckDisplay();
|
|
489 |
size=iTopLeft->Size();
|
|
490 |
SizeChange(3);
|
|
491 |
iTopLeft->SetSize(size);
|
|
492 |
if(iTopLeft->DrawOpaque())
|
|
493 |
{
|
|
494 |
iTopLeft->CTWin::DrawNow();
|
|
495 |
TheClient->Flush();
|
|
496 |
}
|
|
497 |
CheckDisplay();
|
|
498 |
CTransWindow::SetOrdinal(iWindows,0,2);
|
|
499 |
CheckDisplay();
|
|
500 |
SizeChange(7);
|
|
501 |
iTopLeft->SetSize(size);
|
|
502 |
if(iTopLeft->DrawOpaque())
|
|
503 |
{
|
|
504 |
iTopLeft->CTWin::DrawNow();
|
|
505 |
TheClient->Flush();
|
|
506 |
}
|
|
507 |
CheckDisplay();
|
|
508 |
}
|
|
509 |
|
|
510 |
void CTMultipleTrans::MoveWin()
|
|
511 |
{
|
|
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;
|
|
517 |
TInt steps,move;
|
|
518 |
for (steps=2;steps>=0;--steps)
|
|
519 |
{
|
|
520 |
move=maxMove*(3-steps)/3;
|
|
521 |
iTopLeft->SetPos(TPoint(topLeftPos.iX+move,topLeftPos.iY+move));
|
|
522 |
CheckDisplay();
|
|
523 |
iTopRight->SetPos(TPoint(topRightPos.iX-move,topRightPos.iY+move));
|
|
524 |
CheckDisplay();
|
|
525 |
iBotRight->SetPos(TPoint(botRightPos.iX-move,botRightPos.iY-move));
|
|
526 |
CheckDisplay();
|
|
527 |
iBotLeft->SetPos(TPoint(botLeftPos.iX+move,botLeftPos.iY-move));
|
|
528 |
CheckDisplay();
|
|
529 |
}
|
|
530 |
for (steps=4;steps>=0;--steps)
|
|
531 |
{
|
|
532 |
move=maxMove*steps/5;
|
|
533 |
iBotLeft->SetPos(TPoint(botLeftPos.iX+move,botLeftPos.iY-move));
|
|
534 |
CheckDisplay();
|
|
535 |
iTopLeft->SetPos(TPoint(topLeftPos.iX+move,topLeftPos.iY+move));
|
|
536 |
CheckDisplay();
|
|
537 |
iBotRight->SetPos(TPoint(botRightPos.iX-move,botRightPos.iY-move));
|
|
538 |
CheckDisplay();
|
|
539 |
iTopRight->SetPos(TPoint(topRightPos.iX-move,topRightPos.iY+move));
|
|
540 |
CheckDisplay();
|
|
541 |
}
|
|
542 |
}
|
|
543 |
|
|
544 |
void CTMultipleTrans::GroupWinL()
|
|
545 |
{
|
|
546 |
CTWindowGroup* group=new(ELeave) CTWindowGroup(TheClient);
|
|
547 |
CleanupStack::PushL(group);
|
|
548 |
group->ConstructL();
|
|
549 |
CTransWindow* win=CTransWindow::NewL(group,KCyan,TRect(40,40,WinSize.iWidth-40,WinSize.iHeight-40),&DisplayMode);
|
|
550 |
win->CTWin::DrawNow();
|
|
551 |
if(iMajorTest==1)
|
|
552 |
{
|
|
553 |
win->SetDrawOpaque(ETrue);
|
|
554 |
win->Invalidate();
|
|
555 |
TheClient->WaitForRedrawsToFinish();
|
|
556 |
}
|
|
557 |
iWindows.Insert(win,0);
|
|
558 |
CheckDisplay();
|
|
559 |
group->GroupWin()->SetOrdinalPosition(1);
|
|
560 |
iWindows.Remove(0);
|
|
561 |
CheckDisplay();
|
|
562 |
group->GroupWin()->SetOrdinalPosition(0);
|
|
563 |
iWindows.Insert(win,0);
|
|
564 |
CheckDisplay();
|
|
565 |
iWindows.Remove(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);
|
|
568 |
CheckDisplay();
|
|
569 |
}
|
|
570 |
|
|
571 |
void CTMultipleTrans::FadeTranWin()
|
|
572 |
{
|
|
573 |
// system fade on
|
|
574 |
TheClient->iWs.SetSystemFaded(ETrue);
|
|
575 |
// system fade off
|
|
576 |
TheClient->iWs.SetSystemFaded(EFalse);
|
|
577 |
CheckDisplay();
|
|
578 |
}
|
|
579 |
|
|
580 |
void CTMultipleTrans::StartShadows()
|
|
581 |
{
|
|
582 |
iShadows=ETrue;
|
|
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)
|
|
592 |
{
|
|
593 |
iTopRight->ToggleVisibility(); // In 8.1 this isn't needed.
|
|
594 |
iTopRight->ToggleVisibility();
|
|
595 |
}
|
|
596 |
CheckDisplay();
|
|
597 |
}
|
|
598 |
|
|
599 |
void CTMultipleTrans::ShadowsOnOff()
|
|
600 |
{
|
|
601 |
if(!iOpacitySupported)
|
|
602 |
return; // In 8.1 this isn't needed.
|
|
603 |
iBotRight->SetShadowDisabled(EFalse);
|
|
604 |
iBotRight->AdjustShadow(1);
|
|
605 |
CheckDisplay();
|
|
606 |
iBotRight->SetShadowDisabled(ETrue);
|
|
607 |
CheckDisplay();
|
|
608 |
iTopLeft->SetShadowDisabled(EFalse);
|
|
609 |
iTopLeft->AdjustShadow(1);
|
|
610 |
CheckDisplay();
|
|
611 |
iTopLeft->SetShadowDisabled(ETrue);
|
|
612 |
CheckDisplay();
|
|
613 |
iTopRight->SetShadowDisabled(ETrue);
|
|
614 |
CheckDisplay();
|
|
615 |
iBotLeft->SetShadowDisabled(EFalse);
|
|
616 |
iBotLeft->AdjustShadow(1);
|
|
617 |
CheckDisplay();
|
|
618 |
iBotLeft->SetShadowDisabled(ETrue);
|
|
619 |
CheckDisplay();
|
|
620 |
iTopLeft->SetShadowDisabled(EFalse);
|
|
621 |
iTopRight->SetShadowDisabled(EFalse);
|
|
622 |
iBotLeft->SetShadowDisabled(EFalse);
|
|
623 |
iBotRight->SetShadowDisabled(EFalse);
|
|
624 |
iTopLeft->ToggleVisibility();
|
|
625 |
CheckDisplay();
|
|
626 |
iTopLeft->ToggleVisibility();
|
|
627 |
CheckDisplay();
|
|
628 |
iTopRight->ToggleVisibility();
|
|
629 |
CheckDisplay();
|
|
630 |
iTopRight->ToggleVisibility();
|
|
631 |
CheckDisplay();
|
|
632 |
iBotLeft->ToggleVisibility();
|
|
633 |
CheckDisplay();
|
|
634 |
iBotLeft->ToggleVisibility();
|
|
635 |
CheckDisplay();
|
|
636 |
iBotRight->ToggleVisibility();
|
|
637 |
CheckDisplay();
|
|
638 |
iBotRight->ToggleVisibility();
|
|
639 |
CheckDisplay();
|
|
640 |
}
|
|
641 |
|
|
642 |
void CTMultipleTrans::StartChildL()
|
|
643 |
{
|
|
644 |
CTransWindow* win;
|
|
645 |
TInt windows=iWindows.Count();
|
|
646 |
TInt window;
|
|
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)
|
|
649 |
{
|
|
650 |
win=iWindows[0];
|
|
651 |
iWindows.Remove(0);
|
|
652 |
delete win;
|
|
653 |
}
|
|
654 |
RecreateWindowsL(iBackgroundWin);
|
|
655 |
CheckDisplay();
|
|
656 |
}
|
|
657 |
|
|
658 |
void CTMultipleTrans::StartChild2L()
|
|
659 |
{
|
|
660 |
CTransWindow* win;
|
|
661 |
TInt windows=iWindows.Count();
|
|
662 |
TInt window;
|
|
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)
|
|
665 |
{
|
|
666 |
win=iWindows[0];
|
|
667 |
iWindows.Remove(0);
|
|
668 |
delete win;
|
|
669 |
}
|
|
670 |
iShadows=EFalse;
|
|
671 |
TRect rect=WinSize;
|
|
672 |
rect.Shrink(10,10);
|
|
673 |
iBotRight=CTransWindow::NewL(iBackgroundWin,KBlue,rect,&DisplayMode);
|
|
674 |
iBotRight->CTWin::DrawNow();
|
|
675 |
iWindows.Insert(iBotRight,0);
|
|
676 |
CheckDisplay();
|
|
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);
|
|
682 |
CheckDisplay();
|
|
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);
|
|
688 |
CheckDisplay();
|
|
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);
|
|
694 |
if(iMajorTest==1)
|
|
695 |
{
|
|
696 |
for (TInt window = 0; window < iWindows.Count(); ++window)
|
|
697 |
{
|
|
698 |
iWindows[window]->SetDrawOpaque(ETrue);
|
|
699 |
iWindows[window]->Invalidate();
|
|
700 |
}
|
|
701 |
TheClient->WaitForRedrawsToFinish();
|
|
702 |
}
|
|
703 |
CheckDisplay();
|
|
704 |
}
|
|
705 |
|
|
706 |
void CTMultipleTrans::RecreateWindowsL(CTWinBase *aParent)
|
|
707 |
{
|
|
708 |
CTransWindow* win;
|
|
709 |
TInt windows=iWindows.Count();
|
|
710 |
TInt window;
|
|
711 |
//Delete existing windows:
|
|
712 |
for (window=windows;window>0;--window)
|
|
713 |
{
|
|
714 |
win=iWindows[0];
|
|
715 |
iWindows.Remove(0);
|
|
716 |
delete win;
|
|
717 |
}
|
|
718 |
|
|
719 |
if(!aParent)
|
|
720 |
aParent = TheClient->iGroup;
|
|
721 |
|
|
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);
|
|
734 |
iShadows=EFalse;
|
|
735 |
|
|
736 |
if(iMajorTest==1)
|
|
737 |
{
|
|
738 |
for (TInt window=0;window<iWindows.Count();++window)
|
|
739 |
{
|
|
740 |
iWindows[window]->SetDrawOpaque(ETrue);
|
|
741 |
iWindows[window]->Invalidate();
|
|
742 |
}
|
|
743 |
TheClient->WaitForRedrawsToFinish();
|
|
744 |
}
|
|
745 |
}
|
|
746 |
|
|
747 |
void CTMultipleTrans::RunTestCaseL(TInt /*aCurTestCase*/)
|
|
748 |
{
|
|
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);
|
|
764 |
|
|
765 |
switch(iTest->iState)
|
|
766 |
{
|
|
767 |
case 0:
|
|
768 |
/**
|
|
769 |
@SYMTestCaseID GRAPHICS-WSERV-0500
|
|
770 |
*/
|
|
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)
|
|
775 |
{
|
|
776 |
LOG_MESSAGE(_L("Transparency is not supported\n"));
|
|
777 |
TestComplete();
|
|
778 |
return;
|
|
779 |
}
|
|
780 |
++iTest->iState; //Fall Through
|
|
781 |
/**
|
|
782 |
@SYMTestCaseID GRAPHICS-WSERV-0111
|
|
783 |
|
|
784 |
@SYMDEF DEF081259
|
|
785 |
|
|
786 |
@SYMTestCaseDesc Simple transparent windows test.
|
|
787 |
|
|
788 |
@SYMTestPriority High
|
|
789 |
|
|
790 |
@SYMTestStatus Implemented
|
|
791 |
|
|
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.
|
|
795 |
|
|
796 |
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
|
|
797 |
*/
|
|
798 |
case 1:
|
|
799 |
((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0111"));
|
|
800 |
iTest->LogSubTest(KSimple);
|
|
801 |
SimpleTest();
|
|
802 |
break;
|
|
803 |
/**
|
|
804 |
@SYMTestCaseID GRAPHICS-WSERV-0112
|
|
805 |
|
|
806 |
@SYMDEF DEF081259
|
|
807 |
|
|
808 |
@SYMTestCaseDesc On/off switching of visibility of transparent windows
|
|
809 |
|
|
810 |
@SYMTestPriority High
|
|
811 |
|
|
812 |
@SYMTestStatus Implemented
|
|
813 |
|
|
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.
|
|
818 |
|
|
819 |
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
|
|
820 |
*/
|
|
821 |
case 2:
|
|
822 |
case 23:
|
|
823 |
case 42:
|
|
824 |
((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0112"));
|
|
825 |
iTest->LogSubTest(KVisibility);
|
|
826 |
ChangeVisibility();
|
|
827 |
break;
|
|
828 |
/**
|
|
829 |
@SYMTestCaseID GRAPHICS-WSERV-0113
|
|
830 |
|
|
831 |
@SYMDEF DEF081259
|
|
832 |
|
|
833 |
@SYMTestCaseDesc On/off switching of visibility of a small transparent window on top of existing transparent windows
|
|
834 |
|
|
835 |
@SYMTestPriority High
|
|
836 |
|
|
837 |
@SYMTestStatus Implemented
|
|
838 |
|
|
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.
|
|
844 |
|
|
845 |
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
|
|
846 |
*/
|
|
847 |
case 3:
|
|
848 |
((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0113"));
|
|
849 |
iTest->LogSubTest(KVisibility2);
|
|
850 |
ChangeVisibility2();
|
|
851 |
break;
|
|
852 |
/**
|
|
853 |
@SYMTestCaseID GRAPHICS-WSERV-0114
|
|
854 |
|
|
855 |
@SYMDEF DEF081259
|
|
856 |
|
|
857 |
@SYMTestCaseDesc Ordinal positions' switches of intersecting transparent windows
|
|
858 |
|
|
859 |
@SYMTestPriority High
|
|
860 |
|
|
861 |
@SYMTestStatus Implemented
|
|
862 |
|
|
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.
|
|
867 |
|
|
868 |
|
|
869 |
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
|
|
870 |
*/
|
|
871 |
case 4:
|
|
872 |
case 43:
|
|
873 |
((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0114"));
|
|
874 |
iTest->LogSubTest(KOrdinal);
|
|
875 |
OrdinalPos();
|
|
876 |
break;
|
|
877 |
/**
|
|
878 |
@SYMTestCaseID GRAPHICS-WSERV-0115
|
|
879 |
|
|
880 |
@SYMDEF DEF081259
|
|
881 |
|
|
882 |
@SYMTestCaseDesc Changing sizes of intersecting transparent windows
|
|
883 |
|
|
884 |
@SYMTestPriority High
|
|
885 |
|
|
886 |
@SYMTestStatus Implemented
|
|
887 |
|
|
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.
|
|
893 |
|
|
894 |
|
|
895 |
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
|
|
896 |
*/
|
|
897 |
case 5:
|
|
898 |
case 24:
|
|
899 |
((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0115"));
|
|
900 |
iTest->LogSubTest(KSizeChange);
|
|
901 |
SizeChange();
|
|
902 |
break;
|
|
903 |
/**
|
|
904 |
@SYMTestCaseID GRAPHICS-WSERV-0116
|
|
905 |
|
|
906 |
@SYMDEF DEF081259
|
|
907 |
|
|
908 |
@SYMTestCaseDesc Moving intersecting transparent windows
|
|
909 |
|
|
910 |
@SYMTestPriority High
|
|
911 |
|
|
912 |
@SYMTestStatus Implemented
|
|
913 |
|
|
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.
|
|
919 |
|
|
920 |
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
|
|
921 |
*/
|
|
922 |
case 6:
|
|
923 |
((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0116"));
|
|
924 |
iTest->LogSubTest(KMoveWin);
|
|
925 |
MoveWin();
|
|
926 |
break;
|
|
927 |
/**
|
|
928 |
@SYMTestCaseID GRAPHICS-WSERV-0117
|
|
929 |
|
|
930 |
@SYMDEF DEF081259
|
|
931 |
|
|
932 |
@SYMTestCaseDesc Test with a second window group
|
|
933 |
|
|
934 |
@SYMTestPriority High
|
|
935 |
|
|
936 |
@SYMTestStatus Implemented
|
|
937 |
|
|
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.
|
|
946 |
|
|
947 |
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
|
|
948 |
*/
|
|
949 |
case 7:
|
|
950 |
((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0117"));
|
|
951 |
iTest->LogSubTest(KGroupWin);
|
|
952 |
GroupWinL();
|
|
953 |
break;
|
|
954 |
case 8:
|
|
955 |
((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
|
|
956 |
iTest->LogSubTest(KBackground);
|
|
957 |
//Change the background color of the 4 test windows and the window behind them
|
|
958 |
break;
|
|
959 |
/**
|
|
960 |
@SYMTestCaseID GRAPHICS-WSERV-0118
|
|
961 |
|
|
962 |
@SYMDEF DEF081259
|
|
963 |
|
|
964 |
@SYMTestCaseDesc On/off switching of fading
|
|
965 |
|
|
966 |
@SYMTestPriority High
|
|
967 |
|
|
968 |
@SYMTestStatus Implemented
|
|
969 |
|
|
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
|
|
973 |
after that.
|
|
974 |
The test does nothing if transparency is not enabled on the screen.
|
|
975 |
|
|
976 |
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
|
|
977 |
*/
|
|
978 |
case 9:
|
|
979 |
((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0118"));
|
|
980 |
iTest->LogSubTest(KTranWinFade);
|
|
981 |
FadeTranWin();
|
|
982 |
break;
|
|
983 |
case 10:
|
|
984 |
((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
|
|
985 |
iTest->iState=21-1;
|
|
986 |
break;
|
|
987 |
/**
|
|
988 |
@SYMTestCaseID GRAPHICS-WSERV-0120
|
|
989 |
|
|
990 |
@SYMDEF DEF081259
|
|
991 |
|
|
992 |
@SYMTestCaseDesc Shadows' on/off test.
|
|
993 |
|
|
994 |
@SYMTestPriority High
|
|
995 |
|
|
996 |
@SYMTestStatus Implemented
|
|
997 |
|
|
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.
|
|
1004 |
|
|
1005 |
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
|
|
1006 |
*/
|
|
1007 |
case 22:
|
|
1008 |
((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0120"));
|
|
1009 |
iTest->LogSubTest(KShadowsOnOff);
|
|
1010 |
ShadowsOnOff();
|
|
1011 |
break;
|
|
1012 |
case 25:
|
|
1013 |
((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
|
|
1014 |
iTest->iState=41-1;
|
|
1015 |
break;
|
|
1016 |
/**
|
|
1017 |
@SYMTestCaseID GRAPHICS-WSERV-0121
|
|
1018 |
|
|
1019 |
@SYMDEF DEF081259
|
|
1020 |
|
|
1021 |
@SYMTestCaseDesc Transparent child-windows of a bacground window
|
|
1022 |
|
|
1023 |
@SYMTestPriority High
|
|
1024 |
|
|
1025 |
@SYMTestStatus Implemented
|
|
1026 |
|
|
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.
|
|
1032 |
|
|
1033 |
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
|
|
1034 |
*/
|
|
1035 |
case 41:
|
|
1036 |
((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0121"));
|
|
1037 |
iTest->LogSubTest(KChild1);
|
|
1038 |
StartChildL();
|
|
1039 |
break;
|
|
1040 |
case 44:
|
|
1041 |
((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
|
|
1042 |
iTest->iState=61-1;
|
|
1043 |
break;
|
|
1044 |
/**
|
|
1045 |
@SYMTestCaseID GRAPHICS-WSERV-0122
|
|
1046 |
|
|
1047 |
@SYMDEF DEF081259
|
|
1048 |
|
|
1049 |
@SYMTestCaseDesc
|
|
1050 |
|
|
1051 |
@SYMTestPriority High
|
|
1052 |
|
|
1053 |
@SYMTestStatus Implemented
|
|
1054 |
|
|
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.
|
|
1061 |
|
|
1062 |
@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
|
|
1063 |
*/
|
|
1064 |
case 61:
|
|
1065 |
((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0122"));
|
|
1066 |
iTest->LogSubTest(KChild2);
|
|
1067 |
StartChild2L();
|
|
1068 |
break;
|
|
1069 |
default:
|
|
1070 |
((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0123"));
|
|
1071 |
/**
|
|
1072 |
@SYMTestCaseID GRAPHICS-WSERV-0123
|
|
1073 |
|
|
1074 |
@SYMDEF DEF081259
|
|
1075 |
|
|
1076 |
@SYMTestCaseDesc
|
|
1077 |
|
|
1078 |
@SYMTestPriority High
|
|
1079 |
|
|
1080 |
@SYMTestStatus Implemented
|
|
1081 |
|
|
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.
|
|
1086 |
|
|
1087 |
@SYMTestExpectedResults Expects that all tests will obtain results they expected.
|
|
1088 |
*/
|
|
1089 |
if (iMajorTest==1 || !iOpacitySupported)
|
|
1090 |
{
|
|
1091 |
if (!iOpacitySupported)
|
|
1092 |
{
|
|
1093 |
_LIT(KNoOpacity,"Opacity is not supported");
|
|
1094 |
LOG_MESSAGE(KNoOpacity);
|
|
1095 |
}
|
|
1096 |
((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
|
|
1097 |
TestComplete();
|
|
1098 |
return;
|
|
1099 |
}
|
|
1100 |
LOG_MESSAGE(KOpacity);
|
|
1101 |
iTest->iState=0;
|
|
1102 |
iMajorTest=1;
|
|
1103 |
RecreateWindowsL();
|
|
1104 |
break;
|
|
1105 |
}
|
|
1106 |
((CTMultipleTransStep*)iStep)->RecordTestResultL();
|
|
1107 |
++iTest->iState;
|
|
1108 |
}
|
|
1109 |
|
|
1110 |
|
|
1111 |
__WS_CONSTRUCT_STEP__(MultipleTrans)
|