os/graphics/windowing/windowserver/test/t_stress/inc/spritewin.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  @file
    18  @test
    19  @internalComponent
    20 */
    21 
    22 #ifndef SPRITEWIN_H
    23 #define SPRITEWIN_H
    24 
    25 #include <w32std.h>
    26 #include "compwin.h"
    27 
    28 
    29 _LIT8(KSpritedWindowType, "Sprited");
    30 
    31 class CSpritedWin : public CCompWin
    32 	{
    33 public:
    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; }
    37 	~CSpritedWin();
    38 	
    39 	// from CCompWin
    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);
    47 	
    48 protected:
    49 	CSpritedWin(RWsSession& aWs, RWindowGroup* aGroup, CCompWin* aParent, CWindowGc& aGc);
    50 	void ConstructL();
    51 	
    52 	// from CCompWin
    53 	TBool QueryReadyForVerification();
    54  
    55 private:
    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;
    66 
    67 	enum TValues
    68 	{
    69 	ENofSlides = 4,
    70 	ESpriteSzX  = 64,
    71 	ESpriteSzY  = 64,
    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
    79 	};
    80 	
    81 	RWsSprite 				iSprite;
    82 	CFbsBitmap* 			iSpriteContent [ENofSlides];
    83 	CFbsBitmap* 			iSpriteMask [ENofSlides];
    84 	CFbsBitmapDevice*		iSpriteCntDevice [ENofSlides];
    85 	CFbsBitmapDevice*		iSpriteMskDevice [ENofSlides];
    86 	struct TSpriteMember 	iSpriteDef [ENofSlides];
    87 	TBool					iConstructed;
    88 	
    89 	TRgb					iBgColor;
    90 	CGraphicsContext::TPenStyle   iPenStyle;
    91 	CGraphicsContext::TBrushStyle iBrushStyle;
    92 	CGraphicsContext::TDrawMode   iDrawMode;	
    93 
    94 	TTimeIntervalMicroSeconds32
    95 							iSlideDuration; //duration for a single slide in microseconds
    96 	
    97 	TUint32 				iSpriteStartup; //time (in ticks) when sprite was activated
    98 	TInt 					iKernelTicksPeriod; //microseconds per tick
    99 	RBlankWindow*  			iForeWin; //transparent foreground window
   100 	};
   101 
   102 
   103 #endif // SPRITEWIN_H