diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-06-09 13:24:12 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-06-09 13:24:12 -0700 |
commit | bfa9a824a20f37c2dd7111012b46c929cf2ed8a0 (patch) | |
tree | 4cfbe682869d89900f33751c37f6a84865beeb0a /core/include | |
parent | b116136da234afcad018bb44a3ccb64b9ad2a554 (diff) | |
download | pdfium-bfa9a824a20f37c2dd7111012b46c929cf2ed8a0.tar.xz |
Merge to XFA: Use stdint.h types throughout PDFium.
Near-automatic merge, plus re-running scripts to update
additional usage.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1172793002
Diffstat (limited to 'core/include')
28 files changed, 352 insertions, 363 deletions
diff --git a/core/include/fdrm/fx_crypt.h b/core/include/fdrm/fx_crypt.h index 7bd69defdf..8b0ce2f703 100644 --- a/core/include/fdrm/fx_crypt.h +++ b/core/include/fdrm/fx_crypt.h @@ -20,26 +20,26 @@ void CRYPT_AESSetKey(FX_LPVOID context, FX_DWORD blocklen, FX_LPCBYTE key, FX_DW void CRYPT_AESSetIV(FX_LPVOID context, FX_LPCBYTE iv); void CRYPT_AESDecrypt(FX_LPVOID context, FX_LPBYTE dest, FX_LPCBYTE src, FX_DWORD size); void CRYPT_AESEncrypt(FX_LPVOID context, FX_LPBYTE dest, FX_LPCBYTE src, FX_DWORD size); -void CRYPT_MD5Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[16]); +void CRYPT_MD5Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[16]); void CRYPT_MD5Start(FX_LPVOID context); void CRYPT_MD5Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size); -void CRYPT_MD5Finish(FX_LPVOID context, FX_BYTE digest[16]); -void CRYPT_SHA1Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[20]); +void CRYPT_MD5Finish(FX_LPVOID context, uint8_t digest[16]); +void CRYPT_SHA1Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[20]); void CRYPT_SHA1Start(FX_LPVOID context); void CRYPT_SHA1Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size); -void CRYPT_SHA1Finish(FX_LPVOID context, FX_BYTE digest[20]); -void CRYPT_SHA256Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[32]); +void CRYPT_SHA1Finish(FX_LPVOID context, uint8_t digest[20]); +void CRYPT_SHA256Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[32]); void CRYPT_SHA256Start(FX_LPVOID context); void CRYPT_SHA256Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size); -void CRYPT_SHA256Finish(FX_LPVOID context, FX_BYTE digest[32]); +void CRYPT_SHA256Finish(FX_LPVOID context, uint8_t digest[32]); void CRYPT_SHA384Start(FX_LPVOID context); void CRYPT_SHA384Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size); -void CRYPT_SHA384Finish(FX_LPVOID context, FX_BYTE digest[48]); -void CRYPT_SHA384Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[48]); +void CRYPT_SHA384Finish(FX_LPVOID context, uint8_t digest[48]); +void CRYPT_SHA384Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[48]); void CRYPT_SHA512Start(FX_LPVOID context); void CRYPT_SHA512Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size); -void CRYPT_SHA512Finish(FX_LPVOID context, FX_BYTE digest[64]); -void CRYPT_SHA512Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[64]); +void CRYPT_SHA512Finish(FX_LPVOID context, uint8_t digest[64]); +void CRYPT_SHA512Generate(FX_LPCBYTE data, FX_DWORD size, uint8_t digest[64]); void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(FX_LPCBYTE pData, FX_DWORD size, FX_LPBYTE data_buf, FX_DWORD& data_len)); #ifdef __cplusplus diff --git a/core/include/fpdfapi/fpdf_objects.h b/core/include/fpdfapi/fpdf_objects.h index c0065def47..8444f09b70 100644 --- a/core/include/fpdfapi/fpdf_objects.h +++ b/core/include/fpdfapi/fpdf_objects.h @@ -520,7 +520,7 @@ public: void SetData(FX_LPCBYTE pData, FX_DWORD size, FX_BOOL bCompressed, FX_BOOL bKeepBuf); - void InitStream(FX_BYTE* pData, FX_DWORD size, CPDF_Dictionary* pDict); + void InitStream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDict); void InitStream(IFX_FileRead *pFile, CPDF_Dictionary* pDict); @@ -657,7 +657,7 @@ protected: FX_DWORD m_SrcOffset; - FX_BYTE m_SrcBuffer[FPDF_FILTER_BUFFER_SIZE]; + uint8_t m_SrcBuffer[FPDF_FILTER_BUFFER_SIZE]; friend class CPDF_Stream; }; class CPDF_Null : public CPDF_Object diff --git a/core/include/fpdfapi/fpdf_pageobj.h b/core/include/fpdfapi/fpdf_pageobj.h index 1b53bdc859..e09c0456fe 100644 --- a/core/include/fpdfapi/fpdf_pageobj.h +++ b/core/include/fpdfapi/fpdf_pageobj.h @@ -114,7 +114,7 @@ public: CPDF_Path* m_pPathList; - FX_BYTE* m_pTypeList; + uint8_t* m_pTypeList; int m_TextCount; diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h index d18d362ec0..f0e3e2ca08 100644 --- a/core/include/fpdfapi/fpdf_parser.h +++ b/core/include/fpdfapi/fpdf_parser.h @@ -269,7 +269,7 @@ public: CFX_ByteString GetKeyword(); - void GetBinary(FX_BYTE* buffer, FX_DWORD size); + void GetBinary(uint8_t* buffer, FX_DWORD size); void ToNextLine(); @@ -291,18 +291,18 @@ public: return m_pCryptoHandler != NULL; } - FX_BOOL GetCharAt(FX_FILESIZE pos, FX_BYTE& ch); + FX_BOOL GetCharAt(FX_FILESIZE pos, uint8_t& ch); - FX_BOOL ReadBlock(FX_BYTE* pBuf, FX_DWORD size); + FX_BOOL ReadBlock(uint8_t* pBuf, FX_DWORD size); CFX_ByteString GetNextWord(FX_BOOL& bIsNumber); protected: static const int kParserMaxRecursionDepth = 64; static int s_CurrentRecursionDepth; - virtual FX_BOOL GetNextChar(FX_BYTE& ch); + virtual FX_BOOL GetNextChar(uint8_t& ch); - FX_BOOL GetCharAtBackward(FX_FILESIZE pos, FX_BYTE& ch); + FX_BOOL GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch); void GetNextWord(); @@ -326,7 +326,7 @@ protected: FX_FILESIZE m_FileLen; - FX_BYTE* m_pFileBuf; + uint8_t* m_pFileBuf; FX_DWORD m_BufSize; @@ -334,7 +334,7 @@ protected: CPDF_CryptoHandler* m_pCryptoHandler; - FX_BYTE m_WordBuffer[257]; + uint8_t m_WordBuffer[257]; FX_DWORD m_WordSize; @@ -458,7 +458,7 @@ public: return m_ObjVersion[objnum]; } - void GetIndirectBinary(FX_DWORD objnum, FX_BYTE*& pBuffer, FX_DWORD& size); + void GetIndirectBinary(FX_DWORD objnum, uint8_t*& pBuffer, FX_DWORD& size); FX_BOOL GetFileStreamOption() { @@ -635,7 +635,7 @@ public: FX_LPCBYTE user_pass, FX_DWORD user_size, FX_DWORD type = PDF_ENCRYPT_CONTENT); CFX_ByteString GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size); - CFX_ByteString GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size, FX_INT32 key_len); + CFX_ByteString GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size, int32_t key_len); int GetVersion() { return m_Version; @@ -661,16 +661,16 @@ private: FX_BOOL LoadDict(CPDF_Dictionary* pEncryptDict, FX_DWORD type, int& cipher, int& key_len); FX_BOOL CheckUserPassword(FX_LPCBYTE password, FX_DWORD pass_size, - FX_BOOL bIgnoreEncryptMeta, FX_LPBYTE key, FX_INT32 key_len); + FX_BOOL bIgnoreEncryptMeta, FX_LPBYTE key, int32_t key_len); - FX_BOOL CheckOwnerPassword(FX_LPCBYTE password, FX_DWORD pass_size, FX_LPBYTE key, FX_INT32 key_len); + FX_BOOL CheckOwnerPassword(FX_LPCBYTE password, FX_DWORD pass_size, FX_LPBYTE key, int32_t key_len); FX_BOOL AES256_CheckPassword(FX_LPCBYTE password, FX_DWORD size, FX_BOOL bOwner, FX_LPBYTE key); void AES256_SetPassword(CPDF_Dictionary* pEncryptDict, FX_LPCBYTE password, FX_DWORD size, FX_BOOL bOwner, FX_LPCBYTE key); void AES256_SetPerms(CPDF_Dictionary* pEncryptDict, FX_DWORD permission, FX_BOOL bEncryptMetadata, FX_LPCBYTE key); void OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray, FX_LPCBYTE user_pass, FX_DWORD user_size, FX_LPCBYTE owner_pass, FX_DWORD owner_size, FX_BOOL bDefault, FX_DWORD type); - FX_BOOL CheckSecurity(FX_INT32 key_len); + FX_BOOL CheckSecurity(int32_t key_len); FX_BOOL m_bOwner; @@ -678,7 +678,7 @@ private: int m_Cipher; - FX_BYTE m_EncryptKey[32]; + uint8_t m_EncryptKey[32]; int m_KeyLen; }; @@ -731,7 +731,7 @@ protected: virtual FX_BOOL CryptStream(FX_LPVOID context, FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt); virtual FX_BOOL CryptFinish(FX_LPVOID context, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt); - FX_BYTE m_EncryptKey[32]; + uint8_t m_EncryptKey[32]; int m_KeyLen; @@ -798,9 +798,9 @@ protected: CFX_WideString FPDF_FileSpec_GetWin32Path(const CPDF_Object* pFileSpec); void FPDF_FileSpec_SetWin32Path(CPDF_Object* pFileSpec, const CFX_WideString& fullpath); -void FlateEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); -FX_DWORD FlateDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); -FX_DWORD RunLengthDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); +void FlateEncode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); +FX_DWORD FlateDecode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); +FX_DWORD RunLengthDecode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size); class CPDF_NumberTree { public: @@ -847,8 +847,8 @@ public: virtual void SetDocument(CPDF_Document* pDoc) = 0; virtual FX_BOOL IsPageAvail(int iPage, IFX_DownloadHints* pHints) = 0; virtual FX_BOOL IsLinearized() = 0; - virtual FX_INT32 IsFormAvail(IFX_DownloadHints *pHints) = 0; - virtual FX_INT32 IsLinearizedPDF() = 0; + virtual int32_t IsFormAvail(IFX_DownloadHints *pHints) = 0; + virtual int32_t IsLinearizedPDF() = 0; virtual void GetLinearizedMainXRefInfo(FX_FILESIZE *pPos, FX_DWORD *pSize) = 0; protected: diff --git a/core/include/fpdfapi/fpdf_render.h b/core/include/fpdfapi/fpdf_render.h index 47d1b19920..2f03ae5bb7 100644 --- a/core/include/fpdfapi/fpdf_render.h +++ b/core/include/fpdfapi/fpdf_render.h @@ -241,7 +241,7 @@ public: void ClearImageData(); FX_DWORD EstimateSize(); - void CacheOptimization(FX_INT32 dwLimitCacheSize); + void CacheOptimization(int32_t dwLimitCacheSize); FX_DWORD GetCachedSize(CPDF_Stream* pStream) const; FX_DWORD GetTimeCount() const { @@ -254,7 +254,7 @@ public: void GetCachedBitmap(CPDF_Stream* pStream, CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, - CPDF_RenderStatus* pRenderStatus = NULL, FX_INT32 downsampleWidth = 0, FX_INT32 downsampleHeight = 0); + CPDF_RenderStatus* pRenderStatus = NULL, int32_t downsampleWidth = 0, int32_t downsampleHeight = 0); void ResetBitmap(CPDF_Stream* pStream, const CFX_DIBitmap* pBitmap); void ClearImageCache(CPDF_Stream* pStream); @@ -266,7 +266,7 @@ public: public: FX_BOOL StartGetCachedBitmap(CPDF_Stream* pStream, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, - FX_INT32 downsampleWidth = 0, FX_INT32 downsampleHeight = 0); + int32_t downsampleWidth = 0, int32_t downsampleHeight = 0); FX_BOOL Continue(IFX_Pause* pPause); CPDF_ImageCache* m_pCurImageCache; diff --git a/core/include/fpdfapi/fpdf_resource.h b/core/include/fpdfapi/fpdf_resource.h index f1ea6b5a23..06dcdfec44 100644 --- a/core/include/fpdfapi/fpdf_resource.h +++ b/core/include/fpdfapi/fpdf_resource.h @@ -160,7 +160,7 @@ public: if (offset < 0 || nStrLen < 1) { return 0; } - FX_BYTE ch = offset < nStrLen ? pString[offset++] : pString[nStrLen-1]; + uint8_t ch = offset < nStrLen ? pString[offset++] : pString[nStrLen-1]; return static_cast<FX_DWORD>(ch); } @@ -326,14 +326,14 @@ public: FX_BOOL IsIdentical(CPDF_FontEncoding* pAnother) const; - FX_WCHAR UnicodeFromCharCode(FX_BYTE charcode) const + FX_WCHAR UnicodeFromCharCode(uint8_t charcode) const { return m_Unicodes[charcode]; } int CharCodeFromUnicode(FX_WCHAR unicode) const; - void SetUnicode(FX_BYTE charcode, FX_WCHAR unicode) + void SetUnicode(uint8_t charcode, FX_WCHAR unicode) { m_Unicodes[charcode] = unicode; } @@ -368,7 +368,7 @@ protected: virtual void LoadGlyphMap() = 0; virtual FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const { - return m_Encoding.UnicodeFromCharCode((FX_BYTE)charcode); + return m_Encoding.UnicodeFromCharCode((uint8_t)charcode); } virtual FX_DWORD _CharCodeFromUnicode(FX_WCHAR Unicode) const { @@ -831,7 +831,7 @@ public: { } FX_ARGB* pMatteColor; - FX_INT32 nQuality; + int32_t nQuality; }; class CPDF_Image { @@ -884,12 +884,12 @@ public: - FX_INT32 GetPixelHeight() const + int32_t GetPixelHeight() const { return m_Height; } - FX_INT32 GetPixelWidth() const + int32_t GetPixelWidth() const { return m_Width; } @@ -909,9 +909,9 @@ public: - void SetImage(const CFX_DIBitmap* pDIBitmap, FX_INT32 iCompress, IFX_FileWrite *pFileWrite = NULL, IFX_FileRead *pFileRead = NULL, const CFX_DIBitmap* pMask = NULL, const CPDF_ImageSetParam* pParam = NULL); + void SetImage(const CFX_DIBitmap* pDIBitmap, int32_t iCompress, IFX_FileWrite *pFileWrite = NULL, IFX_FileRead *pFileRead = NULL, const CFX_DIBitmap* pMask = NULL, const CPDF_ImageSetParam* pParam = NULL); - void SetJpegImage(FX_BYTE* pImageData, FX_DWORD size); + void SetJpegImage(uint8_t* pImageData, FX_DWORD size); void SetJpegImage(IFX_FileRead *pFile); @@ -931,9 +931,9 @@ private: FX_BOOL m_bInline; CPDF_Dictionary* m_pInlineDict; - FX_INT32 m_Height; + int32_t m_Height; - FX_INT32 m_Width; + int32_t m_Width; FX_BOOL m_bIsMask; diff --git a/core/include/fpdfapi/fpdf_serial.h b/core/include/fpdfapi/fpdf_serial.h index fc55fa08a9..e4a0aec2e5 100644 --- a/core/include/fpdfapi/fpdf_serial.h +++ b/core/include/fpdfapi/fpdf_serial.h @@ -127,9 +127,9 @@ public: FX_BOOL Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0); - FX_INT32 Continue(IFX_Pause *pPause = NULL); + int32_t Continue(IFX_Pause *pPause = NULL); - FX_BOOL SetFileVersion(FX_INT32 fileVersion = 17); + FX_BOOL SetFileVersion(int32_t fileVersion = 17); protected: CPDF_Document* m_pDocument; @@ -155,16 +155,16 @@ protected: CPDF_XRefStream* m_pXRefStream; - FX_INT32 m_ObjectStreamSize; + int32_t m_ObjectStreamSize; FX_DWORD m_dwLastObjNum; FX_BOOL Create(FX_DWORD flags); void ResetStandardSecurity(); void Clear(); - FX_INT32 WriteDoc_Stage1(IFX_Pause *pPause); - FX_INT32 WriteDoc_Stage2(IFX_Pause *pPause); - FX_INT32 WriteDoc_Stage3(IFX_Pause *pPause); - FX_INT32 WriteDoc_Stage4(IFX_Pause *pPause); + int32_t WriteDoc_Stage1(IFX_Pause *pPause); + int32_t WriteDoc_Stage2(IFX_Pause *pPause); + int32_t WriteDoc_Stage3(IFX_Pause *pPause); + int32_t WriteDoc_Stage4(IFX_Pause *pPause); CFX_FileBufferArchive m_File; @@ -172,19 +172,19 @@ protected: void InitOldObjNumOffsets(); void InitNewObjNumOffsets(); void AppendNewObjNum(FX_DWORD objbum); - FX_INT32 WriteOldIndirectObject(FX_DWORD objnum); - FX_INT32 WriteOldObjs(IFX_Pause *pPause); - FX_INT32 WriteNewObjs(FX_BOOL bIncremental, IFX_Pause *pPause); - FX_INT32 WriteIndirectObj(const CPDF_Object* pObj); - FX_INT32 WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, FX_BOOL bEncrypt = TRUE); - FX_INT32 WriteIndirectObjectToStream(const CPDF_Object* pObj); - FX_INT32 WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj); - FX_INT32 WriteIndirectObjectToStream(FX_DWORD objnum, FX_LPCBYTE pBuffer, FX_DWORD dwSize); - FX_INT32 AppendObjectNumberToXRef(FX_DWORD objnum); + int32_t WriteOldIndirectObject(FX_DWORD objnum); + int32_t WriteOldObjs(IFX_Pause *pPause); + int32_t WriteNewObjs(FX_BOOL bIncremental, IFX_Pause *pPause); + int32_t WriteIndirectObj(const CPDF_Object* pObj); + int32_t WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, FX_BOOL bEncrypt = TRUE); + int32_t WriteIndirectObjectToStream(const CPDF_Object* pObj); + int32_t WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj); + int32_t WriteIndirectObjectToStream(FX_DWORD objnum, FX_LPCBYTE pBuffer, FX_DWORD dwSize); + int32_t AppendObjectNumberToXRef(FX_DWORD objnum); void InitID(FX_BOOL bDefault = TRUE); - FX_INT32 WriteStream(const CPDF_Object* pStream, FX_DWORD objnum, CPDF_CryptoHandler* pCrypto); + int32_t WriteStream(const CPDF_Object* pStream, FX_DWORD objnum, CPDF_CryptoHandler* pCrypto); - FX_INT32 m_iStage; + int32_t m_iStage; FX_DWORD m_dwFlags; FX_POSITION m_Pos; FX_FILESIZE m_XrefStart; @@ -196,7 +196,7 @@ protected: CPDF_Array* m_pIDArray; - FX_INT32 m_FileVersion; + int32_t m_FileVersion; friend class CPDF_ObjectStream; friend class CPDF_XRefStream; }; diff --git a/core/include/fpdfdoc/fpdf_ap.h b/core/include/fpdfdoc/fpdf_ap.h index 39daf028ac..1d30ebbb0a 100644 --- a/core/include/fpdfdoc/fpdf_ap.h +++ b/core/include/fpdfdoc/fpdf_ap.h @@ -15,19 +15,19 @@ class IPVT_FontMap { public: virtual ~IPVT_FontMap() { } - virtual CPDF_Font* GetPDFFont(FX_INT32 nFontIndex) = 0; - virtual CFX_ByteString GetPDFFontAlias(FX_INT32 nFontIndex) = 0; + virtual CPDF_Font* GetPDFFont(int32_t nFontIndex) = 0; + virtual CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) = 0; }; struct CPVT_Dash { - CPVT_Dash(FX_INT32 dash, FX_INT32 gap, FX_INT32 phase) : nDash(dash), nGap(gap), nPhase(phase) + CPVT_Dash(int32_t dash, int32_t gap, int32_t phase) : nDash(dash), nGap(gap), nPhase(phase) {} - FX_INT32 nDash; + int32_t nDash; - FX_INT32 nGap; + int32_t nGap; - FX_INT32 nPhase; + int32_t nPhase; }; #define CT_TRANSPARENT 0 #define CT_GRAY 1 @@ -35,11 +35,11 @@ struct CPVT_Dash { #define CT_CMYK 3 struct CPVT_Color { - CPVT_Color(FX_INT32 type = 0, FX_FLOAT color1 = 0.0f, FX_FLOAT color2 = 0.0f, FX_FLOAT color3 = 0.0f, FX_FLOAT color4 = 0.0f) + CPVT_Color(int32_t type = 0, FX_FLOAT color1 = 0.0f, FX_FLOAT color2 = 0.0f, FX_FLOAT color3 = 0.0f, FX_FLOAT color4 = 0.0f) : nColorType(type), fColor1(color1), fColor2(color2), fColor3(color3), fColor4(color4) {} - FX_INT32 nColorType; + int32_t nColorType; FX_FLOAT fColor1; FX_FLOAT fColor2; FX_FLOAT fColor3; @@ -53,17 +53,17 @@ public: virtual ~CPVT_Provider(); - FX_INT32 GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle); + int32_t GetCharWidth(int32_t nFontIndex, FX_WORD word, int32_t nWordStyle); - FX_INT32 GetTypeAscent(FX_INT32 nFontIndex); + int32_t GetTypeAscent(int32_t nFontIndex); - FX_INT32 GetTypeDescent(FX_INT32 nFontIndex); + int32_t GetTypeDescent(int32_t nFontIndex); - FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex); + int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex); FX_BOOL IsLatinWord(FX_WORD word); - FX_INT32 GetDefaultFontIndex(); + int32_t GetDefaultFontIndex(); private: IPVT_FontMap * m_pFontMap; @@ -88,7 +88,7 @@ public: static CFX_ByteString GenerateBorderAP(const CPDF_Rect & rect, FX_FLOAT fWidth, const CPVT_Color & color, const CPVT_Color & crLeftTop, const CPVT_Color & crRightBottom, - FX_INT32 nStyle, const CPVT_Dash & dash); + int32_t nStyle, const CPVT_Dash & dash); static CFX_ByteString GenerateColorAP(const CPVT_Color & color, const FX_BOOL & bFillOrStroke); }; diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h index 307a31cd20..14cc145d6d 100644 --- a/core/include/fpdfdoc/fpdf_doc.h +++ b/core/include/fpdfdoc/fpdf_doc.h @@ -331,7 +331,7 @@ public: CPDF_Dictionary* GetAnnot() const; - FX_INT32 GetOperationType() const; + int32_t GetOperationType() const; CPDF_Stream* GetSoundStream() const { @@ -733,19 +733,19 @@ public: static CPDF_Font* AddSystemDefaultFont(const CPDF_Document* pDocument); - static CPDF_Font* AddSystemFont(const CPDF_Document* pDocument, CFX_ByteString csFontName, FX_BYTE iCharSet = 1); + static CPDF_Font* AddSystemFont(const CPDF_Document* pDocument, CFX_ByteString csFontName, uint8_t iCharSet = 1); - static CPDF_Font* AddSystemFont(const CPDF_Document* pDocument, CFX_WideString csFontName, FX_BYTE iCharSet = 1); + static CPDF_Font* AddSystemFont(const CPDF_Document* pDocument, CFX_WideString csFontName, uint8_t iCharSet = 1); static CPDF_Font* AddStandardFont(const CPDF_Document* pDocument, CFX_ByteString csFontName); - static CFX_ByteString GetNativeFont(FX_BYTE iCharSet, FX_LPVOID pLogFont = NULL); + static CFX_ByteString GetNativeFont(uint8_t iCharSet, FX_LPVOID pLogFont = NULL); static CFX_ByteString GetNativeFont(FX_LPVOID pLogFont = NULL); - static FX_BYTE GetNativeCharSet(); + static uint8_t GetNativeCharSet(); - static CPDF_Font* AddNativeFont(FX_BYTE iCharSet, const CPDF_Document* pDocument); + static CPDF_Font* AddNativeFont(uint8_t iCharSet, const CPDF_Document* pDocument); static CPDF_Font* AddNativeFont(const CPDF_Document* pDocument); @@ -837,7 +837,7 @@ public: CPDF_Font* GetFormFont(CFX_ByteString csFontName, CFX_ByteString& csNameTag); - CPDF_Font* GetNativeFormFont(FX_BYTE iCharSet, CFX_ByteString& csNameTag); + CPDF_Font* GetNativeFormFont(uint8_t iCharSet, CFX_ByteString& csNameTag); CPDF_Font* GetNativeFormFont(CFX_ByteString& csNameTag); @@ -856,7 +856,7 @@ public: void AddFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag); - CPDF_Font* AddNativeFormFont(FX_BYTE iCharSet, CFX_ByteString& csNameTag); + CPDF_Font* AddNativeFormFont(uint8_t iCharSet, CFX_ByteString& csNameTag); CPDF_Font* AddNativeFormFont(CFX_ByteString& csNameTag); @@ -1517,10 +1517,10 @@ public: CFX_WideString GetLabel(int nPage) const; - FX_INT32 GetPageByLabel(FX_BSTR bsLabel) const; + int32_t GetPageByLabel(FX_BSTR bsLabel) const; - FX_INT32 GetPageByLabel(FX_WSTR wsLabel) const; + int32_t GetPageByLabel(FX_WSTR wsLabel) const; protected: CPDF_Document* m_pDocument; @@ -1537,7 +1537,7 @@ public: void LoadDoc(CPDF_Document *pDoc); - FX_INT32 GetString(FX_BSTR bsItem, CFX_WideString &wsStr); + int32_t GetString(FX_BSTR bsItem, CFX_WideString &wsStr); CXML_Element* GetRoot() const; @@ -1560,7 +1560,7 @@ public: FX_BOOL PrintScaling() const; - FX_INT32 NumCopies() const; + int32_t NumCopies() const; CPDF_Array* PrintPageRange() const; diff --git a/core/include/fpdfdoc/fpdf_vt.h b/core/include/fpdfdoc/fpdf_vt.h index 87ef02576b..fbfeacb755 100644 --- a/core/include/fpdfdoc/fpdf_vt.h +++ b/core/include/fpdfdoc/fpdf_vt.h @@ -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() { } diff --git a/core/include/fpdftext/fpdf_text.h b/core/include/fpdftext/fpdf_text.h index d18a7692c6..65c20b04b4 100644 --- a/core/include/fpdftext/fpdf_text.h +++ b/core/include/fpdftext/fpdf_text.h @@ -36,7 +36,7 @@ CFX_WideString PDF_GetFirstTextLine_Unicode(CPDF_Document* pDoc, CPDF_Dictionary typedef struct { FX_WCHAR m_Unicode; FX_WCHAR m_Charcode; - FX_INT32 m_Flag; + int32_t m_Flag; FX_FLOAT m_FontSize; FX_FLOAT m_OriginX; FX_FLOAT m_OriginY; diff --git a/core/include/fxcodec/fx_codec.h b/core/include/fxcodec/fx_codec.h index 6a62c2d12c..31dea3b8d2 100644 --- a/core/include/fxcodec/fx_codec.h +++ b/core/include/fxcodec/fx_codec.h @@ -114,9 +114,9 @@ class ICodec_BasicModule public: virtual ~ICodec_BasicModule() {} - virtual FX_BOOL RunLengthEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, + virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0; - virtual FX_BOOL A85Encode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, + virtual FX_BOOL A85Encode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0; virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc) = 0; @@ -154,10 +154,10 @@ public: virtual ~ICodec_FlateModule() {} virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc, int predictor, int Colors, int BitsPerComponent, int Columns) = 0; - virtual FX_DWORD FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange, + virtual FX_DWORD FlateOrLZWDecode(FX_BOOL bLZW, const uint8_t* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange, int predictor, int Colors, int BitsPerComponent, int Columns, FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0; - virtual FX_BOOL Encode(const FX_BYTE* src_buf, FX_DWORD src_size, + virtual FX_BOOL Encode(const uint8_t* src_buf, FX_DWORD src_size, int predictor, int Colors, int BitsPerComponent, int Columns, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0; virtual FX_BOOL Encode(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0; @@ -258,23 +258,23 @@ public: virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
- virtual FX_INT32 ReadHeader(void* pContext, int* width, int* height,
+ virtual int32_t ReadHeader(void* pContext, int* width, int* height,
int* pal_num, void** pal_pp, int* bg_index, CFX_DIBAttribute* pAttribute = NULL) = 0;
- virtual FX_INT32 LoadFrameInfo(void* pContext, int* frame_num) = 0;
+ virtual int32_t LoadFrameInfo(void* pContext, int* frame_num) = 0;
void (*RecordCurrentPositionCallback)(void* pModule, FX_DWORD& cur_pos);
- FX_LPBYTE (*AskLocalPaletteBufCallback)(void* pModule, FX_INT32 frame_num, FX_INT32 pal_size);
+ FX_LPBYTE (*AskLocalPaletteBufCallback)(void* pModule, int32_t frame_num, int32_t pal_size);
- virtual FX_INT32 LoadFrame(void* pContext, int frame_num, CFX_DIBAttribute* pAttribute = NULL) = 0;
+ virtual int32_t LoadFrame(void* pContext, int frame_num, CFX_DIBAttribute* pAttribute = NULL) = 0;
FX_BOOL (*InputRecordPositionBufCallback)(void* pModule, FX_DWORD rcd_pos, const FX_RECT& img_rc,
- FX_INT32 pal_num, void* pal_ptr,
- FX_INT32 delay_time, FX_BOOL user_input,
- FX_INT32 trans_index, FX_INT32 disposal_method, FX_BOOL interlace);
+ int32_t pal_num, void* pal_ptr,
+ int32_t delay_time, FX_BOOL user_input,
+ int32_t trans_index, int32_t disposal_method, FX_BOOL interlace);
- void (*ReadScanlineCallback)(void* pModule, FX_INT32 row_num, FX_LPBYTE row_buf);
+ void (*ReadScanlineCallback)(void* pModule, int32_t row_num, FX_LPBYTE row_buf);
};
class ICodec_BmpModule {
@@ -290,14 +290,14 @@ public: virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
- virtual FX_INT32 ReadHeader(void* pContext, FX_INT32* width, FX_INT32* height, FX_BOOL* tb_flag, FX_INT32* components,
+ virtual int32_t ReadHeader(void* pContext, int32_t* width, int32_t* height, FX_BOOL* tb_flag, int32_t* components,
int* pal_num, FX_DWORD** pal_pp, CFX_DIBAttribute* pAttribute = NULL) = 0;
- virtual FX_INT32 LoadImage(void* pContext) = 0;
+ virtual int32_t LoadImage(void* pContext) = 0;
FX_BOOL (*InputImagePositionBufCallback)(void* pModule, FX_DWORD rcd_pos);
- void (*ReadScanlineCallback)(void* pModule, FX_INT32 row_num, FX_LPBYTE row_buf);
+ void (*ReadScanlineCallback)(void* pModule, int32_t row_num, FX_LPBYTE row_buf);
};
class ICodec_TiffModule {
@@ -308,9 +308,9 @@ public: virtual FX_LPVOID CreateDecoder(IFX_FileRead* file_ptr) = 0;
- virtual void GetFrames(FX_LPVOID ctx, FX_INT32& frames) = 0;
+ virtual void GetFrames(FX_LPVOID ctx, int32_t& frames) = 0;
- virtual FX_BOOL LoadFrameInfo(FX_LPVOID ctx, FX_INT32 frame, FX_DWORD& width, FX_DWORD& height, FX_DWORD& comps, FX_DWORD& bpc, CFX_DIBAttribute* pAttribute = NULL) = 0;
+ virtual FX_BOOL LoadFrameInfo(FX_LPVOID ctx, int32_t frame, FX_DWORD& width, FX_DWORD& height, FX_DWORD& comps, FX_DWORD& bpc, CFX_DIBAttribute* pAttribute = NULL) = 0;
virtual FX_BOOL Decode(FX_LPVOID ctx, class CFX_DIBitmap* pDIBitmap) = 0;
@@ -348,21 +348,21 @@ public: virtual FXCODEC_IMAGE_TYPE GetType() = 0;
- virtual FX_INT32 GetWidth() = 0;
+ virtual int32_t GetWidth() = 0;
- virtual FX_INT32 GetHeight() = 0;
+ virtual int32_t GetHeight() = 0;
- virtual FX_INT32 GetNumComponents() = 0;
+ virtual int32_t GetNumComponents() = 0;
- virtual FX_INT32 GetBPC() = 0;
+ virtual int32_t GetBPC() = 0;
virtual void SetClipBox(FX_RECT* clip) = 0;
- virtual FXCODEC_STATUS GetFrames(FX_INT32& frames, IFX_Pause* pPause = NULL) = 0;
+ virtual FXCODEC_STATUS GetFrames(int32_t& frames, IFX_Pause* pPause = NULL) = 0;
virtual FXCODEC_STATUS StartDecode(class CFX_DIBitmap* pDIBitmap,
- FX_INT32 start_x, FX_INT32 start_y, FX_INT32 size_x, FX_INT32 size_y,
- FX_INT32 frames = 0, FX_BOOL bInterpol = TRUE) = 0;
+ int32_t start_x, int32_t start_y, int32_t size_x, int32_t size_y,
+ int32_t frames = 0, FX_BOOL bInterpol = TRUE) = 0;
virtual FXCODEC_STATUS ContinueDecode(IFX_Pause* pPause = NULL) = 0;
};
@@ -415,11 +415,11 @@ public: ) = 0; - virtual FX_LPVOID CreateTransform_sRGB(FX_LPCBYTE pProfileData, FX_DWORD dwProfileSize, FX_INT32& nComponents, FX_INT32 intent = 0, + virtual FX_LPVOID CreateTransform_sRGB(FX_LPCBYTE pProfileData, FX_DWORD dwProfileSize, int32_t& nComponents, int32_t intent = 0, FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT) = 0; - virtual FX_LPVOID CreateTransform_CMYK(FX_LPCBYTE pSrcProfileData, FX_DWORD dwSrcProfileSize, FX_INT32& nSrcComponents, - FX_LPCBYTE pDstProfileData, FX_DWORD dwDstProfileSize, FX_INT32 intent = 0, + virtual FX_LPVOID CreateTransform_CMYK(FX_LPCBYTE pSrcProfileData, FX_DWORD dwSrcProfileSize, int32_t& nSrcComponents, + FX_LPCBYTE pDstProfileData, FX_DWORD dwDstProfileSize, int32_t intent = 0, FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT, FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT ) = 0; @@ -431,18 +431,19 @@ public: virtual void TranslateScanline(FX_LPVOID pTransform, FX_LPBYTE pDest, FX_LPCBYTE pSrc, int pixels) = 0; virtual void SetComponents(FX_DWORD nComponents) = 0; }; + void AdobeCMYK_to_sRGB(FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B); -void AdobeCMYK_to_sRGB1(FX_BYTE c, FX_BYTE m, FX_BYTE y, FX_BYTE k, FX_BYTE& R, FX_BYTE& G, FX_BYTE& B); -FX_BOOL MD5ComputeID(FX_LPCVOID buf, FX_DWORD dwSize, FX_BYTE ID[16]); +void AdobeCMYK_to_sRGB1(uint8_t c, uint8_t m, uint8_t y, uint8_t k, uint8_t& R, uint8_t& G, uint8_t& B); +FX_BOOL MD5ComputeID(FX_LPCVOID buf, FX_DWORD dwSize, uint8_t ID[16]); class CFX_DIBAttribute {
public:
CFX_DIBAttribute();
~CFX_DIBAttribute();
- FX_INT32 m_nXDPI;
+ int32_t m_nXDPI;
- FX_INT32 m_nYDPI;
+ int32_t m_nYDPI;
FX_FLOAT m_fAspectRatio;
@@ -450,16 +451,16 @@ public: CFX_ByteString m_strAuthor;
- FX_BYTE m_strTime[20];
+ uint8_t m_strTime[20];
- FX_INT32 m_nGifLeft;
- FX_INT32 m_nGifTop;
+ int32_t m_nGifLeft;
+ int32_t m_nGifTop;
FX_DWORD* m_pGifLocalPalette;
FX_DWORD m_nGifLocalPalNum;
- FX_INT32 m_nBmpCompressType;
+ int32_t m_nBmpCompressType;
class IFX_DIBAttributeExif* m_pExif;
};
class IFX_DIBAttributeExif diff --git a/core/include/fxcrt/fx_arb.h b/core/include/fxcrt/fx_arb.h index 8c2a8eba42..56f56fb9ab 100644 --- a/core/include/fxcrt/fx_arb.h +++ b/core/include/fxcrt/fx_arb.h @@ -55,9 +55,9 @@ public: virtual FX_WCHAR GetFormChar(FX_WCHAR wch, FX_WCHAR prev = 0, FX_WCHAR next = 0) const = 0; virtual FX_WCHAR GetFormChar(const CFX_Char *cur, const CFX_Char *prev, const CFX_Char *next) const = 0; }; -void FX_BidiLine(CFX_WideString &wsText, FX_INT32 iBaseLevel = 0); -void FX_BidiLine(CFX_TxtCharArray &chars, FX_INT32 iCount, FX_INT32 iBaseLevel = 0); -void FX_BidiLine(CFX_RTFCharArray &chars, FX_INT32 iCount, FX_INT32 iBaseLevel = 0); +void FX_BidiLine(CFX_WideString &wsText, int32_t iBaseLevel = 0); +void FX_BidiLine(CFX_TxtCharArray &chars, int32_t iCount, int32_t iBaseLevel = 0); +void FX_BidiLine(CFX_RTFCharArray &chars, int32_t iCount, int32_t iBaseLevel = 0); class IFX_BidiChar { public: @@ -66,7 +66,7 @@ public: virtual void SetPolicy(FX_BOOL bSeparateNeutral = TRUE) = 0; virtual FX_BOOL AppendChar(FX_WCHAR wch) = 0; virtual FX_BOOL EndChar() = 0; - virtual FX_INT32 GetBidiInfo(FX_INT32 &iStart, FX_INT32 &iCount) = 0; + virtual int32_t GetBidiInfo(int32_t &iStart, int32_t &iCount) = 0; virtual void Reset() = 0; protected: diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h index 111e0d3876..fbcb657012 100644 --- a/core/include/fxcrt/fx_basic.h +++ b/core/include/fxcrt/fx_basic.h @@ -41,14 +41,14 @@ public: void AppendBlock(const void* pBuf, FX_STRSIZE size); - void AppendFill(FX_BYTE byte, FX_STRSIZE count); + void AppendFill(uint8_t byte, FX_STRSIZE count); void AppendString(FX_BSTR str) { AppendBlock(str.GetPtr(), str.GetLength()); } - inline void AppendByte(FX_BYTE byte) + inline void AppendByte(uint8_t byte) { if (m_AllocSize <= m_DataSize) { ExpandBuf(1); @@ -99,7 +99,7 @@ public: void AppendChar(int ch) { - AppendByte((FX_BYTE)ch); + AppendByte((uint8_t)ch); } CFX_ByteTextBuf& operator << (int i); @@ -160,7 +160,7 @@ class CFX_ArchiveSaver public: CFX_ArchiveSaver() : m_pStream(NULL) {} - CFX_ArchiveSaver& operator << (FX_BYTE i); + CFX_ArchiveSaver& operator << (uint8_t i); CFX_ArchiveSaver& operator << (int i); @@ -178,7 +178,7 @@ public: void Write(const void* pData, FX_STRSIZE dwSize); - FX_INTPTR GetLength() + intptr_t GetLength() { return m_SavingBuf.GetSize(); } @@ -204,7 +204,7 @@ public: CFX_ArchiveLoader(FX_LPCBYTE pData, FX_DWORD dwSize); - CFX_ArchiveLoader& operator >> (FX_BYTE& i); + CFX_ArchiveLoader& operator >> (uint8_t& i); CFX_ArchiveLoader& operator >> (int& i); @@ -241,14 +241,14 @@ public: FX_BOOL Flush(); - FX_INT32 AppendBlock(const void* pBuf, size_t size); + int32_t AppendBlock(const void* pBuf, size_t size); - FX_INT32 AppendByte(FX_BYTE byte); + int32_t AppendByte(uint8_t byte); - FX_INT32 AppendDWord(FX_DWORD i); + int32_t AppendDWord(FX_DWORD i); - FX_INT32 AppendString(FX_BSTR lpsz); + int32_t AppendString(FX_BSTR lpsz); protected: @@ -282,14 +282,14 @@ private: }; struct CFX_CharMap { - static CFX_CharMap* GetDefaultMapper(FX_INT32 codepage = 0); + static CFX_CharMap* GetDefaultMapper(int32_t codepage = 0); CFX_WideString (*m_GetWideString)(CFX_CharMap* pMap, const CFX_ByteString& bstr); CFX_ByteString (*m_GetByteString)(CFX_CharMap* pMap, const CFX_WideString& wstr); - FX_INT32 (*m_GetCodePage)(); + int32_t (*m_GetCodePage)(); }; class CFX_UTF8Decoder { @@ -301,7 +301,7 @@ public: void Clear(); - void Input(FX_BYTE byte); + void Input(uint8_t byte); void AppendChar(FX_DWORD ch); @@ -541,13 +541,13 @@ public: return -1; } }; -typedef CFX_ArrayTemplate<FX_BYTE> CFX_ByteArray; +typedef CFX_ArrayTemplate<uint8_t> CFX_ByteArray; typedef CFX_ArrayTemplate<FX_WORD> CFX_WordArray; typedef CFX_ArrayTemplate<FX_DWORD> CFX_DWordArray; typedef CFX_ArrayTemplate<void*> CFX_PtrArray; typedef CFX_ArrayTemplate<FX_FILESIZE> CFX_FileSizeArray; typedef CFX_ArrayTemplate<FX_FLOAT> CFX_FloatArray; -typedef CFX_ArrayTemplate<FX_INT32> CFX_Int32Array; +typedef CFX_ArrayTemplate<int32_t> CFX_Int32Array; template <class ObjectClass> class CFX_ObjectArray : public CFX_BasicArray { @@ -574,12 +574,12 @@ public: return InsertSpaceAt(m_nSize, 1); } - FX_INT32 Append(const CFX_ObjectArray& src, FX_INT32 nStart = 0, FX_INT32 nCount = -1) + int32_t Append(const CFX_ObjectArray& src, int32_t nStart = 0, int32_t nCount = -1) { if (nCount == 0) { return 0; } - FX_INT32 nSize = src.GetSize(); + int32_t nSize = src.GetSize(); if (!nSize) { return 0; } @@ -597,18 +597,18 @@ public: InsertSpaceAt(m_nSize, nCount); ObjectClass* pStartObj = (ObjectClass*)GetDataPtr(nSize); nSize = nStart + nCount; - for (FX_INT32 i = nStart; i < nSize; i ++, pStartObj++) { + for (int32_t i = nStart; i < nSize; i ++, pStartObj++) { new ((void*)pStartObj) ObjectClass(src[i]); } return nCount; } - FX_INT32 Copy(const CFX_ObjectArray& src, FX_INT32 nStart = 0, FX_INT32 nCount = -1) + int32_t Copy(const CFX_ObjectArray& src, int32_t nStart = 0, int32_t nCount = -1) { if (nCount == 0) { return 0; } - FX_INT32 nSize = src.GetSize(); + int32_t nSize = src.GetSize(); if (!nSize) { return 0; } @@ -626,7 +626,7 @@ public: SetSize(nCount); ObjectClass* pStartObj = (ObjectClass*)m_pData; nSize = nStart + nCount; - for (FX_INT32 i = nStart; i < nSize; i ++, pStartObj++) { + for (int32_t i = nStart; i < nSize; i ++, pStartObj++) { new ((void*)pStartObj) ObjectClass(src[i]); } return nCount; @@ -704,9 +704,9 @@ private: short m_SegmentSize; - FX_BYTE m_IndexSize; + uint8_t m_IndexSize; - FX_BYTE m_IndexDepth; + uint8_t m_IndexDepth; int m_DataSize; @@ -859,26 +859,26 @@ public: FX_BOOL Lookup(KeyType key, ValueType& rValue) const { FX_LPVOID pValue = NULL; - if (!CFX_MapPtrToPtr::Lookup((void*)(FX_UINTPTR)key, pValue)) { + if (!CFX_MapPtrToPtr::Lookup((void*)(uintptr_t)key, pValue)) { return FALSE; } - rValue = (ValueType)(FX_UINTPTR)pValue; + rValue = (ValueType)(uintptr_t)pValue; return TRUE; } ValueType& operator[](KeyType key) { - return (ValueType&)CFX_MapPtrToPtr::operator []((void*)(FX_UINTPTR)key); + return (ValueType&)CFX_MapPtrToPtr::operator []((void*)(uintptr_t)key); } void SetAt(KeyType key, ValueType newValue) { - CFX_MapPtrToPtr::SetAt((void*)(FX_UINTPTR)key, (void*)(FX_UINTPTR)newValue); + CFX_MapPtrToPtr::SetAt((void*)(uintptr_t)key, (void*)(uintptr_t)newValue); } FX_BOOL RemoveKey(KeyType key) { - return CFX_MapPtrToPtr::RemoveKey((void*)(FX_UINTPTR)key); + return CFX_MapPtrToPtr::RemoveKey((void*)(uintptr_t)key); } void GetNextAssoc(FX_POSITION& rNextPosition, KeyType& rKey, ValueType& rValue) const @@ -886,8 +886,8 @@ public: void* pKey = NULL; void* pValue = NULL; CFX_MapPtrToPtr::GetNextAssoc(rNextPosition, pKey, pValue); - rKey = (KeyType)(FX_UINTPTR)pKey; - rValue = (ValueType)(FX_UINTPTR)pValue; + rKey = (KeyType)(uintptr_t)pKey; + rValue = (ValueType)(uintptr_t)pValue; } }; class CFX_CMapDWordToDWord @@ -1428,9 +1428,9 @@ protected: struct DataList { - FX_INT32 start; + int32_t start; - FX_INT32 count; + int32_t count; FX_LPBYTE data; }; public: @@ -1445,7 +1445,7 @@ public: void Clear() { - for (FX_INT32 i = m_DataLists.GetUpperBound(); i >= 0; i--) { + for (int32_t i = m_DataLists.GetUpperBound(); i >= 0; i--) { DataList list = m_DataLists.ElementAt(i); if (list.data) { FX_Free(list.data); @@ -1455,15 +1455,15 @@ public: m_CurList = 0; } - void Append(FX_INT32 nStart, FX_INT32 nCount) + void Append(int32_t nStart, int32_t nCount) { if (nStart < 0) { return; } while (nCount > 0) { - FX_INT32 temp_count = FX_MIN(nCount, FX_DATALIST_LENGTH); + int32_t temp_count = FX_MIN(nCount, FX_DATALIST_LENGTH); DataList list; - list.data = FX_Alloc2D(FX_BYTE, temp_count, unit); + list.data = FX_Alloc2D(uint8_t, temp_count, unit); list.start = nStart; list.count = temp_count; Append(list); @@ -1472,7 +1472,7 @@ public: } } - FX_LPBYTE GetAt(FX_INT32 nIndex) + FX_LPBYTE GetAt(int32_t nIndex) { if (nIndex < 0) { return NULL; @@ -1483,9 +1483,9 @@ public: DataList *pCurList = m_DataLists.GetDataPtr(m_CurList); if (!pCurList || nIndex < pCurList->start || nIndex >= pCurList->start + pCurList->count) { pCurList = NULL; - FX_INT32 iStart = 0; - FX_INT32 iEnd = m_DataLists.GetUpperBound(); - FX_INT32 iMid = 0; + int32_t iStart = 0; + int32_t iEnd = m_DataLists.GetUpperBound(); + int32_t iMid = 0; while (iStart <= iEnd) { iMid = (iStart + iEnd) / 2; DataList* list = m_DataLists.GetDataPtr(iMid); @@ -1505,11 +1505,11 @@ public: protected: void Append(const DataList& list) { - FX_INT32 iStart = 0; - FX_INT32 iEnd = m_DataLists.GetUpperBound(); - FX_INT32 iFind = 0; + int32_t iStart = 0; + int32_t iEnd = m_DataLists.GetUpperBound(); + int32_t iFind = 0; while (iStart <= iEnd) { - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iMid = (iStart + iEnd) / 2; DataList* cur_list = m_DataLists.GetDataPtr(iMid); if (list.start < cur_list->start + cur_list->count) { iEnd = iMid - 1; @@ -1529,7 +1529,7 @@ protected: } m_DataLists.InsertAt(iFind, list); } - FX_INT32 m_CurList; + int32_t m_CurList; CFX_ArrayTemplate<DataList> m_DataLists; }; template<typename T1, typename T2> @@ -1542,19 +1542,19 @@ public: m_Data.Clear(); } - void Add(FX_INT32 nStart, FX_INT32 nCount) + void Add(int32_t nStart, int32_t nCount) { m_Data.Append(nStart, nCount); } - T2& operator [] (FX_INT32 nIndex) + T2& operator [] (int32_t nIndex) { FX_LPBYTE data = m_Data.GetAt(nIndex); FXSYS_assert(data != NULL); return (T2&)(*(volatile T2*)data); } - T2* GetPtrAt(FX_INT32 nIndex) + T2* GetPtrAt(int32_t nIndex) { return (T2*)m_Data.GetAt(nIndex); } diff --git a/core/include/fxcrt/fx_coordinates.h b/core/include/fxcrt/fx_coordinates.h index 076c0e6a2f..c98ece9e07 100644 --- a/core/include/fxcrt/fx_coordinates.h +++ b/core/include/fxcrt/fx_coordinates.h @@ -113,15 +113,15 @@ public: } baseType x, y; }; -typedef CFX_PSVTemplate<FX_INT32> CFX_Point; +typedef CFX_PSVTemplate<int32_t> CFX_Point; typedef CFX_PSVTemplate<FX_FLOAT> CFX_PointF; -typedef CFX_PSVTemplate<FX_INT32> CFX_Size; +typedef CFX_PSVTemplate<int32_t> CFX_Size; typedef CFX_PSVTemplate<FX_FLOAT> CFX_SizeF; typedef CFX_ArrayTemplate<CFX_Point> CFX_Points; typedef CFX_ArrayTemplate<CFX_PointF> CFX_PointsF; -typedef CFX_PSVTemplate<FX_INT32> * FX_LPPOINT; +typedef CFX_PSVTemplate<int32_t> * FX_LPPOINT; typedef CFX_PSVTemplate<FX_FLOAT> * FX_LPPOINTF; -typedef CFX_PSVTemplate<FX_INT32> const * FX_LPCPOINT; +typedef CFX_PSVTemplate<int32_t> const * FX_LPCPOINT; typedef CFX_PSVTemplate<FX_FLOAT> const * FX_LPCPOINTF; #define CFX_FloatPoint CFX_PointF template<class baseType> @@ -227,7 +227,7 @@ public: return v.y < 0 ? -fSlope : fSlope; } }; -typedef CFX_VTemplate<FX_INT32> CFX_Vector; +typedef CFX_VTemplate<int32_t> CFX_Vector; typedef CFX_VTemplate<FX_FLOAT> CFX_VectorF; template<class baseType> class CFX_RTemplate @@ -524,11 +524,11 @@ public: baseType left, top; baseType width, height; }; -typedef CFX_RTemplate<FX_INT32> CFX_Rect; +typedef CFX_RTemplate<int32_t> CFX_Rect; typedef CFX_RTemplate<FX_FLOAT> CFX_RectF; -typedef CFX_RTemplate<FX_INT32> * FX_LPRECT; +typedef CFX_RTemplate<int32_t> * FX_LPRECT; typedef CFX_RTemplate<FX_FLOAT> * FX_LPRECTF; -typedef CFX_RTemplate<FX_INT32> const * FX_LPCRECT; +typedef CFX_RTemplate<int32_t> const * FX_LPCRECT; typedef CFX_RTemplate<FX_FLOAT> const * FX_LPCRECTF; typedef CFX_ArrayTemplate<CFX_RectF> CFX_RectFArray; struct FX_RECT { @@ -602,13 +602,13 @@ struct FX_RECT { }; struct FX_SMALL_RECT { - FX_SHORT Left; + int16_t Left; - FX_SHORT Top; + int16_t Top; - FX_SHORT Right; + int16_t Right; - FX_SHORT Bottom; + int16_t Bottom; }; class CFX_FloatRect { @@ -807,7 +807,7 @@ public: void Translate(FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended = FALSE); - void TranslateI(FX_INT32 x, FX_INT32 y, FX_BOOL bPrepended = FALSE) + void TranslateI(int32_t x, int32_t y, FX_BOOL bPrepended = FALSE) { Translate((FX_FLOAT)x, (FX_FLOAT)y, bPrepended); } @@ -831,17 +831,17 @@ public: FX_FLOAT GetUnitArea() const; FX_FLOAT TransformXDistance(FX_FLOAT dx) const; - FX_INT32 TransformXDistance(FX_INT32 dx) const; + int32_t TransformXDistance(int32_t dx) const; FX_FLOAT TransformYDistance(FX_FLOAT dy) const; - FX_INT32 TransformYDistance(FX_INT32 dy) const; + int32_t TransformYDistance(int32_t dy) const; FX_FLOAT TransformDistance(FX_FLOAT dx, FX_FLOAT dy) const; - FX_INT32 TransformDistance(FX_INT32 dx, FX_INT32 dy) const; + int32_t TransformDistance(int32_t dx, int32_t dy) const; FX_FLOAT TransformDistance(FX_FLOAT distance) const; void TransformPoint(FX_FLOAT &x, FX_FLOAT &y) const; - void TransformPoint(FX_INT32 &x, FX_INT32 &y) const; - void TransformPoints(CFX_PointF *points, FX_INT32 iCount) const; - void TransformPoints(CFX_Point *points, FX_INT32 iCount) const; + void TransformPoint(int32_t &x, int32_t &y) const; + void TransformPoints(CFX_PointF *points, int32_t iCount) const; + void TransformPoints(CFX_Point *points, int32_t iCount) const; void Transform(FX_FLOAT& x, FX_FLOAT& y) const { diff --git a/core/include/fxcrt/fx_ext.h b/core/include/fxcrt/fx_ext.h index 97c47df6f6..b31d7a43f7 100644 --- a/core/include/fxcrt/fx_ext.h +++ b/core/include/fxcrt/fx_ext.h @@ -19,31 +19,31 @@ extern "C" { FX_FLOAT FXSYS_tan(FX_FLOAT a); FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x); -FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength = -1, FX_INT32 *pUsedLen = NULL); -FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength = -1, FX_INT32 *pUsedLen = NULL); +FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, int32_t iLength = -1, int32_t *pUsedLen = NULL); +FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, int32_t iLength = -1, int32_t *pUsedLen = NULL); FX_LPWSTR FXSYS_wcsncpy(FX_LPWSTR dstStr, FX_LPCWSTR srcStr, size_t count); -FX_INT32 FXSYS_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count); -FX_INT32 FXSYS_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count); +int32_t FXSYS_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count); +int32_t FXSYS_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count); -inline FX_BOOL FXSYS_islower(FX_INT32 ch) +inline FX_BOOL FXSYS_islower(int32_t ch) { return ch >= 'a' && ch <= 'z'; } -inline FX_BOOL FXSYS_isupper(FX_INT32 ch) +inline FX_BOOL FXSYS_isupper(int32_t ch) { return ch >= 'A' && ch <= 'Z'; } -inline FX_INT32 FXSYS_tolower(FX_INT32 ch) +inline int32_t FXSYS_tolower(int32_t ch) { return ch < 'A' || ch > 'Z' ? ch : (ch + 0x20); } -inline FX_INT32 FXSYS_toupper(FX_INT32 ch) +inline int32_t FXSYS_toupper(int32_t ch) { return ch < 'a' || ch > 'z' ? ch : (ch - 0x20); } -FX_DWORD FX_HashCode_String_GetA(FX_LPCSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase = FALSE); -FX_DWORD FX_HashCode_String_GetW(FX_LPCWSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase = FALSE); +FX_DWORD FX_HashCode_String_GetA(FX_LPCSTR pStr, int32_t iLength, FX_BOOL bIgnoreCase = FALSE); +FX_DWORD FX_HashCode_String_GetW(FX_LPCWSTR pStr, int32_t iLength, FX_BOOL bIgnoreCase = FALSE); #ifdef __cplusplus } @@ -58,11 +58,11 @@ FX_DWORD FX_Random_MT_Generate(FX_LPVOID pContext); void FX_Random_MT_Close(FX_LPVOID pContext); -void FX_Random_GenerateBase(FX_LPDWORD pBuffer, FX_INT32 iCount); +void FX_Random_GenerateBase(FX_LPDWORD pBuffer, int32_t iCount); -void FX_Random_GenerateMT(FX_LPDWORD pBuffer, FX_INT32 iCount); +void FX_Random_GenerateMT(FX_LPDWORD pBuffer, int32_t iCount); -void FX_Random_GenerateCrypto(FX_LPDWORD pBuffer, FX_INT32 iCount); +void FX_Random_GenerateCrypto(FX_LPDWORD pBuffer, int32_t iCount); #ifdef __cplusplus } #endif @@ -74,7 +74,7 @@ typedef struct FX_GUID { FX_DWORD data1; FX_WORD data2; FX_WORD data3; - FX_BYTE data4[8]; + uint8_t data4[8]; } FX_GUID, * FX_LPGUID; typedef FX_GUID const * FX_LPCGUID; @@ -88,10 +88,10 @@ template<class baseType> class CFX_SSortTemplate { public: - void ShellSort(baseType *pArray, FX_INT32 iCount) + void ShellSort(baseType *pArray, int32_t iCount) { FXSYS_assert(pArray != NULL && iCount > 0); - FX_INT32 i, j, gap; + int32_t i, j, gap; baseType v1, v2; gap = iCount >> 1; while (gap > 0) { diff --git a/core/include/fxcrt/fx_safe_types.h b/core/include/fxcrt/fx_safe_types.h index e45e6d3c8d..ee50a53e34 100644 --- a/core/include/fxcrt/fx_safe_types.h +++ b/core/include/fxcrt/fx_safe_types.h @@ -12,7 +12,7 @@ #include "fx_system.h" typedef pdfium::base::CheckedNumeric<FX_DWORD> FX_SAFE_DWORD; -typedef pdfium::base::CheckedNumeric<FX_INT32> FX_SAFE_INT32; +typedef pdfium::base::CheckedNumeric<int32_t> FX_SAFE_INT32; typedef pdfium::base::CheckedNumeric<size_t> FX_SAFE_SIZE_T; typedef pdfium::base::CheckedNumeric<FX_FILESIZE> FX_SAFE_FILESIZE; diff --git a/core/include/fxcrt/fx_stream.h b/core/include/fxcrt/fx_stream.h index 35c54cb3d2..190ce97cac 100644 --- a/core/include/fxcrt/fx_stream.h +++ b/core/include/fxcrt/fx_stream.h @@ -20,7 +20,7 @@ typedef struct FX_HFILE_ { FX_LPVOID pData; }* FX_HFILE; #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ -#define FX_FILESIZE FX_INT32 +#define FX_FILESIZE int32_t #else #include <fcntl.h> #include <unistd.h> @@ -37,10 +37,10 @@ typedef struct FX_HFILE_ { #define FX_GETBYTEOFFSET40(a) 0 #define FX_GETBYTEOFFSET48(a) 0 #define FX_GETBYTEOFFSET56(a) 0 -#define FX_GETBYTEOFFSET24(a) ((FX_BYTE)(a>>24)) -#define FX_GETBYTEOFFSET16(a) ((FX_BYTE)(a>>16)) -#define FX_GETBYTEOFFSET8(a) ((FX_BYTE)(a>>8)) -#define FX_GETBYTEOFFSET0(a) ((FX_BYTE)(a)) +#define FX_GETBYTEOFFSET24(a) ((uint8_t)(a>>24)) +#define FX_GETBYTEOFFSET16(a) ((uint8_t)(a>>16)) +#define FX_GETBYTEOFFSET8(a) ((uint8_t)(a>>8)) +#define FX_GETBYTEOFFSET0(a) ((uint8_t)(a)) #define FX_FILEMODE_Write 0 #define FX_FILEMODE_ReadOnly 1 #define FX_FILEMODE_Truncate 2 diff --git a/core/include/fxcrt/fx_string.h b/core/include/fxcrt/fx_string.h index 9903dad942..8fc9d79ebb 100644 --- a/core/include/fxcrt/fx_string.h +++ b/core/include/fxcrt/fx_string.h @@ -121,7 +121,7 @@ public: return m_Length == 0; } - FX_BYTE GetAt(FX_STRSIZE index) const + uint8_t GetAt(FX_STRSIZE index) const { return m_Ptr[index]; } @@ -140,7 +140,7 @@ public: return CFX_ByteStringC(m_Ptr + index, count); } - const FX_BYTE& operator[] (size_t index) const + const uint8_t& operator[] (size_t index) const { return m_Ptr[index]; } @@ -279,12 +279,12 @@ public: const CFX_ByteString& operator += (FX_BSTR bstrc); - FX_BYTE GetAt(FX_STRSIZE nIndex) const + uint8_t GetAt(FX_STRSIZE nIndex) const { return m_pData ? m_pData->m_String[nIndex] : 0; } - FX_BYTE operator[](FX_STRSIZE nIndex) const + uint8_t operator[](FX_STRSIZE nIndex) const { return m_pData ? m_pData->m_String[nIndex] : 0; } diff --git a/core/include/fxcrt/fx_system.h b/core/include/fxcrt/fx_system.h index f0ebcf90b1..80d75908d4 100644 --- a/core/include/fxcrt/fx_system.h +++ b/core/include/fxcrt/fx_system.h @@ -68,35 +68,23 @@ extern "C" { #endif typedef void* FX_LPVOID; // Deprecate, use with void*. -typedef void const* FX_LPCVOID; // Deprecate, use with const void*. +typedef const void* FX_LPCVOID; // Deprecate, use with const void*. typedef void* FX_POSITION; // Keep until fxcrt containers gone -typedef signed char FX_INT8; // Deprecate, use int8_t. -typedef unsigned char FX_UINT8; // Deprecate, use uint8_t. -typedef unsigned char FX_BYTE; // Deprecate, use uint8_t. -typedef unsigned char* FX_LPBYTE; // Deprecate, use uint8_t*. -typedef unsigned char const* FX_LPCBYTE; // Deprecate, use const uint8_t*. -typedef short FX_INT16; // Deprecate, use int16_t. -typedef unsigned short FX_UINT16; // Deprecate, use uint16_t. -typedef short FX_SHORT; // Deprecate, use int16_t. +typedef uint8_t* FX_LPBYTE; // Deprecate, use uint8_t*. +typedef const uint8_t* FX_LPCBYTE; // Deprecate, use const uint8_t*. typedef unsigned short FX_WORD; // Keep - "an efficient small type" -typedef unsigned short* FX_LPWORD; // Deprecate, use FX_WORD*. -typedef unsigned short const* FX_LPCWORD; // Deprecate, use const FX_WORD*. -typedef int FX_INT32; // Deprecate, use int32_t. -typedef unsigned int FX_UINT32; // Deprecate, use uint32_t. +typedef FX_WORD* FX_LPWORD; // Deprecate, use FX_WORD*. +typedef const FX_WORD* FX_LPCWORD; // Deprecate, use const FX_WORD*. typedef unsigned int FX_DWORD; // Keep - "an efficient type" -typedef unsigned int* FX_LPDWORD; // Deprecate, use FX_DWORD*. -typedef int64_t FX_INT64; // Deprecate, use int64_t. -typedef uint64_t FX_UINT64; // Deprecate, use uint64_t. -typedef intptr_t FX_INTPTR; // Deprecate, use intptr_t. -typedef uintptr_t FX_UINTPTR; // Deprecate, use uintptr_t. +typedef FX_DWORD* FX_LPDWORD; // Deprecate, use FX_DWORD*. typedef float FX_FLOAT; // Keep, allow upgrade to doubles. typedef int FX_BOOL; // Sadly not always 0 or 1. typedef char FX_CHAR; // Keep, questionable signedness. -typedef char* FX_LPSTR; // Deprecate, use FX_CHAR*. -typedef char const* FX_LPCSTR; // Deprecate, use const FX_CHAR*. +typedef FX_CHAR* FX_LPSTR; // Deprecate, use FX_CHAR*. +typedef const FX_CHAR* FX_LPCSTR; // Deprecate, use const FX_CHAR*. typedef wchar_t FX_WCHAR; // Keep, maybe bad platform wchars. -typedef wchar_t* FX_LPWSTR; // Deprecate, use FX_WCHAR*. -typedef wchar_t const* FX_LPCWSTR; // Deprecate, use const FX_WCHAR*. +typedef FX_WCHAR* FX_LPWSTR; // Deprecate, use FX_WCHAR*. +typedef const FX_WCHAR* FX_LPCWSTR; // Deprecate, use const FX_WCHAR*. // PDFium string sizes are limited to 2^31-1, and the value is signed to // allow -1 as a placeholder for "unknown". @@ -260,19 +248,19 @@ wchar_t* FXSYS_wcsupr(wchar_t* str); #define FXSYS_fmod(a, b) (FX_FLOAT)fmod(a, b) #define FXSYS_abs abs #define FXDWORD_FROM_LSBFIRST(i) (i) -#define FXDWORD_FROM_MSBFIRST(i) (((FX_BYTE)(i) << 24) | ((FX_BYTE)((i) >> 8) << 16) | ((FX_BYTE)((i) >> 16) << 8) | (FX_BYTE)((i) >> 24)) +#define FXDWORD_FROM_MSBFIRST(i) (((uint8_t)(i) << 24) | ((uint8_t)((i) >> 8) << 16) | ((uint8_t)((i) >> 16) << 8) | (uint8_t)((i) >> 24)) #define FXDWORD_GET_LSBFIRST(p) ((((FX_LPBYTE)(p))[3] << 24) | (((FX_LPBYTE)(p))[2] << 16) | (((FX_LPBYTE)(p))[1] << 8) | (((FX_LPBYTE)(p))[0])) #define FXDWORD_GET_MSBFIRST(p) ((((FX_LPBYTE)(p))[0] << 24) | (((FX_LPBYTE)(p))[1] << 16) | (((FX_LPBYTE)(p))[2] << 8) | (((FX_LPBYTE)(p))[3])) -#define FXSYS_HIBYTE(word) ((FX_BYTE)((word) >> 8)) -#define FXSYS_LOBYTE(word) ((FX_BYTE)(word)) +#define FXSYS_HIBYTE(word) ((uint8_t)((word) >> 8)) +#define FXSYS_LOBYTE(word) ((uint8_t)(word)) #define FXSYS_HIWORD(dword) ((FX_WORD)((dword) >> 16)) #define FXSYS_LOWORD(dword) ((FX_WORD)(dword)) -FX_INT32 FXSYS_atoi(FX_LPCSTR str); -FX_INT32 FXSYS_wtoi(FX_LPCWSTR str); -FX_INT64 FXSYS_atoi64(FX_LPCSTR str); -FX_INT64 FXSYS_wtoi64(FX_LPCWSTR str); -FX_LPCSTR FXSYS_i64toa(FX_INT64 value, FX_LPSTR str, int radix); -FX_LPCWSTR FXSYS_i64tow(FX_INT64 value, FX_LPWSTR str, int radix); +int32_t FXSYS_atoi(FX_LPCSTR str); +int32_t FXSYS_wtoi(FX_LPCWSTR str); +int64_t FXSYS_atoi64(FX_LPCSTR str); +int64_t FXSYS_wtoi64(FX_LPCWSTR str); +FX_LPCSTR FXSYS_i64toa(int64_t value, FX_LPSTR str, int radix); +FX_LPCWSTR FXSYS_i64tow(int64_t value, FX_LPWSTR str, int radix); int FXSYS_round(FX_FLOAT f); #define FXSYS_Mul(a, b) ((a) * (b)) #define FXSYS_Div(a, b) ((a) / (b)) diff --git a/core/include/fxcrt/fx_ucd.h b/core/include/fxcrt/fx_ucd.h index 42ab623afb..466acd45d4 100644 --- a/core/include/fxcrt/fx_ucd.h +++ b/core/include/fxcrt/fx_ucd.h @@ -141,13 +141,13 @@ public: return m_dwCharProps & FX_CHARTYPEBITSMASK;
}
FX_WORD m_wCharCode;
- FX_BYTE m_nBreakType;
- FX_INT8 m_nRotation;
+ uint8_t m_nBreakType;
+ int8_t m_nRotation;
FX_DWORD m_dwCharProps;
FX_DWORD m_dwCharStyles;
- FX_INT32 m_iCharWidth;
- FX_INT32 m_iHorizontalScale;
- FX_INT32 m_iVertialScale;
+ int32_t m_iCharWidth;
+ int32_t m_iHorizontalScale;
+ int32_t m_iVertialScale;
};
typedef CFX_ArrayTemplate<CFX_Char> CFX_CharArray;
class CFX_TxtChar : public CFX_Char
@@ -163,10 +163,10 @@ public: {
}
FX_DWORD m_dwStatus;
- FX_INT16 m_iBidiClass;
- FX_INT16 m_iBidiLevel;
- FX_INT16 m_iBidiPos;
- FX_INT16 m_iBidiOrder;
+ int16_t m_iBidiClass;
+ int16_t m_iBidiLevel;
+ int16_t m_iBidiPos;
+ int16_t m_iBidiOrder;
FX_LPVOID m_pUserData;
};
typedef CFX_ArrayTemplate<CFX_TxtChar> CFX_TxtCharArray;
@@ -186,12 +186,12 @@ public: {
}
FX_DWORD m_dwStatus;
- FX_INT32 m_iFontSize;
- FX_INT32 m_iFontHeight;
- FX_INT16 m_iBidiClass;
- FX_INT16 m_iBidiLevel;
- FX_INT16 m_iBidiPos;
- FX_INT16 m_iBidiOrder;
+ int32_t m_iFontSize;
+ int32_t m_iFontHeight;
+ int16_t m_iBidiClass;
+ int16_t m_iBidiLevel;
+ int16_t m_iBidiPos;
+ int16_t m_iBidiOrder;
FX_DWORD m_dwLayoutStyles;
FX_DWORD m_dwIdentity;
IFX_Unknown *m_pUserData;
diff --git a/core/include/fxge/fpf.h b/core/include/fxge/fpf.h index 440c329439..30c1c77bbe 100644 --- a/core/include/fxge/fpf.h +++ b/core/include/fxge/fpf.h @@ -31,19 +31,19 @@ public: virtual CFX_ByteString GetFamilyName() = 0; virtual CFX_WideString GetPsName() = 0; virtual FX_DWORD GetFontStyle() const = 0; - virtual FX_BYTE GetCharset() const = 0; + virtual uint8_t GetCharset() const = 0; - virtual FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode) = 0; - virtual FX_INT32 GetGlyphWidth(FX_INT32 iGlyphIndex) = 0; + virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode) = 0; + virtual int32_t GetGlyphWidth(int32_t iGlyphIndex) = 0; - virtual FX_INT32 GetAscent() const = 0; - virtual FX_INT32 GetDescent() const = 0; + virtual int32_t GetAscent() const = 0; + virtual int32_t GetDescent() const = 0; - virtual FX_BOOL GetGlyphBBox(FX_INT32 iGlyphIndex, FX_RECT &rtBBox) = 0; + virtual FX_BOOL GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox) = 0; virtual FX_BOOL GetBBox(FX_RECT &rtBBox) = 0; - virtual FX_INT32 GetHeight() const = 0; - virtual FX_INT32 GetItalicAngle() const = 0; + virtual int32_t GetHeight() const = 0; + virtual int32_t GetItalicAngle() const = 0; virtual FX_DWORD GetFontData(FX_DWORD dwTable, FX_LPBYTE pBuffer, FX_DWORD dwSize) = 0; protected: @@ -58,7 +58,7 @@ public: virtual void LoadPrivateFont(FX_BSTR bsFileName) = 0; virtual void LoadPrivateFont(FX_LPVOID pBuffer, size_t szBuffer) = 0; - virtual IFPF_Font* CreateFont(FX_BSTR bsFamilyname, FX_BYTE charset, FX_DWORD dwStyle, FX_DWORD dwMatch = 0) = 0; + virtual IFPF_Font* CreateFont(FX_BSTR bsFamilyname, uint8_t charset, FX_DWORD dwStyle, FX_DWORD dwMatch = 0) = 0; }; #endif // CORE_INCLUDE_FXGE_FPF_H_ diff --git a/core/include/fxge/fx_dib.h b/core/include/fxge/fx_dib.h index 74738d0d0f..d798ca3511 100644 --- a/core/include/fxge/fx_dib.h +++ b/core/include/fxge/fx_dib.h @@ -74,10 +74,10 @@ class CFX_DIBitmap; #define FXSYS_GetBValue(rgb) (((rgb) >> 16) & 0xff) #define FX_CCOLOR(val) (255-(val)) #define FXSYS_CMYK(c, m, y, k) (((c) << 24) | ((m) << 16) | ((y) << 8) | (k)) -#define FXSYS_GetCValue(cmyk) ((FX_BYTE)((cmyk) >> 24) & 0xff) -#define FXSYS_GetMValue(cmyk) ((FX_BYTE)((cmyk) >> 16) & 0xff) -#define FXSYS_GetYValue(cmyk) ((FX_BYTE)((cmyk) >> 8) & 0xff) -#define FXSYS_GetKValue(cmyk) ((FX_BYTE)(cmyk) & 0xff) +#define FXSYS_GetCValue(cmyk) ((uint8_t)((cmyk) >> 24) & 0xff) +#define FXSYS_GetMValue(cmyk) ((uint8_t)((cmyk) >> 16) & 0xff) +#define FXSYS_GetYValue(cmyk) ((uint8_t)((cmyk) >> 8) & 0xff) +#define FXSYS_GetKValue(cmyk) ((uint8_t)(cmyk) & 0xff) void CmykDecode(FX_CMYK cmyk, int& c, int& m, int& y, int& k); inline FX_CMYK CmykEncode(int c, int m, int y, int k) { @@ -90,10 +90,10 @@ inline FX_ARGB ArgbEncode(int a, int r, int g, int b) return (a << 24) | (r << 16) | (g << 8) | b; } FX_ARGB ArgbEncode(int a, FX_COLORREF rgb); -#define FXARGB_A(argb) ((FX_BYTE)((argb) >> 24)) -#define FXARGB_R(argb) ((FX_BYTE)((argb) >> 16)) -#define FXARGB_G(argb) ((FX_BYTE)((argb) >> 8)) -#define FXARGB_B(argb) ((FX_BYTE)(argb)) +#define FXARGB_A(argb) ((uint8_t)((argb) >> 24)) +#define FXARGB_R(argb) ((uint8_t)((argb) >> 16)) +#define FXARGB_G(argb) ((uint8_t)((argb) >> 8)) +#define FXARGB_B(argb) ((uint8_t)(argb)) #define FXARGB_MAKE(a,r,g,b) (((FX_DWORD)(a) << 24) | ((r) << 16) | ((g) << 8) | (b)) #define FXARGB_MUL_ALPHA(argb, alpha) (((((argb) >> 24) * (alpha) / 255) << 24) | ((argb) & 0xffffff)) #define FXRGB2GRAY(r,g,b) (((b) * 11 + (g) * 59 + (r) * 30) / 100) @@ -101,15 +101,15 @@ FX_ARGB ArgbEncode(int a, FX_COLORREF rgb); #define FXDIB_ALPHA_MERGE(backdrop, source, source_alpha) (((backdrop) * (255-(source_alpha)) + (source)*(source_alpha))/255) #define FXDIB_ALPHA_UNION(dest, src) ((dest) + (src) - (dest)*(src)/255) #define FXCMYK_GETDIB(p) ((((FX_LPBYTE)(p))[0] << 24 | (((FX_LPBYTE)(p))[1] << 16) | (((FX_LPBYTE)(p))[2] << 8) | ((FX_LPBYTE)(p))[3])) -#define FXCMYK_SETDIB(p, cmyk) ((FX_LPBYTE)(p))[0] = (FX_BYTE)((cmyk) >> 24), \ - ((FX_LPBYTE)(p))[1] = (FX_BYTE)((cmyk) >> 16), \ - ((FX_LPBYTE)(p))[2] = (FX_BYTE)((cmyk) >> 8), \ - ((FX_LPBYTE)(p))[3] = (FX_BYTE)(cmyk)) +#define FXCMYK_SETDIB(p, cmyk) ((FX_LPBYTE)(p))[0] = (uint8_t)((cmyk) >> 24), \ + ((FX_LPBYTE)(p))[1] = (uint8_t)((cmyk) >> 16), \ + ((FX_LPBYTE)(p))[2] = (uint8_t)((cmyk) >> 8), \ + ((FX_LPBYTE)(p))[3] = (uint8_t)(cmyk)) #define FXARGB_GETDIB(p) ((((FX_LPBYTE)(p))[0]) | (((FX_LPBYTE)(p))[1] << 8) | (((FX_LPBYTE)(p))[2] << 16) | (((FX_LPBYTE)(p))[3] << 24)) -#define FXARGB_SETDIB(p, argb) ((FX_LPBYTE)(p))[0] = (FX_BYTE)(argb), \ - ((FX_LPBYTE)(p))[1] = (FX_BYTE)((argb) >> 8), \ - ((FX_LPBYTE)(p))[2] = (FX_BYTE)((argb) >> 16), \ - ((FX_LPBYTE)(p))[3] = (FX_BYTE)((argb) >> 24) +#define FXARGB_SETDIB(p, argb) ((FX_LPBYTE)(p))[0] = (uint8_t)(argb), \ + ((FX_LPBYTE)(p))[1] = (uint8_t)((argb) >> 8), \ + ((FX_LPBYTE)(p))[2] = (uint8_t)((argb) >> 16), \ + ((FX_LPBYTE)(p))[3] = (uint8_t)((argb) >> 24) #define FXARGB_COPY(dest, src) *(FX_LPBYTE)(dest) = *(FX_LPBYTE)(src), \ *((FX_LPBYTE)(dest)+1) = *((FX_LPBYTE)(src)+1), \ *((FX_LPBYTE)(dest)+2) = *((FX_LPBYTE)(src)+2), \ @@ -118,21 +118,21 @@ FX_ARGB ArgbEncode(int a, FX_COLORREF rgb); *((FX_LPBYTE)(dest)+1) = *((FX_LPBYTE)(src)+1), \ *((FX_LPBYTE)(dest)+2) = *((FX_LPBYTE)(src)+2), \ *((FX_LPBYTE)(dest)+3) = *((FX_LPBYTE)(src)+3) -#define FXARGB_SETRGBORDERDIB(p, argb) ((FX_LPBYTE)(p))[3] = (FX_BYTE)(argb>>24), \ - ((FX_LPBYTE)(p))[0] = (FX_BYTE)((argb) >> 16), \ - ((FX_LPBYTE)(p))[1] = (FX_BYTE)((argb) >> 8), \ - ((FX_LPBYTE)(p))[2] = (FX_BYTE)(argb) +#define FXARGB_SETRGBORDERDIB(p, argb) ((FX_LPBYTE)(p))[3] = (uint8_t)(argb>>24), \ + ((FX_LPBYTE)(p))[0] = (uint8_t)((argb) >> 16), \ + ((FX_LPBYTE)(p))[1] = (uint8_t)((argb) >> 8), \ + ((FX_LPBYTE)(p))[2] = (uint8_t)(argb) #define FXARGB_GETRGBORDERDIB(p) (((FX_LPBYTE)(p))[2]) | (((FX_LPBYTE)(p))[1] << 8) | (((FX_LPBYTE)(p))[0] << 16) | (((FX_LPBYTE)(p))[3] << 24) #define FXARGB_RGBORDERCOPY(dest, src) *((FX_LPBYTE)(dest)+3) = *((FX_LPBYTE)(src)+3), \ *(FX_LPBYTE)(dest) = *((FX_LPBYTE)(src)+2), \ *((FX_LPBYTE)(dest)+1) = *((FX_LPBYTE)(src)+1), \ *((FX_LPBYTE)(dest)+2) = *((FX_LPBYTE)(src)) #define FXARGB_TODIB(argb) (argb) -#define FXCMYK_TODIB(cmyk) ((FX_BYTE)((cmyk) >> 24) | ((FX_BYTE)((cmyk) >> 16)) << 8 | ((FX_BYTE)((cmyk) >> 8)) << 16 | ((FX_BYTE)(cmyk) << 24)) -#define FXARGB_TOBGRORDERDIB(argb) ((FX_BYTE)(argb>>16) | ((FX_BYTE)(argb>>8)) << 8 | ((FX_BYTE)(argb)) << 16 | ((FX_BYTE)(argb>>24) << 24)) -#define FXGETFLAG_COLORTYPE(flag) (FX_BYTE)((flag)>>8) -#define FXGETFLAG_ALPHA_FILL(flag) (FX_BYTE)(flag) -#define FXGETFLAG_ALPHA_STROKE(flag) (FX_BYTE)((flag)>>16) +#define FXCMYK_TODIB(cmyk) ((uint8_t)((cmyk) >> 24) | ((uint8_t)((cmyk) >> 16)) << 8 | ((uint8_t)((cmyk) >> 8)) << 16 | ((uint8_t)(cmyk) << 24)) +#define FXARGB_TOBGRORDERDIB(argb) ((uint8_t)(argb>>16) | ((uint8_t)(argb>>8)) << 8 | ((uint8_t)(argb)) << 16 | ((uint8_t)(argb>>24) << 24)) +#define FXGETFLAG_COLORTYPE(flag) (uint8_t)((flag)>>8) +#define FXGETFLAG_ALPHA_FILL(flag) (uint8_t)(flag) +#define FXGETFLAG_ALPHA_STROKE(flag) (uint8_t)((flag)>>16) #define FXSETFLAG_COLORTYPE(flag, val) flag = (((val)<<8)|(flag&0xffff00ff)) #define FXSETFLAG_ALPHA_FILL(flag, val) flag = ((val)|(flag&0xffffff00)) #define FXSETFLAG_ALPHA_STROKE(flag, val) flag = (((val)<<16)|(flag&0xff00ffff)) @@ -415,7 +415,7 @@ public: ~CFX_ScanlineCompositor(); - FX_BOOL Init(FXDIB_Format dest_format, FXDIB_Format src_format, FX_INT32 width, FX_DWORD* pSrcPalette, + FX_BOOL Init(FXDIB_Format dest_format, FXDIB_Format src_format, int32_t width, FX_DWORD* pSrcPalette, FX_DWORD mask_color, int blend_type, FX_BOOL bClip, FX_BOOL bRgbByteOrder = FALSE, int alpha_flag = 0, void* pIccTransform = NULL); @@ -519,11 +519,11 @@ public: ~CFX_ImageStretcher(); - FX_INT32 Start(IFX_ScanlineComposer* pDest, const CFX_DIBSource* pBitmap, + int32_t Start(IFX_ScanlineComposer* pDest, const CFX_DIBSource* pBitmap, int dest_width, int dest_height, const FX_RECT& bitmap_rect, FX_DWORD flags); - FX_INT32 Continue(IFX_Pause* pPause); + int32_t Continue(IFX_Pause* pPause); IFX_ScanlineComposer* m_pDest; const CFX_DIBSource* m_pSource; CStretchEngine* m_pStretchEngine; @@ -538,15 +538,15 @@ public: FX_LPBYTE m_pScanline; FX_LPBYTE m_pMaskScanline; FXDIB_Format m_DestFormat; - FX_INT32 m_Status; + int32_t m_Status; - FX_INT32 StartQuickStretch(); + int32_t StartQuickStretch(); - FX_INT32 StartStretch(); + int32_t StartStretch(); - FX_INT32 ContinueQuickStretch(IFX_Pause* pPause); + int32_t ContinueQuickStretch(IFX_Pause* pPause); - FX_INT32 ContinueStretch(IFX_Pause* pPause); + int32_t ContinueStretch(IFX_Pause* pPause); }; class CFX_ImageTransformer { @@ -556,10 +556,10 @@ public: ~CFX_ImageTransformer(); - FX_INT32 Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pMatrix, int flags, const FX_RECT* pClip); + int32_t Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pMatrix, int flags, const FX_RECT* pClip); - FX_INT32 Continue(IFX_Pause* pPause); + int32_t Continue(IFX_Pause* pPause); CFX_AffineMatrix* m_pMatrix; FX_RECT m_StretchClip; int m_ResultLeft, m_ResultTop, m_ResultWidth, m_ResultHeight; @@ -577,13 +577,13 @@ public: ~CFX_ImageRenderer(); - FX_INT32 Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn, + int32_t Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn, const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD mask_color, const CFX_AffineMatrix* pMatrix, FX_DWORD dib_flags, FX_BOOL bRgbByteOrder = FALSE, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); - FX_INT32 Continue(IFX_Pause* pPause); + int32_t Continue(IFX_Pause* pPause); protected: CFX_DIBitmap* m_pDevice; const CFX_ClipRgn* m_pClipRgn; diff --git a/core/include/fxge/fx_ge.h b/core/include/fxge/fx_ge.h index 60374eff45..a880166c39 100644 --- a/core/include/fxge/fx_ge.h +++ b/core/include/fxge/fx_ge.h @@ -65,7 +65,7 @@ protected: void InitPlatform(); void DestroyPlatform(); private: - FX_BYTE m_GammaValue[256]; + uint8_t m_GammaValue[256]; CFX_FontCache* m_pFontCache; CFX_FontMgr* m_pFontMgr; CCodec_ModuleMgr* m_pCodecModule; @@ -133,8 +133,8 @@ protected: void IntersectMaskRect(FX_RECT rect, FX_RECT mask_box, CFX_DIBitmapRef Mask); }; -extern const FX_BYTE g_GammaRamp[256]; -extern const FX_BYTE g_GammaInverse[256]; +extern const uint8_t g_GammaRamp[256]; +extern const uint8_t g_GammaInverse[256]; #define FX_GAMMA(value) (value) #define FX_GAMMA_INVERSE(value) (value) inline FX_ARGB ArgbGamma(FX_ARGB argb) diff --git a/core/include/fxge/fx_ge_apple.h b/core/include/fxge/fx_ge_apple.h index 90cd03455b..b22d31fa9f 100644 --- a/core/include/fxge/fx_ge_apple.h +++ b/core/include/fxge/fx_ge_apple.h @@ -13,9 +13,9 @@ class CFX_QuartzDevice : public CFX_RenderDevice public: CFX_QuartzDevice(); ~CFX_QuartzDevice(); - FX_BOOL Attach(CGContextRef context, FX_INT32 nDeviceClass = FXDC_DISPLAY); + FX_BOOL Attach(CGContextRef context, int32_t nDeviceClass = FXDC_DISPLAY); FX_BOOL Attach(CFX_DIBitmap* pBitmap); - FX_BOOL Create(FX_INT32 width, FX_INT32 height, FXDIB_Format format); + FX_BOOL Create(int32_t width, int32_t height, FXDIB_Format format); CGContextRef GetContext(); diff --git a/core/include/fxge/fx_ge_win32.h b/core/include/fxge/fx_ge_win32.h index c9cb2a35a9..3972090326 100644 --- a/core/include/fxge/fx_ge_win32.h +++ b/core/include/fxge/fx_ge_win32.h @@ -17,7 +17,7 @@ typedef struct WINDIB_Open_Args_ { int flags; - const FX_BYTE* memory_base; + const uint8_t* memory_base; size_t memory_size; diff --git a/core/include/reflow/fpdf_layout.h b/core/include/reflow/fpdf_layout.h index ebd879c764..b1038db329 100644 --- a/core/include/reflow/fpdf_layout.h +++ b/core/include/reflow/fpdf_layout.h @@ -252,7 +252,7 @@ typedef struct _LayoutProviderStyle { m_Language = LP_Lang_Unknow; m_bIgnoreInvisibleText = TRUE; } - FX_INT32 m_Language; + int32_t m_Language; FX_BOOL m_bIgnoreInvisibleText; } LAYOUTPROVIDER_STYLE; class IPDF_LayoutProvider diff --git a/core/include/reflow/reflowengine.h b/core/include/reflow/reflowengine.h index af3c943e97..30c7174053 100644 --- a/core/include/reflow/reflowengine.h +++ b/core/include/reflow/reflowengine.h @@ -22,11 +22,11 @@ public: virtual CFX_PrivateData* GetPrivateDataCtrl() = 0; - virtual void GetDisplayMatrix(CFX_AffineMatrix& matrix, FX_INT32 xPos, FX_INT32 yPos, FX_INT32 xSize, FX_INT32 ySize, FX_INT32 iRotate, const CFX_AffineMatrix* pPageMatrix) = 0; + virtual void GetDisplayMatrix(CFX_AffineMatrix& matrix, int32_t xPos, int32_t yPos, int32_t xSize, int32_t ySize, int32_t iRotate, const CFX_AffineMatrix* pPageMatrix) = 0; virtual FX_FLOAT GetPageHeight() = 0; virtual FX_FLOAT GetPageWidth() = 0; - virtual void FocusGetData(const CFX_AffineMatrix matrix, FX_INT32 x, FX_INT32 y, CFX_ByteString& str) = 0; - virtual FX_BOOL FocusGetPosition(const CFX_AffineMatrix matrix, CFX_ByteString str, FX_INT32& x, FX_INT32& y) = 0; + virtual void FocusGetData(const CFX_AffineMatrix matrix, int32_t x, int32_t y, CFX_ByteString& str) = 0; + virtual FX_BOOL FocusGetPosition(const CFX_AffineMatrix matrix, CFX_ByteString str, int32_t& x, int32_t& y) = 0; }; typedef struct _RF_ParseStyle { _RF_ParseStyle() |