Merge to XFA: Remove FX_BSTR and FX_WSTR typedefs.
[pdfium.git] / xfa / src / fdp / src / css / fde_cssstyleselector.h
index 4100299..9d1d02b 100644 (file)
@@ -27,24 +27,24 @@ public:
     void                                                       AddRulesFrom(const CFDE_CSSStyleSheetArray &sheets, FX_DWORD dwMediaList, IFX_FontMgr *pFontMgr);\r
     void                                                       Clear();\r
 \r
-    FX_INT32                                           CountSelectors() const\r
+    int32_t                                            CountSelectors() const\r
     {\r
         return m_iSelectors;\r
     }\r
     FDE_LPCSSRULEDATA                          GetIDRuleData(FX_DWORD dwIDHash)\r
     {\r
-        FX_LPVOID pData;\r
-        return m_IDRules.Lookup((FX_LPVOID)(FX_UINTPTR)dwIDHash, pData) ? (FDE_LPCSSRULEDATA)pData : NULL;\r
+        void* pData;\r
+        return m_IDRules.Lookup((void*)(uintptr_t)dwIDHash, pData) ? (FDE_LPCSSRULEDATA)pData : NULL;\r
     }\r
     FDE_LPCSSRULEDATA                          GetTagRuleData(FX_DWORD dwTagHasn)\r
     {\r
-        FX_LPVOID pData;\r
-        return m_TagRules.Lookup((FX_LPVOID)(FX_UINTPTR)dwTagHasn, pData) ? (FDE_LPCSSRULEDATA)pData : NULL;\r
+        void* pData;\r
+        return m_TagRules.Lookup((void*)(uintptr_t)dwTagHasn, pData) ? (FDE_LPCSSRULEDATA)pData : NULL;\r
     }\r
     FDE_LPCSSRULEDATA                          GetClassRuleData(FX_DWORD dwIDHash)\r
     {\r
-        FX_LPVOID pData;\r
-        return m_ClassRules.Lookup((FX_LPVOID)(FX_UINTPTR)dwIDHash, pData) ? (FDE_LPCSSRULEDATA)pData : NULL;\r
+        void* pData;\r
+        return m_ClassRules.Lookup((void*)(uintptr_t)dwIDHash, pData) ? (FDE_LPCSSRULEDATA)pData : NULL;\r
     }\r
     FDE_LPCSSRULEDATA                          GetUniversalRuleData()\r
     {\r
@@ -65,7 +65,7 @@ protected:
     CFX_MapPtrToPtr                                    m_ClassRules;\r
     FDE_LPCSSRULEDATA                          m_pUniversalRules;\r
     FDE_LPCSSRULEDATA                          m_pPersudoRules;\r
-    FX_INT32                                           m_iSelectors;\r
+    int32_t                                            m_iSelectors;\r
 };\r
 class CFDE_CSSAccelerator;\r
 class CFDE_CSSComputedStyle;\r
@@ -88,15 +88,15 @@ public:
     virtual void                                       UpdateStyleIndex(FX_DWORD dwMediaList);\r
     virtual IFDE_CSSAccelerator*       InitAccelerator();\r
     virtual IFDE_CSSComputedStyle*     CreateComputedStyle(IFDE_CSSComputedStyle *pParentStyle);\r
-    virtual FX_INT32                           MatchDeclarations(IFDE_CSSTagProvider *pTag, CFDE_CSSDeclarationArray &matchedDecls, FDE_CSSPERSUDO ePersudoType = FDE_CSSPERSUDO_NONE);\r
-    virtual void                                       ComputeStyle(IFDE_CSSTagProvider *pTag, const IFDE_CSSDeclaration **ppDeclArray, FX_INT32 iDeclCount, IFDE_CSSComputedStyle *pDestStyle);\r
+    virtual int32_t                            MatchDeclarations(IFDE_CSSTagProvider *pTag, CFDE_CSSDeclarationArray &matchedDecls, FDE_CSSPERSUDO ePersudoType = FDE_CSSPERSUDO_NONE);\r
+    virtual void                                       ComputeStyle(IFDE_CSSTagProvider *pTag, const IFDE_CSSDeclaration **ppDeclArray, int32_t iDeclCount, IFDE_CSSComputedStyle *pDestStyle);\r
 protected:\r
     void                                                       Reset();\r
     void                                                       MatchRules(FDE_LPCSSTAGCACHE pCache, FDE_LPCSSRULEDATA pList, FDE_CSSPERSUDO ePersudoType);\r
     void                                                       SortRulesTo(CFDE_CSSDeclarationArray &matchDecls);\r
     FX_BOOL                                                    MatchSelector(FDE_LPCSSTAGCACHE pCache, IFDE_CSSSelector *pSel, FDE_CSSPERSUDO ePersudoType);\r
-    void                                                       AppendInlineStyle(CFDE_CSSDeclaration *pDecl, FX_LPCWSTR psz, FX_INT32 iLen);\r
-    void                                                       ApplyDeclarations(FX_BOOL bPriority, const IFDE_CSSDeclaration **ppDeclArray, FX_INT32 iDeclCount, IFDE_CSSComputedStyle *pDestStyle);\r
+    void                                                       AppendInlineStyle(CFDE_CSSDeclaration *pDecl, const FX_WCHAR* psz, int32_t iLen);\r
+    void                                                       ApplyDeclarations(FX_BOOL bPriority, const IFDE_CSSDeclaration **ppDeclArray, int32_t iDeclCount, IFDE_CSSComputedStyle *pDestStyle);\r
     void                                                       ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSValue *pValue, CFDE_CSSComputedStyle *pComputedStyle);\r
 \r
     FX_FLOAT                                           ApplyNumber(FDE_CSSPRIMITIVETYPE eUnit, FX_FLOAT fValue, FX_FLOAT fPercentBase);\r
@@ -151,21 +151,21 @@ public:
     {\r
         FX_memset(this, 0, sizeof(_FDE_CSSCOUNTERDATA));\r
     }\r
-    FX_BOOL            GetCounterIncrement(FX_INT32 &iValue)\r
+    FX_BOOL            GetCounterIncrement(int32_t &iValue)\r
     {\r
         iValue = m_iIncVal;\r
         return m_bIncrement;\r
     }\r
-    FX_BOOL            GetCounterReset(FX_INT32 &iValue)\r
+    FX_BOOL            GetCounterReset(int32_t &iValue)\r
     {\r
         iValue = m_iResetVal;\r
         return m_bReset;\r
     }\r
-    FX_LPCWSTR m_pszIdent;\r
+    const FX_WCHAR*    m_pszIdent;\r
     FX_BOOL            m_bIncrement;\r
     FX_BOOL            m_bReset;\r
-    FX_INT32   m_iIncVal;\r
-    FX_INT32   m_iResetVal;\r
+    int32_t    m_iIncVal;\r
+    int32_t    m_iResetVal;\r
 } FDE_CSSCOUNTERDATA, *FDE_LPCSSCOUNTERDATA;\r
 class CFDE_CSSCounterStyle\r
 {\r
@@ -181,22 +181,22 @@ public:
         m_pCounterReset = pList;\r
         m_bIndexDirty = TRUE;\r
     }\r
-    FX_INT32                                                           CountCounters()\r
+    int32_t                                                            CountCounters()\r
     {\r
         UpdateIndex();\r
         return m_arrCounterData.GetSize();\r
     }\r
-    FX_BOOL                                                                    GetCounterIncrement(FX_INT32 index, FX_INT32 &iValue)\r
+    FX_BOOL                                                                    GetCounterIncrement(int32_t index, int32_t &iValue)\r
     {\r
         UpdateIndex();\r
         return m_arrCounterData.ElementAt(index).GetCounterIncrement(iValue);\r
     }\r
-    FX_BOOL                                                                    GetCounterReset(FX_INT32 index, FX_INT32 &iValue)\r
+    FX_BOOL                                                                    GetCounterReset(int32_t index, int32_t &iValue)\r
     {\r
         UpdateIndex();\r
         return m_arrCounterData.ElementAt(index).GetCounterReset(iValue);\r
     }\r
-    FX_LPCWSTR                                                         GetCounterIdentifier(FX_INT32 index)\r
+    const FX_WCHAR*                                                            GetCounterIdentifier(int32_t index)\r
     {\r
         UpdateIndex();\r
         return m_arrCounterData.ElementAt(index).m_pszIdent;\r
@@ -204,7 +204,7 @@ public:
 protected:\r
     void                                                                       UpdateIndex();\r
     void                                                                       DoUpdateIndex(IFDE_CSSValueList *pList);\r
-    FX_INT32                                                           FindIndex(FX_LPCWSTR pszIdentifier);\r
+    int32_t                                                            FindIndex(const FX_WCHAR* pszIdentifier);\r
     IFDE_CSSValueList                                          *m_pCounterInc;\r
     IFDE_CSSValueList                                          *m_pCounterReset;\r
     CFX_ArrayTemplate<FDE_CSSCOUNTERDATA>      m_arrCounterData;\r
@@ -227,7 +227,7 @@ public:
         m_bTextEmphasisColorCurrent = TRUE;\r
         m_iOrphans = 2;\r
     }\r
-    FX_LPCWSTR                                         m_pszListStyleImage;\r
+    const FX_WCHAR*                                            m_pszListStyleImage;\r
     FDE_CSSLENGTH                                      m_LetterSpacing;\r
     FDE_CSSLENGTH                                      m_WordSpacing;\r
     FDE_CSSLENGTH                                      m_TextIndent;\r
@@ -240,9 +240,9 @@ public:
     FX_ARGB                                                    m_dwFontColor;\r
     FX_ARGB                                                    m_dwTextEmphasisColor;\r
     FX_WORD                                                    m_wFontWeight;\r
-    FX_INT32                                           m_iWidows;\r
-    FX_INT32                                           m_iOrphans;\r
-    FX_LPCWSTR                                         m_pszTextEmphasisCustomMark;\r
+    int32_t                                            m_iWidows;\r
+    int32_t                                            m_iOrphans;\r
+    const FX_WCHAR*                                            m_pszTextEmphasisCustomMark;\r
     FX_WORD                                                    m_eFontVariant          : 1;\r
     FX_WORD                                                    m_eFontStyle            : 1;\r
     FX_WORD                                                    m_bTextEmphasisColorCurrent: 1;\r
@@ -289,7 +289,7 @@ public:
     FDE_CSSSIZE                                                m_MinBoxSize;\r
     FDE_CSSSIZE                                                m_MaxBoxSize;\r
     FDE_CSSPOINT                                       m_BKGPosition;\r
-    FX_LPCWSTR                                         m_pszBKGImage;\r
+    const FX_WCHAR*                                            m_pszBKGImage;\r
     FX_ARGB                                                    m_dwBKGColor;\r
     FX_ARGB                                                    m_dwBDRLeftColor;\r
     FX_ARGB                                                    m_dwBDRTopColor;\r
@@ -411,9 +411,9 @@ public:
     {\r
         return (IFDE_CSSRubyStyle * const)this;\r
     }\r
-    virtual FX_BOOL                                    GetCustomStyle(FX_WSTR wsName, CFX_WideString &wsValue) const\r
+    virtual FX_BOOL                                    GetCustomStyle(const CFX_WideStringC& wsName, CFX_WideString &wsValue) const\r
     {\r
-        for (FX_INT32 i = m_CustomProperties.GetSize() - 2; i > -1; i -= 2) {\r
+        for (int32_t i = m_CustomProperties.GetSize() - 2; i > -1; i -= 2) {\r
             if (wsName == m_CustomProperties[i]) {\r
                 wsValue = m_CustomProperties[i + 1];\r
                 return TRUE;\r
@@ -445,19 +445,19 @@ public:
     {\r
         return (FDE_CSSCAPTIONSIDE)m_InheritedData.m_eCaptionSide;\r
     }\r
-    virtual FX_INT32                           CountCounters()\r
+    virtual int32_t                            CountCounters()\r
     {\r
         return (m_NonInheritedData.m_pCounterStyle == NULL) ? 0 : m_NonInheritedData.m_pCounterStyle->CountCounters();\r
     }\r
-    virtual FX_LPCWSTR                         GetCounterIdentifier(FX_INT32 index)\r
+    virtual const FX_WCHAR*                            GetCounterIdentifier(int32_t index)\r
     {\r
         return m_NonInheritedData.m_pCounterStyle->GetCounterIdentifier(index);\r
     }\r
-    virtual FX_BOOL                                    GetCounterReset(FX_INT32 index, FX_INT32 &iValue)\r
+    virtual FX_BOOL                                    GetCounterReset(int32_t index, int32_t &iValue)\r
     {\r
         return m_NonInheritedData.m_pCounterStyle->GetCounterReset(index, iValue);\r
     }\r
-    virtual FX_BOOL                                    GetCounterIncrement(FX_INT32 index, FX_INT32 &iValue)\r
+    virtual FX_BOOL                                    GetCounterIncrement(int32_t index, int32_t &iValue)\r
     {\r
         return m_NonInheritedData.m_pCounterStyle->GetCounterIncrement(index, iValue);\r
     }\r
@@ -465,11 +465,11 @@ public:
     {\r
         return m_NonInheritedData.m_pContentList;\r
     }\r
-    virtual FX_INT32                           CountQuotes() const\r
+    virtual int32_t                            CountQuotes() const\r
     {\r
         return m_InheritedData.m_pQuotes == NULL ? 0 : m_InheritedData.m_pQuotes->CountValues();\r
     }\r
-    virtual FX_LPCWSTR                         GetQuotes(FX_INT32 index) const\r
+    virtual const FX_WCHAR*                            GetQuotes(int32_t index) const\r
     {\r
         FXSYS_assert(m_InheritedData.m_pQuotes != NULL && m_InheritedData.m_pQuotes->CountValues() > index);\r
         return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pQuotes->GetValue(index)))->GetString(index);\r
@@ -522,11 +522,11 @@ public:
     {\r
         m_NonInheritedData.m_ColumnWidth = columnWidth;\r
     }\r
-    virtual FX_INT32                           CountFontFamilies() const\r
+    virtual int32_t                            CountFontFamilies() const\r
     {\r
         return m_InheritedData.m_pFontFamily ? m_InheritedData.m_pFontFamily->CountValues() : 0;\r
     }\r
-    virtual FX_LPCWSTR                         GetFontFamily(FX_INT32 index) const\r
+    virtual const FX_WCHAR*                            GetFontFamily(int32_t index) const\r
     {\r
         return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pFontFamily->GetValue(index)))->GetString(index);\r
     }\r
@@ -782,7 +782,7 @@ public:
     {\r
         return (FDE_CSSWORDBREAK)m_InheritedData.m_eWordBreak;\r
     }\r
-    virtual FX_INT32                           GetWidows() const\r
+    virtual int32_t                            GetWidows() const\r
     {\r
         return m_InheritedData.m_iWidows;\r
     }\r
@@ -802,7 +802,7 @@ public:
     {\r
         return (FDE_CSSPAGEBREAK)m_NonInheritedData.m_ePageBreakInside;\r
     }\r
-    virtual FX_INT32                           GetOrphans() const\r
+    virtual int32_t                            GetOrphans() const\r
     {\r
         return m_InheritedData.m_iOrphans;\r
     }\r
@@ -815,7 +815,7 @@ public:
     {\r
         return (FDE_CSSTEXTEMPHASISFILL)m_InheritedData.m_eTextEmphasisFill;\r
     }\r
-    virtual FX_LPCWSTR                         GetTextEmphasisCustom() const\r
+    virtual const FX_WCHAR*                            GetTextEmphasisCustom() const\r
     {\r
         FXSYS_assert(m_InheritedData.m_eTextEmphasisMark == FDE_CSSTEXTEMPHASISMARK_Custom);\r
         return m_InheritedData.m_pszTextEmphasisCustomMark;\r
@@ -881,7 +881,7 @@ public:
     {\r
         m_InheritedData.m_eWordBreak = eWordBreak;\r
     }\r
-    virtual void                                       SetWidows(FX_INT32 iWidows)\r
+    virtual void                                       SetWidows(int32_t iWidows)\r
     {\r
         m_InheritedData.m_iWidows = iWidows;\r
     }\r
@@ -901,7 +901,7 @@ public:
     {\r
         m_NonInheritedData.m_ePageBreakInside = ePageBreakInside;\r
     }\r
-    virtual void                                       SetOrphans(FX_INT32 iOrphans)\r
+    virtual void                                       SetOrphans(int32_t iOrphans)\r
     {\r
         m_InheritedData.m_iOrphans = iOrphans;\r
     }\r
@@ -913,7 +913,7 @@ public:
     {\r
         return m_NonInheritedData.m_dwBKGColor;\r
     }\r
-    virtual FX_LPCWSTR                         GetBKGImage() const\r
+    virtual const FX_WCHAR*                            GetBKGImage() const\r
     {\r
         return m_NonInheritedData.m_pszBKGImage;\r
     }\r
@@ -949,11 +949,11 @@ public:
     {\r
         return (FDE_CSSOVERFLOW)m_NonInheritedData.m_eOverflowY;\r
     }\r
-    virtual FX_INT32                           CountCursorUrls() const\r
+    virtual int32_t                            CountCursorUrls() const\r
     {\r
         return m_InheritedData.m_pCursorUris == NULL ? 0 : m_InheritedData.m_pCursorUris->CountValues();\r
     }\r
-    virtual FX_LPCWSTR                         GetCursorUrl(FX_INT32 index) const\r
+    virtual const FX_WCHAR*                            GetCursorUrl(int32_t index) const\r
     {\r
         FXSYS_assert(m_InheritedData.m_pCursorUris != NULL);\r
         return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pCursorUris->GetValue(index)))->GetString(index);\r
@@ -974,7 +974,7 @@ public:
     {\r
         return (FDE_CSSLISTSTYLEPOSITION)m_NonInheritedData.m_eListStylePosition;\r
     }\r
-    virtual FX_LPCWSTR                                 GetListStyleImage() const\r
+    virtual const FX_WCHAR*                                    GetListStyleImage() const\r
     {\r
         return m_InheritedData.m_pszListStyleImage;\r
     }\r