diff -r 000000000000 -r 5d03bc08d59c windowing/windowserver/nonnga/SERVER/wsfont.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/windowing/windowserver/nonnga/SERVER/wsfont.h Tue Feb 02 01:47:50 2010 +0200 @@ -0,0 +1,92 @@ +// Copyright (c) 2007-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: +// FONT related classes and font cache +// +// + +#ifndef __WSFONT_H__ +#define __WSFONT_H__ + +#include +#include +#include "w32cmd.h" +#include +#include +#include +#include "OBJECT.H" +#include "CLIENT.H" +#include "server.h" + +class CWsAnim; + +class CAnimFbsFont : public CFbsBitGcFont + { + friend class CWsAnim; +public: + static CAnimFbsFont* NewL(TInt aHandle,TInt& aError); + void Open(); + void Close(); + inline TInt Duplicate(TInt aHandle); +private: + CAnimFbsFont(); + ~CAnimFbsFont(); +private: + TInt iAccessCount; + }; + +class CWsFontCache; + +class CWsFbsFont : public CFbsBitGcFont + { +public: + ~CWsFbsFont(); + CWsFbsFont(); + inline TInt Duplicate(TInt aHandle); + inline TInt Handle() const; + inline void Reset(); +public: + TDblQueLink iLink; + TInt iCount; + }; + +class CWsFontCache : public CBase + { + enum {EFontCacheSize=128}; +public: + static void CreateInstanceL(); + static void DestroyInstance(); + static CWsFontCache * Instance() { return iSelf; } + TBool UseFont(CWsFbsFont *&aFont, TInt aHandle); + void ReleaseFont(CWsFbsFont *&aFont); + static TDblQue& List(); +private: + CWsFontCache(); + ~CWsFontCache(); +private: + static CWsFontCache * iSelf; + static TDblQue * iList; + CWsFbsFont iFont[EFontCacheSize]; + }; + +inline TInt CWsFbsFont::Duplicate(TInt aHandle) + {return(CFbsBitGcFont::Duplicate(aHandle));} +inline TInt CWsFbsFont::Handle() const + {return(CFbsBitGcFont::Handle());} +inline void CWsFbsFont::Reset() + {CFbsBitGcFont::Reset();} +// +inline TInt CAnimFbsFont::Duplicate(TInt aHandle) + {return(CFbsFont::Duplicate(aHandle));} + +#endif