diff options
Diffstat (limited to 'core/include/fpdfapi')
-rw-r--r-- | core/include/fpdfapi/fpdf_module.h | 16 | ||||
-rw-r--r-- | core/include/fpdfapi/fpdf_objects.h | 32 | ||||
-rw-r--r-- | core/include/fpdfapi/fpdf_page.h | 2 | ||||
-rw-r--r-- | core/include/fpdfapi/fpdf_parser.h | 98 | ||||
-rw-r--r-- | core/include/fpdfapi/fpdf_resource.h | 18 | ||||
-rw-r--r-- | core/include/fpdfapi/fpdf_serial.h | 12 |
6 files changed, 89 insertions, 89 deletions
diff --git a/core/include/fpdfapi/fpdf_module.h b/core/include/fpdfapi/fpdf_module.h index 5be2b192c4..c7977b6183 100644 --- a/core/include/fpdfapi/fpdf_module.h +++ b/core/include/fpdfapi/fpdf_module.h @@ -66,11 +66,11 @@ public: void InitRenderModule(); - void SetDownloadCallback(FX_BOOL (*callback)(FX_LPCSTR module_name)); + void SetDownloadCallback(FX_BOOL (*callback)(const FX_CHAR* module_name)); - FX_BOOL DownloadModule(FX_LPCSTR module_name); + FX_BOOL DownloadModule(const FX_CHAR* module_name); - void NotifyModuleAvailable(FX_LPCSTR module_name); + void NotifyModuleAvailable(const FX_CHAR* module_name); @@ -102,13 +102,13 @@ public: ICodec_IccModule* GetIccModule(); ICodec_FlateModule* GetFlateModule(); - void RegisterSecurityHandler(FX_LPCSTR name, CPDF_SecurityHandler * (*CreateHandler)(void* param), void* param); + void RegisterSecurityHandler(const FX_CHAR* name, CPDF_SecurityHandler * (*CreateHandler)(void* param), void* param); - CPDF_SecurityHandler* CreateSecurityHandler(FX_LPCSTR name); + CPDF_SecurityHandler* CreateSecurityHandler(const FX_CHAR* name); - void SetPrivateData(FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback); + void SetPrivateData(void* module_id, void* pData, PD_CALLBACK_FREEDATA callback); - FX_LPVOID GetPrivateData(FX_LPVOID module_id); + void* GetPrivateData(void* module_id); int m_FileBufSize; protected: @@ -129,7 +129,7 @@ protected: CPDF_PageModuleDef* m_pPageModule; - FX_BOOL (*m_pDownloadCallback)(FX_LPCSTR module_name); + FX_BOOL (*m_pDownloadCallback)(const FX_CHAR* module_name); CFX_MapByteStringToPtr m_SecurityHandlerMap; diff --git a/core/include/fpdfapi/fpdf_objects.h b/core/include/fpdfapi/fpdf_objects.h index 8444f09b70..5b5811d2be 100644 --- a/core/include/fpdfapi/fpdf_objects.h +++ b/core/include/fpdfapi/fpdf_objects.h @@ -36,7 +36,7 @@ class IFX_FileRead; #define PDFOBJ_NULL 8 #define PDFOBJ_REFERENCE 9 -typedef IFX_FileStream* (*FPDF_LPFCloneStreamCallback)(CPDF_Stream *pStream, FX_LPVOID pUserData); +typedef IFX_FileStream* (*FPDF_LPFCloneStreamCallback)(CPDF_Stream *pStream, void* pUserData); class CPDF_Object { public: @@ -83,7 +83,7 @@ public: void SetString(const CFX_ByteString& str); - void SetUnicodeText(FX_LPCWSTR pUnicodes, int len = -1); + void SetUnicodeText(const FX_WCHAR* pUnicodes, int len = -1); int GetDirectType() const; @@ -265,14 +265,14 @@ public: return FX_NEW CPDF_Name(str); } - static CPDF_Name* Create(FX_LPCSTR str) + static CPDF_Name* Create(const FX_CHAR* str) { return FX_NEW CPDF_Name(str); } CPDF_Name(const CFX_ByteString& str) : CPDF_Object(PDFOBJ_NAME), m_Name(str) { } CPDF_Name(FX_BSTR str) : CPDF_Object(PDFOBJ_NAME), m_Name(str) { } - CPDF_Name(FX_LPCSTR str) : CPDF_Object(PDFOBJ_NAME), m_Name(str) { } + CPDF_Name(const FX_CHAR* str) : CPDF_Object(PDFOBJ_NAME), m_Name(str) { } CFX_ByteString& GetString() { @@ -506,19 +506,19 @@ class CPDF_Stream : public CPDF_Object { public: - static CPDF_Stream* Create(FX_LPBYTE pData, FX_DWORD size, CPDF_Dictionary* pDict) + static CPDF_Stream* Create(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDict) { return FX_NEW CPDF_Stream(pData, size, pDict); } - CPDF_Stream(FX_LPBYTE pData, FX_DWORD size, CPDF_Dictionary* pDict); + CPDF_Stream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDict); CPDF_Dictionary* GetDict() const { return m_pDict; } - void SetData(FX_LPCBYTE pData, FX_DWORD size, FX_BOOL bCompressed, FX_BOOL bKeepBuf); + void SetData(const uint8_t* pData, FX_DWORD size, FX_BOOL bCompressed, FX_BOOL bKeepBuf); void InitStream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDict); @@ -535,7 +535,7 @@ public: return m_dwSize; } - FX_BOOL ReadRawData(FX_FILESIZE start_pos, FX_LPBYTE pBuf, FX_DWORD buf_size) const; + FX_BOOL ReadRawData(FX_FILESIZE start_pos, uint8_t* pBuf, FX_DWORD buf_size) const; FX_BOOL IsMemoryBased() const @@ -543,7 +543,7 @@ public: return m_GenNum == (FX_DWORD) - 1; } - CPDF_Stream* Clone(FX_BOOL bDirect, FPDF_LPFCloneStreamCallback lpfCallback, FX_LPVOID pUserData) const; + CPDF_Stream* Clone(FX_BOOL bDirect, FPDF_LPFCloneStreamCallback lpfCallback, void* pUserData) const; protected: ~CPDF_Stream(); @@ -556,7 +556,7 @@ protected: union { - FX_LPBYTE m_pDataBuf; + uint8_t* m_pDataBuf; IFX_FileRead* m_pFile; }; @@ -591,11 +591,11 @@ public: return m_pStream? m_pStream->GetDict() : NULL; } - FX_LPCBYTE GetData() const; + const uint8_t* GetData() const; FX_DWORD GetSize() const; - FX_LPBYTE DetachData(); + uint8_t* DetachData(); const CFX_ByteString& GetImageDecoder() { @@ -608,7 +608,7 @@ public: } protected: - FX_LPBYTE m_pData; + uint8_t* m_pData; FX_DWORD m_dwSize; @@ -620,7 +620,7 @@ protected: const CPDF_Stream* m_pStream; - FX_LPBYTE m_pSrcData; + uint8_t* m_pSrcData; }; CFX_DataFilter* FPDF_CreateFilter(FX_BSTR name, const CPDF_Dictionary* pParam, int width = 0, int height = 0); #define FPDF_FILTER_BUFFER_SIZE 20480 @@ -630,7 +630,7 @@ public: ~CPDF_StreamFilter(); - FX_DWORD ReadBlock(FX_LPBYTE buffer, FX_DWORD size); + FX_DWORD ReadBlock(uint8_t* buffer, FX_DWORD size); FX_DWORD GetSrcPos() { @@ -645,7 +645,7 @@ protected: CPDF_StreamFilter() {} - FX_DWORD ReadLeftOver(FX_LPBYTE buffer, FX_DWORD buf_size); + FX_DWORD ReadLeftOver(uint8_t* buffer, FX_DWORD buf_size); const CPDF_Stream* m_pStream; diff --git a/core/include/fpdfapi/fpdf_page.h b/core/include/fpdfapi/fpdf_page.h index d549b7713a..867f00208b 100644 --- a/core/include/fpdfapi/fpdf_page.h +++ b/core/include/fpdfapi/fpdf_page.h @@ -235,7 +235,7 @@ public: void TransformContent(CFX_Matrix& matrix); protected: void ProcessImage(CFX_ByteTextBuf& buf, CPDF_ImageObject* pImageObj); - void ProcessForm(CFX_ByteTextBuf& buf, FX_LPCBYTE data, FX_DWORD size, CFX_Matrix& matrix); + void ProcessForm(CFX_ByteTextBuf& buf, const uint8_t* data, FX_DWORD size, CFX_Matrix& matrix); CFX_ByteString RealizeResource(CPDF_Object* pResourceObj, const FX_CHAR* szType); private: CPDF_Page* m_pPage; diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h index f0e3e2ca08..cdd7aaaa11 100644 --- a/core/include/fpdfapi/fpdf_parser.h +++ b/core/include/fpdfapi/fpdf_parser.h @@ -202,7 +202,7 @@ class CPDF_SimpleParser { public: - CPDF_SimpleParser(FX_LPCBYTE pData, FX_DWORD dwSize); + CPDF_SimpleParser(const uint8_t* pData, FX_DWORD dwSize); CPDF_SimpleParser(FX_BSTR str); @@ -229,9 +229,9 @@ public: } private: - void ParseWord(FX_LPCBYTE& pStart, FX_DWORD& dwSize, int& type); + void ParseWord(const uint8_t*& pStart, FX_DWORD& dwSize, int& type); - FX_LPCBYTE m_pData; + const uint8_t* m_pData; FX_DWORD m_dwSize; @@ -306,7 +306,7 @@ protected: void GetNextWord(); - FX_BOOL IsWholeWord(FX_FILESIZE startpos, FX_FILESIZE limit, FX_LPCBYTE tag, FX_DWORD taglen); + FX_BOOL IsWholeWord(FX_FILESIZE startpos, FX_FILESIZE limit, const uint8_t* tag, FX_DWORD taglen); CFX_ByteString ReadString(); @@ -373,8 +373,8 @@ public: CPDF_Parser(); ~CPDF_Parser(); - FX_DWORD StartParse(FX_LPCSTR filename, FX_BOOL bReParse = FALSE); - FX_DWORD StartParse(FX_LPCWSTR filename, FX_BOOL bReParse = FALSE); + FX_DWORD StartParse(const FX_CHAR* filename, FX_BOOL bReParse = FALSE); + FX_DWORD StartParse(const FX_WCHAR* filename, FX_BOOL bReParse = FALSE); FX_DWORD StartParse(IFX_FileRead* pFile, FX_BOOL bReParse = FALSE, FX_BOOL bOwnFileRead = TRUE); void CloseParser(FX_BOOL bReParse = FALSE); @@ -592,7 +592,7 @@ public: virtual FX_BOOL IsOwner() = 0; - virtual FX_BOOL GetCryptInfo(int& cipher, FX_LPCBYTE& buffer, int& keylen) = 0; + virtual FX_BOOL GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen) = 0; virtual FX_BOOL IsMetadataEncrypted() { @@ -619,7 +619,7 @@ public: { return m_bOwner; } - virtual FX_BOOL GetCryptInfo(int& cipher, FX_LPCBYTE& buffer, int& keylen); + virtual FX_BOOL GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen); virtual FX_BOOL IsMetadataEncrypted(); virtual CPDF_CryptoHandler* CreateCryptoHandler(); virtual CPDF_StandardSecurityHandler* GetStandardHandler() @@ -628,14 +628,14 @@ public: } 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_DWORD type = PDF_ENCRYPT_CONTENT); + const uint8_t* user_pass, FX_DWORD user_size, + const uint8_t* owner_pass, FX_DWORD owner_size, FX_DWORD type = PDF_ENCRYPT_CONTENT); void OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray, - FX_LPCBYTE user_pass, FX_DWORD user_size, FX_DWORD type = PDF_ENCRYPT_CONTENT); + const uint8_t* 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, int32_t key_len); + CFX_ByteString GetUserPassword(const uint8_t* owner_pass, FX_DWORD pass_size); + CFX_ByteString GetUserPassword(const uint8_t* owner_pass, FX_DWORD pass_size, int32_t key_len); int GetVersion() { return m_Version; @@ -645,8 +645,8 @@ public: return m_Revision; } - int CheckPassword(FX_LPCBYTE password, FX_DWORD pass_size, FX_BOOL bOwner, FX_LPBYTE key); - int CheckPassword(FX_LPCBYTE password, FX_DWORD pass_size, FX_BOOL bOwner, FX_LPBYTE key, int key_len); + int CheckPassword(const uint8_t* password, FX_DWORD pass_size, FX_BOOL bOwner, uint8_t* key); + int CheckPassword(const uint8_t* password, FX_DWORD pass_size, FX_BOOL bOwner, uint8_t* key, int key_len); private: int m_Version; @@ -660,16 +660,16 @@ private: FX_BOOL LoadDict(CPDF_Dictionary* pEncryptDict); 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, int32_t key_len); + FX_BOOL CheckUserPassword(const uint8_t* password, FX_DWORD pass_size, + FX_BOOL bIgnoreEncryptMeta, uint8_t* key, int32_t 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); + FX_BOOL CheckOwnerPassword(const uint8_t* password, FX_DWORD pass_size, uint8_t* key, int32_t key_len); + FX_BOOL AES256_CheckPassword(const uint8_t* password, FX_DWORD size, FX_BOOL bOwner, uint8_t* key); + void AES256_SetPassword(CPDF_Dictionary* pEncryptDict, const uint8_t* password, FX_DWORD size, FX_BOOL bOwner, const uint8_t* key); + void AES256_SetPerms(CPDF_Dictionary* pEncryptDict, FX_DWORD permission, FX_BOOL bEncryptMetadata, const uint8_t* 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); + const uint8_t* user_pass, FX_DWORD user_size, + const uint8_t* owner_pass, FX_DWORD owner_size, FX_BOOL bDefault, FX_DWORD type); FX_BOOL CheckSecurity(int32_t key_len); FX_BOOL m_bOwner; @@ -692,17 +692,17 @@ public: virtual FX_DWORD DecryptGetSize(FX_DWORD src_size) = 0; - virtual FX_LPVOID DecryptStart(FX_DWORD objnum, FX_DWORD gennum) = 0; + virtual void* DecryptStart(FX_DWORD objnum, FX_DWORD gennum) = 0; - virtual FX_BOOL DecryptStream(FX_LPVOID context, FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) = 0; + virtual FX_BOOL DecryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) = 0; - virtual FX_BOOL DecryptFinish(FX_LPVOID context, CFX_BinaryBuf& dest_buf) = 0; + virtual FX_BOOL DecryptFinish(void* context, CFX_BinaryBuf& dest_buf) = 0; - virtual FX_DWORD EncryptGetSize(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0; + virtual FX_DWORD EncryptGetSize(FX_DWORD objnum, FX_DWORD version, const uint8_t* src_buf, FX_DWORD src_size) = 0; - virtual FX_BOOL EncryptContent(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size, - FX_LPBYTE dest_buf, FX_DWORD& dest_size) = 0; + virtual FX_BOOL EncryptContent(FX_DWORD objnum, FX_DWORD version, const uint8_t* src_buf, FX_DWORD src_size, + uint8_t* dest_buf, FX_DWORD& dest_size) = 0; void Decrypt(FX_DWORD objnum, FX_DWORD version, CFX_ByteString& str); }; @@ -714,22 +714,22 @@ public: virtual ~CPDF_StandardCryptoHandler(); - FX_BOOL Init(int cipher, FX_LPCBYTE key, int keylen); + FX_BOOL Init(int cipher, const uint8_t* key, int keylen); virtual FX_BOOL Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler); virtual FX_DWORD DecryptGetSize(FX_DWORD src_size); - virtual FX_LPVOID DecryptStart(FX_DWORD objnum, FX_DWORD gennum); - virtual FX_BOOL DecryptStream(FX_LPVOID context, FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf); - virtual FX_BOOL DecryptFinish(FX_LPVOID context, CFX_BinaryBuf& dest_buf); - virtual FX_DWORD EncryptGetSize(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size); - virtual FX_BOOL EncryptContent(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size, - FX_LPBYTE dest_buf, FX_DWORD& dest_size); + virtual void* DecryptStart(FX_DWORD objnum, FX_DWORD gennum); + virtual FX_BOOL DecryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf); + virtual FX_BOOL DecryptFinish(void* context, CFX_BinaryBuf& dest_buf); + virtual FX_DWORD EncryptGetSize(FX_DWORD objnum, FX_DWORD version, const uint8_t* src_buf, FX_DWORD src_size); + virtual FX_BOOL EncryptContent(FX_DWORD objnum, FX_DWORD version, const uint8_t* src_buf, FX_DWORD src_size, + uint8_t* dest_buf, FX_DWORD& dest_size); protected: - virtual void CryptBlock(FX_BOOL bEncrypt, FX_DWORD objnum, FX_DWORD gennum, FX_LPCBYTE src_buf, FX_DWORD src_size, - FX_LPBYTE dest_buf, FX_DWORD& dest_size); - virtual FX_LPVOID CryptStart(FX_DWORD objnum, FX_DWORD gennum, FX_BOOL bEncrypt); - 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); + virtual void CryptBlock(FX_BOOL bEncrypt, FX_DWORD objnum, FX_DWORD gennum, const uint8_t* src_buf, FX_DWORD src_size, + uint8_t* dest_buf, FX_DWORD& dest_size); + virtual void* CryptStart(FX_DWORD objnum, FX_DWORD gennum, FX_BOOL bEncrypt); + virtual FX_BOOL CryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt); + virtual FX_BOOL CryptFinish(void* context, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt); uint8_t m_EncryptKey[32]; @@ -737,7 +737,7 @@ protected: int m_Cipher; - FX_LPBYTE m_pAESContext; + uint8_t* m_pAESContext; }; class CPDF_Point { @@ -760,11 +760,11 @@ CFX_ByteString PDF_NameDecode(FX_BSTR orig); CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig); CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig); CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, FX_BOOL bHex = FALSE); -CFX_WideString PDF_DecodeText(FX_LPCBYTE pData, FX_DWORD size, CFX_CharMap* pCharMap = NULL); +CFX_WideString PDF_DecodeText(const uint8_t* pData, FX_DWORD size, CFX_CharMap* pCharMap = NULL); inline CFX_WideString PDF_DecodeText(const CFX_ByteString& bstr, CFX_CharMap* pCharMap = NULL) { - return PDF_DecodeText((FX_LPCBYTE)bstr.c_str(), bstr.GetLength(), pCharMap); + return PDF_DecodeText((const uint8_t*)bstr.c_str(), bstr.GetLength(), pCharMap); } -CFX_ByteString PDF_EncodeText(FX_LPCWSTR pString, int len = -1, CFX_CharMap* pCharMap = NULL); +CFX_ByteString PDF_EncodeText(const FX_WCHAR* pString, int len = -1, CFX_CharMap* pCharMap = NULL); inline CFX_ByteString PDF_EncodeText(const CFX_WideString& str, CFX_CharMap* pCharMap = NULL) { return PDF_EncodeText(str.c_str(), str.GetLength(), pCharMap); } @@ -774,7 +774,7 @@ class CFDF_Document : public CPDF_IndirectObjects public: static CFDF_Document* CreateNewDoc(); static CFDF_Document* ParseFile(IFX_FileRead *pFile, FX_BOOL bOwnFile = FALSE); - static CFDF_Document* ParseMemory(FX_LPCBYTE pData, FX_DWORD size); + static CFDF_Document* ParseMemory(const uint8_t* pData, FX_DWORD size); ~CFDF_Document(); @@ -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 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); +void FlateEncode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size); +FX_DWORD FlateDecode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size); +FX_DWORD RunLengthDecode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size); class CPDF_NumberTree { public: diff --git a/core/include/fpdfapi/fpdf_resource.h b/core/include/fpdfapi/fpdf_resource.h index 06dcdfec44..f962fef916 100644 --- a/core/include/fpdfapi/fpdf_resource.h +++ b/core/include/fpdfapi/fpdf_resource.h @@ -155,7 +155,7 @@ public: return m_Font.GetFace(); } - virtual FX_DWORD GetNextChar(FX_LPCSTR pString, int nStrLen, int& offset) const + virtual FX_DWORD GetNextChar(const FX_CHAR* pString, int nStrLen, int& offset) const { if (offset < 0 || nStrLen < 1) { return 0; @@ -164,14 +164,14 @@ public: return static_cast<FX_DWORD>(ch); } - virtual int CountChar(FX_LPCSTR pString, int size) const + virtual int CountChar(const FX_CHAR* pString, int size) const { return size; } void AppendChar(CFX_ByteString& str, FX_DWORD charcode) const; - virtual int AppendChar(FX_LPSTR buf, FX_DWORD charcode) const + virtual int AppendChar(FX_CHAR* buf, FX_DWORD charcode) const { *buf = (FX_CHAR)charcode; return 1; @@ -514,9 +514,9 @@ public: return !m_bType1; } - virtual FX_DWORD GetNextChar(FX_LPCSTR pString, int nStrLen, int& offset) const override; - virtual int CountChar(FX_LPCSTR pString, int size) const; - virtual int AppendChar(FX_LPSTR str, FX_DWORD charcode) const; + virtual FX_DWORD GetNextChar(const FX_CHAR* pString, int nStrLen, int& offset) const override; + virtual int CountChar(const FX_CHAR* pString, int size) const; + virtual int AppendChar(FX_CHAR* str, FX_DWORD charcode) const; virtual int GetCharSize(FX_DWORD charcode) const; int GetCharset() const @@ -524,7 +524,7 @@ public: return m_Charset; } - FX_LPCBYTE GetCIDTransform(FX_WORD CID) const; + const uint8_t* GetCIDTransform(FX_WORD CID) const; virtual FX_BOOL IsVertWriting() const; short GetVertWidth(FX_WORD CID) const; void GetVertOrigin(FX_WORD CID, short& vx, short& vy) const; @@ -624,7 +624,7 @@ public: FX_BOOL SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const; - virtual void TranslateImageLine(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf, int pixels, + virtual void TranslateImageLine(uint8_t* dest_buf, const uint8_t* src_buf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const; CPDF_Array*& GetArray() @@ -942,7 +942,7 @@ private: CPDF_Document* m_pDocument; CPDF_Dictionary* m_pOC; - CPDF_Dictionary* InitJPEG(FX_LPBYTE pData, FX_DWORD size); + CPDF_Dictionary* InitJPEG(uint8_t* pData, FX_DWORD size); }; #endif // CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ diff --git a/core/include/fpdfapi/fpdf_serial.h b/core/include/fpdfapi/fpdf_serial.h index e4a0aec2e5..ada77a2075 100644 --- a/core/include/fpdfapi/fpdf_serial.h +++ b/core/include/fpdfapi/fpdf_serial.h @@ -26,7 +26,7 @@ class CPDF_ObjArchiveLoader : public CFX_ArchiveLoader { public: - CPDF_ObjArchiveLoader(FX_LPCBYTE pData, FX_DWORD dwSize) : CFX_ArchiveLoader(pData, dwSize), + CPDF_ObjArchiveLoader(const uint8_t* pData, FX_DWORD dwSize) : CFX_ArchiveLoader(pData, dwSize), m_IndirectObjects(NULL) {} friend CPDF_ObjArchiveLoader& operator >> (CPDF_ObjArchiveLoader& ar, CPDF_Object*& pObj); @@ -72,7 +72,7 @@ class CPDF_PageArchiveLoader : public CPDF_ObjArchiveLoader { public: - CPDF_PageArchiveLoader(CPDF_PageObjects* pPageObjs, FX_LPCBYTE pData, FX_DWORD dwSize); + CPDF_PageArchiveLoader(CPDF_PageObjects* pPageObjs, const uint8_t* pData, FX_DWORD dwSize); friend CPDF_PageArchiveLoader& operator >> (CPDF_PageArchiveLoader& ar, CPDF_PageObject*& pObj); @@ -91,7 +91,7 @@ public: protected: void PostProcColor(CPDF_Color& color); - CPDF_Object* AddResource(CPDF_Object* pSrcObj, FX_LPCSTR type); + CPDF_Object* AddResource(CPDF_Object* pSrcObj, const FX_CHAR* type); CPDF_ClipPath m_LastClipPath; @@ -121,9 +121,9 @@ public: void RemoveSecurity(); - FX_BOOL Create(FX_LPCWSTR filename, FX_DWORD flags = 0); + FX_BOOL Create(const FX_WCHAR* filename, FX_DWORD flags = 0); - FX_BOOL Create(FX_LPCSTR filename, FX_DWORD flags = 0); + FX_BOOL Create(const FX_CHAR* filename, FX_DWORD flags = 0); FX_BOOL Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0); @@ -179,7 +179,7 @@ protected: 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 WriteIndirectObjectToStream(FX_DWORD objnum, const uint8_t* pBuffer, FX_DWORD dwSize); int32_t AppendObjectNumberToXRef(FX_DWORD objnum); void InitID(FX_BOOL bDefault = TRUE); int32_t WriteStream(const CPDF_Object* pStream, FX_DWORD objnum, CPDF_CryptoHandler* pCrypto); |