os/graphics/windowing/windowserver/test/t_stress/inc/compwin.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200 (2014-06-10)
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 COMPWIN_H
sl@0
    23
#define COMPWIN_H
sl@0
    24
sl@0
    25
#include <w32std.h>
sl@0
    26
#include "test_step_conf.h"
sl@0
    27
sl@0
    28
//common configuration parameter names
sl@0
    29
_LIT(KT_WservStressParamEnabled, "enabled");
sl@0
    30
_LIT(KT_WservStressParamTransparent, "transparent");
sl@0
    31
_LIT(KT_WservStressParamRandomizeAlpha, "randomize_alpha");
sl@0
    32
_LIT(KT_WservStressParamRandomizePenStyle, "randomize_pen_style");
sl@0
    33
_LIT(KT_WservStressParamRandomizeBrushStyle, "randomize_brush_style");
sl@0
    34
_LIT(KT_WservStressParamTransparentForegroundWindow, "transparent_foreground_window");
sl@0
    35
sl@0
    36
sl@0
    37
/*******************************************************************************
sl@0
    38
Base class for all windows in this test.
sl@0
    39
*******************************************************************************/
sl@0
    40
_LIT8(KCommonWindowType, "Common");
sl@0
    41
class CCompWin : public CBase
sl@0
    42
	{
sl@0
    43
public:
sl@0
    44
	static CCompWin* NewLC(RWsSession& aWs, RWindowGroup* aGroup, CCompWin* aParent, CWindowGc& aGc);
sl@0
    45
	static void LoadConfiguration(const MTestStepConfigurationContext* aContext);
sl@0
    46
	~CCompWin();
sl@0
    47
	
sl@0
    48
	TInt NumChildren() { return iChildren.Count(); }
sl@0
    49
	RDrawableWindow * Window() { return iWindow; }
sl@0
    50
	const TSize Size() const { return iSize; }
sl@0
    51
	const TPoint Pos() const { return iPos; }
sl@0
    52
	virtual void SetPos(const TPoint & aPos);
sl@0
    53
	virtual void SetSize(const TSize & aSize);
sl@0
    54
	CCompWin * CCompWin::RandomWindow();
sl@0
    55
	void AddChildL(CCompWin* aChild);
sl@0
    56
	void RemoveChild(CCompWin* aChild);
sl@0
    57
	void HandleRedraw(TWsRedrawEvent& aEvent);
sl@0
    58
	void SendToBackL();
sl@0
    59
	void BringToFrontL();
sl@0
    60
	void Dump(RFile & aFile, TPoint & aOrigin, TInt aDepth, CCompWin * aMark);
sl@0
    61
	virtual void DumpDetails(RFile & aFile, TInt aDepth);
sl@0
    62
	virtual void Redraw(const TRect& aRect) = 0;
sl@0
    63
	virtual void DrawBitmap(CFbsBitGc* aGc, TRect& aClip, TPoint& aOrigin);
sl@0
    64
	virtual void ClearBitmapBackground(CFbsBitGc* aGc, TRect& aClip, TPoint& aOrigin);
sl@0
    65
	virtual const TDesC8& TypeName() { return KCommonWindowType; }
sl@0
    66
	//If a window has been modified in TickL it should return ETrue
sl@0
    67
	virtual TBool TickL() { return EFalse; }
sl@0
    68
	virtual void ToggleVisible();
sl@0
    69
	virtual TBool QueryReadyForVerification();
sl@0
    70
	virtual void SubSelfFromRegion(TRegion& aRegion, const TRect& aClip, const TPoint& aOrigin);
sl@0
    71
	virtual TRgb BackgroundColor() { return TRgb(0, sBackgroundAlpha); }
sl@0
    72
	TBool IsVisible() { return iVisible; }
sl@0
    73
	void SetVerifyTick(TUint32 aTick);
sl@0
    74
	
sl@0
    75
protected:
sl@0
    76
	CCompWin(RWsSession& aWs, RWindowGroup* aGroup, CCompWin* aParent, CWindowGc& aGc);
sl@0
    77
	void PreConstructL(TBool aTransparency = ETrue, TBool aBackedup = EFalse);
sl@0
    78
	void PostConstructL();
sl@0
    79
	static CGraphicsContext::TDrawMode GetRandomDrawMode();
sl@0
    80
	static CGraphicsContext::TPenStyle GetRandomPenStyle();
sl@0
    81
	static CGraphicsContext::TBrushStyle GetRandomBrushStyle();
sl@0
    82
protected:
sl@0
    83
	static TInt sBackgroundAlpha;
sl@0
    84
	RWsSession& iWs;
sl@0
    85
	RWindowGroup* iGroup;
sl@0
    86
	CCompWin* iParent;
sl@0
    87
	CWindowGc& iWsGc;
sl@0
    88
	RDrawableWindow* iWindow;
sl@0
    89
	RWindow* iRedrawWindow;
sl@0
    90
	RBackedUpWindow* iBackedupWindow;
sl@0
    91
	RPointerArray<CCompWin> iChildren;
sl@0
    92
	TPoint iPos;
sl@0
    93
	TSize iSize;
sl@0
    94
	TBool iVisible;
sl@0
    95
	TUint32 iVerifyTick;
sl@0
    96
	};
sl@0
    97
sl@0
    98
#endif // COMPWIN_H