author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 02 Sep 2010 22:23:14 +0300 | |
changeset 57 | 01e38b33e72a |
parent 51 | a7c938434754 |
permissions | -rw-r--r-- |
32 | 1 |
/* |
2 |
* Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef __FNTSTD_H__ |
|
20 |
#define __FNTSTD_H__ |
|
21 |
||
22 |
#include <e32std.h> |
|
23 |
#include <graphics/shapeimpl.h> |
|
24 |
||
25 |
/** |
|
26 |
@internalComponent |
|
27 |
*/ |
|
28 |
enum TFntStorePanic |
|
29 |
{ |
|
30 |
EFntTypefaceIndexOutOfRange, |
|
31 |
EFntHeightIndexOutOfRange, |
|
32 |
EFntNoTypefaces, |
|
33 |
EFntNoTypefaceFontBitmaps, |
|
34 |
EFntTypefaceHasNoFontBitmaps, |
|
35 |
EFntFontBitmapNotLoaded, |
|
36 |
EFntFontAccessCountNonZero, |
|
37 |
EFntFontStoreFileInUse, |
|
38 |
EFntKPixelHeightInTwipsZero, |
|
39 |
EFntSessionCacheIndexOutOfRange, |
|
40 |
EFntMetricsIndexOutOfBounds, |
|
41 |
EFntNoFontFound, |
|
42 |
EFntRemovingAlreadyDeletedLinkedFont, |
|
43 |
EFntOverFlow, |
|
44 |
EFntMetricsNotOnHeap, |
|
45 |
EFntPointerNotByteAligned, |
|
46 |
}; |
|
47 |
||
48 |
/** |
|
49 |
@internalComponent |
|
50 |
*/ |
|
51 |
GLREF_C void Panic(TFntStorePanic aPanic); |
|
52 |
||
53 |
// COpenFontSessionCacheList is placed here rather than openfont.cpp because it is used in fntstore.cpp as well. |
|
54 |
||
51
a7c938434754
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
32
diff
changeset
|
55 |
class COpenFontSessionCache; |
32 | 56 |
class COpenFont; |
57 |
||
58 |
class COpenFontSessionCacheList |
|
59 |
/** |
|
60 |
@internalComponent |
|
61 |
*/ |
|
62 |
{ |
|
63 |
public: |
|
64 |
inline COpenFontSessionCacheList(); |
|
51
a7c938434754
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
32
diff
changeset
|
65 |
TInt AddCache(COpenFontSessionCache* aCache); |
a7c938434754
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
32
diff
changeset
|
66 |
COpenFontSessionCache* FindCache(TInt aSessionHandle) const; |
32 | 67 |
void Delete(RHeap* aHeap); |
68 |
void DeleteCache(RHeap* aHeap,TInt aSessionHandle); |
|
69 |
void DeleteFontGlyphs(RHeap* aHeap,const COpenFont* aFont); |
|
51
a7c938434754
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
32
diff
changeset
|
70 |
private: |
a7c938434754
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
32
diff
changeset
|
71 |
enum { EMaxNumCaches = 256 }; |
a7c938434754
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
32
diff
changeset
|
72 |
private: |
a7c938434754
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
32
diff
changeset
|
73 |
TInt iSessionHandleArray[EMaxNumCaches]; |
a7c938434754
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
32
diff
changeset
|
74 |
TInt iCacheOffsetArray[EMaxNumCaches]; |
32 | 75 |
}; |
76 |
||
51
a7c938434754
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
32
diff
changeset
|
77 |
inline COpenFontSessionCacheList::COpenFontSessionCacheList() |
32 | 78 |
{ |
51
a7c938434754
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
32
diff
changeset
|
79 |
Mem::FillZ(this, sizeof(COpenFontSessionCacheList)); |
32 | 80 |
} |
81 |
||
82 |
/** |
|
83 |
@internalComponent |
|
84 |
*/ |
|
85 |
#ifdef __GCC32__ |
|
86 |
#define PACKED_STRUCTURE_PREFIX |
|
87 |
#define PACKED_STRUCTURE_SUFFIX __attribute__(( __packed__)) |
|
88 |
#elif defined(__ARMCC__) |
|
89 |
#define PACKED_STRUCTURE_PREFIX __packed |
|
90 |
#define PACKED_STRUCTURE_SUFFIX |
|
91 |
#else |
|
92 |
#define PACKED_STRUCTURE_PREFIX |
|
93 |
#define PACKED_STRUCTURE_SUFFIX |
|
94 |
#endif |
|
95 |
||
96 |
PACKED_STRUCTURE_PREFIX class TBitmapFontCharacterOffset |
|
97 |
/** |
|
98 |
Class to store an offset to the given position of a characters binary data in the |
|
99 |
bitmap section of the font file. |
|
100 |
@internalComponent |
|
101 |
*/ |
|
102 |
||
103 |
{ |
|
104 |
public: |
|
105 |
TBitmapFontCharacterOffset(); |
|
106 |
void InternalizeL(RReadStream& aStream); |
|
107 |
public: |
|
108 |
TUint16 iBitmapOffset; // restricts bitmap to 64k |
|
109 |
} PACKED_STRUCTURE_SUFFIX; |
|
110 |
||
111 |
PACKED_STRUCTURE_PREFIX class TBitmapFontCharacterMetrics |
|
112 |
/** |
|
113 |
Character metrics stored in .GDR files. |
|
114 |
||
115 |
This structure cannot be changed without changing the format of bitmap font |
|
116 |
files (.GDR files). This is because a pointer to TBitmapFontCharacterMetrics is made to point |
|
117 |
to part of the .GDR file in ROM. |
|
118 |
@internalComponent |
|
119 |
*/ |
|
120 |
||
121 |
{ |
|
122 |
public: |
|
123 |
TBitmapFontCharacterMetrics(); |
|
124 |
void InternalizeL(RReadStream& aStream); |
|
125 |
||
126 |
TInt8 iAscentInPixels; |
|
127 |
TInt8 iHeightInPixels; |
|
128 |
TInt8 iLeftAdjustInPixels; |
|
129 |
TInt8 iMoveInPixels; |
|
130 |
TInt8 iRightAdjustInPixels; |
|
131 |
} PACKED_STRUCTURE_SUFFIX; |
|
132 |
||
133 |
#endif |