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.
sl@0
     1
// Copyright (c) 2008-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
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @test
sl@0
    19
 @internalComponent
sl@0
    20
*/
sl@0
    21
sl@0
    22
#ifndef SPRITEWIN_H
sl@0
    23
#define SPRITEWIN_H
sl@0
    24
sl@0
    25
#include <w32std.h>
sl@0
    26
#include "compwin.h"
sl@0
    27
sl@0
    28
sl@0
    29
_LIT8(KSpritedWindowType, "Sprited");
sl@0
    30
sl@0
    31
class CSpritedWin : public CCompWin
sl@0
    32
	{
sl@0
    33
public:
sl@0
    34
	static CSpritedWin* NewLC(RWsSession& aWs, RWindowGroup* aGroup, CCompWin* aParent, CWindowGc& aGc);
sl@0
    35
	static void LoadConfiguration(const MTestStepConfigurationContext* aContext);
sl@0
    36
	static TBool IsEnabled() { return iEnabled; }
sl@0
    37
	~CSpritedWin();
sl@0
    38
	
sl@0
    39
	// from CCompWin
sl@0
    40
	void Redraw(const TRect& aRect);
sl@0
    41
	void DrawBitmap(CFbsBitGc* aGc, TRect& aClip, TPoint& aOrigin);
sl@0
    42
	void ClearBitmapBackground(CFbsBitGc* aGc, TRect& aClip, TPoint& aOrigin);
sl@0
    43
	void SetSize(const TSize & aSize);
sl@0
    44
	void SetPos(const TPoint & aPos);
sl@0
    45
	virtual const TDesC8& TypeName() { return KSpritedWindowType; }
sl@0
    46
	void DumpDetails(RFile & aFile, TInt aDepth);
sl@0
    47
	
sl@0
    48
protected:
sl@0
    49
	CSpritedWin(RWsSession& aWs, RWindowGroup* aGroup, CCompWin* aParent, CWindowGc& aGc);
sl@0
    50
	void ConstructL();
sl@0
    51
	
sl@0
    52
	// from CCompWin
sl@0
    53
	TBool QueryReadyForVerification();
sl@0
    54
 
sl@0
    55
private:
sl@0
    56
	static TBool iEnabled;
sl@0
    57
	static TBool iTransparent;
sl@0
    58
	static TBool iRandomizePenStyle;
sl@0
    59
	static TBool iRandomizeBrushStyle;
sl@0
    60
	static TBool iRandomizeDrawMode;
sl@0
    61
	static TBool iTransparentForegroundWindow;
sl@0
    62
	static TInt  iMaxRandomStepX;
sl@0
    63
	static TInt  iMaxRandomStepY;
sl@0
    64
	static TInt  iMaxRandomOffsetX;
sl@0
    65
	static TInt  iMaxRandomOffsetY;
sl@0
    66
sl@0
    67
	enum TValues
sl@0
    68
	{
sl@0
    69
	ENofSlides = 4,
sl@0
    70
	ESpriteSzX  = 64,
sl@0
    71
	ESpriteSzY  = 64,
sl@0
    72
	ESpriteSzXHalf  = ESpriteSzX / 2,
sl@0
    73
	ESpriteSzYHalf  = ESpriteSzY / 2,
sl@0
    74
	EStepWidth		= ESpriteSzXHalf / (ENofSlides+1),
sl@0
    75
	EStepHeight		= ESpriteSzYHalf / (ENofSlides+1),
sl@0
    76
	ESlideDurMult	= 100000,	//duration multiplier (microseconds)
sl@0
    77
	ESlideDurMaxTenthSec = 15,	//max random sprite frame duration
sl@0
    78
	EFrameBorderSenseMs = 10000
sl@0
    79
	};
sl@0
    80
	
sl@0
    81
	RWsSprite 				iSprite;
sl@0
    82
	CFbsBitmap* 			iSpriteContent [ENofSlides];
sl@0
    83
	CFbsBitmap* 			iSpriteMask [ENofSlides];
sl@0
    84
	CFbsBitmapDevice*		iSpriteCntDevice [ENofSlides];
sl@0
    85
	CFbsBitmapDevice*		iSpriteMskDevice [ENofSlides];
sl@0
    86
	struct TSpriteMember 	iSpriteDef [ENofSlides];
sl@0
    87
	TBool					iConstructed;
sl@0
    88
	
sl@0
    89
	TRgb					iBgColor;
sl@0
    90
	CGraphicsContext::TPenStyle   iPenStyle;
sl@0
    91
	CGraphicsContext::TBrushStyle iBrushStyle;
sl@0
    92
	CGraphicsContext::TDrawMode   iDrawMode;	
sl@0
    93
sl@0
    94
	TTimeIntervalMicroSeconds32
sl@0
    95
							iSlideDuration; //duration for a single slide in microseconds
sl@0
    96
	
sl@0
    97
	TUint32 				iSpriteStartup; //time (in ticks) when sprite was activated
sl@0
    98
	TInt 					iKernelTicksPeriod; //microseconds per tick
sl@0
    99
	RBlankWindow*  			iForeWin; //transparent foreground window
sl@0
   100
	};
sl@0
   101
sl@0
   102
sl@0
   103
#endif // SPRITEWIN_H