summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-10 11:09:44 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-10 11:09:44 -0700
commitfbf266fc0ea4be2523cbb901a641aa33f0035662 (patch)
treed0e5eda4d3c220818903eca76bc2ca835a1851d0 /core/include
parent3c949d5d2b0d680839766ea99c86b263230b263d (diff)
downloadpdfium-fbf266fc0ea4be2523cbb901a641aa33f0035662.tar.xz
Remove typdefs for pointer types in fx_system.h.
This involves fixing some multiple variable per line declarations, as the textually-substituted "*" applies only to the first one. This involves moving some consts around following the substitution. This involves replacing some typedefs used as constructors with better code. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1171733003
Diffstat (limited to 'core/include')
-rw-r--r--core/include/fdrm/fx_crypt.h56
-rw-r--r--core/include/fpdfapi/fpdf_module.h16
-rw-r--r--core/include/fpdfapi/fpdf_objects.h32
-rw-r--r--core/include/fpdfapi/fpdf_page.h2
-rw-r--r--core/include/fpdfapi/fpdf_parser.h98
-rw-r--r--core/include/fpdfapi/fpdf_resource.h18
-rw-r--r--core/include/fpdfapi/fpdf_serial.h12
-rw-r--r--core/include/fpdfdoc/fpdf_doc.h8
-rw-r--r--core/include/fpdfdoc/fpdf_vt.h4
-rw-r--r--core/include/fxcodec/fx_codec.h80
-rw-r--r--core/include/fxcodec/fx_codec_provider.h18
-rw-r--r--core/include/fxcrt/fx_basic.h70
-rw-r--r--core/include/fxcrt/fx_ext.h26
-rw-r--r--core/include/fxcrt/fx_memory.h4
-rw-r--r--core/include/fxcrt/fx_stream.h26
-rw-r--r--core/include/fxcrt/fx_string.h128
-rw-r--r--core/include/fxcrt/fx_system.h31
-rw-r--r--core/include/fxge/fpf.h6
-rw-r--r--core/include/fxge/fx_dib.h119
-rw-r--r--core/include/fxge/fx_font.h38
-rw-r--r--core/include/fxge/fx_ge.h18
-rw-r--r--core/include/fxge/fx_ge_win32.h6
-rw-r--r--core/include/reflow/fpdf_layout.h2
23 files changed, 405 insertions, 413 deletions
diff --git a/core/include/fdrm/fx_crypt.h b/core/include/fdrm/fx_crypt.h
index 8b0ce2f703..af72fcf470 100644
--- a/core/include/fdrm/fx_crypt.h
+++ b/core/include/fdrm/fx_crypt.h
@@ -13,34 +13,34 @@
extern "C" {
#endif
-void CRYPT_ArcFourCryptBlock(FX_LPBYTE data, FX_DWORD size, FX_LPCBYTE key, FX_DWORD keylen);
-void CRYPT_ArcFourSetup(FX_LPVOID context, FX_LPCBYTE key, FX_DWORD length);
-void CRYPT_ArcFourCrypt(FX_LPVOID context, FX_LPBYTE data, FX_DWORD size);
-void CRYPT_AESSetKey(FX_LPVOID context, FX_DWORD blocklen, FX_LPCBYTE key, FX_DWORD keylen, FX_BOOL bEncrypt);
-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, 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, 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, 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, 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, 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, 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));
+void CRYPT_ArcFourCryptBlock(uint8_t* data, FX_DWORD size, const uint8_t* key, FX_DWORD keylen);
+void CRYPT_ArcFourSetup(void* context, const uint8_t* key, FX_DWORD length);
+void CRYPT_ArcFourCrypt(void* context, uint8_t* data, FX_DWORD size);
+void CRYPT_AESSetKey(void* context, FX_DWORD blocklen, const uint8_t* key, FX_DWORD keylen, FX_BOOL bEncrypt);
+void CRYPT_AESSetIV(void* context, const uint8_t* iv);
+void CRYPT_AESDecrypt(void* context, uint8_t* dest, const uint8_t* src, FX_DWORD size);
+void CRYPT_AESEncrypt(void* context, uint8_t* dest, const uint8_t* src, FX_DWORD size);
+void CRYPT_MD5Generate(const uint8_t* data, FX_DWORD size, uint8_t digest[16]);
+void CRYPT_MD5Start(void* context);
+void CRYPT_MD5Update(void* context, const uint8_t* data, FX_DWORD size);
+void CRYPT_MD5Finish(void* context, uint8_t digest[16]);
+void CRYPT_SHA1Generate(const uint8_t* data, FX_DWORD size, uint8_t digest[20]);
+void CRYPT_SHA1Start(void* context);
+void CRYPT_SHA1Update(void* context, const uint8_t* data, FX_DWORD size);
+void CRYPT_SHA1Finish(void* context, uint8_t digest[20]);
+void CRYPT_SHA256Generate(const uint8_t* data, FX_DWORD size, uint8_t digest[32]);
+void CRYPT_SHA256Start(void* context);
+void CRYPT_SHA256Update(void* context, const uint8_t* data, FX_DWORD size);
+void CRYPT_SHA256Finish(void* context, uint8_t digest[32]);
+void CRYPT_SHA384Start(void* context);
+void CRYPT_SHA384Update(void* context, const uint8_t* data, FX_DWORD size);
+void CRYPT_SHA384Finish(void* context, uint8_t digest[48]);
+void CRYPT_SHA384Generate(const uint8_t* data, FX_DWORD size, uint8_t digest[48]);
+void CRYPT_SHA512Start(void* context);
+void CRYPT_SHA512Update(void* context, const uint8_t* data, FX_DWORD size);
+void CRYPT_SHA512Finish(void* context, uint8_t digest[64]);
+void CRYPT_SHA512Generate(const uint8_t* data, FX_DWORD size, uint8_t digest[64]);
+void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(const uint8_t* pData, FX_DWORD size, uint8_t* data_buf, FX_DWORD& data_len));
#ifdef __cplusplus
};
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 d0c76c5b0d..39a05c64f9 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 new CPDF_Name(str);
}
- static CPDF_Name* Create(FX_LPCSTR str)
+ static CPDF_Name* Create(const FX_CHAR* str)
{
return 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 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 054e90a158..651b894ec2 100644
--- a/core/include/fpdfapi/fpdf_resource.h
+++ b/core/include/fpdfapi/fpdf_resource.h
@@ -153,7 +153,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;
@@ -162,14 +162,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;
@@ -512,9 +512,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
@@ -522,7 +522,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;
@@ -622,7 +622,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()
@@ -940,7 +940,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);
diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h
index 13fd41f432..b46579ac88 100644
--- a/core/include/fpdfdoc/fpdf_doc.h
+++ b/core/include/fpdfdoc/fpdf_doc.h
@@ -727,7 +727,7 @@ public:
static FX_BOOL UpdatingAPEnabled();
- static CFX_ByteString GenerateNewResourceName(const CPDF_Dictionary* pResDict, FX_LPCSTR csType, int iMinLen = 2, FX_LPCSTR csPrefix = "");
+ static CFX_ByteString GenerateNewResourceName(const CPDF_Dictionary* pResDict, const FX_CHAR* csType, int iMinLen = 2, const FX_CHAR* csPrefix = "");
@@ -739,9 +739,9 @@ public:
static CPDF_Font* AddStandardFont(const CPDF_Document* pDocument, CFX_ByteString csFontName);
- static CFX_ByteString GetNativeFont(uint8_t iCharSet, FX_LPVOID pLogFont = NULL);
+ static CFX_ByteString GetNativeFont(uint8_t iCharSet, void* pLogFont = NULL);
- static CFX_ByteString GetNativeFont(FX_LPVOID pLogFont = NULL);
+ static CFX_ByteString GetNativeFont(void* pLogFont = NULL);
static uint8_t GetNativeCharSet();
@@ -1543,7 +1543,7 @@ public:
CXML_Element* GetRDF() const;
protected:
- FX_LPVOID m_pData;
+ void* m_pData;
};
class CPDF_ViewerPreferences
{
diff --git a/core/include/fpdfdoc/fpdf_vt.h b/core/include/fpdfdoc/fpdf_vt.h
index fbfeacb755..1fec0e629a 100644
--- a/core/include/fpdfdoc/fpdf_vt.h
+++ b/core/include/fpdfdoc/fpdf_vt.h
@@ -375,7 +375,7 @@ public:
virtual void ResetAll() = 0;
- virtual void SetText(FX_LPCWSTR text, int32_t charset = 1, const CPVT_SecProps * pSecProps = NULL,
+ virtual void SetText(const FX_WCHAR* 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, int32_t charset = 1,
@@ -384,7 +384,7 @@ public:
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, int32_t charset = 1,
+ virtual CPVT_WordPlace InsertText(const CPVT_WordPlace & place, const FX_WCHAR* 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;
diff --git a/core/include/fxcodec/fx_codec.h b/core/include/fxcodec/fx_codec.h
index a16d0d7c5e..75c7480b3d 100644
--- a/core/include/fxcodec/fx_codec.h
+++ b/core/include/fxcodec/fx_codec.h
@@ -85,11 +85,11 @@ class ICodec_BasicModule
public:
virtual ~ICodec_BasicModule() {}
- virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf,
+ virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf,
FX_DWORD& dest_size) = 0;
- virtual FX_BOOL A85Encode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf,
+ virtual FX_BOOL A85Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf,
FX_DWORD& dest_size) = 0;
- virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
int nComps, int bpc) = 0;
};
class ICodec_ScanlineDecoder
@@ -102,7 +102,7 @@ public:
virtual void DownScale(int dest_width, int dest_height) = 0;
- virtual FX_LPBYTE GetScanline(int line) = 0;
+ virtual uint8_t* GetScanline(int line) = 0;
virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) = 0;
@@ -123,15 +123,15 @@ class ICodec_FlateModule
public:
virtual ~ICodec_FlateModule() {}
- virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ virtual ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* 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 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;
+ FX_DWORD estimated_size, uint8_t*& dest_buf, FX_DWORD& dest_size) = 0;
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;
+ uint8_t*& dest_buf, FX_DWORD& dest_size) = 0;
+ virtual FX_BOOL Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size) = 0;
};
class ICodec_FaxModule
{
@@ -139,12 +139,12 @@ public:
virtual ~ICodec_FaxModule() {}
- virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ virtual ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, int Columns, int Rows) = 0;
- virtual FX_BOOL Encode(FX_LPCBYTE src_buf, int width, int height, int pitch,
- FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0;
+ virtual FX_BOOL Encode(const uint8_t* src_buf, int width, int height, int pitch,
+ uint8_t*& dest_buf, FX_DWORD& dest_size) = 0;
};
class ICodec_JpegModule
{
@@ -154,21 +154,21 @@ public:
virtual void SetPovider(IFX_JpegProvider* pJP) = 0;
- virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size,
+ virtual ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size,
int width, int height, int nComps, FX_BOOL ColorTransform) = 0;
- virtual FX_BOOL LoadInfo(FX_LPCBYTE src_buf, FX_DWORD src_size, int& width, int& height,
+ virtual FX_BOOL LoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width, int& height,
int& num_components, int& bits_per_components, FX_BOOL& color_transform,
- FX_LPBYTE* icc_buf_ptr = NULL, FX_DWORD* icc_length = NULL) = 0;
+ uint8_t** icc_buf_ptr = NULL, FX_DWORD* icc_length = NULL) = 0;
- virtual FX_BOOL Encode(const class CFX_DIBSource* pSource, FX_LPBYTE& dest_buf, FX_STRSIZE& dest_size, int quality = 75,
- FX_LPCBYTE icc_buf = NULL, FX_DWORD icc_length = 0) = 0;
+ virtual FX_BOOL Encode(const class CFX_DIBSource* pSource, uint8_t*& dest_buf, FX_STRSIZE& dest_size, int quality = 75,
+ const uint8_t* icc_buf = NULL, FX_DWORD icc_length = 0) = 0;
virtual void* Start() = 0;
virtual void Finish(void* pContext) = 0;
- virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
+ virtual void Input(void* pContext, const uint8_t* src_buf, FX_DWORD src_size) = 0;
virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps) = 0;
@@ -176,10 +176,10 @@ public:
virtual int StartScanline(void* pContext, int down_scale) = 0;
- virtual FX_BOOL ReadScanline(void* pContext, FX_LPBYTE dest_buf) = 0;
+ virtual FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf) = 0;
- virtual FX_DWORD GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr = NULL) = 0;
+ virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr = NULL) = 0;
};
class ICodec_JpxModule
{
@@ -187,15 +187,15 @@ public:
virtual ~ICodec_JpxModule() {}
- virtual FX_LPVOID CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_BOOL useColorSpace = FALSE) = 0;
+ virtual void* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, FX_BOOL useColorSpace = FALSE) = 0;
- virtual void GetImageInfo(FX_LPVOID ctx, FX_DWORD& width, FX_DWORD& height,
+ virtual void GetImageInfo(void* ctx, FX_DWORD& width, FX_DWORD& height,
FX_DWORD& codestream_nComps, FX_DWORD& output_nComps) = 0;
- virtual FX_BOOL Decode(FX_LPVOID ctx, FX_LPBYTE dest_data, int pitch,
- FX_BOOL bTranslateColor, FX_LPBYTE offsets) = 0;
+ virtual FX_BOOL Decode(void* ctx, uint8_t* dest_data, int pitch,
+ FX_BOOL bTranslateColor, uint8_t* offsets) = 0;
- virtual void DestroyDecoder(FX_LPVOID ctx) = 0;
+ virtual void DestroyDecoder(void* ctx) = 0;
};
class ICodec_Jbig2Module
{
@@ -203,18 +203,18 @@ public:
virtual ~ICodec_Jbig2Module() {}
- virtual FX_BOOL Decode(FX_DWORD width, FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size,
- FX_LPCBYTE global_data, FX_DWORD global_size, FX_LPBYTE dest_buf, FX_DWORD dest_pitch) = 0;
+ virtual FX_BOOL Decode(FX_DWORD width, FX_DWORD height, const uint8_t* src_buf, FX_DWORD src_size,
+ const uint8_t* global_data, FX_DWORD global_size, uint8_t* dest_buf, FX_DWORD dest_pitch) = 0;
virtual FX_BOOL Decode(IFX_FileRead* file_ptr, FX_DWORD& width, FX_DWORD& height,
- FX_DWORD& pitch, FX_LPBYTE& dest_buf) = 0;
+ FX_DWORD& pitch, uint8_t*& dest_buf) = 0;
virtual void* CreateJbig2Context() = 0;
- virtual FXCODEC_STATUS StartDecode(void* pJbig2Context, FX_DWORD width, FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size,
- FX_LPCBYTE global_data, FX_DWORD global_size, FX_LPBYTE dest_buf, FX_DWORD dest_pitch, IFX_Pause* pPause) = 0;
+ virtual FXCODEC_STATUS StartDecode(void* pJbig2Context, FX_DWORD width, FX_DWORD height, const uint8_t* src_buf, FX_DWORD src_size,
+ const uint8_t* global_data, FX_DWORD global_size, uint8_t* dest_buf, FX_DWORD dest_pitch, IFX_Pause* pPause) = 0;
virtual FXCODEC_STATUS StartDecode(void* pJbig2Context, IFX_FileRead* file_ptr,
- FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, FX_LPBYTE& dest_buf, IFX_Pause* pPause) = 0;
+ FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, uint8_t*& dest_buf, IFX_Pause* pPause) = 0;
virtual FXCODEC_STATUS ContinueDecode(void* pJbig2Content, IFX_Pause* pPause) = 0;
virtual void DestroyJbig2Context(void* pJbig2Content) = 0;
};
@@ -246,18 +246,18 @@ public:
IccCS ColorSpace;
FX_DWORD dwProfileType;
FX_DWORD dwFormat;
- FX_LPBYTE pProfileData;
+ uint8_t* pProfileData;
FX_DWORD dwProfileSize;
double Gamma;
} IccParam;
virtual ~ICodec_IccModule() {}
- virtual IccCS GetProfileCS(FX_LPCBYTE pProfileData, unsigned int dwProfileSize) = 0;
+ virtual IccCS GetProfileCS(const uint8_t* pProfileData, unsigned int dwProfileSize) = 0;
virtual IccCS GetProfileCS(IFX_FileRead* pFile) = 0;
- virtual FX_LPVOID CreateTransform(ICodec_IccModule::IccParam* pInputParam,
+ virtual void* CreateTransform(ICodec_IccModule::IccParam* pInputParam,
ICodec_IccModule::IccParam* pOutputParam,
ICodec_IccModule::IccParam* pProofParam = NULL,
FX_DWORD dwIntent = Icc_INTENT_PERCEPTUAL,
@@ -267,24 +267,24 @@ public:
) = 0;
- virtual FX_LPVOID CreateTransform_sRGB(FX_LPCBYTE pProfileData, FX_DWORD dwProfileSize, int32_t& nComponents, int32_t intent = 0,
+ virtual void* CreateTransform_sRGB(const uint8_t* 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, int32_t& nSrcComponents,
- FX_LPCBYTE pDstProfileData, FX_DWORD dwDstProfileSize, int32_t intent = 0,
+ virtual void* CreateTransform_CMYK(const uint8_t* pSrcProfileData, FX_DWORD dwSrcProfileSize, int32_t& nSrcComponents,
+ const uint8_t* pDstProfileData, FX_DWORD dwDstProfileSize, int32_t intent = 0,
FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT,
FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT
) = 0;
- virtual void DestroyTransform(FX_LPVOID pTransform) = 0;
+ virtual void DestroyTransform(void* pTransform) = 0;
- virtual void Translate(FX_LPVOID pTransform, FX_FLOAT* pSrcValues, FX_FLOAT* pDestValues) = 0;
+ virtual void Translate(void* pTransform, FX_FLOAT* pSrcValues, FX_FLOAT* pDestValues) = 0;
- virtual void TranslateScanline(FX_LPVOID pTransform, FX_LPBYTE pDest, FX_LPCBYTE pSrc, int pixels) = 0;
+ virtual void TranslateScanline(void* pTransform, uint8_t* pDest, const uint8_t* 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(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]);
+FX_BOOL MD5ComputeID(const void* buf, FX_DWORD dwSize, uint8_t ID[16]);
#endif // CORE_INCLUDE_FXCODEC_FX_CODEC_H_
diff --git a/core/include/fxcodec/fx_codec_provider.h b/core/include/fxcodec/fx_codec_provider.h
index 6d15473ef7..20fd0c5357 100644
--- a/core/include/fxcodec/fx_codec_provider.h
+++ b/core/include/fxcodec/fx_codec_provider.h
@@ -12,7 +12,7 @@ class IFX_JpegProvider
public:
virtual void Release() = 0;
- virtual void* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, FX_BOOL ColorTransform) = 0;
+ virtual void* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height, int nComps, FX_BOOL ColorTransform) = 0;
virtual void DestroyDecoder(void* pDecoder) = 0;
@@ -21,23 +21,23 @@ public:
virtual FX_BOOL Rewind(void* pDecoder) = 0;
- virtual FX_LPBYTE GetNextLine(void* pDecoder) = 0;
+ virtual uint8_t* GetNextLine(void* pDecoder) = 0;
virtual FX_DWORD GetSrcOffset(void* pDecoder) = 0;
- virtual FX_BOOL LoadInfo(FX_LPCBYTE src_buf, FX_DWORD src_size, int& width, int& height,
+ virtual FX_BOOL LoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width, int& height,
int& num_components, int& bits_per_components, FX_BOOL& color_transform,
- FX_LPBYTE* icc_buf_ptr = NULL, FX_DWORD* icc_length = NULL) = 0;
+ uint8_t** icc_buf_ptr = NULL, FX_DWORD* icc_length = NULL) = 0;
- virtual FX_BOOL Encode(const class CFX_DIBSource* pSource, FX_LPBYTE& dest_buf, FX_STRSIZE& dest_size, int quality = 75,
- FX_LPCBYTE icc_buf = NULL, FX_DWORD icc_length = 0) = 0;
+ virtual FX_BOOL Encode(const class CFX_DIBSource* pSource, uint8_t*& dest_buf, FX_STRSIZE& dest_size, int quality = 75,
+ const uint8_t* icc_buf = NULL, FX_DWORD icc_length = 0) = 0;
virtual void* Start() = 0;
virtual void Finish(void* pContext) = 0;
- virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
+ virtual void Input(void* pContext, const uint8_t* src_buf, FX_DWORD src_size) = 0;
virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps) = 0;
@@ -45,10 +45,10 @@ public:
virtual int StartScanline(void* pContext, int down_scale) = 0;
- virtual FX_BOOL ReadScanline(void* pContext, FX_LPBYTE dest_buf) = 0;
+ virtual FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf) = 0;
- virtual FX_DWORD GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr = NULL) = 0;
+ virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr = NULL) = 0;
protected:
~IFX_JpegProvider() { }
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h
index 3af8a60766..004b01875b 100644
--- a/core/include/fxcrt/fx_basic.h
+++ b/core/include/fxcrt/fx_basic.h
@@ -66,7 +66,7 @@ public:
void Delete(int start_index, int count);
- FX_LPBYTE GetBuffer() const
+ uint8_t* GetBuffer() const
{
return m_pBuffer;
}
@@ -83,7 +83,7 @@ protected:
FX_STRSIZE m_AllocStep;
- FX_LPBYTE m_pBuffer;
+ uint8_t* m_pBuffer;
FX_STRSIZE m_DataSize;
@@ -121,7 +121,7 @@ class CFX_WideTextBuf : public CFX_BinaryBuf
{
public:
- void operator = (FX_LPCWSTR lpsz);
+ void operator = (const FX_WCHAR* lpsz);
void operator = (FX_WSTR str);
@@ -131,7 +131,7 @@ public:
CFX_WideTextBuf& operator << (double f);
- CFX_WideTextBuf& operator << (FX_LPCWSTR lpsz);
+ CFX_WideTextBuf& operator << (const FX_WCHAR* lpsz);
CFX_WideTextBuf& operator << (FX_WSTR str);
CFX_WideTextBuf& operator << (const CFX_WideString &str);
@@ -143,9 +143,9 @@ public:
return m_DataSize / sizeof(FX_WCHAR);
}
- FX_LPWSTR GetBuffer() const
+ FX_WCHAR* GetBuffer() const
{
- return (FX_LPWSTR)m_pBuffer;
+ return (FX_WCHAR*)m_pBuffer;
}
void Delete(int start_index, int count)
@@ -172,7 +172,7 @@ public:
CFX_ArchiveSaver& operator << (FX_BSTR bstr);
- CFX_ArchiveSaver& operator << (FX_LPCWSTR bstr);
+ CFX_ArchiveSaver& operator << (const FX_WCHAR* bstr);
CFX_ArchiveSaver& operator << (const CFX_WideString& wstr);
@@ -183,7 +183,7 @@ public:
return m_SavingBuf.GetSize();
}
- FX_LPCBYTE GetBuffer()
+ const uint8_t* GetBuffer()
{
return m_SavingBuf.GetBuffer();
}
@@ -202,7 +202,7 @@ class CFX_ArchiveLoader
{
public:
- CFX_ArchiveLoader(FX_LPCBYTE pData, FX_DWORD dwSize);
+ CFX_ArchiveLoader(const uint8_t* pData, FX_DWORD dwSize);
CFX_ArchiveLoader& operator >> (uint8_t& i);
@@ -225,7 +225,7 @@ protected:
FX_DWORD m_LoadingPos;
- FX_LPCBYTE m_pLoadingBuf;
+ const uint8_t* m_pLoadingBuf;
FX_DWORD m_LoadingSize;
};
@@ -256,7 +256,7 @@ protected:
FX_STRSIZE m_BufSize;
- FX_LPBYTE m_pBuffer;
+ uint8_t* m_pBuffer;
FX_STRSIZE m_Length;
};
@@ -269,9 +269,9 @@ public:
FX_BOOL AttachFile(IFX_StreamWrite *pFile, FX_BOOL bTakeover = FALSE);
- FX_BOOL AttachFile(FX_LPCWSTR filename);
+ FX_BOOL AttachFile(const FX_WCHAR* filename);
- FX_BOOL AttachFile(FX_LPCSTR filename);
+ FX_BOOL AttachFile(const FX_CHAR* filename);
private:
virtual FX_BOOL DoWork(const void* pBuf, size_t size);
@@ -365,7 +365,7 @@ protected:
FX_BOOL Copy(const CFX_BasicArray& src);
- FX_LPBYTE InsertSpaceAt(int nIndex, int nCount);
+ uint8_t* InsertSpaceAt(int nIndex, int nCount);
FX_BOOL RemoveAt(int nIndex, int nCount);
@@ -374,7 +374,7 @@ protected:
const void* GetDataPtr(int index) const;
protected:
- FX_LPBYTE m_pData;
+ uint8_t* m_pData;
int m_nSize;
@@ -713,7 +713,7 @@ private:
void* m_pIndex;
void** GetIndex(int seg_index) const;
void* IterateIndex(int level, int& start, void** pIndex, FX_BOOL (*callback)(void* param, void* pData), void* param) const;
- void* IterateSegment(FX_LPCBYTE pSegment, int count, FX_BOOL (*callback)(void* param, void* pData), void* param) const;
+ void* IterateSegment(const uint8_t* pSegment, int count, FX_BOOL (*callback)(void* param, void* pData), void* param) const;
};
template <class ElementType>
class CFX_SegmentedArray : public CFX_BaseSegmentedArray
@@ -858,7 +858,7 @@ public:
FX_BOOL Lookup(KeyType key, ValueType& rValue) const
{
- FX_LPVOID pValue = NULL;
+ void* pValue = NULL;
if (!CFX_MapPtrToPtr::Lookup((void*)(uintptr_t)key, pValue)) {
return FALSE;
}
@@ -954,7 +954,7 @@ public:
void GetNextAssoc(FX_POSITION& rNextPosition, CFX_ByteString& rKey, void*& rValue) const;
- FX_LPVOID GetNextValue(FX_POSITION& rNextPosition) const;
+ void* GetNextValue(FX_POSITION& rNextPosition) const;
FX_DWORD GetHashTableSize() const
{
@@ -1000,7 +1000,7 @@ public:
void GetNextAssoc(FX_POSITION& rNextPosition, CFX_ByteString& rKey, void*& rValue) const;
- FX_LPVOID GetNextValue(FX_POSITION& rNextPosition) const;
+ void* GetNextValue(FX_POSITION& rNextPosition) const;
FX_BOOL Lookup(FX_BSTR key, void*& rValue) const;
@@ -1115,14 +1115,14 @@ public:
~CFX_PtrList();
};
-typedef void (*PD_CALLBACK_FREEDATA)(FX_LPVOID pData);
+typedef void (*PD_CALLBACK_FREEDATA)(void* pData);
struct FX_PRIVATEDATA {
void FreeData();
- FX_LPVOID m_pModuleId;
+ void* m_pModuleId;
- FX_LPVOID m_pData;
+ void* m_pData;
PD_CALLBACK_FREEDATA m_pCallback;
@@ -1136,13 +1136,13 @@ public:
void ClearAll();
- void SetPrivateData(FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback);
+ void SetPrivateData(void* module_id, void* pData, PD_CALLBACK_FREEDATA callback);
- void SetPrivateObj(FX_LPVOID module_id, CFX_DestructObject* pObj);
+ void SetPrivateObj(void* module_id, CFX_DestructObject* pObj);
- FX_LPVOID GetPrivateData(FX_LPVOID module_id);
+ void* GetPrivateData(void* module_id);
- FX_BOOL LookupPrivateData(FX_LPVOID module_id, FX_LPVOID &pData) const
+ FX_BOOL LookupPrivateData(void* module_id, void* &pData) const
{
if (!module_id) {
return FALSE;
@@ -1157,18 +1157,18 @@ public:
return FALSE;
}
- FX_BOOL RemovePrivateData(FX_LPVOID module_id);
+ FX_BOOL RemovePrivateData(void* module_id);
protected:
CFX_ArrayTemplate<FX_PRIVATEDATA> m_DataList;
- void AddData(FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback, FX_BOOL bSelfDestruct);
+ void AddData(void* module_id, void* pData, PD_CALLBACK_FREEDATA callback, FX_BOOL bSelfDestruct);
};
class CFX_BitStream
{
public:
- void Init(FX_LPCBYTE pData, FX_DWORD dwSize);
+ void Init(const uint8_t* pData, FX_DWORD dwSize);
FX_DWORD GetBits(FX_DWORD nBits);
@@ -1195,7 +1195,7 @@ protected:
FX_DWORD m_BitSize;
- FX_LPCBYTE m_pData;
+ const uint8_t* m_pData;
};
template <class ObjClass> class CFX_CountRef
{
@@ -1356,13 +1356,13 @@ public:
return m_SrcPos;
}
- void FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
+ void FilterIn(const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
void FilterFinish(CFX_BinaryBuf& dest_buf);
protected:
CFX_DataFilter();
- virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) = 0;
+ virtual void v_FilterIn(const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) = 0;
virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) = 0;
void ReportEOF(FX_DWORD left_input);
@@ -1422,7 +1422,7 @@ protected:
int32_t start;
int32_t count;
- FX_LPBYTE data;
+ uint8_t* data;
};
public:
@@ -1463,7 +1463,7 @@ public:
}
}
- FX_LPBYTE GetAt(int32_t nIndex)
+ uint8_t* GetAt(int32_t nIndex)
{
if (nIndex < 0) {
return NULL;
@@ -1540,7 +1540,7 @@ public:
T2& operator [] (int32_t nIndex)
{
- FX_LPBYTE data = m_Data.GetAt(nIndex);
+ uint8_t* data = m_Data.GetAt(nIndex);
FXSYS_assert(data != NULL);
return (T2&)(*(volatile T2*)data);
}
diff --git a/core/include/fxcrt/fx_ext.h b/core/include/fxcrt/fx_ext.h
index 60cc259ff8..4e1525a1a0 100644
--- a/core/include/fxcrt/fx_ext.h
+++ b/core/include/fxcrt/fx_ext.h
@@ -19,11 +19,11 @@ 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, 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);
-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);
+FX_FLOAT FXSYS_strtof(const FX_CHAR* pcsStr, int32_t iLength = -1, int32_t *pUsedLen = NULL);
+FX_FLOAT FXSYS_wcstof(const FX_WCHAR* pwsStr, int32_t iLength = -1, int32_t *pUsedLen = NULL);
+FX_WCHAR* FXSYS_wcsncpy(FX_WCHAR* dstStr, const FX_WCHAR* srcStr, size_t count);
+int32_t FXSYS_wcsnicmp(const FX_WCHAR* s1, const FX_WCHAR* s2, size_t count);
+int32_t FXSYS_strnicmp(const FX_CHAR* s1, const FX_CHAR* s2, size_t count);
inline FX_BOOL FXSYS_islower(int32_t ch)
{
@@ -42,8 +42,8 @@ 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, int32_t iLength, FX_BOOL bIgnoreCase = FALSE);
-FX_DWORD FX_HashCode_String_GetW(FX_LPCWSTR pStr, int32_t iLength, FX_BOOL bIgnoreCase = FALSE);
+FX_DWORD FX_HashCode_String_GetA(const FX_CHAR* pStr, int32_t iLength, FX_BOOL bIgnoreCase = FALSE);
+FX_DWORD FX_HashCode_String_GetW(const FX_WCHAR* pStr, int32_t iLength, FX_BOOL bIgnoreCase = FALSE);
#ifdef __cplusplus
}
@@ -52,17 +52,17 @@ FX_DWORD FX_HashCode_String_GetW(FX_LPCWSTR pStr, int32_t iLength, FX_BOOL bIgno
extern "C" {
#endif
-FX_LPVOID FX_Random_MT_Start(FX_DWORD dwSeed);
+void* FX_Random_MT_Start(FX_DWORD dwSeed);
-FX_DWORD FX_Random_MT_Generate(FX_LPVOID pContext);
+FX_DWORD FX_Random_MT_Generate(void* pContext);
-void FX_Random_MT_Close(FX_LPVOID pContext);
+void FX_Random_MT_Close(void* pContext);
-void FX_Random_GenerateBase(FX_LPDWORD pBuffer, int32_t iCount);
+void FX_Random_GenerateBase(FX_DWORD* pBuffer, int32_t iCount);
-void FX_Random_GenerateMT(FX_LPDWORD pBuffer, int32_t iCount);
+void FX_Random_GenerateMT(FX_DWORD* pBuffer, int32_t iCount);
-void FX_Random_GenerateCrypto(FX_LPDWORD pBuffer, int32_t iCount);
+void FX_Random_GenerateCrypto(FX_DWORD* pBuffer, int32_t iCount);
#ifdef __cplusplus
}
#endif
diff --git a/core/include/fxcrt/fx_memory.h b/core/include/fxcrt/fx_memory.h
index c6a7d486f1..93403302a1 100644
--- a/core/include/fxcrt/fx_memory.h
+++ b/core/include/fxcrt/fx_memory.h
@@ -89,14 +89,14 @@ public:
m_TrunkSize = trunk_size;
}
- void* AllocDebug(size_t size, FX_LPCSTR file, int line)
+ void* AllocDebug(size_t size, const FX_CHAR* file, int line)
{
return Alloc(size);
}
void* Alloc(size_t size);
- void* ReallocDebug(void* p, size_t new_size, FX_LPCSTR file, int line)
+ void* ReallocDebug(void* p, size_t new_size, const FX_CHAR* file, int line)
{
return NULL;
}
diff --git a/core/include/fxcrt/fx_stream.h b/core/include/fxcrt/fx_stream.h
index a07fd6dc3a..44f911d150 100644
--- a/core/include/fxcrt/fx_stream.h
+++ b/core/include/fxcrt/fx_stream.h
@@ -10,14 +10,14 @@
#include "fx_memory.h"
#include "fx_string.h"
-void* FX_OpenFolder(FX_LPCSTR path);
-void* FX_OpenFolder(FX_LPCWSTR path);
+void* FX_OpenFolder(const FX_CHAR* path);
+void* FX_OpenFolder(const FX_WCHAR* path);
FX_BOOL FX_GetNextFile(void* handle, CFX_ByteString& filename, FX_BOOL& bFolder);
FX_BOOL FX_GetNextFile(void* handle, CFX_WideString& filename, FX_BOOL& bFolder);
void FX_CloseFolder(void* handle);
FX_WCHAR FX_GetFolderSeparator();
typedef struct FX_HFILE_ {
- FX_LPVOID pData;
+ void* pData;
}* FX_HFILE;
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
#define FX_FILESIZE int32_t
@@ -88,8 +88,8 @@ public:
return WriteBlock(pData, GetSize(), size);
}
};
-IFX_FileWrite* FX_CreateFileWrite(FX_LPCSTR filename);
-IFX_FileWrite* FX_CreateFileWrite(FX_LPCWSTR filename);
+IFX_FileWrite* FX_CreateFileWrite(const FX_CHAR* filename);
+IFX_FileWrite* FX_CreateFileWrite(const FX_WCHAR* filename);
class IFX_StreamRead
{
public:
@@ -134,8 +134,8 @@ public:
return 0;
}
};
-IFX_FileRead* FX_CreateFileRead(FX_LPCSTR filename);
-IFX_FileRead* FX_CreateFileRead(FX_LPCWSTR filename);
+IFX_FileRead* FX_CreateFileRead(const FX_CHAR* filename);
+IFX_FileRead* FX_CreateFileRead(const FX_WCHAR* filename);
class IFX_FileStream : public IFX_FileRead, public IFX_FileWrite
{
public:
@@ -162,8 +162,8 @@ public:
virtual FX_BOOL Flush() = 0;
};
-IFX_FileStream* FX_CreateFileStream(FX_LPCSTR filename, FX_DWORD dwModes);
-IFX_FileStream* FX_CreateFileStream(FX_LPCWSTR filename, FX_DWORD dwModes);
+IFX_FileStream* FX_CreateFileStream(const FX_CHAR* filename, FX_DWORD dwModes);
+IFX_FileStream* FX_CreateFileStream(const FX_WCHAR* filename, FX_DWORD dwModes);
class IFX_MemoryStream : public IFX_FileStream
{
public:
@@ -172,13 +172,13 @@ public:
virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) = 0;
- virtual FX_LPBYTE GetBuffer() const = 0;
+ virtual uint8_t* GetBuffer() const = 0;
- virtual void AttachBuffer(FX_LPBYTE pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE) = 0;
+ virtual void AttachBuffer(uint8_t* pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE) = 0;
virtual void DetachBuffer() = 0;
};
-IFX_MemoryStream* FX_CreateMemoryStream(FX_LPBYTE pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE);
+IFX_MemoryStream* FX_CreateMemoryStream(uint8_t* pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE);
IFX_MemoryStream* FX_CreateMemoryStream(FX_BOOL bConsecutive = FALSE);
class IFX_BufferRead : public IFX_StreamRead
{
@@ -194,7 +194,7 @@ public:
virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) = 0;
- virtual FX_LPCBYTE GetBlockBuffer() = 0;
+ virtual const uint8_t* GetBlockBuffer() = 0;
virtual size_t GetBlockSize() = 0;
diff --git a/core/include/fxcrt/fx_string.h b/core/include/fxcrt/fx_string.h
index 8fc9d79ebb..5923ffdf2d 100644
--- a/core/include/fxcrt/fx_string.h
+++ b/core/include/fxcrt/fx_string.h
@@ -31,15 +31,15 @@ public:
m_Length = 0;
}
- CFX_ByteStringC(FX_LPCBYTE ptr, FX_STRSIZE size)
+ CFX_ByteStringC(const uint8_t* ptr, FX_STRSIZE size)
{
m_Ptr = ptr;
m_Length = size;
}
- CFX_ByteStringC(FX_LPCSTR ptr)
+ CFX_ByteStringC(const FX_CHAR* ptr)
{
- m_Ptr = (FX_LPCBYTE)ptr;
+ m_Ptr = (const uint8_t*)ptr;
m_Length = ptr ? FXSYS_strlen(ptr) : 0;
}
@@ -52,13 +52,13 @@ public:
// TODO(tsepez): Mark single-argument string constructors as explicit.
CFX_ByteStringC(FX_CHAR& ch)
{
- m_Ptr = (FX_LPCBYTE)&ch;
+ m_Ptr = (const uint8_t*)&ch;
m_Length = 1;
}
- CFX_ByteStringC(FX_LPCSTR ptr, FX_STRSIZE len)
+ CFX_ByteStringC(const FX_CHAR* ptr, FX_STRSIZE len)
{
- m_Ptr = (FX_LPCBYTE)ptr;
+ m_Ptr = (const uint8_t*)ptr;
m_Length = (len == -1) ? FXSYS_strlen(ptr) : len;
}
@@ -70,9 +70,9 @@ public:
CFX_ByteStringC(const CFX_ByteString& src);
- CFX_ByteStringC& operator = (FX_LPCSTR src)
+ CFX_ByteStringC& operator = (const FX_CHAR* src)
{
- m_Ptr = (FX_LPCBYTE)src;
+ m_Ptr = (const uint8_t*)src;
m_Length = m_Ptr ? FXSYS_strlen(src) : 0;
return *this;
}
@@ -101,14 +101,14 @@ public:
FX_DWORD GetID(FX_STRSIZE start_pos = 0) const;
- FX_LPCBYTE GetPtr() const
+ const uint8_t* GetPtr() const
{
return m_Ptr;
}
- FX_LPCSTR GetCStr() const
+ const FX_CHAR* GetCStr() const
{
- return (FX_LPCSTR)m_Ptr;
+ return (const FX_CHAR*)m_Ptr;
}
FX_STRSIZE GetLength() const
@@ -152,7 +152,7 @@ public:
}
protected:
- FX_LPCBYTE m_Ptr;
+ const uint8_t* m_Ptr;
FX_STRSIZE m_Length;
private:
@@ -190,36 +190,36 @@ public:
}
CFX_ByteString(char ch);
- CFX_ByteString(FX_LPCSTR ptr)
+ CFX_ByteString(const FX_CHAR* ptr)
: CFX_ByteString(ptr, ptr ? FXSYS_strlen(ptr) : 0) { }
- CFX_ByteString(FX_LPCSTR ptr, FX_STRSIZE len);
- CFX_ByteString(FX_LPCBYTE ptr, FX_STRSIZE len);
+ CFX_ByteString(const FX_CHAR* ptr, FX_STRSIZE len);
+ CFX_ByteString(const uint8_t* ptr, FX_STRSIZE len);
CFX_ByteString(FX_BSTR bstrc);
CFX_ByteString(FX_BSTR bstrc1, FX_BSTR bstrc2);
~CFX_ByteString();
- static CFX_ByteString FromUnicode(FX_LPCWSTR ptr, FX_STRSIZE len = -1);
+ static CFX_ByteString FromUnicode(const FX_WCHAR* ptr, FX_STRSIZE len = -1);
static CFX_ByteString FromUnicode(const CFX_WideString& str);
// Explicit conversion to raw string
- FX_LPCSTR c_str() const
+ const FX_CHAR* c_str() const
{
return m_pData ? m_pData->m_String : "";
}
// Implicit conversion to C-style string -- deprecated
- operator FX_LPCSTR() const
+ operator const FX_CHAR*() const
{
return m_pData ? m_pData->m_String : "";
}
- operator FX_LPCBYTE() const
+ operator const uint8_t*() const
{
- return m_pData ? (FX_LPCBYTE)m_pData->m_String : NULL;
+ return m_pData ? (const uint8_t*)m_pData->m_String : NULL;
}
FX_STRSIZE GetLength() const
@@ -261,7 +261,7 @@ public:
void Empty();
- const CFX_ByteString& operator = (FX_LPCSTR str);
+ const CFX_ByteString& operator = (const FX_CHAR* str);
const CFX_ByteString& operator = (FX_BSTR bstrc);
@@ -269,11 +269,11 @@ public:
const CFX_ByteString& operator = (const CFX_BinaryBuf& buf);
- void Load(FX_LPCBYTE str, FX_STRSIZE len);
+ void Load(const uint8_t* str, FX_STRSIZE len);
const CFX_ByteString& operator += (FX_CHAR ch);
- const CFX_ByteString& operator += (FX_LPCSTR str);
+ const CFX_ByteString& operator += (const FX_CHAR* str);
const CFX_ByteString& operator += (const CFX_ByteString& str);
@@ -296,14 +296,14 @@ public:
FX_STRSIZE Delete(FX_STRSIZE index, FX_STRSIZE count = 1);
- void Format(FX_LPCSTR lpszFormat, ... );
+ void Format(const FX_CHAR* lpszFormat, ... );
- void FormatV(FX_LPCSTR lpszFormat, va_list argList);
+ void FormatV(const FX_CHAR* lpszFormat, va_list argList);
void Reserve(FX_STRSIZE len);
- FX_LPSTR GetBuffer(FX_STRSIZE len);
+ FX_CHAR* GetBuffer(FX_STRSIZE len);
void ReleaseBuffer(FX_STRSIZE len = -1);
@@ -384,9 +384,9 @@ protected:
};
void AllocCopy(CFX_ByteString& dest, FX_STRSIZE nCopyLen, FX_STRSIZE nCopyIndex) const;
- void AssignCopy(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData);
- void ConcatCopy(FX_STRSIZE nSrc1Len, FX_LPCSTR lpszSrc1Data, FX_STRSIZE nSrc2Len, FX_LPCSTR lpszSrc2Data);
- void ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData);
+ void AssignCopy(FX_STRSIZE nSrcLen, const FX_CHAR* lpszSrcData);
+ void ConcatCopy(FX_STRSIZE nSrc1Len, const FX_CHAR* lpszSrc1Data, FX_STRSIZE nSrc2Len, const FX_CHAR* lpszSrc2Data);
+ void ConcatInPlace(FX_STRSIZE nSrcLen, const FX_CHAR* lpszSrcData);
void CopyBeforeWrite();
void AllocBeforeWrite(FX_STRSIZE nLen);
@@ -395,12 +395,12 @@ protected:
};
inline CFX_ByteStringC::CFX_ByteStringC(const CFX_ByteString& src)
{
- m_Ptr = (FX_LPCBYTE)src;
+ m_Ptr = (const uint8_t*)src;
m_Length = src.GetLength();
}
inline CFX_ByteStringC& CFX_ByteStringC::operator = (const CFX_ByteString& src)
{
- m_Ptr = (FX_LPCBYTE)src;
+ m_Ptr = (const uint8_t*)src;
m_Length = src.GetLength();
return *this;
}
@@ -422,11 +422,11 @@ inline CFX_ByteString operator + (FX_BSTR str1, FX_BSTR str2)
{
return CFX_ByteString(str1, str2);
}
-inline CFX_ByteString operator + (FX_BSTR str1, FX_LPCSTR str2)
+inline CFX_ByteString operator + (FX_BSTR str1, const FX_CHAR* str2)
{
return CFX_ByteString(str1, str2);
}
-inline CFX_ByteString operator + (FX_LPCSTR str1, FX_BSTR str2)
+inline CFX_ByteString operator + (const FX_CHAR* str1, FX_BSTR str2)
{
return CFX_ByteString(str1, str2);
}
@@ -450,11 +450,11 @@ inline CFX_ByteString operator + (FX_CHAR ch, const CFX_ByteString& str2)
{
return CFX_ByteString(ch, str2);
}
-inline CFX_ByteString operator + (const CFX_ByteString& str1, FX_LPCSTR str2)
+inline CFX_ByteString operator + (const CFX_ByteString& str1, const FX_CHAR* str2)
{
return CFX_ByteString(str1, str2);
}
-inline CFX_ByteString operator + (FX_LPCSTR str1, const CFX_ByteString& str2)
+inline CFX_ByteString operator + (const FX_CHAR* str1, const CFX_ByteString& str2)
{
return CFX_ByteString(str1, str2);
}
@@ -477,7 +477,7 @@ public:
m_Length = 0;
}
- CFX_WideStringC(FX_LPCWSTR ptr)
+ CFX_WideStringC(const FX_WCHAR* ptr)
{
m_Ptr = ptr;
m_Length = ptr ? FXSYS_wcslen(ptr) : 0;
@@ -489,7 +489,7 @@ public:
m_Length = 1;
}
- CFX_WideStringC(FX_LPCWSTR ptr, FX_STRSIZE len)
+ CFX_WideStringC(const FX_WCHAR* ptr, FX_STRSIZE len)
{
m_Ptr = ptr;
m_Length = (len == -1) ? FXSYS_wcslen(ptr) : len;
@@ -503,7 +503,7 @@ public:
CFX_WideStringC(const CFX_WideString& src);
- CFX_WideStringC& operator = (FX_LPCWSTR src)
+ CFX_WideStringC& operator = (const FX_WCHAR* src)
{
m_Ptr = src;
m_Length = FXSYS_wcslen(src);
@@ -532,7 +532,7 @@ public:
return !(*this == str);
}
- FX_LPCWSTR GetPtr() const
+ const FX_WCHAR* GetPtr() const
{
return m_Ptr;
}
@@ -600,7 +600,7 @@ public:
}
protected:
- FX_LPCWSTR m_Ptr;
+ const FX_WCHAR* m_Ptr;
FX_STRSIZE m_Length;
private:
@@ -636,10 +636,10 @@ public:
other.m_pData = nullptr;
}
- CFX_WideString(FX_LPCWSTR ptr)
+ CFX_WideString(const FX_WCHAR* ptr)
: CFX_WideString(ptr, ptr ? FXSYS_wcslen(ptr) : 0) { }
- CFX_WideString(FX_LPCWSTR ptr, FX_STRSIZE len);
+ CFX_WideString(const FX_WCHAR* ptr, FX_STRSIZE len);
CFX_WideString(FX_WCHAR ch);
@@ -658,13 +658,13 @@ public:
static FX_STRSIZE WStringLength(const unsigned short* str);
// Explicit conversion to raw string
- FX_LPCWSTR c_str() const
+ const FX_WCHAR* c_str() const
{
return m_pData ? m_pData->m_String : L"";
}
// Implicit conversion to C-style wide string -- deprecated
- operator FX_LPCWSTR() const
+ operator const FX_WCHAR*() const
{
return m_pData ? m_pData->m_String : L"";
}
@@ -682,13 +682,13 @@ public:
return m_pData ? m_pData->m_nDataLength : 0;
}
- const CFX_WideString& operator = (FX_LPCWSTR str);
+ const CFX_WideString& operator = (const FX_WCHAR* str);
const CFX_WideString& operator =(const CFX_WideString& stringSrc);
const CFX_WideString& operator =(const CFX_WideStringC& stringSrc);
- const CFX_WideString& operator += (FX_LPCWSTR str);
+ const CFX_WideString& operator += (const FX_WCHAR* str);
const CFX_WideString& operator += (FX_WCHAR ch);
@@ -725,11 +725,11 @@ public:
void SetAt(FX_STRSIZE nIndex, FX_WCHAR ch);
- int Compare(FX_LPCWSTR str) const;
+ int Compare(const FX_WCHAR* str) const;
int Compare(const CFX_WideString& str) const;
- int CompareNoCase(FX_LPCWSTR str) const;
+ int CompareNoCase(const FX_WCHAR* str) const;
bool Equal(const wchar_t* ptr) const;
bool Equal(const CFX_WideStringC& str) const;
@@ -747,9 +747,9 @@ public:
FX_STRSIZE Delete(FX_STRSIZE index, FX_STRSIZE count = 1);
- void Format(FX_LPCWSTR lpszFormat, ... );
+ void Format(const FX_WCHAR* lpszFormat, ... );
- void FormatV(FX_LPCWSTR lpszFormat, va_list argList);
+ void FormatV(const FX_WCHAR* lpszFormat, va_list argList);
void MakeLower();
@@ -759,17 +759,17 @@ public:
void TrimRight(FX_WCHAR chTarget);
- void TrimRight(FX_LPCWSTR lpszTargets);
+ void TrimRight(const FX_WCHAR* lpszTargets);
void TrimLeft();
void TrimLeft(FX_WCHAR chTarget);
- void TrimLeft(FX_LPCWSTR lpszTargets);
+ void TrimLeft(const FX_WCHAR* lpszTargets);
void Reserve(FX_STRSIZE len);
- FX_LPWSTR GetBuffer(FX_STRSIZE len);
+ FX_WCHAR* GetBuffer(FX_STRSIZE len);
void ReleaseBuffer(FX_STRSIZE len = -1);
@@ -777,11 +777,11 @@ public:
FX_FLOAT GetFloat() const;
- FX_STRSIZE Find(FX_LPCWSTR lpszSub, FX_STRSIZE start = 0) const;
+ FX_STRSIZE Find(const FX_WCHAR* lpszSub, FX_STRSIZE start = 0) const;
FX_STRSIZE Find(FX_WCHAR ch, FX_STRSIZE start = 0) const;
- FX_STRSIZE Replace(FX_LPCWSTR lpszOld, FX_LPCWSTR lpszNew);
+ FX_STRSIZE Replace(const FX_WCHAR* lpszOld, const FX_WCHAR* lpszNew);
FX_STRSIZE Remove(FX_WCHAR ch);
@@ -816,9 +816,9 @@ protected:
void CopyBeforeWrite();
void AllocBeforeWrite(FX_STRSIZE nLen);
- void ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCWSTR lpszSrcData);
- void ConcatCopy(FX_STRSIZE nSrc1Len, FX_LPCWSTR lpszSrc1Data, FX_STRSIZE nSrc2Len, FX_LPCWSTR lpszSrc2Data);
- void AssignCopy(FX_STRSIZE nSrcLen, FX_LPCWSTR lpszSrcData);
+ void ConcatInPlace(FX_STRSIZE nSrcLen, const FX_WCHAR* lpszSrcData);
+ void ConcatCopy(FX_STRSIZE nSrc1Len, const FX_WCHAR* lpszSrc1Data, FX_STRSIZE nSrc2Len, const FX_WCHAR* lpszSrc2Data);
+ void AssignCopy(FX_STRSIZE nSrcLen, const FX_WCHAR* lpszSrcData);
void AllocCopy(CFX_WideString& dest, FX_STRSIZE nCopyLen, FX_STRSIZE nCopyIndex) const;
StringData* m_pData;
@@ -840,11 +840,11 @@ inline CFX_WideString operator + (const CFX_WideStringC& str1, const CFX_WideStr
{
return CFX_WideString(str1, str2);
}
-inline CFX_WideString operator + (const CFX_WideStringC& str1, FX_LPCWSTR str2)
+inline CFX_WideString operator + (const CFX_WideStringC& str1, const FX_WCHAR* str2)
{
return CFX_WideString(str1, str2);
}
-inline CFX_WideString operator + (FX_LPCWSTR str1, const CFX_WideStringC& str2)
+inline CFX_WideString operator + (const FX_WCHAR* str1, const CFX_WideStringC& str2)
{
return CFX_WideString(str1, str2);
}
@@ -868,11 +868,11 @@ inline CFX_WideString operator + (FX_WCHAR ch, const CFX_WideString& str2)
{
return CFX_WideString(ch, str2);
}
-inline CFX_WideString operator + (const CFX_WideString& str1, FX_LPCWSTR str2)
+inline CFX_WideString operator + (const CFX_WideString& str1, const FX_WCHAR* str2)
{
return CFX_WideString(str1, str2);
}
-inline CFX_WideString operator + (FX_LPCWSTR str1, const CFX_WideString& str2)
+inline CFX_WideString operator + (const FX_WCHAR* str1, const CFX_WideString& str2)
{
return CFX_WideString(str1, str2);
}
@@ -898,8 +898,8 @@ inline bool operator!= (const CFX_WideStringC& lhs, const CFX_WideString& rhs) {
}
FX_FLOAT FX_atof(FX_BSTR str);
void FX_atonum(FX_BSTR str, FX_BOOL& bInteger, void* pData);
-FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_LPSTR buf);
-CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len);
+FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf);
+CFX_ByteString FX_UTF8Encode(const FX_WCHAR* pwsStr, FX_STRSIZE len);
inline CFX_ByteString FX_UTF8Encode(FX_WSTR wsStr)
{
return FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength());
diff --git a/core/include/fxcrt/fx_system.h b/core/include/fxcrt/fx_system.h
index 80d75908d4..ec6d6294b0 100644
--- a/core/include/fxcrt/fx_system.h
+++ b/core/include/fxcrt/fx_system.h
@@ -67,24 +67,13 @@
#ifdef __cplusplus
extern "C" {
#endif
-typedef void* FX_LPVOID; // Deprecate, use with void*.
-typedef const void* FX_LPCVOID; // Deprecate, use with const void*.
typedef void* FX_POSITION; // Keep until fxcrt containers gone
-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 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 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 int FX_BOOL; // Keep, sadly not always 0 or 1.
typedef char FX_CHAR; // Keep, questionable signedness.
-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 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".
@@ -158,7 +147,7 @@ void FXSYS_vsnprintf(char *str, size_t size, const char* fmt, va_list ap);
#define FXSYS_wfopen _wfopen
#endif
#else
-FXSYS_FILE* FXSYS_wfopen(FX_LPCWSTR filename, FX_LPCWSTR mode);
+FXSYS_FILE* FXSYS_wfopen(const FX_WCHAR* filename, const FX_WCHAR* mode);
#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
#ifdef __cplusplus
@@ -249,18 +238,18 @@ wchar_t* FXSYS_wcsupr(wchar_t* str);
#define FXSYS_abs abs
#define FXDWORD_FROM_LSBFIRST(i) (i)
#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 FXDWORD_GET_LSBFIRST(p) ((((uint8_t*)(p))[3] << 24) | (((uint8_t*)(p))[2] << 16) | (((uint8_t*)(p))[1] << 8) | (((uint8_t*)(p))[0]))
+#define FXDWORD_GET_MSBFIRST(p) ((((uint8_t*)(p))[0] << 24) | (((uint8_t*)(p))[1] << 16) | (((uint8_t*)(p))[2] << 8) | (((uint8_t*)(p))[3]))
#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))
-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);
+int32_t FXSYS_atoi(const FX_CHAR* str);
+int32_t FXSYS_wtoi(const FX_WCHAR* str);
+int64_t FXSYS_atoi64(const FX_CHAR* str);
+int64_t FXSYS_wtoi64(const FX_WCHAR* str);
+const FX_CHAR* FXSYS_i64toa(int64_t value, FX_CHAR* str, int radix);
+const FX_WCHAR* FXSYS_i64tow(int64_t value, FX_WCHAR* 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/fxge/fpf.h b/core/include/fxge/fpf.h
index 30c1c77bbe..710600c84f 100644
--- a/core/include/fxge/fpf.h
+++ b/core/include/fxge/fpf.h
@@ -20,7 +20,7 @@ public:
IFPF_DeviceModule* FPF_GetDeviceModule();
#define FPF_MATCHFONT_REPLACEANSI 1
typedef struct FPF_HFONT_ {
- FX_LPVOID pData;
+ void* pData;
}* FPF_HFONT;
class IFPF_Font
{
@@ -44,7 +44,7 @@ public:
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;
+ virtual FX_DWORD GetFontData(FX_DWORD dwTable, uint8_t* pBuffer, FX_DWORD dwSize) = 0;
protected:
~IFPF_Font() { }
@@ -56,7 +56,7 @@ public:
virtual void LoadSystemFonts() = 0;
virtual void LoadPrivateFont(IFX_FileRead* pFontFile) = 0;
virtual void LoadPrivateFont(FX_BSTR bsFileName) = 0;
- virtual void LoadPrivateFont(FX_LPVOID pBuffer, size_t szBuffer) = 0;
+ virtual void LoadPrivateFont(void* pBuffer, size_t szBuffer) = 0;
virtual IFPF_Font* CreateFont(FX_BSTR bsFamilyname, uint8_t charset, FX_DWORD dwStyle, FX_DWORD dwMatch = 0) = 0;
};
diff --git a/core/include/fxge/fx_dib.h b/core/include/fxge/fx_dib.h
index d798ca3511..50dd3e9eed 100644
--- a/core/include/fxge/fx_dib.h
+++ b/core/include/fxge/fx_dib.h
@@ -100,33 +100,33 @@ FX_ARGB ArgbEncode(int a, FX_COLORREF rgb);
#define FXCMYK2GRAY(c,m,y,k) (((255-(c)) * (255-(k)) * 30 + (255-(m)) * (255-(k)) * 59 + (255-(y)) * (255-(k)) * 11) / 25500)
#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] = (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] = (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), \
- *((FX_LPBYTE)(dest)+3) = *((FX_LPBYTE)(src)+3)
-#define FXCMYK_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), \
- *((FX_LPBYTE)(dest)+3) = *((FX_LPBYTE)(src)+3)
-#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 FXCMYK_GETDIB(p) ((((uint8_t*)(p))[0] << 24 | (((uint8_t*)(p))[1] << 16) | (((uint8_t*)(p))[2] << 8) | ((uint8_t*)(p))[3]))
+#define FXCMYK_SETDIB(p, cmyk) ((uint8_t*)(p))[0] = (uint8_t)((cmyk) >> 24), \
+ ((uint8_t*)(p))[1] = (uint8_t)((cmyk) >> 16), \
+ ((uint8_t*)(p))[2] = (uint8_t)((cmyk) >> 8), \
+ ((uint8_t*)(p))[3] = (uint8_t)(cmyk))
+#define FXARGB_GETDIB(p) ((((uint8_t*)(p))[0]) | (((uint8_t*)(p))[1] << 8) | (((uint8_t*)(p))[2] << 16) | (((uint8_t*)(p))[3] << 24))
+#define FXARGB_SETDIB(p, argb) ((uint8_t*)(p))[0] = (uint8_t)(argb), \
+ ((uint8_t*)(p))[1] = (uint8_t)((argb) >> 8), \
+ ((uint8_t*)(p))[2] = (uint8_t)((argb) >> 16), \
+ ((uint8_t*)(p))[3] = (uint8_t)((argb) >> 24)
+#define FXARGB_COPY(dest, src) *(uint8_t*)(dest) = *(uint8_t*)(src), \
+ *((uint8_t*)(dest)+1) = *((uint8_t*)(src)+1), \
+ *((uint8_t*)(dest)+2) = *((uint8_t*)(src)+2), \
+ *((uint8_t*)(dest)+3) = *((uint8_t*)(src)+3)
+#define FXCMYK_COPY(dest, src) *(uint8_t*)(dest) = *(uint8_t*)(src), \
+ *((uint8_t*)(dest)+1) = *((uint8_t*)(src)+1), \
+ *((uint8_t*)(dest)+2) = *((uint8_t*)(src)+2), \
+ *((uint8_t*)(dest)+3) = *((uint8_t*)(src)+3)
+#define FXARGB_SETRGBORDERDIB(p, argb) ((uint8_t*)(p))[3] = (uint8_t)(argb>>24), \
+ ((uint8_t*)(p))[0] = (uint8_t)((argb) >> 16), \
+ ((uint8_t*)(p))[1] = (uint8_t)((argb) >> 8), \
+ ((uint8_t*)(p))[2] = (uint8_t)(argb)
+#define FXARGB_GETRGBORDERDIB(p) (((uint8_t*)(p))[2]) | (((uint8_t*)(p))[1] << 8) | (((uint8_t*)(p))[0] << 16) | (((uint8_t*)(p))[3] << 24)
+#define FXARGB_RGBORDERCOPY(dest, src) *((uint8_t*)(dest)+3) = *((uint8_t*)(src)+3), \
+ *(uint8_t*)(dest) = *((uint8_t*)(src)+2), \
+ *((uint8_t*)(dest)+1) = *((uint8_t*)(src)+1), \
+ *((uint8_t*)(dest)+2) = *((uint8_t*)(src))
#define FXARGB_TODIB(argb) (argb)
#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))
@@ -171,19 +171,19 @@ public:
- virtual FX_LPBYTE GetBuffer() const
+ virtual uint8_t* GetBuffer() const
{
return NULL;
}
- virtual FX_LPCBYTE GetScanline(int line) const = 0;
+ virtual const uint8_t* GetScanline(int line) const = 0;
virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) const
{
return FALSE;
}
- virtual void DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
+ virtual void DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp,
int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const = 0;
virtual void SetDownSampleSize(int width, int height) const {}
@@ -291,21 +291,21 @@ public:
CFX_DIBitmap(const CFX_DIBitmap& src);
- FX_BOOL Create(int width, int height, FXDIB_Format format, FX_LPBYTE pBuffer = NULL, int pitch = 0);
+ FX_BOOL Create(int width, int height, FXDIB_Format format, uint8_t* pBuffer = NULL, int pitch = 0);
FX_BOOL Copy(const CFX_DIBSource* pSrc);
- virtual FX_LPBYTE GetBuffer() const
+ virtual uint8_t* GetBuffer() const
{
return m_pBuffer;
}
- virtual FX_LPCBYTE GetScanline(int line) const
+ virtual const uint8_t* GetScanline(int line) const
{
return m_pBuffer ? m_pBuffer + line * m_Pitch : NULL;
}
- virtual void DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
+ virtual void DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp,
int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const;
void TakeOver(CFX_DIBitmap* pSrcBitmap);
@@ -347,7 +347,7 @@ public:
FX_BOOL DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_RECT* pRect = NULL);
protected:
- FX_LPBYTE m_pBuffer;
+ uint8_t* m_pBuffer;
FX_BOOL m_bExtBuf;
@@ -385,26 +385,26 @@ public:
virtual FX_DWORD* GetDestPalette() = 0;
- virtual void TranslateScanline(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf) const = 0;
+ virtual void TranslateScanline(uint8_t* dest_buf, const uint8_t* src_buf) const = 0;
- virtual void TranslateDownSamples(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf, int pixels, int Bpp) const = 0;
+ virtual void TranslateDownSamples(uint8_t* dest_buf, const uint8_t* src_buf, int pixels, int Bpp) const = 0;
protected:
- virtual FX_LPCBYTE GetScanline(int line) const;
- virtual void DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
+ virtual const uint8_t* GetScanline(int line) const;
+ virtual void DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp,
int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const;
const CFX_DIBSource* m_pSrc;
FX_BOOL m_bAutoDropSrc;
- FX_LPBYTE m_pScanline;
+ uint8_t* m_pScanline;
};
class IFX_ScanlineComposer
{
public:
virtual ~IFX_ScanlineComposer() { }
- virtual void ComposeScanline(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha = NULL) = 0;
+ virtual void ComposeScanline(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha = NULL) = 0;
virtual FX_BOOL SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette) = 0;
};
@@ -419,20 +419,20 @@ public:
FX_DWORD mask_color, int blend_type, FX_BOOL bClip, FX_BOOL bRgbByteOrder = FALSE, int alpha_flag = 0, void* pIccTransform = NULL);
- void CompositeRgbBitmapLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_extra_alpha = NULL, FX_LPBYTE dst_extra_alpha = NULL);
+ void CompositeRgbBitmapLine(uint8_t* dest_scan, const uint8_t* src_scan, int width, const uint8_t* clip_scan,
+ const uint8_t* src_extra_alpha = NULL, uint8_t* dst_extra_alpha = NULL);
- void CompositePalBitmapLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_extra_alpha = NULL, FX_LPBYTE dst_extra_alpha = NULL);
+ void CompositePalBitmapLine(uint8_t* dest_scan, const uint8_t* src_scan, int src_left, int width, const uint8_t* clip_scan,
+ const uint8_t* src_extra_alpha = NULL, uint8_t* dst_extra_alpha = NULL);
- void CompositeByteMaskLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, FX_LPCBYTE clip_scan,
- FX_LPBYTE dst_extra_alpha = NULL);
+ void CompositeByteMaskLine(uint8_t* dest_scan, const uint8_t* src_scan, int width, const uint8_t* clip_scan,
+ uint8_t* dst_extra_alpha = NULL);
- void CompositeBitMaskLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width, FX_LPCBYTE clip_scan,
- FX_LPBYTE dst_extra_alpha = NULL);
+ void CompositeBitMaskLine(uint8_t* dest_scan, const uint8_t* src_scan, int src_left, int width, const uint8_t* clip_scan,
+ uint8_t* dst_extra_alpha = NULL);
protected:
int m_Transparency;
FXDIB_Format m_SrcFormat,
@@ -446,7 +446,7 @@ protected:
m_MaskBlack;
int m_BlendType;
void* m_pIccTransform;
- FX_LPBYTE m_pCacheScanline;
+ uint8_t* m_pCacheScanline;
int m_CacheSize;
FX_BOOL m_bRgbByteOrder;
};
@@ -467,11 +467,11 @@ public:
virtual FX_BOOL SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette);
- virtual void ComposeScanline(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha);
+ virtual void ComposeScanline(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha);
protected:
- void DoCompose(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int dest_width, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_extra_alpha = NULL, FX_LPBYTE dst_extra_alpha = NULL);
+ void DoCompose(uint8_t* dest_scan, const uint8_t* src_scan, int dest_width, const uint8_t* clip_scan,
+ const uint8_t* src_extra_alpha = NULL, uint8_t* dst_extra_alpha = NULL);
CFX_DIBitmap* m_pBitmap;
const CFX_ClipRgn* m_pClipRgn;
FXDIB_Format m_SrcFormat;
@@ -484,8 +484,11 @@ protected:
void* m_pIccTransform;
FX_BOOL m_bRgbByteOrder;
int m_BlendType;
- void ComposeScanlineV(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha = NULL);
- FX_LPBYTE m_pScanlineV, m_pClipScanV, m_pAddClipScan, m_pScanlineAlphaV;
+ void ComposeScanlineV(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha = NULL);
+ uint8_t* m_pScanlineV;
+ uint8_t* m_pClipScanV;
+ uint8_t* m_pAddClipScan;
+ uint8_t* m_pScanlineAlphaV;
};
class CFX_BitmapStorer : public IFX_ScanlineComposer
{
@@ -495,7 +498,7 @@ public:
~CFX_BitmapStorer();
- virtual void ComposeScanline(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha);
+ virtual void ComposeScanline(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha);
virtual FX_BOOL SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette);
@@ -535,8 +538,8 @@ public:
FX_RECT m_ClipRect;
int m_LineIndex;
int m_DestBPP;
- FX_LPBYTE m_pScanline;
- FX_LPBYTE m_pMaskScanline;
+ uint8_t* m_pScanline;
+ uint8_t* m_pMaskScanline;
FXDIB_Format m_DestFormat;
int32_t m_Status;
diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h
index aa985820c8..df752b4f77 100644
--- a/core/include/fxge/fx_font.h
+++ b/core/include/fxge/fx_font.h
@@ -57,7 +57,7 @@ public:
FX_BOOL LoadSubst(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
int weight, int italic_angle, int CharsetCP, FX_BOOL bVertical = FALSE);
- FX_BOOL LoadEmbedded(FX_LPCBYTE data, FX_DWORD size);
+ FX_BOOL LoadEmbedded(const uint8_t* data, FX_DWORD size);
FX_BOOL LoadFile(IFX_FileRead* pFile);
@@ -122,9 +122,9 @@ public:
}
void AdjustMMParams(int glyph_index, int width, int weight);
- FX_LPBYTE m_pFontDataAllocation;
- FX_LPBYTE m_pFontData;
- FX_LPBYTE m_pGsubData;
+ uint8_t* m_pFontDataAllocation;
+ uint8_t* m_pFontData;
+ uint8_t* m_pGsubData;
FX_DWORD m_dwSize;
CFX_BinaryBuf m_OtfFontData;
void* m_hHandle;
@@ -168,7 +168,7 @@ public:
CFX_SubstFont();
- FX_LPVOID m_ExtHandle;
+ void* m_ExtHandle;
CFX_ByteString m_Family;
@@ -194,7 +194,7 @@ public:
#define FX_FONT_FLAG_SYMBOLIC_DINGBATS 0x20
#define FX_FONT_FLAG_MULTIPLEMASTER 0x40
typedef struct {
- FX_LPCBYTE m_pFontData;
+ const uint8_t* m_pFontData;
FX_DWORD m_dwSize;
} FoxitFonts;
class CFX_FontMgr
@@ -204,15 +204,15 @@ public:
~CFX_FontMgr();
void InitFTLibrary();
FXFT_Face GetCachedFace(const CFX_ByteString& face_name,
- int weight, FX_BOOL bItalic, FX_LPBYTE& pFontData);
+ int weight, FX_BOOL bItalic, uint8_t*& pFontData);
FXFT_Face AddCachedFace(const CFX_ByteString& face_name,
- int weight, FX_BOOL bItalic, FX_LPBYTE pData, FX_DWORD size, int face_index);
+ int weight, FX_BOOL bItalic, uint8_t* pData, FX_DWORD size, int face_index);
FXFT_Face GetCachedTTCFace(int ttc_size, FX_DWORD checksum,
- int font_offset, FX_LPBYTE& pFontData);
+ int font_offset, uint8_t*& pFontData);
FXFT_Face AddCachedTTCFace(int ttc_size, FX_DWORD checksum,
- FX_LPBYTE pData, FX_DWORD size, int font_offset);
- FXFT_Face GetFileFace(FX_LPCSTR filename, int face_index);
- FXFT_Face GetFixedFace(FX_LPCBYTE pData, FX_DWORD size, int face_index);
+ uint8_t* pData, FX_DWORD size, int font_offset);
+ FXFT_Face GetFileFace(const FX_CHAR* filename, int face_index);
+ FXFT_Face GetFixedFace(const uint8_t* pData, FX_DWORD size, int face_index);
void ReleaseFace(FXFT_Face face);
void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo);
FXFT_Face FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
@@ -220,7 +220,7 @@ public:
void FreeCache();
- FX_BOOL GetStandardFont(FX_LPCBYTE& pFontData, FX_DWORD& size, int index);
+ FX_BOOL GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index);
CFX_FontMapper* m_pBuiltinMapper;
IFX_FontMapper* m_pExtMapper;
CFX_MapByteStringToPtr m_FaceMap;
@@ -298,9 +298,9 @@ public:
virtual void Release() = 0;
virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper) = 0;
- virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR face, FX_BOOL& bExact) = 0;
- virtual void* GetFont(FX_LPCSTR face) = 0;
- virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size) = 0;
+ virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* face, FX_BOOL& bExact) = 0;
+ virtual void* GetFont(const FX_CHAR* face) = 0;
+ virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, uint8_t* buffer, FX_DWORD size) = 0;
virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) = 0;
virtual FX_BOOL GetFontCharset(void* hFont, int& charset) = 0;
virtual int GetFaceIndex(void* hFont)
@@ -323,9 +323,9 @@ public:
void AddPath(FX_BSTR path);
virtual void Release();
virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper);
- virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR face, FX_BOOL& bExact);
- virtual void* GetFont(FX_LPCSTR face);
- virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size);
+ virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* face, FX_BOOL& bExact);
+ virtual void* GetFont(const FX_CHAR* face);
+ virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, uint8_t* buffer, FX_DWORD size);
virtual void DeleteFont(void* hFont);
virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name);
virtual FX_BOOL GetFontCharset(void* hFont, int& charset);
diff --git a/core/include/fxge/fx_ge.h b/core/include/fxge/fx_ge.h
index a880166c39..46ff0c30f8 100644
--- a/core/include/fxge/fx_ge.h
+++ b/core/include/fxge/fx_ge.h
@@ -41,7 +41,7 @@ public:
return m_pFontMgr;
}
void SetTextGamma(FX_FLOAT gammaValue);
- FX_LPCBYTE GetTextGammaTable();
+ const uint8_t* GetTextGammaTable();
void SetExtFontMapper(IFX_FontMapper* pFontMapper);
void SetCodecModule(CCodec_ModuleMgr* pCodecModule)
@@ -423,12 +423,12 @@ public:
FX_DWORD color, FX_DWORD flags = 0, int alpha_flag = 0, void* pIccTransform = NULL);
FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
- const CFX_AffineMatrix* pMatrix, FX_DWORD flags, FX_LPVOID& handle,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD flags, void*& handle,
int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
- FX_BOOL ContinueDIBits(FX_LPVOID handle, IFX_Pause* pPause);
+ FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause);
- void CancelDIBits(FX_LPVOID handle);
+ void CancelDIBits(void* handle);
FX_BOOL DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont, CFX_FontCache* pCache,
@@ -601,15 +601,15 @@ public:
int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) = 0;
virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
- const CFX_AffineMatrix* pMatrix, FX_DWORD flags, FX_LPVOID& handle,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD flags, void*& handle,
int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) = 0;
- virtual FX_BOOL ContinueDIBits(FX_LPVOID handle, IFX_Pause* pPause)
+ virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause)
{
return FALSE;
}
- virtual void CancelDIBits(FX_LPVOID handle) {}
+ virtual void CancelDIBits(void* handle) {}
virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
@@ -634,7 +634,7 @@ class IFX_PSOutput
{
public:
virtual void Release() = 0;
- virtual void OutputPS(FX_LPCSTR string, int len) = 0;
+ virtual void OutputPS(const FX_CHAR* string, int len) = 0;
protected:
~IFX_PSOutput() { }
@@ -726,7 +726,7 @@ private:
void FindPSFontGlyph(CFX_FaceCache* pFaceCache, CFX_Font* pFont, const FXTEXT_CHARPOS& charpos, int& ps_fontnum, int &ps_glyphindex);
- void WritePSBinary(FX_LPCBYTE data, int len);
+ void WritePSBinary(const uint8_t* data, int len);
};
#endif // CORE_INCLUDE_FXGE_FX_GE_H_
diff --git a/core/include/fxge/fx_ge_win32.h b/core/include/fxge/fx_ge_win32.h
index 3972090326..57f30f7d35 100644
--- a/core/include/fxge/fx_ge_win32.h
+++ b/core/include/fxge/fx_ge_win32.h
@@ -21,7 +21,7 @@ typedef struct WINDIB_Open_Args_ {
size_t memory_size;
- FX_LPCWSTR path_name;
+ const FX_WCHAR* path_name;
} WINDIB_Open_Args_;
class CFX_WindowsDIB : public CFX_DIBitmap
{
@@ -35,9 +35,9 @@ public:
static CFX_DIBitmap* LoadFromDDB(HDC hDC, HBITMAP hBitmap, FX_DWORD* pPalette = NULL, FX_DWORD size = 256);
- static CFX_DIBitmap* LoadFromFile(FX_LPCWSTR filename);
+ static CFX_DIBitmap* LoadFromFile(const FX_WCHAR* filename);
- static CFX_DIBitmap* LoadFromFile(FX_LPCSTR filename)
+ static CFX_DIBitmap* LoadFromFile(const FX_CHAR* filename)
{
return LoadFromFile(CFX_WideString::FromLocal(filename).c_str());
}
diff --git a/core/include/reflow/fpdf_layout.h b/core/include/reflow/fpdf_layout.h
index b1038db329..2fff2759ab 100644
--- a/core/include/reflow/fpdf_layout.h
+++ b/core/include/reflow/fpdf_layout.h
@@ -224,7 +224,7 @@ public:
static IPDF_LayoutProcessor* Create_LayoutProcessor_Reflow(FX_FLOAT TopIndent, FX_FLOAT fWidth, FX_FLOAT fHeight, void* pReflowedPage, int flags, FX_FLOAT lineSpace = 0);
- static IPDF_LayoutProcessor* Create_LayoutProcessor_2HTML(FX_LPCSTR fileName);
+ static IPDF_LayoutProcessor* Create_LayoutProcessor_2HTML(const FX_CHAR* fileName);
virtual LayoutStatus StartProcess(IPDF_LayoutElement* pElement, IFX_Pause* pPause, const CFX_AffineMatrix* pPDFMatrix = NULL) = 0;