windowing/windowserver/test/t_stress/inc/compwin.h
author William Roberts <williamr@symbian.org>
Thu, 03 Jun 2010 17:39:46 +0100
branchNewGraphicsArchitecture
changeset 87 0709f76d91e5
parent 0 5d03bc08d59c
permissions -rw-r--r--
Add MMP files to build libOpenVG_sw.lib which uses LINKAS to redirect to libOpenVG.dll (and the same for libEGL_sw.lib and libOpenVGU_sw.lib). Only the libEGL_sw.lib redirection isn't activated - this can't happen until there is a merged libEGL.dll which supports the OpenWF synchronisation and also implements the graphical support functions. The overall aim is to eliminate the *_sw.dll implementations, at least as a compile-time way of choosing a software-only implementation.The correct way to choose is to put the right set of libraries into a ROM with suitable renaming, and in the emulator to use the "switching DLL" technique to pick the right set. As the Symbian Foundation doesn't have any alternative implementations, we don't need the switching DLLs and we can build directly to the correct name.

// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//

/**
 @file
 @test
 @internalComponent
*/

#ifndef COMPWIN_H
#define COMPWIN_H

#include <w32std.h>
#include "test_step_conf.h"

//common configuration parameter names
_LIT(KT_WservStressParamEnabled, "enabled");
_LIT(KT_WservStressParamTransparent, "transparent");
_LIT(KT_WservStressParamRandomizeAlpha, "randomize_alpha");
_LIT(KT_WservStressParamRandomizePenStyle, "randomize_pen_style");
_LIT(KT_WservStressParamRandomizeBrushStyle, "randomize_brush_style");
_LIT(KT_WservStressParamTransparentForegroundWindow, "transparent_foreground_window");


/*******************************************************************************
Base class for all windows in this test.
*******************************************************************************/
_LIT8(KCommonWindowType, "Common");
class CCompWin : public CBase
	{
public:
	static CCompWin* NewLC(RWsSession& aWs, RWindowGroup* aGroup, CCompWin* aParent, CWindowGc& aGc);
	static void LoadConfiguration(const MTestStepConfigurationContext* aContext);
	~CCompWin();
	
	TInt NumChildren() { return iChildren.Count(); }
	RDrawableWindow * Window() { return iWindow; }
	const TSize Size() const { return iSize; }
	const TPoint Pos() const { return iPos; }
	virtual void SetPos(const TPoint & aPos);
	virtual void SetSize(const TSize & aSize);
	CCompWin * CCompWin::RandomWindow();
	void AddChildL(CCompWin* aChild);
	void RemoveChild(CCompWin* aChild);
	void HandleRedraw(TWsRedrawEvent& aEvent);
	void SendToBackL();
	void BringToFrontL();
	void Dump(RFile & aFile, TPoint & aOrigin, TInt aDepth, CCompWin * aMark);
	virtual void DumpDetails(RFile & aFile, TInt aDepth);
	virtual void Redraw(const TRect& aRect) = 0;
	virtual void DrawBitmap(CFbsBitGc* aGc, TRect& aClip, TPoint& aOrigin);
	virtual void ClearBitmapBackground(CFbsBitGc* aGc, TRect& aClip, TPoint& aOrigin);
	virtual const TDesC8& TypeName() { return KCommonWindowType; }
	//If a window has been modified in TickL it should return ETrue
	virtual TBool TickL() { return EFalse; }
	virtual void ToggleVisible();
	virtual TBool QueryReadyForVerification();
	virtual void SubSelfFromRegion(TRegion& aRegion, const TRect& aClip, const TPoint& aOrigin);
	virtual TRgb BackgroundColor() { return TRgb(0, sBackgroundAlpha); }
	TBool IsVisible() { return iVisible; }
	void SetVerifyTick(TUint32 aTick);
	
protected:
	CCompWin(RWsSession& aWs, RWindowGroup* aGroup, CCompWin* aParent, CWindowGc& aGc);
	void PreConstructL(TBool aTransparency = ETrue, TBool aBackedup = EFalse);
	void PostConstructL();
	static CGraphicsContext::TDrawMode GetRandomDrawMode();
	static CGraphicsContext::TPenStyle GetRandomPenStyle();
	static CGraphicsContext::TBrushStyle GetRandomBrushStyle();
protected:
	static TInt sBackgroundAlpha;
	RWsSession& iWs;
	RWindowGroup* iGroup;
	CCompWin* iParent;
	CWindowGc& iWsGc;
	RDrawableWindow* iWindow;
	RWindow* iRedrawWindow;
	RBackedUpWindow* iBackedupWindow;
	RPointerArray<CCompWin> iChildren;
	TPoint iPos;
	TSize iSize;
	TBool iVisible;
	TUint32 iVerifyTick;
	};

#endif // COMPWIN_H