Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
ATSUILayoutCache Class Reference
Collaboration diagram for ATSUILayoutCache:
Collaboration graph
[legend]

List of all members.

Classes

struct  atsuiLayoutCacheKey

Public Member Functions

 ATSUILayoutCache ()
 ~ATSUILayoutCache ()
PRBool Get (short aFont, short aSize, PRBool aBold, PRBool aItalic, nscolor aColor, ATSUTextLayout *aTxlayout)
void Set (short aFont, short aSize, PRBool aBold, PRBool aItalic, nscolor aColor, ATSUTextLayout aTxlayout)

Private Member Functions

PRBool Get (atsuiLayoutCacheKey *key, ATSUTextLayout *txlayout)
void Set (atsuiLayoutCacheKey *key, ATSUTextLayout txlayout)

Static Private Member Functions

static PR_CALLBACK PLHashNumber HashKey (const void *aKey)
static PR_CALLBACK PRIntn CompareKeys (const void *v1, const void *v2)
static PR_CALLBACK PRIntn CompareValues (const void *v1, const void *v2)
static PR_CALLBACK PRIntn FreeHashEntries (PLHashEntry *he, PRIntn italic, void *arg)

Private Attributes

struct PLHashTablemTable
PRUint32 mCount

Detailed Description

Definition at line 59 of file nsATSUIUtils.cpp.


Class Documentation

struct ATSUILayoutCache::atsuiLayoutCacheKey

Definition at line 69 of file nsATSUIUtils.cpp.

Class Members
short boldItalic
nscolor color
short font
short size

Constructor & Destructor Documentation

Definition at line 90 of file nsATSUIUtils.cpp.

Here is the call graph for this function:

Definition at line 104 of file nsATSUIUtils.cpp.

Here is the call graph for this function:


Member Function Documentation

PR_CALLBACK PRIntn ATSUILayoutCache::CompareKeys ( const void v1,
const void v2 
) [static, private]

Definition at line 165 of file nsATSUIUtils.cpp.

{
       atsuiLayoutCacheKey *k1 = (atsuiLayoutCacheKey *)v1;
       atsuiLayoutCacheKey *k2 = (atsuiLayoutCacheKey *)v2;
       return (k1->font == k2->font) && (k1->color == k2->color ) && (k1->size == k2->size) && (k1->boldItalic == k2->boldItalic);
}

Here is the caller graph for this function:

PR_CALLBACK PRIntn ATSUILayoutCache::CompareValues ( const void v1,
const void v2 
) [static, private]

Definition at line 173 of file nsATSUIUtils.cpp.

{
       ATSUTextLayout t1 = (ATSUTextLayout)v1;
       ATSUTextLayout t2 = (ATSUTextLayout)v2;
       return (t1 == t2);
}

Here is the caller graph for this function:

PR_CALLBACK PRIntn ATSUILayoutCache::FreeHashEntries ( PLHashEntry he,
PRIntn  italic,
void arg 
) [static, private]

Definition at line 181 of file nsATSUIUtils.cpp.

{
       delete (atsuiLayoutCacheKey*)he->key;
       ATSUDisposeTextLayout((ATSUTextLayout)he->value);
       return HT_ENUMERATE_REMOVE;
}

Here is the caller graph for this function:

PRBool ATSUILayoutCache::Get ( short  aFont,
short  aSize,
PRBool  aBold,
PRBool  aItalic,
nscolor  aColor,
ATSUTextLayout *  aTxlayout 
)

Definition at line 115 of file nsATSUIUtils.cpp.

{
       atsuiLayoutCacheKey k = {aFont, aSize, aColor, (aBold ? 1 : 0) + (aItalic ? 2 : 0) };
       return Get(&k, aTxlayout);
}
PRBool ATSUILayoutCache::Get ( atsuiLayoutCacheKey key,
ATSUTextLayout *  txlayout 
) [private]

Definition at line 133 of file nsATSUIUtils.cpp.

{
       PLHashEntry **hep = PL_HashTableRawLookup(mTable, HashKey(key), key);
       PLHashEntry *he = *hep;
       if( he )
       {
              *txlayout = (ATSUTextLayout)he->value;
              return PR_TRUE;
       }
       return PR_FALSE;
}

Here is the call graph for this function:

Definition at line 158 of file nsATSUIUtils.cpp.

{
       atsuiLayoutCacheKey* key = (atsuiLayoutCacheKey*)aKey;  
       return        key->font + (key->size << 7) + (key->boldItalic << 12) + key->color;
}

Here is the caller graph for this function:

void ATSUILayoutCache::Set ( short  aFont,
short  aSize,
PRBool  aBold,
PRBool  aItalic,
nscolor  aColor,
ATSUTextLayout  aTxlayout 
)

Definition at line 122 of file nsATSUIUtils.cpp.

{
       atsuiLayoutCacheKey k = {aFont, aSize, aColor, (aBold ? 1 : 0) + (aItalic ? 2 : 0) };
       return Set(&k, aTxlayout);
}

Here is the caller graph for this function:

void ATSUILayoutCache::Set ( atsuiLayoutCacheKey key,
ATSUTextLayout  txlayout 
) [private]

Definition at line 146 of file nsATSUIUtils.cpp.

{
       atsuiLayoutCacheKey *newKey = new atsuiLayoutCacheKey;
       if (newKey)
       {
              *newKey = *key;
              PL_HashTableAdd(mTable, newKey, txlayout);
              mCount ++;
       }
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 86 of file nsATSUIUtils.cpp.

Definition at line 85 of file nsATSUIUtils.cpp.


The documentation for this class was generated from the following file: