194 IMPORT_C TCharacterMetrics CharacterMetrics(TInt aCode,const TUint8*& aBytes) const; |
175 IMPORT_C TCharacterMetrics CharacterMetrics(TInt aCode,const TUint8*& aBytes) const; |
195 IMPORT_C TInt RawTextWidthInPixels(const TDesC& aText) const; |
176 IMPORT_C TInt RawTextWidthInPixels(const TDesC& aText) const; |
196 IMPORT_C TBool GetFaceAttrib(TOpenFontFaceAttrib& aAttrib) const; |
177 IMPORT_C TBool GetFaceAttrib(TOpenFontFaceAttrib& aAttrib) const; |
197 IMPORT_C TBool IsOpenFont() const; |
178 IMPORT_C TBool IsOpenFont() const; |
198 IMPORT_C TBool HasCharacter(TInt aCode) const; |
179 IMPORT_C TBool HasCharacter(TInt aCode) const; |
|
180 IMPORT_C TInt TextWidthInPixels(const TDesC& aText,const TMeasureTextInput* aParam) const; |
|
181 IMPORT_C void TextWidthInPixels(const TDesC& aText,const TMeasureTextInput* aParam,SCharWidth& aCharWidth) const; |
|
182 |
199 |
183 |
200 protected: |
184 protected: |
201 IMPORT_C CFbsFont(); |
185 IMPORT_C CFbsFont(); |
202 IMPORT_C ~CFbsFont(); |
186 IMPORT_C ~CFbsFont(); |
203 IMPORT_C CFbsFont(const CFbsFont& aFont); |
187 IMPORT_C CFbsFont(const CFbsFont& aFont); |
204 IMPORT_C CBitmapFont* Address() const; |
188 IMPORT_C CBitmapFont* Address() const; |
205 IMPORT_C TInt Duplicate(TInt aHandle); |
189 IMPORT_C TInt Duplicate(TInt aHandle); |
206 IMPORT_C void Reset(); |
190 IMPORT_C void Reset(); |
207 |
191 |
208 private: |
192 private: |
209 void InsertCharacterInCache(TInt aCode, CLinkedFontInformation* &aInfo, CBitmapFont* &aBitmapFont) const; |
|
210 |
|
211 private: |
|
212 TInt DoFontGetShaping(TFontShapeFunctionParameters* aParam) const; |
193 TInt DoFontGetShaping(TFontShapeFunctionParameters* aParam) const; |
213 TInt DoFontDeleteShaping(TFontShapeDeleteFunctionParameters* aParam) const; |
194 TInt DoFontDeleteShaping(TFontShapeDeleteFunctionParameters* aParam) const; |
|
195 TInt DoTextWidthInPixels(const TDesC& aText,const TMeasureTextInput* aParam) const; |
214 |
196 |
215 protected: |
197 protected: |
216 RFbsSession* iFbs; |
198 RFbsSession* iFbs; |
217 CBitmapFont* iAddressPointer; |
199 CBitmapFont* iAddressPointer; |
218 TInt iHandle; |
200 TInt iHandle; |
219 TInt iServerHandle; |
201 TInt iServerHandle; |
|
202 }; |
|
203 |
|
204 /** |
|
205 An interface for initialization of extended bitmaps. By implementing this interface, |
|
206 creators of extended bitmaps can set the contents of an extended bitmap without |
|
207 allocating a temporary buffer and avoid unnecessary memory copying during calls to |
|
208 CFbsBitmap::CreateExtendedBitmap(). |
|
209 |
|
210 WARNING: Class for internal and partner use ONLY. Compatibility is not guaranteed in future releases. |
|
211 |
|
212 @publishedAll |
|
213 @see CFbsBitmap::CreateExtendedBitmap() |
|
214 */ |
|
215 class MFbsExtendedBitmapInitializer |
|
216 { |
|
217 public: |
|
218 /** |
|
219 Initializes the raw data of an extended bitmap. |
|
220 @param aData A pointer to the raw data to be initialized. |
|
221 @param aDataSize The size in bytes of the raw data to be initialized. |
|
222 @return KErrNone if successful, otherwise another of the system-wide error codes. |
|
223 */ |
|
224 virtual TInt InitExtendedBitmap(TAny* aData, TInt aDataSize) = 0; |
220 }; |
225 }; |
221 |
226 |
222 class CDirectFileStore; |
227 class CDirectFileStore; |
223 |
228 |
224 /** |
229 /** |
305 IMPORT_C void EndDataAccess(TBool aReadOnly=EFalse) const; |
310 IMPORT_C void EndDataAccess(TBool aReadOnly=EFalse) const; |
306 IMPORT_C void LockHeap(TBool aAlways=EFalse) const; |
311 IMPORT_C void LockHeap(TBool aAlways=EFalse) const; |
307 IMPORT_C void UnlockHeap(TBool aAlways=EFalse) const; |
312 IMPORT_C void UnlockHeap(TBool aAlways=EFalse) const; |
308 IMPORT_C void LockHeapLC(TBool aAlways=EFalse) const; |
313 IMPORT_C void LockHeapLC(TBool aAlways=EFalse) const; |
309 IMPORT_C static void UnlockHeap(TAny* aFbsBitmap); |
314 IMPORT_C static void UnlockHeap(TAny* aFbsBitmap); |
|
315 IMPORT_C TBool IsVolatile() const; |
|
316 IMPORT_C TInt TouchCount() const; |
|
317 IMPORT_C TInt64 SerialNumber() const; |
310 IMPORT_C TBool IsCompressedInRAM() const; |
318 IMPORT_C TBool IsCompressedInRAM() const; |
311 IMPORT_C TInt SwapWidthAndHeight(); |
319 IMPORT_C TInt SwapWidthAndHeight(); |
|
320 IMPORT_C TInt CreateExtendedBitmap(const TSize& aSizeInPixels, TDisplayMode aDispMode, TUid aType, const TAny* aData, TInt aDataSize); |
|
321 IMPORT_C TInt CreateExtendedBitmap(const TSize& aSizeInPixels, TDisplayMode aDispMode, TUid aType, TInt aDataSize, MFbsExtendedBitmapInitializer& aInitializer); |
|
322 IMPORT_C TUid ExtendedBitmapType() const; |
|
323 IMPORT_C TInt DataSize() const; |
312 IMPORT_C static HBufC8* GetDecompressionBuffer(TInt aSize); |
324 IMPORT_C static HBufC8* GetDecompressionBuffer(TInt aSize); |
|
325 IMPORT_C static CFbsRasterizer* Rasterizer(); |
313 IMPORT_C TInt GetAllBitmapHandles(RArray<TInt>& aBitmapIdArray) const; |
326 IMPORT_C TInt GetAllBitmapHandles(RArray<TInt>& aBitmapIdArray) const; |
314 IMPORT_C static HBufC8* GetExtraBuffer(TInt aSize); |
327 IMPORT_C static HBufC8* GetExtraBuffer(TInt aSize); |
315 protected: |
328 protected: |
316 IMPORT_C void GetScanLine(TDes8& aBuf,const TPoint& aPixel,TInt aLength,const TPoint& aDitherOffset,TDisplayMode aDispMode) const; |
329 IMPORT_C void GetScanLine(TDes8& aBuf,const TPoint& aPixel,TInt aLength,const TPoint& aDitherOffset,TDisplayMode aDispMode) const; |
317 CBitwiseBitmap* Address() const; |
330 CBitwiseBitmap* Address() const; |
318 IMPORT_C CBitwiseBitmap* CleanAddress() const; |
331 IMPORT_C CBitwiseBitmap* CleanAddress() const; |
319 inline CBitwiseBitmap* CleanAddress(TUint32*& aDataAddress) const; |
332 inline CBitwiseBitmap* BeginDataAccessAndGetCleanAddress(TUint32*& aDataAddress) const; |
320 void DoSaveL(RFile& aFile); |
333 void DoSaveL(RFile& aFile); |
321 TInt DoCreate(const TSize& aSizeInPixels,TDisplayMode aDispMode,TUid aCreatorUid); |
334 TInt DoCreate(const TSize& aSizeInPixels, TDisplayMode aDispMode, TUid aUid, TInt aDataSize = 0); |
322 private: |
335 private: |
323 TInt DoLoad(RFile& aFile,TInt32 aId,TBool aShareIfLoaded,TUint aFileOffset); |
336 TInt DoLoad(RFile& aFile,TInt32 aId,TBool aShareIfLoaded,TUint aFileOffset); |
324 TInt DoLoad(const TDesC& aFileName,TInt32 aId,TBool aShareIfLoaded,TUint aFileOffset); |
337 TInt DoLoad(const TDesC& aFileName,TInt32 aId,TBool aShareIfLoaded,TUint aFileOffset); |
325 TInt DoLoadFromRom(TUint32* aRomPointer, TInt32 aId, TUint aFileOffset, TBool& aRomPointerValid); |
338 TInt DoLoadFromRom(TUint32* aRomPointer, TInt32 aId, TUint aFileOffset, TBool& aRomPointerValid); |
326 TBool LoadShiftedRomBmpL(const TDesC& aFileName,TInt32 aId,TUint aFileOffset); |
339 TBool LoadShiftedRomBmpL(const TDesC& aFileName,TInt32 aId,TUint aFileOffset); |
327 static void DoStoreL(CDirectFileStore* aFileStore,CFbsBitmap* aBitmap,TInt aNumSources,const TDesC* aSources[],TInt32 aSourceIds[]); |
340 static void DoStoreL(CDirectFileStore* aFileStore,CFbsBitmap* aBitmap,TInt aNumSources,const TDesC* aSources[],TInt32 aSourceIds[]); |
328 protected: |
341 protected: |
329 /** |
342 /** WARNING: For internal use ONLY. Compatibility is not guaranteed in future releases. |
330 @internalComponent |
343 */ |
331 */ |
|
332 enum // Flags |
344 enum // Flags |
333 { |
345 { |
334 EIsRomBitmap = 0x0001 |
346 EIsRomBitmap = 0x0001, |
|
347 EIsExtendedBitmap = 0x0002, |
|
348 EIsReadOnlyBitmapMask = EIsRomBitmap | EIsExtendedBitmap |
335 }; |
349 }; |
336 protected: |
350 protected: |
337 /** |
351 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. */ |
338 @internalComponent |
352 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. */ |
339 */ |
353 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. */ |
340 RFbsSession* iFbs; |
354 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. */ |
341 /** |
355 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. */ |
342 @internalComponent |
356 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. */ |
343 */ |
|
344 CBitwiseBitmap* iAddressPointer; |
|
345 /** |
|
346 @internalComponent |
|
347 */ |
|
348 TUint16 iFlags; |
|
349 /** |
|
350 @internalComponent |
|
351 */ |
|
352 TInt16 iUseCount; |
|
353 /** |
|
354 @internalComponent |
|
355 */ |
|
356 TInt iHandle; |
|
357 /** |
|
358 @internalComponent |
|
359 */ |
|
360 TInt iServerHandle; |
|
361 }; |
|
362 |
|
363 class CDirectFileStore; |
|
364 |
|
365 /** |
|
366 @deprecated |
|
367 @internalComponent |
|
368 */ |
|
369 class CFbsBitmapAsyncStreamer : public CBase |
|
370 { |
|
371 public: |
|
372 enum TMode {ELoad, ESave}; |
|
373 public: |
|
374 IMPORT_C ~CFbsBitmapAsyncStreamer(); |
|
375 IMPORT_C static CFbsBitmapAsyncStreamer* NewL(TMode aMode); |
|
376 IMPORT_C TInt Load(const TDesC& aFilename,TInt32 aId,TInt& aScanLines); |
|
377 IMPORT_C TBool LoadScanLinesL(TInt aNumberOfScanLines,CFbsBitmap*& aBitmap); |
|
378 IMPORT_C TInt Save(const TDesC& aFilename,CFbsBitmap* aBitmap,TInt32& aId,TInt& aScanLines); |
|
379 IMPORT_C TBool SaveScanLinesL(TInt aNumberOfScanLines); |
|
380 private: |
|
381 CFbsBitmapAsyncStreamer(TMode aMode); |
|
382 void ConstructL(); |
|
383 void DoLoadL(const TDesC& aFilename,TInt32 aId); |
|
384 void DoSaveL(RFile& aFile); |
|
385 private: |
|
386 RFbsSession* iFbs; |
|
387 RStoreReadStream iReadStream; |
|
388 RStoreWriteStream iWriteStream; |
|
389 TStreamId iId; |
|
390 CDirectFileStore* iStore; |
|
391 TInt iCurrentScanLine; |
|
392 TUint32* iScanLineBase; |
|
393 CFbsBitmap* iBitmap; |
|
394 SEpocBitmapHeader iHeader; |
|
395 TDisplayMode iDispMode; |
|
396 TMode iMode; |
|
397 }; |
357 }; |
398 |
358 |
399 |
359 |
400 /** |
360 /** |
401 Provides fast read/write access to the pixel data of a bitmap. |
361 Provides fast read/write access to the pixel data of a bitmap. |
480 IMPORT_C static void RemoveFontFileLocksL(const TDesC& aDrive, TBool aAllFonts); |
440 IMPORT_C static void RemoveFontFileLocksL(const TDesC& aDrive, TBool aAllFonts); |
481 IMPORT_C static void RemoveFontFileLocksL(const TDesC& aFileName); |
441 IMPORT_C static void RemoveFontFileLocksL(const TDesC& aFileName); |
482 IMPORT_C void ReleaseTwipsCache(); |
442 IMPORT_C void ReleaseTwipsCache(); |
483 IMPORT_C void SetSystemDefaultTypefaceNameL(const TDesC& aFontTypefaceName); |
443 IMPORT_C void SetSystemDefaultTypefaceNameL(const TDesC& aFontTypefaceName); |
484 IMPORT_C TInt RegisterLinkedTypeface(const CLinkedTypefaceSpecification& aLinkedTypefaceSpec, TInt& aId); |
444 IMPORT_C TInt RegisterLinkedTypeface(const CLinkedTypefaceSpecification& aLinkedTypefaceSpec, TInt& aId); |
|
445 IMPORT_C void GetLinkedTypefaceL(CLinkedTypefaceSpecification& aLinkedTypefaceSpec); |
|
446 IMPORT_C TInt RegisterLinkedTypeface(const CLinkedTypefaceSpecification& aLinkedTypefaceSpec); |
|
447 IMPORT_C TInt UpdateLinkedTypeface(const CLinkedTypefaceSpecification& aLinkedTypefaceSpec); |
485 private: |
448 private: |
486 CFbsTypefaceStore(CGraphicsDevice* aDevice); |
449 CFbsTypefaceStore(CGraphicsDevice* aDevice); |
487 void ConstructL(); |
450 void ConstructL(); |
488 TInt CreateFont(CFont*& aFont,const TFontInfo& aFontInfo); |
451 TInt CreateFont(CFont*& aFont,const TFontInfo& aFontInfo); |
489 TBool IsFontLoaded(CFont*& aFont, const TFontInfo& aFontInfo) const; |
452 TBool IsFontLoaded(CFont*& aFont, const TFontInfo& aFontInfo) const; |
490 TInt FontHeight(TInt aTypefaceIndex,TInt aHeightIndex,TInt aMessage) const; |
453 TInt FontHeight(TInt aTypefaceIndex,TInt aHeightIndex,TInt aMessage) const; |
491 TInt GetNearestFontInTwipsAndCreateFont(CFont*& aFont, TFbsMessage aFbsMessage, const TFontSpec& aFontSpec, TInt aMaxHeight = 0); |
454 TInt GetNearestFontInTwipsAndCreateFont(CFont*& aFont, TInt aFbsMessage, const TFontSpec& aFontSpec, TInt aMaxHeight = 0); |
492 TInt SendGetNearestFontCommandNCreateFont( |
455 TInt SendGetNearestFontCommandNCreateFont( |
493 CFont*& aFont, TFbsMessage aFbsMessage, const TFontSpec& aFontSpec, TInt aMaxHeight = 0); |
456 CFont*& aFont, TInt aFbsMessage, const TFontSpec& aFontSpec, TInt aMaxHeight = 0); |
494 void GetPixelSizeInTwips(TSize& aSize) const; |
457 void GetPixelSizeInTwips(TSize& aSize) const; |
495 |
458 |
496 private: |
459 private: |
497 RFbsSession* iFbs; |
460 RFbsSession* iFbs; |
498 CGraphicsDevice* iDevice; |
461 CGraphicsDevice* iDevice; |