fontservices/fontstore/inc/OPENFONT.H
branchRCL_3
changeset 1 e96e8a131979
parent 0 1fb32624e06b
child 2 6971d1c87c9a
equal deleted inserted replaced
0:1fb32624e06b 1:e96e8a131979
   337 	inline TInt FontMaxDescent() const;
   337 	inline TInt FontMaxDescent() const;
   338 	inline TInt FontLineGap() const;
   338 	inline TInt FontLineGap() const;
   339 	inline TInt FontMaxHeight() const;
   339 	inline TInt FontMaxHeight() const;
   340 	void DeleteShaper() const;
   340 	void DeleteShaper() const;
   341 	TInt GetFontTable(TUint32 aTag, TAny*& aTableContent, TInt& aLength);
   341 	TInt GetFontTable(TUint32 aTag, TAny*& aTableContent, TInt& aLength);
   342 	TInt GetGlyphOutline(TUint aCode, TBool aHinted, 
   342 	TInt GetGlyphOutline(TUint aCode, TBool aHinted, TAny*& aOutline, TInt& aLength);
   343 	            TAny*& aOutline, TInt& aLength);
   343 	
   344 #ifdef FNTSTORE_SUPPORT_FMM
   344 protected:	
   345 private:	
       
   346 	/** WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
   345 	/** WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
   347 	*/
   346 	*/
   348 	TInt PointerToThisOffset(const TAny* aAny);
   347 	TInt PointerToThisOffset(const TAny* aAny);
   349 	/** WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
   348 	/** WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
   350 	*/
   349 	*/
   351 	TAny* ThisOffsetToPointer(const TInt aOffset);
   350 	TAny* ThisOffsetToPointer(const TInt aOffset);
   352 #endif // FNTSTORE_SUPPORT_FMM
       
   353 		
   351 		
   354 protected:
   352 protected:
   355 	RHeap* iHeap;
   353 	RHeap* iHeap;
   356 	TOpenFontMetrics iMetrics;
   354 	TOpenFontMetrics iMetrics;
   357 private:
   355 private:
   381 		lines of text in the font */
   379 		lines of text in the font */
   382 	TInt iFontLineGap;
   380 	TInt iFontLineGap;
   383 private:
   381 private:
   384 	const COpenFontGlyph* Glyph(TInt aSessionHandle,TInt aCode) const;
   382 	const COpenFontGlyph* Glyph(TInt aSessionHandle,TInt aCode) const;
   385 protected:
   383 protected:
   386 #ifdef FNTSTORE_SUPPORT_FMM
   384 
   387 	/** WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
   385 	/** WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
   388 	*/
   386 	*/
   389 	const COpenFontGlyph* FontCacheGlyph(TInt aCode,TInt*& aNode);
   387 	const COpenFontGlyph* FontCacheGlyph(TInt aCode,TInt*& aNode);
       
   388 	const COpenFontGlyph* FontCacheGlyph(TInt aCode);
   390 	
   389 	
   391 	/** Used to calculate an offset that is applied to pointers to objects on the
   390 	void SetGlyphCache(COpenFontGlyphCache* aGlyphCache);
   392 	FBServ shared heap to convert them to valid pointers in the current process.
   391 	
   393 	Add the value returned here to pointers to items on the shared heap to get a 
       
   394 	valid pointer to the item in the current process.
       
   395 	  
       
   396 	WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.	  
       
   397 	  
       
   398 	@return Returns an offset between the "this" pointer that this object had on 
       
   399 	construction and its current "this" pointer.  
       
   400 	*/
       
   401 	inline TInt Offset() const;
       
   402 #else
       
   403 	/** WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
       
   404 	*/
       
   405 	const COpenFontGlyph* FontCacheGlyph(TInt aCode,COpenFontGlyphTreeEntry**& aNode);	
       
   406 #endif // FNTSTORE_SUPPORT_FMM
       
   407 	/** WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
       
   408 	*/
       
   409 	const COpenFontGlyph* FontCacheGlyph(TInt aCode);
       
   410 private:
   392 private:
   411 	const COpenFontGlyph* SessionCacheGlyph(RHeap* aHeap,TInt aSessionHandle,TInt aCode,
   393 	const COpenFontGlyph* SessionCacheGlyph(RHeap* aHeap,TInt aSessionHandle,TInt aCode,
   412 											COpenFontSessionCache*& aCache,TInt& aIndex,TBool aCreate) const;
   394 											COpenFontSessionCache*& aCache,TInt& aIndex,TBool aCreate) const;
   413 	void RasterizeHelperL(TInt aCode,TOpenFontGlyphData* aGlyphData,TOpenFontGlyphData*& aTempGlyphData);
   395 	void RasterizeHelperL(TInt aCode,TOpenFontGlyphData* aGlyphData,TOpenFontGlyphData*& aTempGlyphData);
   414 #ifdef FNTSTORE_SUPPORT_FMM
   396 
   415 	inline COpenFontSessionCacheList* SessionCacheList();
   397 	COpenFontSessionCacheList* SessionCacheList()const;
   416 #endif // FNTSTORE_SUPPORT_FMM
   398 	
       
   399     void SetSessionCacheList(COpenFontSessionCacheList* aSessionCacheList);
       
   400     
       
   401     void SetFile(COpenFontFile* aFile);
   417 private:
   402 private:
   418 	COpenFontFile* iFile;									// the file used by this font; null if it has been deleted
   403     
   419 															// or cannot be used
   404     // Offset from the address of the file used by this font.
       
   405     // If the file has been deleted or cannot be used, the offest will be zero.
       
   406     TInt iFileOffset;
       
   407     
   420 	TInt iFaceIndex;										// index of the face in the font file
   408 	TInt iFaceIndex;										// index of the face in the font file
   421 protected:
   409 protected:
   422 	/** WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please use the provided APIs only. 
   410     /**
   423 	 */
   411     WARNING: Compatibility is not guaranteed in future releases. Please use the provided APIs only.
   424 	COpenFontGlyphCache* iGlyphCache;						// the per-font glyph cache; owned by the font
   412     Offset from the address of this font of the per-font glyph cache which is owned by the font
       
   413     @internalTechnology
       
   414     */  
       
   415     TInt iGlyphCacheOffset;
   425 private:
   416 private:
   426 	COpenFontSessionCacheList* iSessionCacheList;			// the list of per-session glyph caches; owned by CFontStore
   417     // Offset from the address of this font of the list of per-session glyph
   427 #ifdef FNTSTORE_SUPPORT_FMM
   418     // caches which are owned by CFontStore
   428 	/** The initial "this" pointer that this object has when created. When this 
   419     TInt iSessionCacheListOffset;
   429 	object is used in a different process the offset between this starting 
   420 
   430 	"this" pointer and the current "this" pointer can be used to calculate
       
   431 	the offset to other objects that also exist on the shared FBServ heap. 
       
   432 	@see Offset() */
       
   433 	TInt iStartingThis;				
       
   434 #else
       
   435 	TAny* iReserved; // unused; for future expansion
   421 	TAny* iReserved; // unused; for future expansion
   436 #endif // FNTSTORE_SUPPORT_FMM
       
   437 	};
   422 	};
   438 
   423 
   439 /** Open Font System Extension Interface abstract base class.
   424 /** Open Font System Extension Interface abstract base class.
   440 
   425 
   441 COpenFont derivers should also derive from this interface to enable complex
   426 COpenFont derivers should also derive from this interface to enable complex
  1505 These are the attributes of the font represented by this object.
  1490 These are the attributes of the font represented by this object.
  1506 
  1491 
  1507 @return The typeface attributes. */
  1492 @return The typeface attributes. */
  1508 inline const TOpenFontFaceAttrib* COpenFont::FaceAttrib() const
  1493 inline const TOpenFontFaceAttrib* COpenFont::FaceAttrib() const
  1509 	{
  1494 	{
  1510 #ifdef FNTSTORE_SUPPORT_FMM
  1495     return iFileOffset == 0 ? NULL : &File()->FaceAttrib(iFaceIndex);
  1511 	return iFile ? &File()->FaceAttrib(iFaceIndex) : NULL;
       
  1512 #else
       
  1513 	return iFile ? &iFile->FaceAttrib(iFaceIndex) : NULL;
       
  1514 #endif // FNTSTORE_SUPPORT_FMM
       
  1515 	}
  1496 	}
  1516 
  1497 
  1517 /** Gets a pointer to the COpenFontFile which created this object.
  1498 /** Gets a pointer to the COpenFontFile which created this object.
  1518 
  1499 
  1519 This is the COpenFontFile which owns the file that contains the definition 
  1500 This is the COpenFontFile which owns the file that contains the definition 
  1521 to access the rasterizer context (engine).
  1502 to access the rasterizer context (engine).
  1522 
  1503 
  1523 @return The COpenFontFile which created this object. */
  1504 @return The COpenFontFile which created this object. */
  1524 inline COpenFontFile* COpenFont::File() const
  1505 inline COpenFontFile* COpenFont::File() const
  1525 	{
  1506 	{
  1526 #ifdef FNTSTORE_SUPPORT_FMM
  1507     return iFileOffset == 0 ? NULL : reinterpret_cast<COpenFontFile*>(const_cast<COpenFont*>(PtrAdd(this, iFileOffset)));
  1527 	return iFile?reinterpret_cast<COpenFontFile*>(reinterpret_cast<TInt>(iFile)+Offset()):NULL;
       
  1528 #else
       
  1529 	return iFile;
       
  1530 #endif // FNTSTORE_SUPPORT_FMM
       
  1531 	}
  1508 	}
  1532 
  1509 
  1533 /** Gets the index of this typeface within the font file.
  1510 /** Gets the index of this typeface within the font file.
  1534 
  1511 
  1535 @return The index of this typeface within the font file. */
  1512 @return The index of this typeface within the font file. */
  1645 */
  1622 */
  1646 inline TInt COpenFont::FontMaxHeight() const
  1623 inline TInt COpenFont::FontMaxHeight() const
  1647 	{
  1624 	{
  1648 	return iFontMaxAscent + iFontMaxDescent;
  1625 	return iFontMaxAscent + iFontMaxDescent;
  1649 	}
  1626 	}
  1650 
       
  1651 #ifdef FNTSTORE_SUPPORT_FMM
       
  1652 inline COpenFontSessionCacheList* COpenFont::SessionCacheList()
       
  1653 	{
       
  1654 	return iSessionCacheList?reinterpret_cast<COpenFontSessionCacheList*>(reinterpret_cast<TInt>(iSessionCacheList)+Offset()):NULL;
       
  1655 	}
       
  1656 
       
  1657 /** Used to calculate an offset that can be applied to pointers to objects on the
       
  1658 FBServ shared heap to convert them to valid pointers in the current process.
       
  1659 Add the value returned here to pointers to items on the shared heap to get a 
       
  1660 valid pointer to the item in the current process.
       
  1661   
       
  1662 @return Returns an offset between the "this" pointer that this object had on 
       
  1663 construction and its current "this" pointer.  
       
  1664  */
       
  1665 inline TInt COpenFont::Offset() const
       
  1666 	{
       
  1667 	return reinterpret_cast<TInt>(this)-iStartingThis;
       
  1668 	}
       
  1669 #endif // FNTSTORE_SUPPORT_FMM
       
  1670 
  1627 
  1671 /** Default C++ constructor.
  1628 /** Default C++ constructor.
  1672 
  1629 
  1673 This sets all attribute fields to zero. As for other T classes, there is no 
  1630 This sets all attribute fields to zero. As for other T classes, there is no 
  1674 need to explicitly clean-up objects derived from this class. */
  1631 need to explicitly clean-up objects derived from this class. */