Update contrib.
1 // Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
28 #include <graphics/fbsdefs.h>
34 const TUid KCFbsFontUid = { 268435518 };
37 Indicates version of the font and bitmap server without heap locking.
41 #define SYMBIAN_FBSERV_V2
44 Indicates version of FBS that provides the CFbsFont extension
45 interfaces RFbsGlyphDataIterator for using hardware glyphs, and
46 RFbsGlyphMetricsArray.
50 //#define SYMBIAN_FBSERV_GLYPHDATA
53 Character width and adjustment information.
60 /** The left adjust of the character. */
62 /** The right adjust of the character. */
64 /** The total width of the character, defined as iLeftAdjust + iWidth + iRightAdjust. */
66 /** The width of the character. */
71 class CFbsSessionHelper;
73 class TGlyphCacheMetrics;
74 class TFbsOogmMessage;
77 A session with the font and bitmap server.
81 class RFbsSession : protected RSessionBase
83 // Allow access to internals for test
86 friend class CTBitmap;
90 friend class CFbsBitmap;
91 friend class CFbsBitmapAsyncStreamer;
93 IMPORT_C RFbsSession();
94 IMPORT_C static TInt Connect();
95 IMPORT_C static TInt Connect(RFs& aFileServer);
96 IMPORT_C static void Disconnect();
97 IMPORT_C static RFbsSession* GetSession();
98 IMPORT_C void CallBack();
99 IMPORT_C void SetCallBack(TCallBack aCallBack);
100 IMPORT_C void ResetCallBack();
101 IMPORT_C TInt ResourceCount();
102 IMPORT_C TInt SendCommand(TInt aMessage,TInt aInt0=0,TInt aInt1=0,TInt aInt2=0,TInt aInt3=0) const;
103 TInt SendCommand(TInt aMessage, const TIpcArgs& aArgs) const;
104 void SendCommand(TInt aMessage, const TIpcArgs& aArgs, TRequestStatus &aStatus) const;
105 IMPORT_C TVersion Version();
106 IMPORT_C TUint8* HeapBase() const;
107 IMPORT_C TInt GetHeapSizes(TInt& aDefaultHeap, TInt& aSmallBmpHeap, TInt& aBigBmpChunk);
108 TInt SessionHandle() const { return Handle(); }
109 TInt AllocScanLineBuffer(TInt aSize);
110 HBufC8* GetScanLineBuffer();
111 void SetCallBackPtr(TInt* aBitmapHandle)const;
112 HBufC8* GetDecompressionBuffer(TInt aSize);
113 HBufC8* GetExtraBuffer(TInt aSize);
114 TInt ServerSessionHandle() const;
115 IMPORT_C TInt GetGlyphCacheMetrics(TGlyphCacheMetrics& aGlyphCacheMetrics);
116 IMPORT_C TInt ConveyOogmMessage( TFbsOogmMessage& aOogmMessage );
119 /** WARNING: For internal use ONLY. Compatibility is not guaranteed in future releases.
120 Used for testing server side out of memory failures.
125 EHeapFailTypeServerMemory,
126 EHeapFailTypeHeapMemory,
129 TBool LookupBitmapInROM(const TDesC& aFilename, TAny*& aAddr);
130 RFs& FileServer() { return *((RFs*)iSpare); }
131 static TInt DoAlloc(RFbsSession*& aNewSession);
132 TInt DoConnect(RFs& aFileServer);
135 mutable TCallBack iCallBack;
137 CFbsSessionHelper* iHelper;
138 RChunk iLargeBitmapChunk;
140 CFbsRalCache* iRomFileAddrCache;
141 HBufC8* iDecompressionBuffer;
142 HBufC8* iScanLineBuffer;
146 /** forward declaration of some private classes. */
147 class TGetFontTableParam;
148 class TReleaseGlyphOutlineParam;
149 class TGetGlyphOutlineParam;
153 Font managed by the font and bitmap server.
154 CFbsFont objects are used for screen and off-screen bitmap fonts. They are
155 usually obtained by calls to the CBitmapDevice::GetNearestFontInPixels() and
156 MGraphicsDeviceMap::GetNearestFontInTwips() functions.
157 The class implements a number of functions inherited from CFont.
158 @see CBitmapDevice::GetNearestFontInPixels()
159 @see MGraphicsDeviceMap::GetNearestFontInTwips()
163 class CFbsFont: public CFont
165 friend class CFbsTypefaceStore;
166 friend class RFbsGlyphDataIterator;
167 friend class RFbsGlyphMetricsArray;
171 /** Gets the font's UID.
172 All CFbsFont objects have the constant UID KCFbsFontUid. It is safe to cast
173 from CFont* to CFbsFont* if CFont::TypeUid() returns KCFbsFontUid.
174 @return The font's UID. This should be KCFbsFontUid.
175 @see CFont::TypeUid() */
176 virtual TUid DoTypeUid() const { return KCFbsFontUid; }
177 IMPORT_C virtual TInt DoHeightInPixels() const;
178 IMPORT_C virtual TInt DoAscentInPixels() const;
179 IMPORT_C virtual TInt DoCharWidthInPixels(TChar aChar) const;
180 IMPORT_C virtual TInt DoTextWidthInPixels(const TDesC& aText) const;
181 IMPORT_C virtual TInt DoBaselineOffsetInPixels() const;
182 IMPORT_C virtual TInt DoTextCount(const TDesC& aText,TInt aWidthInPixels) const;
183 IMPORT_C virtual TInt DoTextCount(const TDesC& aText,TInt aWidthInPixels,TInt& aExcessWidthInPixels) const;
184 IMPORT_C virtual TInt DoMaxCharWidthInPixels() const;
185 IMPORT_C virtual TInt DoMaxNormalCharWidthInPixels() const;
186 IMPORT_C virtual TFontSpec DoFontSpecInTwips() const;
187 IMPORT_C virtual CFont::TCharacterDataAvailability DoGetCharacterData(TUint aCode, TOpenFontCharMetrics& aMetrics,
188 const TUint8*& aBitmap, TSize& aBitmapSize) const;
189 IMPORT_C virtual TInt DoExtendedFunction(TUid aFunctionId, TAny* aParam = NULL) const;
193 IMPORT_C TBool GetFontMetrics(TOpenFontMetrics& aMetrics) const;
194 IMPORT_C TInt TextWidthInPixels(const TDesC& aText) const;
195 IMPORT_C void TextWidthInPixels(const TDesC& aText,SCharWidth& aCharWidth) const;
196 IMPORT_C TInt Handle() const;
197 IMPORT_C TCharacterMetrics CharacterMetrics(TInt aCode,const TUint8*& aBytes) const;
198 IMPORT_C TInt RawTextWidthInPixels(const TDesC& aText) const;
199 IMPORT_C TBool GetFaceAttrib(TOpenFontFaceAttrib& aAttrib) const;
200 IMPORT_C TBool IsOpenFont() const;
201 IMPORT_C TBool HasCharacter(TInt aCode) const;
202 IMPORT_C TInt TextWidthInPixels(const TDesC& aText,const TMeasureTextInput* aParam) const;
203 IMPORT_C void TextWidthInPixels(const TDesC& aText,const TMeasureTextInput* aParam,SCharWidth& aCharWidth) const;
208 IMPORT_C ~CFbsFont();
209 IMPORT_C CFbsFont(const CFbsFont& aFont);
210 IMPORT_C CBitmapFont* Address() const;
211 IMPORT_C TInt Duplicate(TInt aHandle);
212 IMPORT_C void Reset();
215 TInt DoFontGetShaping(TFontShapeFunctionParameters* aParam) const;
216 TInt DoFontDeleteShaping(TFontShapeDeleteFunctionParameters* aParam) const;
217 TInt DoTextWidthInPixels(const TDesC& aText,const TMeasureTextInput* aParam) const;
218 TInt DoGetFontTable(TGetFontTableParam * aParam) const;
219 TInt DoGetGlyphOutline(TGetGlyphOutlineParam *aParam) const;
220 TInt DoReleaseGlyphOutline(TReleaseGlyphOutlineParam *aParam) const;
221 TInt DoReleaseFontTable(TUint32 *aParam) const;
225 CBitmapFont* iAddressPointer;
231 An interface for initialization of extended bitmaps. By implementing this interface,
232 creators of extended bitmaps can set the contents of an extended bitmap without
233 allocating a temporary buffer and avoid unnecessary memory copying during calls to
234 CFbsBitmap::CreateExtendedBitmap().
236 WARNING: Class for internal and partner use ONLY. Compatibility is not guaranteed in future releases.
239 @see CFbsBitmap::CreateExtendedBitmap()
241 class MFbsExtendedBitmapInitializer
245 Initializes the raw data of an extended bitmap.
246 @param aData A pointer to the raw data to be initialized.
247 @param aDataSize The size in bytes of the raw data to be initialized.
248 @return KErrNone if successful, otherwise another of the system-wide error codes.
250 virtual TInt InitExtendedBitmap(TAny* aData, TInt aDataSize) = 0;
253 class CDirectFileStore;
256 Note that this class is not intended for user derivation.
257 A bitmap managed by the font and bitmap server.
258 The class also defines some palette functionality which is not yet
259 implemented, since none of the modes currently supported by screen
260 or bitmaps require variable palettes.
261 Note that the CFbsBitmap format is internal to Symbian, but the
262 Image Converter API can be used to convert such bitmaps to standard formats.
263 CFbsBitmap instances cannot be shared between different threads. They use some shared
264 thread local storage data. If you want to share a bitmap between threads, use Duplicate().
267 @see CFbsBitmap::Duplicate()
269 class CFbsBitmap : public CBase
271 friend class TBitmapUtil;
272 friend class CBitwiseBitmap;
273 friend class CFbsBitmapAsyncStreamer;
274 friend class CFbsSessionHelper;
276 IMPORT_C CFbsBitmap();
277 IMPORT_C ~CFbsBitmap();
278 IMPORT_C void Reset();
279 IMPORT_C static TInt ScanLineLength(TInt aLength,TDisplayMode aDispMode);
280 IMPORT_C TDisplayMode DisplayMode() const;
281 IMPORT_C TDisplayMode InitialDisplayMode() const;
282 IMPORT_C TInt SetDisplayMode(TDisplayMode aDisplayMode);
283 IMPORT_C TInt Create(const TSize& aSizeInPixels,TDisplayMode aDispMode);
284 IMPORT_C TInt Duplicate(TInt aHandle);
285 IMPORT_C TBool IsRomBitmap() const;
286 IMPORT_C void SetRomBitmapL(CBitwiseBitmap* aRomBitmapPointer,TInt& aBitmapSizeInBytes);
287 IMPORT_C TInt Load(const TDesC& aFileName,TInt32 aId=0,TBool aShareIfLoaded=ETrue);
288 IMPORT_C TInt Load(const TDesC& aFileName,TInt32 aId,TBool aShareIfLoaded,TUint aFileOffset);
289 IMPORT_C TInt LoadAndCompress(const TDesC& aFileName,TInt32 aId=0,TBool aShareIfLoaded=ETrue);
290 IMPORT_C TInt LoadAndCompress(const TDesC& aFileName,TInt32 aId,TBool aShareIfLoaded,TUint aFileOffset);
291 IMPORT_C TInt Load(RFile& aFile,TInt32 aId=0,TBool aShareIfLoaded=ETrue);
292 IMPORT_C TInt Load(RFile& aFile,TInt32 aId,TBool aShareIfLoaded,TUint aFileOffset);
293 IMPORT_C TInt LoadAndCompress(RFile& aFile,TInt32 aId=0,TBool aShareIfLoaded=ETrue);
294 IMPORT_C TInt LoadAndCompress(RFile& aFile,TInt32 aId,TBool aShareIfLoaded,TUint aFileOffset);
295 IMPORT_C TInt Save(const TDesC& aFilename);
296 IMPORT_C TInt Save(RFile& aFile);
297 IMPORT_C static void StoreL(const TDesC& aFilename,TInt aNumSources,const TDesC* aSources[],TInt32 aSourceIds[]);
298 IMPORT_C static void StoreL(RFile& aFile,TInt aNumSources,const TDesC* aSources[],TInt32 aSourceIds[]);
299 IMPORT_C void GetScanLine(TDes8& aBuf,const TPoint& aPixel,TInt aLength,TDisplayMode aDispMode) const;
300 IMPORT_C void SetScanLine(TDes8& aBuf,TInt aY) const;
301 IMPORT_C void GetVerticalScanLine(TDes8& aBuf,TInt aX,TDisplayMode aDispMode) const;
302 IMPORT_C void GetVerticalScanLine(TDes8& aBuf,TInt aX,const TPoint& aDitherOffset,TDisplayMode aDispMode) const;
303 IMPORT_C TInt Handle() const;
304 IMPORT_C SEpocBitmapHeader Header() const;
305 IMPORT_C TInt HorizontalPixelsToTwips(TInt aPixels) const;
306 IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwips) const;
307 IMPORT_C void GetPixel(TRgb& aColor,const TPoint& aPixel) const;
308 IMPORT_C TInt Resize(const TSize& aSizeInPixels);
309 IMPORT_C TSize SizeInPixels() const;
310 IMPORT_C TSize SizeInTwips() const;
311 IMPORT_C void SetSizeInTwips(const MGraphicsDeviceMap* aMap);
312 IMPORT_C void SetSizeInTwips(const TSize& aSizeInTwips);
313 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
314 IMPORT_C void ExternalizeRectangleL(RWriteStream& aStream,const TRect& aRect) const;
315 IMPORT_C void InternalizeL(RReadStream& aStream);
316 IMPORT_C TInt Compress();
317 IMPORT_C TInt Compress(TBitmapfileCompressionScheme aScheme);
318 IMPORT_C void CompressInBackground(TRequestStatus& aRequestStatus);
319 IMPORT_C TInt CompressInBackground();
320 IMPORT_C void CompressInBackground(TRequestStatus& aRequestStatus, TBitmapfileCompressionScheme aScheme);
321 IMPORT_C TInt CompressInBackground(TBitmapfileCompressionScheme aScheme);
322 IMPORT_C TInt VerticalPixelsToTwips(TInt aPixels) const;
323 IMPORT_C TInt VerticalTwipsToPixels(TInt aTwips) const;
324 IMPORT_C static TBool IsFileInRom(const TDesC& aFilename,TUint32*& aWord);
325 IMPORT_C static TBool IsFileInRom(RFile& aFile,TUint32*& aWord);
326 IMPORT_C TBool IsMonochrome() const;
327 IMPORT_C TBool IsLargeBitmap() const;
328 IMPORT_C void PaletteAttributes(TBool& aModifiable,TInt& aNumEntries) const;
329 IMPORT_C void SetPalette(CPalette* aPalette);
330 IMPORT_C TInt GetPalette(CPalette*& aPalette) const;
331 IMPORT_C TUint32* DataAddress() const;
332 IMPORT_C TInt DataStride() const;
333 IMPORT_C TInt CreateHardwareBitmap(const TSize& aSizeInPixels,TDisplayMode aDispMode,TUid aCreatorUid);
334 IMPORT_C TInt HardwareBitmapHandle() const;
335 IMPORT_C void BeginDataAccess() const;
336 IMPORT_C void EndDataAccess(TBool aReadOnly=EFalse) const;
337 IMPORT_C void LockHeap(TBool aAlways=EFalse) const;
338 IMPORT_C void UnlockHeap(TBool aAlways=EFalse) const;
339 IMPORT_C void LockHeapLC(TBool aAlways=EFalse) const;
340 IMPORT_C static void UnlockHeap(TAny* aFbsBitmap);
341 IMPORT_C TBool IsVolatile() const;
342 IMPORT_C TInt TouchCount() const;
343 IMPORT_C TInt64 SerialNumber() const;
344 IMPORT_C TBool IsCompressedInRAM() const;
345 IMPORT_C TInt SwapWidthAndHeight();
346 IMPORT_C TInt CreateExtendedBitmap(const TSize& aSizeInPixels, TDisplayMode aDispMode, TUid aType, const TAny* aData, TInt aDataSize);
347 IMPORT_C TInt CreateExtendedBitmap(const TSize& aSizeInPixels, TDisplayMode aDispMode, TUid aType, TInt aDataSize, MFbsExtendedBitmapInitializer& aInitializer);
348 IMPORT_C TUid ExtendedBitmapType() const;
349 IMPORT_C TInt DataSize() const;
350 IMPORT_C static HBufC8* GetDecompressionBuffer(TInt aSize);
351 IMPORT_C static CFbsRasterizer* Rasterizer();
352 IMPORT_C TInt GetAllBitmapHandles(RArray<TInt>& aBitmapIdArray) const;
353 IMPORT_C static HBufC8* GetExtraBuffer(TInt aSize);
355 IMPORT_C void GetScanLine(TDes8& aBuf,const TPoint& aPixel,TInt aLength,const TPoint& aDitherOffset,TDisplayMode aDispMode) const;
356 CBitwiseBitmap* Address() const;
357 IMPORT_C CBitwiseBitmap* CleanAddress() const;
358 inline CBitwiseBitmap* BeginDataAccessAndGetCleanAddress(TUint32*& aDataAddress) const;
359 void DoSaveL(RFile& aFile);
360 TInt DoCreate(const TSize& aSizeInPixels, TDisplayMode aDispMode, TUid aUid, TInt aDataSize = 0);
362 TInt DoLoad(RFile& aFile,TInt32 aId,TBool aShareIfLoaded,TUint aFileOffset);
363 TInt DoLoad(const TDesC& aFileName,TInt32 aId,TBool aShareIfLoaded,TUint aFileOffset);
364 TInt DoLoadFromRom(TUint32* aRomPointer, TInt32 aId, TUint aFileOffset, TBool& aRomPointerValid);
365 TBool LoadShiftedRomBmpL(const TDesC& aFileName,TInt32 aId,TUint aFileOffset);
366 static void DoStoreL(CDirectFileStore* aFileStore,CFbsBitmap* aBitmap,TInt aNumSources,const TDesC* aSources[],TInt32 aSourceIds[]);
367 TInt DuplicateInRom(TInt aBitmapHandle);
368 TInt DuplicateInRam(TInt aBitmapHandle);
370 /** WARNING: For internal use ONLY. Compatibility is not guaranteed in future releases.
374 EIsRomBitmap = 0x0001,
375 EIsExtendedBitmap = 0x0002,
376 EIsReadOnlyBitmapMask = EIsRomBitmap | EIsExtendedBitmap
379 RFbsSession* iFbs; /**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
380 CBitwiseBitmap* iAddressPointer; /**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
381 TUint16 iFlags; /**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
382 TInt16 iUseCount; /**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
383 TInt iHandle; /**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
384 TInt iServerHandle; /**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
389 Provides fast read/write access to the pixel data of a bitmap.
391 Functionality includes getting and setting the individual pixels of a bitmap.
392 Common to this is the concept of the current pixel position. This is held
393 as member data and is changed by using various efficient functions. For example,
394 incrementing the position's x- or y co-ordinate is much quicker than setting
395 a completely new position. This efficiency issue is important as these functions
396 are used as part of the frequently used blitting DDA used for creating
397 stretched or compressed versions of bitmaps.
399 Calls to Begin() and End() must surround any calls to the other member functions.
400 Note that you should always ensure each Begin() is matched by an End() call
401 when using this class.
403 Note also that all display modes including EColor16M are supported, but the
404 TDisplayMode values ERgb and ENone are not considered to be display modes.
411 IMPORT_C void Begin(const TPoint& aPosition);
412 IMPORT_C void Begin(const TPoint& aPosition,const TBitmapUtil& aUtil);
414 IMPORT_C TBitmapUtil(CFbsBitmap* aBitmap);
415 IMPORT_C TUint32 GetPixel() const;
416 IMPORT_C void SetPixel(TUint32 aValue);
417 IMPORT_C void SetPixel(const TBitmapUtil& aSource);
418 IMPORT_C void SetPos(const TPoint& aPosition);
419 IMPORT_C void DecXPos();
420 IMPORT_C void DecYPos();
421 IMPORT_C void IncXPos();
422 IMPORT_C void IncYPos();
424 CFbsBitmap* iFbsBitmap;
426 TUint32* iMinWordPos;
427 TUint32* iMaxWordPos;
432 TInt iScanlineWordLength;
439 Font and bitmap server typeface store.
443 class CFbsTypefaceStore : public CTypefaceStore
445 friend class CWsScreenDevice;
447 IMPORT_C static CFbsTypefaceStore* NewL(CGraphicsDevice* aDevice);
448 IMPORT_C ~CFbsTypefaceStore();
449 IMPORT_C TInt AddFile(const TDesC& aName,TInt& aId);
450 IMPORT_C TInt InstallFile(const TDesC& aName,TInt& aId);
451 IMPORT_C void RemoveFile(TInt aId=0);
452 IMPORT_C virtual TInt GetNearestFontInTwips(CFont*& aFont, const TFontSpec& aFontSpec);
453 IMPORT_C TInt GetNearestFontInPixels(CFont*& aFont, const TFontSpec& aFontSpec);
454 IMPORT_C virtual TInt GetNearestFontToDesignHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec);
455 IMPORT_C TInt GetNearestFontToDesignHeightInPixels(CFont*& aFont, const TFontSpec& aFontSpec);
456 IMPORT_C virtual TInt GetNearestFontToMaxHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec, TInt aMaxHeight);
457 IMPORT_C TInt GetNearestFontToMaxHeightInPixels(CFont*& aFont, const TFontSpec& aFontSpec, TInt aMaxHeight);
458 IMPORT_C TInt GetFontById(CFont *&aFont,TUid aUid,const TAlgStyle& aAlgStyle);
459 IMPORT_C virtual TInt NumTypefaces() const;
460 IMPORT_C virtual void TypefaceSupport(TTypefaceSupport& aTypefaceSupport,TInt aTypefaceIndex) const;
461 IMPORT_C virtual TInt FontHeightInTwips(TInt aTypefaceIndex,TInt aHeightIndex) const;
462 IMPORT_C TInt FontHeightInPixels(TInt aTypefaceIndex,TInt aHeightIndex) const;
463 IMPORT_C TGlyphBitmapType DefaultBitmapType() const;
464 IMPORT_C void SetDefaultBitmapType(TGlyphBitmapType aType) const;
465 IMPORT_C void SetFontNameAliasL(const TDesC& aFontAlias,const TDesC& aFontName) const;
466 IMPORT_C void SetDefaultLanguageForMetrics(TLanguage aLanguage) const;
467 IMPORT_C static void RemoveFontFileLocksL();
468 IMPORT_C static void RemoveFontFileLocksL(const TDesC& aDrive, TBool aAllFonts);
469 IMPORT_C static void RemoveFontFileLocksL(const TDesC& aFileName);
470 IMPORT_C void ReleaseTwipsCache();
471 IMPORT_C void SetSystemDefaultTypefaceNameL(const TDesC& aFontTypefaceName);
472 IMPORT_C TInt RegisterLinkedTypeface(const CLinkedTypefaceSpecification& aLinkedTypefaceSpec, TInt& aId);
473 IMPORT_C void GetLinkedTypefaceL(CLinkedTypefaceSpecification& aLinkedTypefaceSpec);
474 IMPORT_C TInt RegisterLinkedTypeface(const CLinkedTypefaceSpecification& aLinkedTypefaceSpec);
475 IMPORT_C TInt UpdateLinkedTypeface(const CLinkedTypefaceSpecification& aLinkedTypefaceSpec);
477 CFbsTypefaceStore(CGraphicsDevice* aDevice);
479 TInt CreateFont(CFont*& aFont,const TFontInfo& aFontInfo);
480 TBool IsFontLoaded(CFont*& aFont, const TFontInfo& aFontInfo) const;
481 TInt FontHeight(TInt aTypefaceIndex,TInt aHeightIndex,TInt aMessage) const;
482 TInt GetNearestFontInTwipsAndCreateFont(CFont*& aFont, TInt aFbsMessage, const TFontSpec& aFontSpec, TInt aMaxHeight = 0);
483 TInt SendGetNearestFontCommandNCreateFont(
484 CFont*& aFont, TInt aFbsMessage, const TFontSpec& aFontSpec, TInt aMaxHeight = 0);
485 void GetPixelSizeInTwips(TSize& aSize) const;
489 CGraphicsDevice* iDevice;
490 CFontCache* iTwipsCache;
493 class CDitherColor256;
496 Copies a bitmap in any display mode of at least 256 colours into a 256
497 colour bitmap, optionally using a user-defined palette.
501 class CFbsColor256BitmapUtil : public CBase
504 /** Indicates whether or not to use dithering. */
509 /** Use the Floyd-Steinberg dithering algorithm. */
514 IMPORT_C static CFbsColor256BitmapUtil* NewL(const CPalette* aPalette);
516 IMPORT_C TInt CopyBitmap(CFbsBitmap* aColor256Destination,CFbsBitmap* aSource,TDither aDither=ENoDither);
518 ~CFbsColor256BitmapUtil();
520 CFbsColor256BitmapUtil();
522 TColor256Util* iColor256Util;
523 CDitherColor256* iDither;
528 A class encapsulating the current state of the glyph cache.
533 class TGlyphCacheMetrics
536 TInt iMaxCacheSizeInBytes;
537 TInt iMaxCacheSizeHigh;
538 TInt iMaxCacheSizeLow;
539 TInt iCacheSizeInBytes;
540 TBool iGpuCacheSizeLimitIsMax;