MOZ_COUNT_CTOR(nsGlyphTableList); NS_INIT_ISUPPORTS(); mDefaultCount = 0;
MOZ_COUNT_CTOR(nsGlyphTable); mFontName.AppendString(aPrimaryFontName); mType = NS_TABLE_TYPE_UNICODE; mState = NS_TABLE_STATE_EMPTY; mCharCache = 0;
MOZ_DECL_CTOR_COUNTER(nsGlyphTableList)class nsGlyphTableList : public nsIObserver{public:  NS_DECL_ISUPPORTS  NS_DECL_NSIOBSERVER  // These are placeholders used to cache the indices (in mTableList) of  // the preferred extension tables for the particular chars.  // Each stretchy char can have a preferred ordered list of fonts to  // be used for its parts, and/or another preferred ordered list of   // fonts to be used for its variants of larger sizes.  // Several levels of indirection are used to store this information.  // The stretchy chars are collated in an array in nsMathMLOperators.  // If 'index' is the rank of a stretchy char in that array, then  // mTableList[gParts[index]] is the first preferred table to be used for  // the parts of that stretchy char, mTableList[gParts[index]+1] is the  // second table, etc. The same reasoning applies with gVariants[index].  static PRInt32* gParts;  static PRInt32* gVariants;  nsGlyphTableList()  {    MOZ_COUNT_CTOR(nsGlyphTableList);    NS_INIT_ISUPPORTS();    mDefaultCount = 0;  }  virtual ~nsGlyphTableList()  {    MOZ_COUNT_DTOR(nsGlyphTableList);  }  nsresult Initialize();  nsresult Finalize();  nsGlyphTable* ElementAt(PRInt32 aIndex)  {    return NS_STATIC_CAST(nsGlyphTable*, mTableList.ElementAt(aIndex));  }  PRInt32 Count(PRBool aEverything = PR_FALSE)  {    return (aEverything) ? mTableList.Count() : mDefaultCount;  }  PRBool AppendElement(nsGlyphTable* aGlyphTable) {    return mTableList.AppendElement(aGlyphTable);  }  // Add a glyph table in the list  nsresult  AddGlyphTable(nsString& aPrimaryFontName);  // Find a glyph table in the list that has a glyph for the given char  nsGlyphTable*  GetGlyphTableFor(nsIPresContext* aPresContext,                   nsMathMLChar*   aChar);  // Find the subset of glyph tables that are applicable to the given char,  // knowing that the stretchy style context of the char has the given font.  // aGlyphTableList is not cleared here, we just append to what may exist there.  nsresult  GetListFor(nsIPresContext* aPresContext,             nsMathMLChar*   aChar,             nsFont*         aFont,             nsVoidArray*    aGlyphTableList);  // Retrieve the subset of preferred glyph tables that start at the given index  // Return the number of installed fonts that are retrieved or 0 if none is found.  // If at least one font is found, the preferred fonts become active and  // take precedence (i.e., whatever was in the existing aGlyphTableList is  // cleared). But if it turns out that no preferred font is actually installed,  // the code behaves as if no preferred font was specified at all (i.e., whatever  // was in aGlyphTableList is retained).  nsresult  GetPreferredListAt(nsIPresContext* aPresContext,                     PRInt32         aStartingIndex,                      nsVoidArray*    aGlyphTableList,                     PRInt32*        aCount);private:  // Ordered list of glyph tables subdivided in several null-separated segments.  // The first segment contains mDefaultCount entries which are the default  // fonts as provided in the mathfont.properties file. The remainder of the  // list is used to store the preferred tables for the particular chars  // as explained above.  nsVoidArray mTableList;  PRInt32     mDefaultCount;};