Update contrib.
1 // Copyright (c) 2008-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.
29 _LIT8(KSpritedWindowType, "Sprited");
31 class CSpritedWin : public CCompWin
34 static CSpritedWin* NewLC(RWsSession& aWs, RWindowGroup* aGroup, CCompWin* aParent, CWindowGc& aGc);
35 static void LoadConfiguration(const MTestStepConfigurationContext* aContext);
36 static TBool IsEnabled() { return iEnabled; }
40 void Redraw(const TRect& aRect);
41 void DrawBitmap(CFbsBitGc* aGc, TRect& aClip, TPoint& aOrigin);
42 void ClearBitmapBackground(CFbsBitGc* aGc, TRect& aClip, TPoint& aOrigin);
43 void SetSize(const TSize & aSize);
44 void SetPos(const TPoint & aPos);
45 virtual const TDesC8& TypeName() { return KSpritedWindowType; }
46 void DumpDetails(RFile & aFile, TInt aDepth);
49 CSpritedWin(RWsSession& aWs, RWindowGroup* aGroup, CCompWin* aParent, CWindowGc& aGc);
53 TBool QueryReadyForVerification();
56 static TBool iEnabled;
57 static TBool iTransparent;
58 static TBool iRandomizePenStyle;
59 static TBool iRandomizeBrushStyle;
60 static TBool iRandomizeDrawMode;
61 static TBool iTransparentForegroundWindow;
62 static TInt iMaxRandomStepX;
63 static TInt iMaxRandomStepY;
64 static TInt iMaxRandomOffsetX;
65 static TInt iMaxRandomOffsetY;
72 ESpriteSzXHalf = ESpriteSzX / 2,
73 ESpriteSzYHalf = ESpriteSzY / 2,
74 EStepWidth = ESpriteSzXHalf / (ENofSlides+1),
75 EStepHeight = ESpriteSzYHalf / (ENofSlides+1),
76 ESlideDurMult = 100000, //duration multiplier (microseconds)
77 ESlideDurMaxTenthSec = 15, //max random sprite frame duration
78 EFrameBorderSenseMs = 10000
82 CFbsBitmap* iSpriteContent [ENofSlides];
83 CFbsBitmap* iSpriteMask [ENofSlides];
84 CFbsBitmapDevice* iSpriteCntDevice [ENofSlides];
85 CFbsBitmapDevice* iSpriteMskDevice [ENofSlides];
86 struct TSpriteMember iSpriteDef [ENofSlides];
90 CGraphicsContext::TPenStyle iPenStyle;
91 CGraphicsContext::TBrushStyle iBrushStyle;
92 CGraphicsContext::TDrawMode iDrawMode;
94 TTimeIntervalMicroSeconds32
95 iSlideDuration; //duration for a single slide in microseconds
97 TUint32 iSpriteStartup; //time (in ticks) when sprite was activated
98 TInt iKernelTicksPeriod; //microseconds per tick
99 RBlankWindow* iForeWin; //transparent foreground window
103 #endif // SPRITEWIN_H