os/graphics/windowing/windowserver/nonnga/SERVER/wsfont.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) 2007-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
// FONT related classes and font cache
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
#ifndef __WSFONT_H__
sl@0
    19
#define __WSFONT_H__
sl@0
    20
sl@0
    21
#include <e32std.h>
sl@0
    22
#include <w32std.h>
sl@0
    23
#include "w32cmd.h"
sl@0
    24
#include <bitstd.h>
sl@0
    25
#include <bitdev.h>
sl@0
    26
#include <e32svr.h>
sl@0
    27
#include "OBJECT.H"
sl@0
    28
#include "CLIENT.H"
sl@0
    29
#include "server.h"
sl@0
    30
sl@0
    31
class CWsAnim;
sl@0
    32
sl@0
    33
class CAnimFbsFont : public CFbsBitGcFont
sl@0
    34
	{
sl@0
    35
	friend class CWsAnim;
sl@0
    36
public:
sl@0
    37
	static CAnimFbsFont* NewL(TInt aHandle,TInt& aError);
sl@0
    38
	void Open();
sl@0
    39
	void Close();
sl@0
    40
	inline TInt Duplicate(TInt aHandle);
sl@0
    41
private:
sl@0
    42
	CAnimFbsFont();
sl@0
    43
	~CAnimFbsFont();
sl@0
    44
private:
sl@0
    45
	TInt iAccessCount;
sl@0
    46
	};
sl@0
    47
sl@0
    48
class CWsFontCache;
sl@0
    49
sl@0
    50
class CWsFbsFont : public CFbsBitGcFont
sl@0
    51
	{
sl@0
    52
public:
sl@0
    53
	~CWsFbsFont();
sl@0
    54
	CWsFbsFont();
sl@0
    55
	inline TInt Duplicate(TInt aHandle);
sl@0
    56
	inline TInt Handle() const;
sl@0
    57
	inline void Reset();
sl@0
    58
public:
sl@0
    59
	TDblQueLink iLink;
sl@0
    60
	TInt iCount;
sl@0
    61
	};
sl@0
    62
sl@0
    63
class CWsFontCache : public CBase
sl@0
    64
	{
sl@0
    65
	enum {EFontCacheSize=128};
sl@0
    66
public:
sl@0
    67
	static void CreateInstanceL();
sl@0
    68
	static void DestroyInstance();
sl@0
    69
	static CWsFontCache * Instance() { return iSelf; }
sl@0
    70
	TBool UseFont(CWsFbsFont *&aFont, TInt aHandle);
sl@0
    71
	void ReleaseFont(CWsFbsFont *&aFont);
sl@0
    72
	static TDblQue<CWsFbsFont>& List();
sl@0
    73
private:
sl@0
    74
	CWsFontCache();
sl@0
    75
	~CWsFontCache();
sl@0
    76
private:
sl@0
    77
	static CWsFontCache * iSelf;
sl@0
    78
	static TDblQue<CWsFbsFont> * iList;
sl@0
    79
	CWsFbsFont iFont[EFontCacheSize];
sl@0
    80
	};
sl@0
    81
sl@0
    82
inline TInt CWsFbsFont::Duplicate(TInt aHandle)
sl@0
    83
	{return(CFbsBitGcFont::Duplicate(aHandle));}
sl@0
    84
inline TInt CWsFbsFont::Handle() const
sl@0
    85
	{return(CFbsBitGcFont::Handle());}
sl@0
    86
inline void CWsFbsFont::Reset()
sl@0
    87
	{CFbsBitGcFont::Reset();}
sl@0
    88
//
sl@0
    89
inline TInt CAnimFbsFont::Duplicate(TInt aHandle)
sl@0
    90
	{return(CFbsFont::Duplicate(aHandle));}
sl@0
    91
sl@0
    92
#endif