windowing/windowserver/nga/SERVER/openwfc/winbase.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) 2006-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:
// CWsWindowBase and associated classes definitions
// 
//

#ifndef __WINBASE_H__
#define __WINBASE_H__

#include "server.h"

class TWalkWindowTreeBase;
class TResumableWalkWindowTreeBase;
class CWsAnim;
class CWsSprite;
class CWsBlankWindow;

/** The base class that represents a node in the window tree.

Every window and window group is part of a window tree. The root of the tree is an instance of the
CWsRootWindow class.

@see RWindowTreeNode
@internalComponent
@released
*/
class CWsWindowBase : public CWsScreenObject, public MWsWindowTreeNode
	{
public:
	CWsWindowBase(CWsClient *aOwner,WH_HANDLES aType, CScreen* aScreen);
	void ConstructL(CWsWindowBase *aParent);
	virtual void AreaCovered(TRegion &aRegion)=0;
	virtual TPoint Origin() const = 0;
	virtual TRect AbsRect() const = 0;
	virtual TSize Size() const = 0;
	CWsWindowGroup *WinGroup() const;
	inline TUint32 ClientHandle() const;
	inline CWsWindowBase *BaseParent() const;
	inline CWsWindowBase *BaseChild() const;
	inline CWsWindowBase *NextSibling() const;
	CWsWindowBase *GetPrevSibling() const;
	CWsWindowBase *LastSibling() const;
	CWsWindowBase *PrevSiblingMultiParent() const;
	CWsWindowBase *NextSiblingMultiParent() const;
	inline TWinType WinType() const;
	virtual void StatusDump(TDes &aBuf)=0;
	TBool QueueEvent(TInt aEvent, TInt aIntVal = 0) const;
	inline TBool AdvancedPointersEnabled() const;
	inline CWsPointerCursor *PointerCursor() const;
	TEventQueueWalkRet EventPurgeCheck(TWsEvent *aEvent);
	virtual void SetOrdinalPosition(TInt aPos);
	TBool TreeIsObscured() const;
	CEventQueue *EventQueue() const;
	TInt Depth() const;
	void WalkWindowTree(TWalkWindowTreeBase &doIt,TWalkMode aMode);
	void WalkWindowTree(TResumableWalkWindowTreeBase& aWalkClass, TWalkMode aMode, TBool aResume);
	void WalkWindowTreeBackToFront(TWalkWindowTreeBase &doIt, TWalkModeBackToFront aMode);
	void PurgeEvents();
	inline TInt FadeCount() const;
  void AddSprite(CWsSpriteBase * aSprite);
  void RemoveSprite(CWsSpriteBase * aSprite);
	inline TBool HasSprite() const;
	virtual TBool IsDSAHost() const;
	virtual void SendState(MWsWindowTreeObserver& aWindowTreeObserver) const;
	
public:	// from CWsObject
	TBool CommandL(TInt aOpcode, TWsWinCmdUnion &aCmd);
	
public: // from MWsWindowTreeNode
	MWsWindowTreeNode::TType NodeType() const;
	const MWsWindow* Window() const;
	const MWsSprite* Sprite() const;
	const MWsStandardTextCursor* StandardTextCursor() const;
	const MWsWindowGroup* WindowGroup() const;
	const MWsWindowTreeNode* ParentNode() const;	
	
protected:
	TInt OrdinalPosition(TBool aFull) const;
	TBool CheckOrdinalPositionChange(TInt aPos);
	virtual void Shutdown();	// Part of two phase destruction
	void SetPointerCursor(CWsPointerCursor *aCursor);
	void SetPointerCursorByIndex(TInt aIndex);
	void ChangeWindowPosition(TInt aPos,CWsWindowBase* aNewParent);

private:
	void RemoveFromSiblingList();
	virtual TBool IsActivated() const;

public:	
	CWsSpriteBase *iSpriteList; // Start of linked list of sprites attached to the window		
	
protected:
	enum TBaseWinFlags
		{
		EBaseWinAdvancedPointersEnabled = 0x00000001,
		EBaseWinNodeCreated				= 0x00000002,
		};
	
	CWsWindowBase *iParent;
	CWsWindowBase *iSibling;
	CWsWindowBase *iChild;
	/** The handle specified by the client when the object was created.
	
	This is different from CWsObject::iWsOwner which is the handle assigned to the object by the server.
	@see CWsObject::iWsOwner
	*/
	TUint32 iClientHandle;
	TInt iOrdinalPriority;
	TWinType iWinType;
	TInt iFadeCount;
	TUint iBaseWinFlags;

private:
	CWsPointerCursor *iPointerCursor;
	
#if defined(_DEBUG)
public:
	void CheckTree();
	TBool IsClientHandleInUse(TUint32 aHandle);
#endif
	};
	
inline TWinType CWsWindowBase::WinType() const
	{
	return iWinType;
	}

inline CWsPointerCursor *CWsWindowBase::PointerCursor() const
	{
	return iPointerCursor;
	}

inline CWsWindowBase *CWsWindowBase::NextSibling() const
	{
	return iSibling;
	}

inline CWsWindowBase *CWsWindowBase::BaseChild() const
	{
	return iChild;
	}

inline CWsWindowBase *CWsWindowBase::BaseParent() const
	{
	return iParent;
	}

inline TUint32 CWsWindowBase::ClientHandle() const
	{
	return iClientHandle;
	}

inline TInt CWsWindowBase::FadeCount() const
	{
	return iFadeCount;
	}

inline TBool CWsWindowBase::AdvancedPointersEnabled() const
	{
	return iBaseWinFlags&EBaseWinAdvancedPointersEnabled;
	}

inline TBool CWsWindowBase::HasSprite() const
	{
	return (NULL != iSpriteList);
	}

#endif