Merge to XFA: Use stdint.h types throughout PDFium.
[pdfium.git] / core / include / fpdfdoc / fpdf_vt.h
index 87ef025..fbfeacb 100644 (file)
@@ -26,7 +26,7 @@ struct CPVT_WordPlace {
     {
     }
 
-    CPVT_WordPlace(FX_INT32 nSecIndex, FX_INT32 nLineIndex, FX_INT32 nWordIndex)
+    CPVT_WordPlace(int32_t nSecIndex, int32_t nLineIndex, int32_t nWordIndex)
     {
         this->nSecIndex = nSecIndex;
         this->nLineIndex = nLineIndex;
@@ -48,7 +48,7 @@ struct CPVT_WordPlace {
         return wp.nSecIndex != this->nSecIndex || wp.nLineIndex != this->nLineIndex || wp.nWordIndex != this->nWordIndex;
     }
 
-    inline FX_INT32 WordCmp(const CPVT_WordPlace & wp) const
+    inline int32_t WordCmp(const CPVT_WordPlace & wp) const
     {
         if (this->nSecIndex > wp.nSecIndex) {
             return 1;
@@ -71,7 +71,7 @@ struct CPVT_WordPlace {
         return 0;
     }
 
-    inline FX_INT32 LineCmp(const CPVT_WordPlace & wp) const
+    inline int32_t LineCmp(const CPVT_WordPlace & wp) const
     {
         if (this->nSecIndex > wp.nSecIndex) {
             return 1;
@@ -88,7 +88,7 @@ struct CPVT_WordPlace {
         return 0;
     }
 
-    inline FX_INT32 SecCmp(const CPVT_WordPlace & wp) const
+    inline int32_t SecCmp(const CPVT_WordPlace & wp) const
     {
         if (this->nSecIndex > wp.nSecIndex) {
             return 1;
@@ -99,11 +99,11 @@ struct CPVT_WordPlace {
         return 0;
     }
 
-    FX_INT32                                                   nSecIndex;
+    int32_t                                                    nSecIndex;
 
-    FX_INT32                                                   nLineIndex;
+    int32_t                                                    nLineIndex;
 
-    FX_INT32                                                   nWordIndex;
+    int32_t                                                    nWordIndex;
 };
 struct CPVT_WordRange {
 
@@ -170,7 +170,7 @@ struct CPVT_SecProps  {
     {
     }
 
-    CPVT_SecProps(FX_FLOAT lineLeading, FX_FLOAT lineIndent, FX_INT32 alignment) :
+    CPVT_SecProps(FX_FLOAT lineLeading, FX_FLOAT lineIndent, int32_t alignment) :
         fLineLeading(lineLeading), fLineIndent(lineIndent), nAlignment(alignment)
     {
     }
@@ -184,7 +184,7 @@ struct CPVT_SecProps  {
 
     FX_FLOAT                   fLineIndent;
 
-    FX_INT32                   nAlignment;
+    int32_t                    nAlignment;
 };
 struct CPVT_WordProps  {
 
@@ -193,8 +193,8 @@ struct CPVT_WordProps  {
     {
     }
 
-    CPVT_WordProps(FX_INT32    fontIndex, FX_FLOAT fontSize, FX_COLORREF wordColor = 0, FX_INT32 scriptType = 0, FX_INT32 wordStyle = 0,
-                   FX_FLOAT charSpace = 0, FX_INT32 horzScale = 100) :
+    CPVT_WordProps(int32_t     fontIndex, FX_FLOAT fontSize, FX_COLORREF wordColor = 0, int32_t scriptType = 0, int32_t wordStyle = 0,
+                   FX_FLOAT charSpace = 0, int32_t horzScale = 100) :
         nFontIndex(fontIndex), fFontSize(fontSize), dwWordColor(wordColor), nScriptType(scriptType),
         nWordStyle(wordStyle), fCharSpace(charSpace), nHorzScale(horzScale)
     {
@@ -207,19 +207,19 @@ struct CPVT_WordProps  {
     {
     }
 
-    FX_INT32                                   nFontIndex;
+    int32_t                                    nFontIndex;
 
     FX_FLOAT                                   fFontSize;
 
     FX_COLORREF                                        dwWordColor;
 
-    FX_INT32                                   nScriptType;
+    int32_t                                    nScriptType;
 
-    FX_INT32                                   nWordStyle;
+    int32_t                                    nWordStyle;
 
     FX_FLOAT                                   fCharSpace;
 
-    FX_INT32                                   nHorzScale;
+    int32_t                                    nHorzScale;
 };
 struct CPVT_Word {
 
@@ -230,7 +230,7 @@ struct CPVT_Word {
 
     FX_WORD                                            Word;
 
-    FX_INT32                                   nCharset;
+    int32_t                                    nCharset;
 
     CPVT_WordPlace                             WordPlace;
 
@@ -242,7 +242,7 @@ struct CPVT_Word {
 
     FX_FLOAT                                   fWidth;
 
-    FX_INT32                                   nFontIndex;
+    int32_t                                    nFontIndex;
 
     FX_FLOAT                                   fFontSize;
 
@@ -281,17 +281,17 @@ class IPDF_VariableText_Provider
 public:
     virtual ~IPDF_VariableText_Provider() { }
 
-    virtual FX_INT32                                           GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle) = 0;
+    virtual int32_t                                            GetCharWidth(int32_t nFontIndex, FX_WORD word, int32_t nWordStyle) = 0;
 
-    virtual FX_INT32                                           GetTypeAscent(FX_INT32 nFontIndex) = 0;
+    virtual int32_t                                            GetTypeAscent(int32_t nFontIndex) = 0;
 
-    virtual FX_INT32                                           GetTypeDescent(FX_INT32 nFontIndex) = 0;
+    virtual int32_t                                            GetTypeDescent(int32_t nFontIndex) = 0;
 
-    virtual FX_INT32                                           GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex) = 0;
+    virtual int32_t                                            GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex) = 0;
 
     virtual FX_BOOL                                                    IsLatinWord(FX_WORD word) = 0;
 
-    virtual FX_INT32                                           GetDefaultFontIndex() = 0;
+    virtual int32_t                                            GetDefaultFontIndex() = 0;
 };
 class IPDF_VariableText_Iterator
 {
@@ -320,7 +320,7 @@ public:
 
     virtual    FX_BOOL                                                 SetSection(const CPVT_Section & section) = 0;
 
-    virtual void                                                       SetAt(FX_INT32 nWordIndex) = 0;
+    virtual void                                                       SetAt(int32_t nWordIndex) = 0;
 
     virtual void                                                       SetAt(const CPVT_WordPlace & place) = 0;
 
@@ -339,17 +339,17 @@ public:
 
     virtual void                                                       SetPlateRect(const CPDF_Rect & rect) = 0;
 
-    virtual void                                                       SetAlignment(FX_INT32 nFormat = 0) = 0;
+    virtual void                                                       SetAlignment(int32_t nFormat = 0) = 0;
 
     virtual void                                                       SetPasswordChar(FX_WORD wSubWord = '*') = 0;
 
-    virtual void                                                       SetLimitChar(FX_INT32 nLimitChar = 0) = 0;
+    virtual void                                                       SetLimitChar(int32_t nLimitChar = 0) = 0;
 
-    virtual void                                                       SetCharArray(FX_INT32 nCharArray = 0) = 0;
+    virtual void                                                       SetCharArray(int32_t nCharArray = 0) = 0;
 
     virtual void                                                       SetCharSpace(FX_FLOAT fCharSpace = 0.0f) = 0;
 
-    virtual void                                                       SetHorzScale(FX_INT32 nHorzScale = 100) = 0;
+    virtual void                                                       SetHorzScale(int32_t nHorzScale = 100) = 0;
 
     virtual void                                                       SetMultiLine(FX_BOOL bMultiLine = TRUE) = 0;
 
@@ -375,16 +375,16 @@ public:
 
     virtual void                                                       ResetAll() = 0;
 
-    virtual void                                                       SetText(FX_LPCWSTR text, FX_INT32 charset = 1, const CPVT_SecProps * pSecProps = NULL,
+    virtual void                                                       SetText(FX_LPCWSTR text, int32_t charset = 1, const CPVT_SecProps * pSecProps = NULL,
             const CPVT_WordProps * pWordProps = NULL) = 0;
 
-    virtual CPVT_WordPlace                                     InsertWord(const CPVT_WordPlace & place, FX_WORD word, FX_INT32 charset = 1,
+    virtual CPVT_WordPlace                                     InsertWord(const CPVT_WordPlace & place, FX_WORD word, int32_t charset = 1,
             const CPVT_WordProps * pWordProps = NULL) = 0;
 
     virtual CPVT_WordPlace                                     InsertSection(const CPVT_WordPlace & place, const CPVT_SecProps * pSecProps = NULL,
             const CPVT_WordProps * pWordProps = NULL) = 0;
 
-    virtual CPVT_WordPlace                                     InsertText(const CPVT_WordPlace & place, FX_LPCWSTR text, FX_INT32 charset = 1,
+    virtual CPVT_WordPlace                                     InsertText(const CPVT_WordPlace & place, FX_LPCWSTR text, int32_t charset = 1,
             const CPVT_SecProps * pSecProps = NULL,    const CPVT_WordProps * pWordProps = NULL) = 0;
 
     virtual CPVT_WordPlace                                     DeleteWords(const CPVT_WordRange & PlaceRange) = 0;
@@ -397,21 +397,21 @@ public:
 
     virtual CPDF_Rect                                          GetContentRect() const = 0;
 
-    virtual FX_INT32                                           GetTotalWords() const = 0;
+    virtual int32_t                                            GetTotalWords() const = 0;
 
     virtual FX_FLOAT                                           GetFontSize() const = 0;
 
-    virtual FX_INT32                                           GetAlignment() const = 0;
+    virtual int32_t                                            GetAlignment() const = 0;
 
     virtual FX_WORD                                                    GetPasswordChar() const = 0;
 
-    virtual FX_INT32                                           GetCharArray() const = 0;
+    virtual int32_t                                            GetCharArray() const = 0;
 
-    virtual FX_INT32                                           GetLimitChar() const = 0;
+    virtual int32_t                                            GetLimitChar() const = 0;
 
     virtual FX_BOOL                                                    IsMultiLine() const = 0;
 
-    virtual FX_INT32                                           GetHorzScale() const = 0;
+    virtual int32_t                                            GetHorzScale() const = 0;
 
     virtual FX_FLOAT                                           GetCharSpace() const = 0;
 
@@ -441,9 +441,9 @@ public:
 
     virtual CPVT_WordPlace                                     AjustLineHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const = 0;
 
-    virtual FX_INT32                                           WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0;
+    virtual int32_t                                            WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0;
 
-    virtual CPVT_WordPlace                                     WordIndexToWordPlace(FX_INT32 index) const = 0;
+    virtual CPVT_WordPlace                                     WordIndexToWordPlace(int32_t index) const = 0;
 
 protected:
     ~IPDF_VariableText() { }