Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_FontRecord Class Reference

CP_FontRecord Class that maintains a mapping between Windows HFONTs/LOGFONTs and a CP_Font. More...

Inheritance diagram for CP_FontRecord:

CP_M_RefCounted List of all members.

Public Member Functions

Constructor / Destructor
 CP_FontRecord (LOGFONTA &inLogFont)
 Constructor.
 ~CP_FontRecord ()
 Destructor.

Static Public Member Functions

Lookup
static CP_FontRecordLookupFont (LOGFONTA &inLogFont)

Public Attributes

HFONT fWinFont
LOGFONTA fLogFontA

Static Public Attributes

static CP_FontRecordList gFontList

Detailed Description

In order to prevent excessive duplication of GDI resources (creating HFONTs for identical LOGFONTs), manage a table of refcounted CP_FontRecords (which contain a LOGFONT and HFONT). Instead of CP_Font creating a font, it calls CP_FontRecord::LookupFont and if the identical font has already been created, it will use the existing one. HFONT disposal happens at the right time as long as the CP_Font unselects the HFONT when it's finished using it.


Constructor & Destructor Documentation

CP_FontRecord::CP_FontRecord LOGFONTA &  inLogFont  ) 
 

Constructor.

Parameters:
inLogFont Non Unicode version of the Windows LOGFONT structure.
Exceptions:
none 

CP_FontRecord::~CP_FontRecord  ) 
 

Destructor.

Exceptions:
none 


Member Function Documentation

CP_FontRecord * CP_FontRecord::LookupFont LOGFONTA &  inLogFont  )  [static]
 

Return a CP_FontRecord for the passed in LOGFONT structure.

Parameters:
inLogFont Non Unicode version of the Windows LOGFONT structure.
Exceptions:
none 
Returns:
CP_FontRecord * A CP_FontRecord corresponding to the passed in Windows LOGFONT structure

UInt32 CP_M_RefCounted::AddReference  )  const [inherited]
 

Add a reference to our object, returning the new reference count.

Exceptions:
none 
Returns:
UInt32 const Returns the new reference count.

UInt32 CP_M_RefCounted::RemoveReference  )  const [inherited]
 

Remove a reference to our object, returning the new reference count. If the count is 0, then this object is also deleted, and 0 is returned.

Exceptions:
none 
Returns:
UInt32 const Returns the new reference count.

void CP_M_RefCounted::Autorelease  )  const [inherited]
 

Add the object to the topmost auto-release pool. This will ensure that the object is eventually released.

See also:
CP_AutoReleasePool
Exceptions:
none 
Returns:
void

UInt32 CP_M_RefCounted::GetRefCount  )  const [inherited]
 

Returns the current ref count.

Exceptions:
none 
Returns:
UInt32 The current referencce count.


Member Data Documentation

HFONT CP_FontRecord::fWinFont
 

LOGFONTA CP_FontRecord::fLogFontA
 

Windows HFONT.

CP_FontRecordList CP_FontRecord::gFontList [static]
 

Windows LOGFONT structure containing information about the font.


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:01:42 2005 for CPLAT by  doxygen 1.4.0