#include <gr_CharWidthsCache.h>
Public Types | |
enum | { CACHE_FONT_SIZE = 120 } |
Static Public Member Functions | |
static GR_CharWidthsCache * | getCharWidthCache () |
static void | destroyCharWidthsCache () |
Protected Types | |
typedef std::map< std::string, GR_CharWidths * > | FontCache |
Protected Member Functions | |
FontCache::iterator | addFont (const GR_Font *pFont) |
GR_CharWidths * | getWidthsForFont (const GR_Font *pFont) |
Private Member Functions | |
GR_CharWidthsCache () | |
~GR_CharWidthsCache () | |
Static Private Member Functions | |
static void | _instantiate (void) |
Private Attributes | |
FontCache | m_fontHash |
Static Private Attributes | |
static GR_CharWidthsCache * | s_pInstance = NULL |
Friends | |
class | GR_Font |
typedef std::map<std::string, GR_CharWidths*> GR_CharWidthsCache::FontCache [protected] |
GR_CharWidthsCache::GR_CharWidthsCache | ( | ) | [private] |
GR_CharWidthsCache::~GR_CharWidthsCache | ( | ) | [private] |
References m_fontHash, and UT_map_delete_all_second().
void GR_CharWidthsCache::_instantiate | ( | void | ) | [static, private] |
Instanciate the singleton instance.
References s_pInstance.
GR_CharWidthsCache::FontCache::iterator GR_CharWidthsCache::addFont | ( | const GR_Font * | pFont | ) | [protected] |
References GR_Font::hashKey(), m_fontHash, and GR_Font::newFontWidths().
Referenced by getWidthsForFont().
static void GR_CharWidthsCache::destroyCharWidthsCache | ( | ) | [inline, static] |
Referenced by XAP_App::~XAP_App().
static GR_CharWidthsCache* GR_CharWidthsCache::getCharWidthCache | ( | ) | [inline, static] |
Get the singleton instance for the class. Instantiate it if needed.
Referenced by GR_Font::getCharWidthFromCache().
GR_CharWidths * GR_CharWidthsCache::getWidthsForFont | ( | const GR_Font * | pFont | ) | [protected] |
Return the char Width for the font
References addFont(), GR_Font::hashKey(), m_fontHash, and UT_DEBUGMSG.
Referenced by GR_Font::getCharWidthFromCache().
friend class GR_Font [friend] |
FontCache GR_CharWidthsCache::m_fontHash [private] |
The font hash that contains the GR_CharWidths
Referenced by addFont(), getWidthsForFont(), and ~GR_CharWidthsCache().
GR_CharWidthsCache * GR_CharWidthsCache::s_pInstance = NULL [static, private] |
The singleton instance.
Referenced by _instantiate().