From 320b2313d19869333ed453af546e61a9fc2b81c9 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 23 Jul 2015 13:26:26 -0700 Subject: FX_BOOL considered harmful, part 2. Fully automatic change, execpt for cleanup in fx_system.h R=thestig@chromium.org Review URL: https://codereview.chromium.org/1254703002 . --- core/include/fdrm/fx_crypt.h | 4 +- core/include/fpdfapi/fpdf_module.h | 6 +- core/include/fpdfapi/fpdf_objects.h | 72 +++++----- core/include/fpdfapi/fpdf_page.h | 28 ++-- core/include/fpdfapi/fpdf_pageobj.h | 28 ++-- core/include/fpdfapi/fpdf_parser.h | 200 +++++++++++++-------------- core/include/fpdfapi/fpdf_render.h | 28 ++-- core/include/fpdfapi/fpdf_resource.h | 142 +++++++++---------- core/include/fpdfapi/fpdf_serial.h | 28 ++-- core/include/fpdfdoc/fpdf_ap.h | 12 +- core/include/fpdfdoc/fpdf_doc.h | 170 +++++++++++------------ core/include/fpdfdoc/fpdf_tagged.h | 10 +- core/include/fpdfdoc/fpdf_vt.h | 48 +++---- core/include/fpdftext/fpdf_text.h | 26 ++-- core/include/fxcodec/fx_codec.h | 40 +++--- core/include/fxcodec/fx_codec_provider.h | 12 +- core/include/fxcrt/fx_arb.h | 6 +- core/include/fxcrt/fx_basic.h | 118 ++++++++-------- core/include/fxcrt/fx_coordinates.h | 70 +++++----- core/include/fxcrt/fx_ext.h | 8 +- core/include/fxcrt/fx_stream.h | 66 ++++----- core/include/fxcrt/fx_string.h | 4 +- core/include/fxcrt/fx_system.h | 9 -- core/include/fxcrt/fx_ucd.h | 12 +- core/include/fxcrt/fx_xml.h | 30 ++-- core/include/fxge/fpf.h | 4 +- core/include/fxge/fx_dib.h | 118 ++++++++-------- core/include/fxge/fx_font.h | 78 +++++------ core/include/fxge/fx_ge.h | 138 +++++++++--------- core/include/fxge/fx_ge_apple.h | 8 +- core/include/fxge/fx_ge_win32.h | 6 +- core/include/thirdparties/libjpeg/jmorecfg.h | 10 +- core/include/thirdparties/libjpeg/jpegint.h | 6 +- core/include/thirdparties/libjpeg/jpeglib.h | 52 +++---- 34 files changed, 794 insertions(+), 803 deletions(-) (limited to 'core/include') diff --git a/core/include/fdrm/fx_crypt.h b/core/include/fdrm/fx_crypt.h index f820999b28..f4f9b9e8c7 100644 --- a/core/include/fdrm/fx_crypt.h +++ b/core/include/fdrm/fx_crypt.h @@ -16,7 +16,7 @@ extern "C" { 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_AESSetKey(void* context, FX_DWORD blocklen, const uint8_t* key, FX_DWORD keylen, 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); @@ -40,7 +40,7 @@ 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)); +void CRYPT_SetPubKeyDecryptor(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 5877e11372..b6f8de0c9f 100644 --- a/core/include/fpdfapi/fpdf_module.h +++ b/core/include/fpdfapi/fpdf_module.h @@ -60,9 +60,9 @@ public: void InitRenderModule(); - void SetDownloadCallback(FX_BOOL (*callback)(const FX_CHAR* module_name)); + void SetDownloadCallback(bool (*callback)(const FX_CHAR* module_name)); - FX_BOOL DownloadModule(const FX_CHAR* module_name); + bool DownloadModule(const FX_CHAR* module_name); void NotifyModuleAvailable(const FX_CHAR* module_name); @@ -110,7 +110,7 @@ private: nonstd::unique_ptr m_pRenderModule; nonstd::unique_ptr m_pPageModule; - FX_BOOL (*m_pDownloadCallback)(const FX_CHAR* module_name); + 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 45b7cc63cb..8d954ff719 100644 --- a/core/include/fpdfapi/fpdf_objects.h +++ b/core/include/fpdfapi/fpdf_objects.h @@ -57,9 +57,9 @@ public: return m_GenNum; } - FX_BOOL IsIdentical(CPDF_Object* pObj) const; + bool IsIdentical(CPDF_Object* pObj) const; - CPDF_Object* Clone(FX_BOOL bDirect = FALSE) const; + CPDF_Object* Clone(bool bDirect = false) const; CPDF_Object* CloneRef(CPDF_IndirectObjects* pObjs) const; @@ -88,9 +88,9 @@ public: int GetDirectType() const; - FX_BOOL IsModified() const + bool IsModified() const { - return FALSE; + return false; } protected: CPDF_Object(FX_DWORD type) : m_Type(type), m_ObjNum(0), m_GenNum(0) { } @@ -108,27 +108,27 @@ protected: friend class CPDF_SyntaxParser; private: CPDF_Object(const CPDF_Object& src) {} - CPDF_Object* CloneInternal(FX_BOOL bDirect, CFX_MapPtrToPtr* visited) const; + CPDF_Object* CloneInternal(bool bDirect, CFX_MapPtrToPtr* visited) const; }; class CPDF_Boolean : public CPDF_Object { public: - static CPDF_Boolean* Create(FX_BOOL value) + static CPDF_Boolean* Create(bool value) { return new CPDF_Boolean(value); } CPDF_Boolean() : CPDF_Object(PDFOBJ_BOOLEAN), m_bValue(false) { } - CPDF_Boolean(FX_BOOL value) : CPDF_Object(PDFOBJ_BOOLEAN), m_bValue(value) { } + CPDF_Boolean(bool value) : CPDF_Object(PDFOBJ_BOOLEAN), m_bValue(value) { } - FX_BOOL Identical(CPDF_Boolean* pOther) const + bool Identical(CPDF_Boolean* pOther) const { return m_bValue == pOther->m_bValue; } protected: - FX_BOOL m_bValue; + bool m_bValue; friend class CPDF_Object; }; class CPDF_Number : public CPDF_Object @@ -150,14 +150,14 @@ public: return new CPDF_Number(str); } - static CPDF_Number* Create(FX_BOOL bInteger, void* pData) + static CPDF_Number* Create(bool bInteger, void* pData) { return new CPDF_Number(bInteger, pData); } CPDF_Number() : CPDF_Object(PDFOBJ_NUMBER), m_bInteger(false), m_Integer(0) { } - CPDF_Number(FX_BOOL bInteger, void* pData); + CPDF_Number(bool bInteger, void* pData); CPDF_Number(int value); @@ -165,13 +165,13 @@ public: CPDF_Number(const CFX_ByteStringC& str); - FX_BOOL Identical(CPDF_Number* pOther) const; + bool Identical(CPDF_Number* pOther) const; CFX_ByteString GetString() const; void SetString(const CFX_ByteStringC& str); - FX_BOOL IsInteger() const + bool IsInteger() const { return m_bInteger; } @@ -199,7 +199,7 @@ public: } protected: - FX_BOOL m_bInteger; + bool m_bInteger; union { @@ -213,7 +213,7 @@ class CPDF_String : public CPDF_Object { public: - static CPDF_String* Create(const CFX_ByteString& str, FX_BOOL bHex = FALSE) + static CPDF_String* Create(const CFX_ByteString& str, bool bHex = false) { return new CPDF_String(str, bHex); } @@ -223,9 +223,9 @@ public: return new CPDF_String(str); } - CPDF_String() : CPDF_Object(PDFOBJ_STRING), m_bHex(FALSE) { } + CPDF_String() : CPDF_Object(PDFOBJ_STRING), m_bHex(false) { } - CPDF_String(const CFX_ByteString& str, FX_BOOL bHex = FALSE) + CPDF_String(const CFX_ByteString& str, bool bHex = false) : CPDF_Object(PDFOBJ_STRING), m_String(str), m_bHex(bHex) { } @@ -236,12 +236,12 @@ public: return m_String; } - FX_BOOL Identical(CPDF_String* pOther) const + bool Identical(CPDF_String* pOther) const { return m_String == pOther->m_String; } - FX_BOOL IsHex() const + bool IsHex() const { return m_bHex; } @@ -249,7 +249,7 @@ protected: CFX_ByteString m_String; - FX_BOOL m_bHex; + bool m_bHex; friend class CPDF_Object; }; class CPDF_Name : public CPDF_Object @@ -280,7 +280,7 @@ public: return m_Name; } - FX_BOOL Identical(CPDF_Name* pOther) const + bool Identical(CPDF_Name* pOther) const { return m_Name == pOther->m_Name; } @@ -378,7 +378,7 @@ public: AddNumber(value); } - FX_BOOL Identical(CPDF_Array* pOther) const; + bool Identical(CPDF_Array* pOther) const; protected: ~CPDF_Array(); @@ -419,7 +419,7 @@ public: int GetInteger(const CFX_ByteStringC& key, int default_int) const; - FX_BOOL GetBoolean(const CFX_ByteStringC& key, FX_BOOL bDefault = FALSE) const; + bool GetBoolean(const CFX_ByteStringC& key, bool bDefault = false) const; FX_FLOAT GetNumber(const CFX_ByteStringC& key) const; @@ -439,7 +439,7 @@ public: } - FX_BOOL KeyExist(const CFX_ByteStringC& key) const; + bool KeyExist(const CFX_ByteStringC& key) const; FX_POSITION GetStartPos() const; @@ -478,7 +478,7 @@ public: void SetAtMatrix(const CFX_ByteStringC& key, const CFX_AffineMatrix& matrix); - void SetAtBoolean(const CFX_ByteStringC& key, FX_BOOL bValue); + void SetAtBoolean(const CFX_ByteStringC& key, bool bValue); @@ -487,7 +487,7 @@ public: void ReplaceKey(const CFX_ByteStringC& oldkey, const CFX_ByteStringC& newkey); - FX_BOOL Identical(CPDF_Dictionary* pDict) const; + bool Identical(CPDF_Dictionary* pDict) const; int GetCount() const { @@ -519,15 +519,15 @@ public: return m_pDict; } - void SetData(const uint8_t* pData, FX_DWORD size, FX_BOOL bCompressed, FX_BOOL bKeepBuf); + void SetData(const uint8_t* pData, FX_DWORD size, bool bCompressed, bool bKeepBuf); void InitStream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDict); void InitStream(IFX_FileRead *pFile, CPDF_Dictionary* pDict); - FX_BOOL Identical(CPDF_Stream* pOther) const; + bool Identical(CPDF_Stream* pOther) const; - CPDF_StreamFilter* GetStreamFilter(FX_BOOL bRaw = FALSE) const; + CPDF_StreamFilter* GetStreamFilter(bool bRaw = false) const; @@ -536,15 +536,15 @@ public: return m_dwSize; } - FX_BOOL ReadRawData(FX_FILESIZE start_pos, uint8_t* pBuf, FX_DWORD buf_size) const; + bool ReadRawData(FX_FILESIZE start_pos, uint8_t* pBuf, FX_DWORD buf_size) const; - FX_BOOL IsMemoryBased() const + bool IsMemoryBased() const { return m_GenNum == (FX_DWORD) - 1; } - CPDF_Stream* Clone(FX_BOOL bDirect, FPDF_LPFCloneStreamCallback lpfCallback, void* pUserData) const; + CPDF_Stream* Clone(bool bDirect, FPDF_LPFCloneStreamCallback lpfCallback, void* pUserData) const; protected: ~CPDF_Stream(); @@ -579,8 +579,8 @@ public: ~CPDF_StreamAcc(); - void LoadAllData(const CPDF_Stream* pStream, FX_BOOL bRawAccess = FALSE, - FX_DWORD estimated_size = 0, FX_BOOL bImageAcc = FALSE); + void LoadAllData(const CPDF_Stream* pStream, bool bRawAccess = false, + FX_DWORD estimated_size = 0, bool bImageAcc = false); const CPDF_Stream* GetStream() const { @@ -613,7 +613,7 @@ protected: FX_DWORD m_dwSize; - FX_BOOL m_bNewBuf; + bool m_bNewBuf; CFX_ByteString m_ImageDecoder; @@ -691,7 +691,7 @@ public: void SetRef(CPDF_IndirectObjects* pDoc, FX_DWORD objnum); - FX_BOOL Identical(CPDF_Reference* pOther) const + bool Identical(CPDF_Reference* pOther) const { return m_RefObjNum == pOther->m_RefObjNum; } diff --git a/core/include/fpdfapi/fpdf_page.h b/core/include/fpdfapi/fpdf_page.h index 7aed626fae..d76920ad1a 100644 --- a/core/include/fpdfapi/fpdf_page.h +++ b/core/include/fpdfapi/fpdf_page.h @@ -31,7 +31,7 @@ class CPDF_PageObjects { public: - CPDF_PageObjects(FX_BOOL bReleaseMembers = TRUE); + CPDF_PageObjects(bool bReleaseMembers = true); ~CPDF_PageObjects(); @@ -45,7 +45,7 @@ public: return m_ParseState; } - FX_BOOL IsParsed() const + bool IsParsed() const { return m_ParseState == PDF_CONTENT_PARSED; } @@ -97,7 +97,7 @@ public: void Transform(const CFX_AffineMatrix& matrix); - FX_BOOL BackgroundAlphaNeeded() const + bool BackgroundAlphaNeeded() const { return m_bBackgroundAlphaNeeded; } @@ -125,15 +125,15 @@ protected: CFX_PtrList m_ObjectList; - FX_BOOL m_bBackgroundAlphaNeeded; + bool m_bBackgroundAlphaNeeded; - FX_BOOL m_bReleaseMembers; + bool m_bReleaseMembers; void LoadTransInfo(); void ClearCacheObjects(); CPDF_ContentParser* m_pParser; - FX_BOOL m_ParseState; + bool m_ParseState; }; class CPDF_Page : public CPDF_PageObjects, public CFX_PrivateData { @@ -143,11 +143,11 @@ public: ~CPDF_Page(); - void Load(CPDF_Document* pDocument, CPDF_Dictionary* pPageDict, FX_BOOL bPageCache = TRUE); + void Load(CPDF_Document* pDocument, CPDF_Dictionary* pPageDict, bool bPageCache = true); - void StartParse(CPDF_ParseOptions* pOptions = NULL, FX_BOOL bReParse = FALSE); + void StartParse(CPDF_ParseOptions* pOptions = NULL, bool bReParse = false); - void ParseContent(CPDF_ParseOptions* pOptions = NULL, FX_BOOL bReParse = FALSE); + void ParseContent(CPDF_ParseOptions* pOptions = NULL, bool bReParse = false); void GetDisplayMatrix(CFX_AffineMatrix& matrix, int xPos, int yPos, int xSize, int ySize, int iRotate) const; @@ -200,13 +200,13 @@ public: CPDF_ParseOptions(); - FX_BOOL m_bTextOnly; + bool m_bTextOnly; - FX_BOOL m_bMarkedContent; + bool m_bMarkedContent; - FX_BOOL m_bSeparateForm; + bool m_bSeparateForm; - FX_BOOL m_bDecodeInlineImage; + bool m_bDecodeInlineImage; }; class CPDF_Form : public CPDF_PageObjects { @@ -229,7 +229,7 @@ class CPDF_PageContentGenerate public: CPDF_PageContentGenerate(CPDF_Page* pPage); ~CPDF_PageContentGenerate(); - FX_BOOL InsertPageObject(CPDF_PageObject* pPageObject); + bool InsertPageObject(CPDF_PageObject* pPageObject); void GenerateContent(); void TransformContent(CFX_Matrix& matrix); protected: diff --git a/core/include/fpdfapi/fpdf_pageobj.h b/core/include/fpdfapi/fpdf_pageobj.h index 73540a3eb3..c140de6c82 100644 --- a/core/include/fpdfapi/fpdf_pageobj.h +++ b/core/include/fpdfapi/fpdf_pageobj.h @@ -88,7 +88,7 @@ public: m_pObject->AppendRect(left, bottom, right, top); } - FX_BOOL IsRect() const + bool IsRect() const { return m_pObject->IsRect(); } @@ -147,7 +147,7 @@ public: CFX_FloatRect GetClipBox() const; - void AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge); + void AppendPath(CPDF_Path path, int type, bool bAutoMerge); void DeletePath(int layer_index); @@ -292,15 +292,15 @@ public: int m_RenderIntent; - FX_BOOL m_StrokeAdjust; + bool m_StrokeAdjust; - FX_BOOL m_AlphaSource; + bool m_AlphaSource; - FX_BOOL m_TextKnockout; + bool m_TextKnockout; - FX_BOOL m_StrokeOP; + bool m_StrokeOP; - FX_BOOL m_FillOP; + bool m_FillOP; int m_OPMode; @@ -325,7 +325,7 @@ public: return m_pObject ? m_pObject->m_BlendType : FXDIB_BLEND_NORMAL; } - int GetAlpha(FX_BOOL bStroke) const + int GetAlpha(bool bStroke) const { return m_pObject ? FXSYS_round((bStroke ? m_pObject->m_StrokeAlpha : m_pObject->m_FillAlpha) * 255) : 255; } @@ -362,7 +362,7 @@ public: return m_pParam; } - inline FX_BOOL HasMCID() const; + inline bool HasMCID() const; inline void SetName(const CFX_ByteString& name) { @@ -402,7 +402,7 @@ public: int GetMCID() const; - void AddMark(const CFX_ByteString& name, CPDF_Dictionary* pDict, FX_BOOL bDictNeedClone); + void AddMark(const CFX_ByteString& name, CPDF_Dictionary* pDict, bool bDictNeedClone); void DeleteLastMark(); private: @@ -418,9 +418,9 @@ public: return m_pObject ? m_pObject->GetMCID() : -1; } - FX_BOOL HasMark(const CFX_ByteStringC& mark) const; + bool HasMark(const CFX_ByteStringC& mark) const; - FX_BOOL LookupMark(const CFX_ByteStringC& mark, CPDF_Dictionary*& pDict) const; + bool LookupMark(const CFX_ByteStringC& mark, CPDF_Dictionary*& pDict) const; }; #define PDFPAGE_TEXT 1 @@ -461,7 +461,7 @@ public: void RemoveClipPath(); - void AppendClipPath(CPDF_Path path, int type, FX_BOOL bAutoMerge); + void AppendClipPath(CPDF_Path path, int type, bool bAutoMerge); void CopyClipPath(CPDF_PageObject* pObj); @@ -629,7 +629,7 @@ public: int m_FillType; - FX_BOOL m_bStroke; + bool m_bStroke; CFX_AffineMatrix m_Matrix; diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h index a856433a08..7a43947384 100644 --- a/core/include/fpdfapi/fpdf_parser.h +++ b/core/include/fpdfapi/fpdf_parser.h @@ -86,9 +86,9 @@ public: int GetPageIndex(FX_DWORD objnum); - FX_DWORD GetUserPermissions(FX_BOOL bCheckRevision = FALSE) const; + FX_DWORD GetUserPermissions(bool bCheckRevision = false) const; - FX_BOOL IsOwner() const; + bool IsOwner() const; @@ -112,14 +112,14 @@ public: void ClearRenderFont(); - FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) const; + bool IsFormStream(FX_DWORD objnum, bool& bForm) const; // |pFontDict| must not be null. CPDF_Font* LoadFont(CPDF_Dictionary* pFontDict); CPDF_ColorSpace* LoadColorSpace(CPDF_Object* pCSObj, CPDF_Dictionary* pResources = NULL); - CPDF_Pattern* LoadPattern(CPDF_Object* pObj, FX_BOOL bShading, const CFX_AffineMatrix* matrix = NULL); + CPDF_Pattern* LoadPattern(CPDF_Object* pObj, bool bShading, const CFX_AffineMatrix* matrix = NULL); CPDF_Image* LoadImageF(CPDF_Object* pObj); @@ -129,17 +129,17 @@ public: #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ - CPDF_Font* AddWindowsFont(LOGFONTA* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE); - CPDF_Font* AddWindowsFont(LOGFONTW* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE); + CPDF_Font* AddWindowsFont(LOGFONTA* pLogFont, bool bVert, bool bTranslateName = false); + CPDF_Font* AddWindowsFont(LOGFONTW* pLogFont, bool bVert, bool bTranslateName = false); #endif #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - CPDF_Font* AddMacFont(CTFontRef pFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE); + CPDF_Font* AddMacFont(CTFontRef pFont, bool bVert, bool bTranslateName = false); #endif CPDF_Font* AddStandardFont(const FX_CHAR* font, CPDF_FontEncoding* pEncoding); - CPDF_Font* AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert); + CPDF_Font* AddFont(CFX_Font* pFont, int charset, bool bVert); void CreateNewDoc(); @@ -161,7 +161,7 @@ protected: CFX_ByteString m_ID2; - FX_BOOL m_bLinearized; + bool m_bLinearized; FX_DWORD m_dwFirstPageNo; @@ -172,8 +172,8 @@ protected: int _GetPageCount() const; CPDF_Dictionary* _FindPDFPage(CPDF_Dictionary* pPages, int iPage, int nPagesToGo, int level); int _FindPageIndex(CPDF_Dictionary* pNode, FX_DWORD& skip_count, FX_DWORD objnum, int& index, int level = 0); - FX_BOOL IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* pPageDict); - FX_BOOL CheckOCGVisible(CPDF_Dictionary* pOCG, FX_BOOL bPrinting); + bool IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* pPageDict); + bool CheckOCGVisible(CPDF_Dictionary* pOCG, bool bPrinting); CPDF_DocPageData* GetValidatePageData(); CPDF_DocRenderData* GetValidateRenderData(); friend class CPDF_Creator; @@ -204,14 +204,14 @@ public: CFX_ByteStringC GetWord(); - FX_BOOL SearchToken(const CFX_ByteStringC& token); + bool SearchToken(const CFX_ByteStringC& token); - FX_BOOL SkipWord(const CFX_ByteStringC& token); + bool SkipWord(const CFX_ByteStringC& token); - FX_BOOL FindTagPair(const CFX_ByteStringC& start_token, const CFX_ByteStringC& end_token, + bool FindTagPair(const CFX_ByteStringC& start_token, const CFX_ByteStringC& end_token, FX_DWORD& start_pos, FX_DWORD& end_pos); - FX_BOOL FindTagParam(const CFX_ByteStringC& token, int nParams); + bool FindTagParam(const CFX_ByteStringC& token, int nParams); FX_DWORD GetPos() { @@ -252,7 +252,7 @@ public: m_Pos = pos; } - CPDF_Object* GetObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, struct PARSE_CONTEXT* pContext = NULL, FX_BOOL bDecrypt = TRUE); + CPDF_Object* GetObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, struct PARSE_CONTEXT* pContext = NULL, bool bDecrypt = true); CPDF_Object* GetObjectByStrict(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, struct PARSE_CONTEXT* pContext = NULL); @@ -271,9 +271,9 @@ public: void ToNextWord(); - FX_BOOL SearchWord(const CFX_ByteStringC& word, FX_BOOL bWholeWord, FX_BOOL bForward, FX_FILESIZE limit); + bool SearchWord(const CFX_ByteStringC& word, bool bWholeWord, bool bForward, FX_FILESIZE limit); - int SearchMultiWord(const CFX_ByteStringC& words, FX_BOOL bWholeWord, FX_FILESIZE limit); + int SearchMultiWord(const CFX_ByteStringC& words, bool bWholeWord, FX_FILESIZE limit); FX_FILESIZE FindTag(const CFX_ByteStringC& tag, FX_FILESIZE limit); @@ -282,27 +282,27 @@ public: m_pCryptoHandler = pCryptoHandler; } - FX_BOOL IsEncrypted() + bool IsEncrypted() { return m_pCryptoHandler != NULL; } - FX_BOOL GetCharAt(FX_FILESIZE pos, uint8_t& ch); + bool GetCharAt(FX_FILESIZE pos, uint8_t& ch); - FX_BOOL ReadBlock(uint8_t* pBuf, FX_DWORD size); + bool ReadBlock(uint8_t* pBuf, FX_DWORD size); - CFX_ByteString GetNextWord(FX_BOOL& bIsNumber); + CFX_ByteString GetNextWord(bool& bIsNumber); protected: static const int kParserMaxRecursionDepth = 64; static int s_CurrentRecursionDepth; - virtual FX_BOOL GetNextChar(uint8_t& ch); + virtual bool GetNextChar(uint8_t& ch); - FX_BOOL GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch); + bool GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch); void GetNextWord(); - FX_BOOL IsWholeWord(FX_FILESIZE startpos, FX_FILESIZE limit, const uint8_t* tag, FX_DWORD taglen); + bool IsWholeWord(FX_FILESIZE startpos, FX_FILESIZE limit, const uint8_t* tag, FX_DWORD taglen); CFX_ByteString ReadString(); @@ -312,7 +312,7 @@ protected: FX_FILESIZE m_Pos; - FX_BOOL m_bFileStream; + bool m_bFileStream; int m_MetadataObjnum; @@ -334,7 +334,7 @@ protected: FX_DWORD m_WordSize; - FX_BOOL m_bIsNumber; + bool m_bIsNumber; FX_FILESIZE m_dwWordPos; friend class CPDF_Parser; @@ -345,7 +345,7 @@ protected: #define PDFPARSE_NOSTREAM 2 struct PARSE_CONTEXT { - FX_BOOL m_Flags; + bool m_Flags; FX_FILESIZE m_DictStart; @@ -369,15 +369,15 @@ public: CPDF_Parser(); ~CPDF_Parser(); - 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); + FX_DWORD StartParse(const FX_CHAR* filename, bool bReParse = false); + FX_DWORD StartParse(const FX_WCHAR* filename, bool bReParse = false); + FX_DWORD StartParse(IFX_FileRead* pFile, bool bReParse = false, bool bOwnFileRead = true); - void CloseParser(FX_BOOL bReParse = FALSE); + void CloseParser(bool bReParse = false); - FX_DWORD GetPermissions(FX_BOOL bCheckRevision = FALSE); + FX_DWORD GetPermissions(bool bCheckRevision = false); - FX_BOOL IsOwner(); + bool IsOwner(); void SetPassword(const FX_CHAR* password) { @@ -399,7 +399,7 @@ public: return m_Syntax.m_pCryptoHandler; } - void SetSecurityHandler(CPDF_SecurityHandler* pSecurityHandler, FX_BOOL bForced = FALSE); + void SetSecurityHandler(CPDF_SecurityHandler* pSecurityHandler, bool bForced = false); CFX_ByteString GetRecipient() { @@ -435,7 +435,7 @@ public: return m_pEncryptDict; } - FX_BOOL IsEncrypted() + bool IsEncrypted() { return GetEncryptDict() != NULL; } @@ -443,7 +443,7 @@ public: CPDF_Object* ParseIndirectObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, PARSE_CONTEXT* pContext = NULL) ; FX_DWORD GetLastObjNum(); - FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm); + bool IsFormStream(FX_DWORD objnum, bool& bForm); FX_FILESIZE GetObjectOffset(FX_DWORD objnum); @@ -456,12 +456,12 @@ public: void GetIndirectBinary(FX_DWORD objnum, uint8_t*& pBuffer, FX_DWORD& size); - FX_BOOL GetFileStreamOption() + bool GetFileStreamOption() { return m_Syntax.m_bFileStream; } - void SetFileStreamOption(FX_BOOL b) + void SetFileStreamOption(bool b) { m_Syntax.m_bFileStream = b; } @@ -476,7 +476,7 @@ public: return m_FileVersion; } - FX_BOOL IsXRefStream() const + bool IsXRefStream() const { return m_bXRefStream; } @@ -486,7 +486,7 @@ public: CPDF_Object* ParseIndirectObjectAtByStrict(CPDF_IndirectObjects* pObjList, FX_FILESIZE pos, FX_DWORD objnum, struct PARSE_CONTEXT* pContext, FX_FILESIZE *pResultPos); - FX_DWORD StartAsynParse(IFX_FileRead* pFile, FX_BOOL bReParse = FALSE, FX_BOOL bOwnFileRead = TRUE); + FX_DWORD StartAsynParse(IFX_FileRead* pFile, bool bReParse = false, bool bOwnFileRead = true); FX_DWORD GetFirstPageNo() { @@ -496,30 +496,30 @@ protected: CPDF_Document* m_pDocument; CPDF_SyntaxParser m_Syntax; - FX_BOOL m_bOwnFileRead; + bool m_bOwnFileRead; CPDF_Object* ParseDirect(CPDF_Object* pObj); - FX_BOOL LoadAllCrossRefV4(FX_FILESIZE pos); + bool LoadAllCrossRefV4(FX_FILESIZE pos); - FX_BOOL LoadAllCrossRefV5(FX_FILESIZE pos); + bool LoadAllCrossRefV5(FX_FILESIZE pos); - FX_BOOL LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, FX_BOOL bSkip, FX_BOOL bFirst); + bool LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, bool bSkip, bool bFirst); - FX_BOOL LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, FX_BOOL bMainXRef); + bool LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, bool bMainXRef); CPDF_Dictionary* LoadTrailerV4(); - FX_BOOL RebuildCrossRef(); + bool RebuildCrossRef(); FX_DWORD SetEncryptHandler(); void ReleaseEncryptHandler(); - FX_BOOL LoadLinearizedAllCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount); + bool LoadLinearizedAllCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount); - FX_BOOL LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount); + bool LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount); - FX_BOOL LoadLinearizedAllCrossRefV5(FX_FILESIZE pos); + bool LoadLinearizedAllCrossRefV5(FX_FILESIZE pos); FX_DWORD LoadLinearizedMainXRefTable(); @@ -527,7 +527,7 @@ protected: CPDF_StreamAcc* GetObjectStream(FX_DWORD number); - FX_BOOL IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset); + bool IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset); @@ -540,12 +540,12 @@ protected: FX_FILESIZE m_LastXRefOffset; - FX_BOOL m_bXRefStream; + bool m_bXRefStream; CPDF_SecurityHandler* m_pSecurityHandler; - FX_BOOL m_bForceUseSecurityHandler; + bool m_bForceUseSecurityHandler; CFX_ByteString m_bsRecipient; @@ -562,7 +562,7 @@ protected: CFX_WordArray m_ObjVersion; CFX_ArrayTemplate m_Trailers; - FX_BOOL m_bVersionUpdated; + bool m_bVersionUpdated; CPDF_Object* m_pLinearized; @@ -582,17 +582,17 @@ public: virtual ~CPDF_SecurityHandler() {} - virtual FX_BOOL OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict) = 0; + virtual bool OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict) = 0; virtual FX_DWORD GetPermissions() = 0; - virtual FX_BOOL IsOwner() = 0; + virtual bool IsOwner() = 0; - virtual FX_BOOL GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen) = 0; + virtual bool GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen) = 0; - virtual FX_BOOL IsMetadataEncrypted() + virtual bool IsMetadataEncrypted() { - return TRUE; + return true; } virtual CPDF_CryptoHandler* CreateCryptoHandler() = 0; @@ -609,14 +609,14 @@ public: CPDF_StandardSecurityHandler(); virtual ~CPDF_StandardSecurityHandler(); - virtual FX_BOOL OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict); + virtual bool OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict); virtual FX_DWORD GetPermissions(); - virtual FX_BOOL IsOwner() + virtual bool IsOwner() { return m_bOwner; } - virtual FX_BOOL GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen); - virtual FX_BOOL IsMetadataEncrypted(); + virtual bool GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen); + virtual bool IsMetadataEncrypted(); virtual CPDF_CryptoHandler* CreateCryptoHandler(); virtual CPDF_StandardSecurityHandler* GetStandardHandler() { @@ -641,8 +641,8 @@ public: return m_Revision; } - 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); + int CheckPassword(const uint8_t* password, FX_DWORD pass_size, bool bOwner, uint8_t* key); + int CheckPassword(const uint8_t* password, FX_DWORD pass_size, bool bOwner, uint8_t* key, int key_len); private: int m_Version; @@ -653,22 +653,22 @@ private: CPDF_Dictionary* m_pEncryptDict; - FX_BOOL LoadDict(CPDF_Dictionary* pEncryptDict); - FX_BOOL LoadDict(CPDF_Dictionary* pEncryptDict, FX_DWORD type, int& cipher, int& key_len); + bool LoadDict(CPDF_Dictionary* pEncryptDict); + bool LoadDict(CPDF_Dictionary* pEncryptDict, FX_DWORD type, int& cipher, int& key_len); - FX_BOOL CheckUserPassword(const uint8_t* password, FX_DWORD pass_size, - FX_BOOL bIgnoreEncryptMeta, uint8_t* key, int32_t key_len); + bool CheckUserPassword(const uint8_t* password, FX_DWORD pass_size, + bool bIgnoreEncryptMeta, uint8_t* key, int32_t key_len); - 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); + bool CheckOwnerPassword(const uint8_t* password, FX_DWORD pass_size, uint8_t* key, int32_t key_len); + bool AES256_CheckPassword(const uint8_t* password, FX_DWORD size, bool bOwner, uint8_t* key); + void AES256_SetPassword(CPDF_Dictionary* pEncryptDict, const uint8_t* password, FX_DWORD size, bool bOwner, const uint8_t* key); + void AES256_SetPerms(CPDF_Dictionary* pEncryptDict, FX_DWORD permission, bool bEncryptMetadata, const uint8_t* key); void OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray, 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); + const uint8_t* owner_pass, FX_DWORD owner_size, bool bDefault, FX_DWORD type); + bool CheckSecurity(int32_t key_len); - FX_BOOL m_bOwner; + bool m_bOwner; FX_DWORD m_Permissions; @@ -684,20 +684,20 @@ public: virtual ~CPDF_CryptoHandler() {} - virtual FX_BOOL Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler) = 0; + virtual bool Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler) = 0; virtual FX_DWORD DecryptGetSize(FX_DWORD src_size) = 0; virtual void* DecryptStart(FX_DWORD objnum, FX_DWORD gennum) = 0; - virtual FX_BOOL DecryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) = 0; + virtual bool DecryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) = 0; - virtual FX_BOOL DecryptFinish(void* context, CFX_BinaryBuf& dest_buf) = 0; + virtual bool DecryptFinish(void* context, CFX_BinaryBuf& dest_buf) = 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, const uint8_t* src_buf, FX_DWORD src_size, + virtual 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); @@ -710,22 +710,22 @@ public: virtual ~CPDF_StandardCryptoHandler(); - FX_BOOL Init(int cipher, const uint8_t* key, int keylen); - virtual FX_BOOL Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler); + bool Init(int cipher, const uint8_t* key, int keylen); + virtual bool Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler); virtual FX_DWORD DecryptGetSize(FX_DWORD src_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 bool DecryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf); + virtual 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, + virtual 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, const uint8_t* src_buf, FX_DWORD src_size, + virtual void CryptBlock(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); + virtual void* CryptStart(FX_DWORD objnum, FX_DWORD gennum, bool bEncrypt); + virtual bool CryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf, bool bEncrypt); + virtual bool CryptFinish(void* context, CFX_BinaryBuf& dest_buf, bool bEncrypt); uint8_t m_EncryptKey[32]; @@ -755,7 +755,7 @@ public: CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& 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_ByteString PDF_EncodeString(const CFX_ByteString& src, bool bHex = false); 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((const uint8_t*)bstr.c_str(), bstr.GetLength(), pCharMap); @@ -769,12 +769,12 @@ 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* ParseFile(IFX_FileRead *pFile, bool bOwnFile = false); static CFDF_Document* ParseMemory(const uint8_t* pData, FX_DWORD size); ~CFDF_Document(); - FX_BOOL WriteBuf(CFX_ByteTextBuf& buf) const; + bool WriteBuf(CFX_ByteTextBuf& buf) const; CPDF_Dictionary* GetRoot() const { @@ -785,10 +785,10 @@ public: protected: CFDF_Document(); - void ParseStream(IFX_FileRead *pFile, FX_BOOL bOwnFile); + void ParseStream(IFX_FileRead *pFile, bool bOwnFile); CPDF_Dictionary* m_pRootDict; IFX_FileRead* m_pFile; - FX_BOOL m_bOwnFile; + bool m_bOwnFile; }; CFX_WideString FPDF_FileSpec_GetWin32Path(const CPDF_Object* pFileSpec); @@ -816,7 +816,7 @@ class IFX_FileAvail { public: virtual ~IFX_FileAvail() { } - virtual FX_BOOL IsDataAvail( FX_FILESIZE offset, FX_DWORD size) = 0; + virtual bool IsDataAvail( FX_FILESIZE offset, FX_DWORD size) = 0; }; class IFX_DownloadHints { @@ -839,10 +839,10 @@ public: IFX_FileAvail* GetFileAvail() const { return m_pFileAvail; } IFX_FileRead* GetFileRead() const { return m_pFileRead; } - virtual FX_BOOL IsDocAvail(IFX_DownloadHints* pHints) = 0; + virtual bool IsDocAvail(IFX_DownloadHints* pHints) = 0; virtual void SetDocument(CPDF_Document* pDoc) = 0; - virtual FX_BOOL IsPageAvail(int iPage, IFX_DownloadHints* pHints) = 0; - virtual FX_BOOL IsLinearized() = 0; + virtual bool IsPageAvail(int iPage, IFX_DownloadHints* pHints) = 0; + virtual bool IsLinearized() = 0; virtual int32_t IsFormAvail(IFX_DownloadHints *pHints) = 0; virtual int32_t IsLinearizedPDF() = 0; virtual void GetLinearizedMainXRefInfo(FX_FILESIZE *pPos, FX_DWORD *pSize) = 0; @@ -859,7 +859,7 @@ public: void AddObjNum(FX_DWORD dwObjNum); - FX_BOOL Find(FX_DWORD dwObjNum); + bool Find(FX_DWORD dwObjNum); void RemoveAll() { @@ -867,7 +867,7 @@ public: } protected: - FX_BOOL BinarySearch(FX_DWORD value, int &iNext); + bool BinarySearch(FX_DWORD value, int &iNext); protected: CFX_DWordArray m_number_array; diff --git a/core/include/fpdfapi/fpdf_render.h b/core/include/fpdfapi/fpdf_render.h index f3590095ad..37e8a540c1 100644 --- a/core/include/fpdfapi/fpdf_render.h +++ b/core/include/fpdfapi/fpdf_render.h @@ -33,9 +33,9 @@ public: virtual ~IPDF_OCContext() {} - virtual FX_BOOL CheckOCGVisible(const CPDF_Dictionary* pOCG) = 0; + virtual bool CheckOCGVisible(const CPDF_Dictionary* pOCG) = 0; - FX_BOOL CheckObjectVisible(const CPDF_PageObject* pObj); + bool CheckObjectVisible(const CPDF_PageObject* pObj); }; #define RENDER_COLOR_NORMAL 0 #define RENDER_COLOR_GRAY 1 @@ -89,10 +89,10 @@ public: CPDF_RenderContext(); - void Create(CPDF_Page* pPage, FX_BOOL bFirstLayer = TRUE); + void Create(CPDF_Page* pPage, bool bFirstLayer = true); void Create(CPDF_Document* pDoc = NULL, CPDF_PageRenderCache* pPageCache = NULL, - CPDF_Dictionary* pPageResources = NULL, FX_BOOL bFirstLayer = TRUE); + CPDF_Dictionary* pPageResources = NULL, bool bFirstLayer = true); ~CPDF_RenderContext(); @@ -126,7 +126,7 @@ protected: CFX_ArrayTemplate m_ContentList; - FX_BOOL m_bFirstLayer; + bool m_bFirstLayer; void Render(CFX_RenderDevice* pDevice, const CPDF_PageObject* pStopObj, const CPDF_RenderOptions* pOptions, const CFX_AffineMatrix* pFinalMatrix); @@ -192,17 +192,17 @@ public: const CPDF_RenderOptions* pOptions = NULL ); - static FX_BOOL DrawTextPath(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, + static bool DrawTextPath(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, CPDF_Font* pFont, FX_FLOAT font_size, const CFX_AffineMatrix* pText2User, const CFX_AffineMatrix* pUser2Device, const CFX_GraphStateData* pGraphState, FX_ARGB fill_argb, FX_ARGB stroke_argb, CFX_PathData* pClippingPath, int nFlag = 0); - static FX_BOOL DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, + static bool DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, CPDF_Font* pFont, FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device, FX_ARGB fill_argb, const CPDF_RenderOptions* pOptions); - static FX_BOOL DrawType3Text(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, + static bool DrawType3Text(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, CPDF_Font* pFont, FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device, FX_ARGB fill_argb); }; @@ -215,7 +215,7 @@ public: m_nTimeCount = 0; m_nCacheSize = 0; m_pCurImageCache = NULL; - m_bCurFindCache = FALSE; + m_bCurFindCache = false; m_pCurImageCaches = NULL; } ~CPDF_PageRenderCache() @@ -238,7 +238,7 @@ public: } void GetCachedBitmap(CPDF_Stream* pStream, CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, - FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, + bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false, CPDF_RenderStatus* pRenderStatus = NULL, int32_t downsampleWidth = 0, int32_t downsampleHeight = 0); void ResetBitmap(CPDF_Stream* pStream, const CFX_DIBitmap* pBitmap); @@ -249,11 +249,11 @@ public: } CFX_MapPtrToPtr m_ImageCaches; public: - FX_BOOL StartGetCachedBitmap(CPDF_Stream* pStream, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, - FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, + bool StartGetCachedBitmap(CPDF_Stream* pStream, bool bStdCS = false, FX_DWORD GroupFamily = 0, + bool bLoadMask = false, CPDF_RenderStatus* pRenderStatus = NULL, int32_t downsampleWidth = 0, int32_t downsampleHeight = 0); - FX_BOOL Continue(IFX_Pause* pPause); + bool Continue(IFX_Pause* pPause); CPDF_ImageCache* m_pCurImageCache; CFX_PtrArray* m_pCurImageCaches; protected: @@ -262,7 +262,7 @@ protected: FX_DWORD m_nTimeCount; FX_DWORD m_nCacheSize; - FX_BOOL m_bCurFindCache; + bool m_bCurFindCache; }; class CPDF_RenderConfig { diff --git a/core/include/fpdfapi/fpdf_resource.h b/core/include/fpdfapi/fpdf_resource.h index 5c8cc85217..c60737d36e 100644 --- a/core/include/fpdfapi/fpdf_resource.h +++ b/core/include/fpdfapi/fpdf_resource.h @@ -116,7 +116,7 @@ public: return m_Flags; } - virtual FX_BOOL IsVertWriting()const; + virtual bool IsVertWriting()const; @@ -142,14 +142,14 @@ public: } - FX_BOOL IsEmbedded() const + bool IsEmbedded() const { return m_FontType == PDFFONT_TYPE3 || m_pFontFile != NULL; } - virtual FX_BOOL IsUnicodeCompatible() const + virtual bool IsUnicodeCompatible() const { - return FALSE; + return false; } CPDF_StreamAcc* GetFontFile() const @@ -162,7 +162,7 @@ public: return m_pFontDict; } - FX_BOOL IsStandardFont() const; + bool IsStandardFont() const; FXFT_Face GetFace() const { @@ -199,7 +199,7 @@ public: - virtual int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph = NULL) = 0; + virtual int GlyphFromCharCode(FX_DWORD charcode, bool *pVertGlyph = NULL) = 0; virtual int GlyphFromCharCodeExt(FX_DWORD charcode) { return GlyphFromCharCode(charcode); @@ -265,11 +265,11 @@ public: protected: explicit CPDF_Font(int fonttype); - FX_BOOL Initialize(); + bool Initialize(); - FX_BOOL Load(); + bool Load(); - virtual FX_BOOL _Load() = 0; + virtual bool _Load() = 0; virtual FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const = 0; @@ -278,7 +278,7 @@ protected: void LoadUnicodeMap(); void LoadPDFEncoding(CPDF_Object* pEncoding, int& iBaseEncoding, - CFX_ByteString*& pCharNames, FX_BOOL bEmbedded, FX_BOOL bTrueType); + CFX_ByteString*& pCharNames, bool bEmbedded, bool bTrueType); void LoadFontDescriptor(CPDF_Dictionary*); @@ -298,7 +298,7 @@ protected: CPDF_ToUnicodeMap* m_pToUnicodeMap; - FX_BOOL m_bToUnicodeLoaded; + bool m_bToUnicodeLoaded; @@ -338,7 +338,7 @@ public: void LoadEncoding(CPDF_Object* pEncoding); - FX_BOOL IsIdentical(CPDF_FontEncoding* pAnother) const; + bool IsIdentical(CPDF_FontEncoding* pAnother) const; FX_WCHAR UnicodeFromCharCode(uint8_t charcode) const { @@ -370,11 +370,11 @@ public: } int GetCharWidthF(FX_DWORD charcode, int level = 0) override; void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0) override; - int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph = NULL) override; - FX_BOOL IsUnicodeCompatible() const override; + int GlyphFromCharCode(FX_DWORD charcode, bool *pVertGlyph = NULL) override; + bool IsUnicodeCompatible() const override; protected: - FX_BOOL LoadCommon(); + bool LoadCommon(); void LoadSubstFont(); @@ -401,7 +401,7 @@ protected: int m_BaseEncoding; FX_WORD m_CharWidth[256]; FX_SMALL_RECT m_CharBBox[256]; - FX_BOOL m_bUseFontWidth; + bool m_bUseFontWidth; }; class CPDF_Type1Font : public CPDF_SimpleFont @@ -416,7 +416,7 @@ public: } virtual int GlyphFromCharCodeExt(FX_DWORD charcode); protected: - virtual FX_BOOL _Load(); + virtual bool _Load(); int m_Base14Font; virtual void LoadGlyphMap(); @@ -427,7 +427,7 @@ public: CPDF_TrueTypeFont(); protected: - virtual FX_BOOL _Load(); + virtual bool _Load(); virtual void LoadGlyphMap(); }; class CPDF_Type3Char @@ -438,11 +438,11 @@ public: ~CPDF_Type3Char(); - FX_BOOL LoadBitmap(CPDF_RenderContext* pContext); + bool LoadBitmap(CPDF_RenderContext* pContext); - FX_BOOL m_bColored; + bool m_bColored; - FX_BOOL m_bPageRequired; + bool m_bPageRequired; @@ -484,7 +484,7 @@ protected: CFX_AffineMatrix m_FontMatrix; private: - FX_BOOL _Load() override; + bool _Load() override; void LoadGlyphMap() override {} int m_CharWidthL[256]; @@ -511,13 +511,13 @@ public: ~CPDF_CIDFont() override; - FX_BOOL LoadGB2312(); - int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph = NULL) override; + bool LoadGB2312(); + int GlyphFromCharCode(FX_DWORD charcode, bool *pVertGlyph = NULL) override; int GetCharWidthF(FX_DWORD charcode, int level = 0) override; void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0) override; FX_WORD CIDFromCharCode(FX_DWORD charcode) const; - FX_BOOL IsTrueType() const + bool IsTrueType() const { return !m_bType1; } @@ -533,19 +533,19 @@ public: } const uint8_t* GetCIDTransform(FX_WORD CID) const; - FX_BOOL IsVertWriting() const override; + bool IsVertWriting() const override; short GetVertWidth(FX_WORD CID) const; void GetVertOrigin(FX_WORD CID, short& vx, short& vy) const; - FX_BOOL IsUnicodeCompatible() const override; - virtual FX_BOOL IsFontStyleFromCharCode(FX_DWORD charcode) const; + bool IsUnicodeCompatible() const override; + virtual bool IsFontStyleFromCharCode(FX_DWORD charcode) const; protected: friend class CPDF_Font; - FX_BOOL _Load() override; + bool _Load() override; FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const override; FX_DWORD _CharCodeFromUnicode(FX_WCHAR Unicode) const override; - int GetGlyphIndex(FX_DWORD unicodeb, FX_BOOL *pVertGlyph); + int GetGlyphIndex(FX_DWORD unicodeb, bool *pVertGlyph); void LoadMetricsArray(CPDF_Array* pArray, CFX_DWordArray& result, int nElements); void LoadSubstFont(); @@ -553,9 +553,9 @@ protected: CPDF_CMap* m_pAllocatedCMap; CPDF_CID2UnicodeMap* m_pCID2UnicodeMap; int m_Charset; - FX_BOOL m_bType1; + bool m_bType1; CPDF_StreamAcc* m_pCIDToGIDMap; - FX_BOOL m_bCIDIsGID; + bool m_bCIDIsGID; FX_WORD m_DefaultWidth; FX_WORD* m_pAnsiWidths; FX_SMALL_RECT m_CharBBox[256]; @@ -563,7 +563,7 @@ protected: short m_DefaultVY; short m_DefaultW1; CFX_DWordArray m_VertMetrics; - FX_BOOL m_bAdobeCourierStd; + bool m_bAdobeCourierStd; CFX_CTTGSUBTable* m_pTTGSUBTable; }; @@ -612,27 +612,27 @@ public: max = 1.0f; } - FX_BOOL sRGB() const; + bool sRGB() const; - virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const = 0; + virtual bool GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const = 0; - virtual FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const + virtual bool SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const { - return FALSE; + return false; } - FX_BOOL GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const; + bool GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const; - FX_BOOL SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const; + bool SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const; 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; + int image_width, int image_height, bool bTransMask = false) const; CPDF_Array*& GetArray() { @@ -646,7 +646,7 @@ public: return NULL; } - virtual void EnableStdConversion(FX_BOOL bEnabled); + virtual void EnableStdConversion(bool bEnabled); CPDF_Document* const m_pDocument; @@ -659,17 +659,17 @@ protected: m_dwStdConversion(0) { } virtual ~CPDF_ColorSpace() {} - virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) + virtual bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) { - return TRUE; + return true; } - virtual FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const + virtual bool v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const { - return FALSE; + return false; } - virtual FX_BOOL v_SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const + virtual bool v_SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const { - return FALSE; + return false; } int m_Family; @@ -692,14 +692,14 @@ public: ~CPDF_Color(); - FX_BOOL IsNull() const + bool IsNull() const { return m_pBuffer == NULL; } - FX_BOOL IsEqual(const CPDF_Color& other) const; + bool IsEqual(const CPDF_Color& other) const; - FX_BOOL IsPattern() const + bool IsPattern() const { return m_pCS && m_pCS->GetFamily() == PDFCS_PATTERN; } @@ -712,7 +712,7 @@ public: void SetValue(CPDF_Pattern* pPattern, FX_FLOAT* comp, int ncomps); - FX_BOOL GetRGB(int& R, int& G, int& B) const; + bool GetRGB(int& R, int& G, int& B) const; CPDF_Pattern* GetPattern() const; @@ -734,7 +734,7 @@ class CPDF_Pattern public: virtual ~CPDF_Pattern(); - void SetForceClear(FX_BOOL bForceClear) { m_bForceClear = bForceClear; } + void SetForceClear(bool bForceClear) { m_bForceClear = bForceClear; } CPDF_Object* m_pPatternObj; @@ -747,7 +747,7 @@ public: protected: CPDF_Pattern(const CFX_AffineMatrix* pParentMatrix); - FX_BOOL m_bForceClear; + bool m_bForceClear; }; class CPDF_TilingPattern : public CPDF_Pattern @@ -758,11 +758,11 @@ public: virtual ~CPDF_TilingPattern(); - FX_BOOL Load(); + bool Load(); - FX_BOOL m_bColored; + bool m_bColored; CFX_FloatRect m_BBox; @@ -778,17 +778,17 @@ class CPDF_ShadingPattern : public CPDF_Pattern { public: - CPDF_ShadingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* parentMatrix); + CPDF_ShadingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, bool bShading, const CFX_AffineMatrix* parentMatrix); virtual ~CPDF_ShadingPattern(); CPDF_Object* m_pShadingObj; - FX_BOOL m_bShadingObj; + bool m_bShadingObj; - FX_BOOL Load(); + bool Load(); - FX_BOOL Reload(); + bool Reload(); int m_ShadingType; @@ -810,7 +810,7 @@ class CPDF_MeshStream { public: - FX_BOOL Load(CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS); + bool Load(CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS); FX_DWORD GetFlag(); @@ -820,7 +820,7 @@ public: FX_DWORD GetVertex(CPDF_MeshVertex& vertex, CFX_AffineMatrix* pObject2Bitmap); - FX_BOOL GetVertexRow(CPDF_MeshVertex* vertex, int count, CFX_AffineMatrix* pObject2Bitmap); + bool GetVertexRow(CPDF_MeshVertex* vertex, int count, CFX_AffineMatrix* pObject2Bitmap); CPDF_Function** m_pFuncs; CPDF_ColorSpace* m_pCS; FX_DWORD m_nFuncs, m_nCoordBits, m_nCompBits, m_nFlagBits, m_nComps; @@ -854,13 +854,13 @@ public: ~CPDF_Image(); - FX_BOOL LoadImageF(CPDF_Stream* pImageStream, FX_BOOL bInline); + bool LoadImageF(CPDF_Stream* pImageStream, bool bInline); void Release(); CPDF_Image* Clone(); - FX_BOOL IsInline() + bool IsInline() { return m_bInline; } @@ -908,17 +908,17 @@ public: } - FX_BOOL IsMask() const + bool IsMask() const { return m_bIsMask; } - FX_BOOL IsInterpol() const + bool IsInterpol() const { return m_bInterpolate; } - CFX_DIBSource* LoadDIBSource(CFX_DIBSource** ppMask = NULL, FX_DWORD* pMatteColor = NULL, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE) const; + CFX_DIBSource* LoadDIBSource(CFX_DIBSource** ppMask = NULL, FX_DWORD* pMatteColor = NULL, bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false) const; @@ -931,8 +931,8 @@ public: void ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pDIBitmap); public: - FX_BOOL StartLoadDIBSource(CPDF_Dictionary* pFormResource, CPDF_Dictionary* pPageResource, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE); - FX_BOOL Continue(IFX_Pause* pPause); + bool StartLoadDIBSource(CPDF_Dictionary* pFormResource, CPDF_Dictionary* pPageResource, bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false); + bool Continue(IFX_Pause* pPause); CFX_DIBSource* DetachBitmap(); CFX_DIBSource* DetachMask(); CFX_DIBSource* m_pDIBSource; @@ -941,16 +941,16 @@ public: private: CPDF_Stream* m_pStream; - FX_BOOL m_bInline; + bool m_bInline; CPDF_Dictionary* m_pInlineDict; int32_t m_Height; int32_t m_Width; - FX_BOOL m_bIsMask; + bool m_bIsMask; - FX_BOOL m_bInterpolate; + bool m_bInterpolate; CPDF_Document* m_pDocument; diff --git a/core/include/fpdfapi/fpdf_serial.h b/core/include/fpdfapi/fpdf_serial.h index 1877ef8866..06cf213d99 100644 --- a/core/include/fpdfapi/fpdf_serial.h +++ b/core/include/fpdfapi/fpdf_serial.h @@ -117,35 +117,35 @@ public: void RemoveSecurity(); - FX_BOOL Create(const FX_WCHAR* filename, FX_DWORD flags = 0); + bool Create(const FX_WCHAR* filename, FX_DWORD flags = 0); - FX_BOOL Create(const FX_CHAR* filename, FX_DWORD flags = 0); + bool Create(const FX_CHAR* filename, FX_DWORD flags = 0); - FX_BOOL Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0); + bool Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0); int32_t Continue(IFX_Pause *pPause = NULL); - FX_BOOL SetFileVersion(int32_t fileVersion = 17); + bool SetFileVersion(int32_t fileVersion = 17); protected: CPDF_Document* m_pDocument; CPDF_Parser* m_pParser; - FX_BOOL m_bCompress; + bool m_bCompress; - FX_BOOL m_bSecurityChanged; + bool m_bSecurityChanged; CPDF_Dictionary* m_pEncryptDict; FX_DWORD m_dwEnryptObjNum; - FX_BOOL m_bEncryptCloned; + bool m_bEncryptCloned; - FX_BOOL m_bStandardSecurity; + bool m_bStandardSecurity; CPDF_CryptoHandler* m_pCryptoHandler; - FX_BOOL m_bNewCrypto; + bool m_bNewCrypto; - FX_BOOL m_bEncryptMetadata; + bool m_bEncryptMetadata; CPDF_Object* m_pMetadata; @@ -154,7 +154,7 @@ protected: int32_t m_ObjectStreamSize; FX_DWORD m_dwLastObjNum; - FX_BOOL Create(FX_DWORD flags); + bool Create(FX_DWORD flags); void ResetStandardSecurity(); void Clear(); int32_t WriteDoc_Stage1(IFX_Pause *pPause); @@ -170,14 +170,14 @@ protected: void AppendNewObjNum(FX_DWORD objbum); int32_t WriteOldIndirectObject(FX_DWORD objnum); int32_t WriteOldObjs(IFX_Pause *pPause); - int32_t WriteNewObjs(FX_BOOL bIncremental, IFX_Pause *pPause); + int32_t WriteNewObjs(bool bIncremental, IFX_Pause *pPause); int32_t WriteIndirectObj(const CPDF_Object* pObj); - int32_t WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, FX_BOOL bEncrypt = TRUE); + int32_t WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, 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, const uint8_t* pBuffer, FX_DWORD dwSize); int32_t AppendObjectNumberToXRef(FX_DWORD objnum); - void InitID(FX_BOOL bDefault = TRUE); + void InitID(bool bDefault = true); int32_t WriteStream(const CPDF_Object* pStream, FX_DWORD objnum, CPDF_CryptoHandler* pCrypto); int32_t m_iStage; diff --git a/core/include/fpdfdoc/fpdf_ap.h b/core/include/fpdfdoc/fpdf_ap.h index 7cfaed4685..eb0ca44b64 100644 --- a/core/include/fpdfdoc/fpdf_ap.h +++ b/core/include/fpdfdoc/fpdf_ap.h @@ -60,7 +60,7 @@ public: int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex); - FX_BOOL IsLatinWord(FX_WORD word); + bool IsLatinWord(FX_WORD word); int32_t GetDefaultFontIndex(); private: @@ -76,20 +76,20 @@ class CPVT_GenerateAP { public: - static FX_BOOL GenerateTextFieldAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); + static bool GenerateTextFieldAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); - static FX_BOOL GenerateComboBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); + static bool GenerateComboBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); - static FX_BOOL GenerateListBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); + static bool GenerateListBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); static CFX_ByteString GenerateEditAP(IPVT_FontMap * pFontMap, IPDF_VariableText_Iterator * pIterator, - const CPDF_Point & ptOffset, FX_BOOL bContinuous, FX_WORD SubWord = 0, const CPVT_WordRange * pVisible = NULL); + const CPDF_Point & ptOffset, bool bContinuous, FX_WORD SubWord = 0, const CPVT_WordRange * pVisible = NULL); static CFX_ByteString GenerateBorderAP(const CPDF_Rect & rect, FX_FLOAT fWidth, const CPVT_Color & color, const CPVT_Color & crLeftTop, const CPVT_Color & crRightBottom, int32_t nStyle, const CPVT_Dash & dash); - static CFX_ByteString GenerateColorAP(const CPVT_Color & color, const FX_BOOL & bFillOrStroke); + static CFX_ByteString GenerateColorAP(const CPVT_Color & color, const bool & bFillOrStroke); }; #endif // CORE_INCLUDE_FPDFDOC_FPDF_AP_H_ diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h index fc9d3bce87..36d9d2935a 100644 --- a/core/include/fpdfdoc/fpdf_doc.h +++ b/core/include/fpdfdoc/fpdf_doc.h @@ -164,26 +164,26 @@ public: return m_eUsageType; } - FX_BOOL CheckOCGVisible(const CPDF_Dictionary *pOCGDict); + bool CheckOCGVisible(const CPDF_Dictionary *pOCGDict); void ResetOCContext(); protected: - FX_BOOL LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig, const CPDF_Dictionary *pOCGDict, FX_BOOL &bValidConfig) const; + bool LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig, const CPDF_Dictionary *pOCGDict, bool &bValidConfig) const; - FX_BOOL LoadOCGState(const CPDF_Dictionary *pOCGDict) const; + bool LoadOCGState(const CPDF_Dictionary *pOCGDict) const; - FX_BOOL GetOCGVisible(const CPDF_Dictionary *pOCGDict); + bool GetOCGVisible(const CPDF_Dictionary *pOCGDict); - FX_BOOL GetOCGVE(CPDF_Array *pExpression, FX_BOOL bFromConfig, int nLevel = 0); + bool GetOCGVE(CPDF_Array *pExpression, bool bFromConfig, int nLevel = 0); - FX_BOOL LoadOCMDState(const CPDF_Dictionary *pOCMDDict, FX_BOOL bFromConfig); + bool LoadOCMDState(const CPDF_Dictionary *pOCMDDict, bool bFromConfig); CPDF_Document *m_pDocument; UsageType m_eUsageType; - std::map m_OCGStates; + std::map m_OCGStates; }; class CPDF_LWinParam { @@ -295,7 +295,7 @@ public: CFX_WideString GetFilePath() const; - FX_BOOL GetNewWindow() const + bool GetNewWindow() const { return m_pDict->GetBoolean("NewWindow"); } @@ -304,7 +304,7 @@ public: CFX_ByteString GetURI(CPDF_Document* pDoc) const; - FX_BOOL GetMouseMap() const + bool GetMouseMap() const { return m_pDict->GetBoolean("IsMap"); } @@ -314,9 +314,9 @@ public: return this; } - FX_BOOL GetHideStatus() const + bool GetHideStatus() const { - return m_pDict->GetBoolean("H", TRUE); + return m_pDict->GetBoolean("H", true); } CFX_ByteString GetNamedAction() const @@ -345,17 +345,17 @@ public: return m_pDict->GetNumber("Volume"); } - FX_BOOL IsSynchronous() const + bool IsSynchronous() const { return m_pDict->GetBoolean("Synchronous"); } - FX_BOOL IsRepeat() const + bool IsRepeat() const { return m_pDict->GetBoolean("Repeat"); } - FX_BOOL IsMixPlay() const + bool IsMixPlay() const { return m_pDict->GetBoolean("Mix"); } @@ -405,7 +405,7 @@ public: DocumentPrinted }; - FX_BOOL ActionExist(AActionType eType) const; + bool ActionExist(AActionType eType) const; CPDF_Action GetAction(AActionType eType) const; @@ -455,13 +455,13 @@ public: return m_pObj; } - FX_BOOL IsURL() const; + bool IsURL() const; - FX_BOOL GetFileName(CFX_WideString &wsFileName) const; + bool GetFileName(CFX_WideString &wsFileName) const; CPDF_Stream* GetFileStream() const; - void SetFileName(const CFX_WideStringC& wsFileName, FX_BOOL bURL = FALSE); + void SetFileName(const CFX_WideStringC& wsFileName, bool bURL = false); protected: CPDF_Object *m_pObj; @@ -543,13 +543,13 @@ class CPDF_Annot : public CFX_PrivateData CPDF_Dictionary* GetAnnotDict(); - FX_BOOL DrawAppearance(const CPDF_Page* pPage, + bool DrawAppearance(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pUser2Device, AppearanceMode mode, const CPDF_RenderOptions* pOptions); - FX_BOOL DrawInContext(const CPDF_Page* pPage, + bool DrawInContext(const CPDF_Page* pPage, const CPDF_RenderContext* pContext, const CFX_AffineMatrix* pUser2Device, AppearanceMode mode); @@ -585,25 +585,25 @@ public: void GetAnnotRect(const CPDF_Dictionary* pAnnotDict, const CFX_Matrix* pUser2Device, CPDF_Rect &rtAnnot) const; void DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, - CFX_AffineMatrix* pMatrix, FX_BOOL bShowWidget, + CFX_AffineMatrix* pMatrix, bool bShowWidget, CPDF_RenderOptions* pOptions); void DisplayAnnots(const CPDF_Page* pPage, CPDF_RenderContext* pContext, - FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix, FX_BOOL bShowWidget, + bool bPrinting, CFX_AffineMatrix* pMatrix, bool bShowWidget, CPDF_RenderOptions* pOptions) { DisplayAnnots(pPage, NULL, pContext, bPrinting, pMatrix, bShowWidget ? 3 : 1, pOptions, NULL); } void DisplayAnnots(const CPDF_Page* pPage, CPDF_RenderContext* pContext, - FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix, FX_BOOL bShowWidget, + bool bPrinting, CFX_AffineMatrix* pMatrix, bool bShowWidget, CPDF_RenderOptions* pOptions, FX_RECT *pClipRect) { DisplayAnnots(pPage, NULL, pContext, bPrinting, pMatrix, bShowWidget ? 3 : 1, pOptions, pClipRect); } void DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, CPDF_RenderContext* pContext, - FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix, FX_DWORD dwAnnotFlags, + bool bPrinting, CFX_AffineMatrix* pMatrix, FX_DWORD dwAnnotFlags, CPDF_RenderOptions* pOptions, FX_RECT* pClipRect); @@ -636,8 +636,8 @@ protected: CFX_PtrArray m_Borders; void DisplayPass(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, - CPDF_RenderContext* pContext, FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix, - FX_BOOL bWidget, CPDF_RenderOptions* pOptions, FX_RECT* clip_rect); + CPDF_RenderContext* pContext, bool bPrinting, CFX_AffineMatrix* pMatrix, + bool bWidget, CPDF_RenderOptions* pOptions, FX_RECT* clip_rect); friend class CPDF_Annot; }; #define COLORTYPE_TRANSPARENT 0 @@ -678,7 +678,7 @@ public: - FX_BOOL HasFont(); + bool HasFont(); CFX_ByteString GetFontString(); @@ -687,18 +687,18 @@ public: - FX_BOOL HasColor(FX_BOOL bStrokingOperation = FALSE); + bool HasColor(bool bStrokingOperation = false); - CFX_ByteString GetColorString(FX_BOOL bStrokingOperation = FALSE); + CFX_ByteString GetColorString(bool bStrokingOperation = false); - void GetColor(int& iColorType, FX_FLOAT fc[4], FX_BOOL bStrokingOperation = FALSE); + void GetColor(int& iColorType, FX_FLOAT fc[4], bool bStrokingOperation = false); - void GetColor(FX_ARGB& color, int& iColorType, FX_BOOL bStrokingOperation = FALSE); + void GetColor(FX_ARGB& color, int& iColorType, bool bStrokingOperation = false); - FX_BOOL HasTextMatrix(); + bool HasTextMatrix(); CFX_ByteString GetTextMatrixString(); @@ -720,15 +720,15 @@ class CPDF_InterForm : public CFX_PrivateData { public: - CPDF_InterForm(CPDF_Document* pDocument, FX_BOOL bUpdateAP); + CPDF_InterForm(CPDF_Document* pDocument, bool bUpdateAP); ~CPDF_InterForm(); - static void EnableUpdateAP(FX_BOOL bUpdateAP); + static void EnableUpdateAP(bool bUpdateAP); - static FX_BOOL UpdatingAPEnabled(); + static bool UpdatingAPEnabled(); static CFX_ByteString GenerateNewResourceName(const CPDF_Dictionary* pResDict, const FX_CHAR* csType, int iMinLen = 2, const FX_CHAR* csPrefix = ""); @@ -756,11 +756,11 @@ public: - FX_BOOL ValidateFieldName(CFX_WideString& csNewFieldName, int iType); + bool ValidateFieldName(CFX_WideString& csNewFieldName, int iType); - FX_BOOL ValidateFieldName(const CPDF_FormField* pField, CFX_WideString& csNewFieldName); + bool ValidateFieldName(const CPDF_FormField* pField, CFX_WideString& csNewFieldName); - FX_BOOL ValidateFieldName(const CPDF_FormControl* pControl, CFX_WideString& csNewFieldName); + bool ValidateFieldName(const CPDF_FormControl* pControl, CFX_WideString& csNewFieldName); @@ -771,7 +771,7 @@ public: void GetAllFieldNames(CFX_WideStringArray& allFieldNames); - FX_BOOL IsValidFormField(const void* pField); + bool IsValidFormField(const void* pField); CPDF_FormField* GetFieldByDict(CPDF_Dictionary* pFieldDict) const; @@ -782,7 +782,7 @@ public: CPDF_FormControl* GetControl(FX_DWORD index, CFX_WideString csFieldName = L""); - FX_BOOL IsValidFormControl(const void* pControl); + bool IsValidFormControl(const void* pControl); int CountPageControls(CPDF_Page* pPage) const; @@ -817,9 +817,9 @@ public: - FX_BOOL NeedConstructAP(); + bool NeedConstructAP(); - void NeedConstructAP(FX_BOOL bNeedAP); + void NeedConstructAP(bool bNeedAP); @@ -845,11 +845,11 @@ public: CPDF_Font* GetNativeFormFont(CFX_ByteString& csNameTag); - FX_BOOL FindFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag); + bool FindFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag); - FX_BOOL FindFormFont(CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag); + bool FindFormFont(CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag); - inline FX_BOOL FindFormFont(CFX_WideString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag) + inline bool FindFormFont(CFX_WideString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag) { return FindFormFont(PDF_EncodeText(csFontName), pFont, csNameTag); } @@ -882,20 +882,20 @@ public: - CPDF_FormField* CheckRequiredFields(const CFX_PtrArray *fields = NULL, FX_BOOL bIncludeOrExclude = TRUE) const; + CPDF_FormField* CheckRequiredFields(const CFX_PtrArray *fields = NULL, bool bIncludeOrExclude = true) const; - CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, FX_BOOL bSimpleFileSpec = FALSE) const; + CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, bool bSimpleFileSpec = false) const; - CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude = TRUE, FX_BOOL bSimpleFileSpec = FALSE) const; + CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, CFX_PtrArray& fields, bool bIncludeOrExclude = true, bool bSimpleFileSpec = false) const; - FX_BOOL ImportFromFDF(const CFDF_Document* pFDFDoc, FX_BOOL bNotify = FALSE); + bool ImportFromFDF(const CFDF_Document* pFDFDoc, bool bNotify = false); - FX_BOOL ResetForm(const CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude = TRUE, FX_BOOL bNotify = FALSE); + bool ResetForm(const CFX_PtrArray& fields, bool bIncludeOrExclude = true, bool bNotify = false); - FX_BOOL ResetForm(FX_BOOL bNotify = FALSE); + bool ResetForm(bool bNotify = false); void ReloadForm(); @@ -907,27 +907,27 @@ public: void SetFormNotify(const CPDF_FormNotify* pNotify); - int GetPageWithWidget(int iCurPage, FX_BOOL bNext); + int GetPageWithWidget(int iCurPage, bool bNext); - FX_BOOL IsUpdated() + bool IsUpdated() { return m_bUpdated; } void ClearUpdatedFlag() { - m_bUpdated = FALSE; + m_bUpdated = false; } - FX_BOOL HasXFAForm() const; + bool HasXFAForm() const; void FixPageFields(const CPDF_Page* pPage); protected: - static FX_BOOL m_bUpdateAP; + static bool m_bUpdateAP; void LoadField(CPDF_Dictionary* pFieldDict, int nLevel = 0); @@ -937,9 +937,9 @@ protected: CPDF_FormControl* AddControl(const CPDF_FormField* pField, const CPDF_Dictionary* pWidgetDict); - void FDF_ImportField(CPDF_Dictionary* pField, const CFX_WideString& parent_name, FX_BOOL bNotify = FALSE, int nLevel = 0); + void FDF_ImportField(CPDF_Dictionary* pField, const CFX_WideString& parent_name, bool bNotify = false, int nLevel = 0); - FX_BOOL ValidateFieldName(CFX_WideString& csNewFieldName, int iType, const CPDF_FormField* pExcludedField, const CPDF_FormControl* pExcludedControl); + bool ValidateFieldName(CFX_WideString& csNewFieldName, int iType, const CPDF_FormField* pExcludedField, const CPDF_FormControl* pExcludedControl); int CompareFieldName(const CFX_WideString& name1, const CFX_WideString& name2); @@ -947,7 +947,7 @@ protected: CPDF_Document* m_pDocument; - FX_BOOL m_bGenerateAP; + bool m_bGenerateAP; CPDF_Dictionary* m_pFormDict; @@ -959,7 +959,7 @@ protected: CPDF_FormNotify* m_pFormNotify; - FX_BOOL m_bUpdated; + bool m_bUpdated; friend class CPDF_FormControl; friend class CPDF_FormField; }; @@ -1018,7 +1018,7 @@ public: m_pDict = pDict; } - FX_BOOL ResetField(FX_BOOL bNotify = FALSE); + bool ResetField(bool bNotify = false); @@ -1075,7 +1075,7 @@ public: CFX_WideString GetDefaultValue(); - FX_BOOL SetValue(const CFX_WideString& value, FX_BOOL bNotify = FALSE); + bool SetValue(const CFX_WideString& value, bool bNotify = false); @@ -1090,13 +1090,13 @@ public: int GetSelectedIndex(int index); - FX_BOOL ClearSelection(FX_BOOL bNotify = FALSE); + bool ClearSelection(bool bNotify = false); - FX_BOOL IsItemSelected(int index); + bool IsItemSelected(int index); - FX_BOOL SetItemSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify = FALSE); + bool SetItemSelection(int index, bool bSelected, bool bNotify = false); - FX_BOOL IsItemDefaultSelected(int index); + bool IsItemDefaultSelected(int index); int GetDefaultSelectedItem(); @@ -1116,7 +1116,7 @@ public: - FX_BOOL CheckControl(int iControlIndex, FX_BOOL bChecked, FX_BOOL bNotify = FALSE); + bool CheckControl(int iControlIndex, bool bChecked, bool bNotify = false); @@ -1130,11 +1130,11 @@ public: int GetSelectedOptionIndex(int index); - FX_BOOL IsOptionSelected(int iOptIndex); + bool IsOptionSelected(int iOptIndex); - FX_BOOL SelectOption(int iOptIndex, FX_BOOL bSelected, FX_BOOL bNotify = FALSE); + bool SelectOption(int iOptIndex, bool bSelected, bool bNotify = false); - FX_BOOL ClearSelectedOptions(FX_BOOL bNotify = FALSE); + bool ClearSelectedOptions(bool bNotify = false); @@ -1169,9 +1169,9 @@ protected: - CFX_WideString GetValue(FX_BOOL bDefault); + CFX_WideString GetValue(bool bDefault); - FX_BOOL SetValue(const CFX_WideString& value, FX_BOOL bDefault, FX_BOOL bNotify); + bool SetValue(const CFX_WideString& value, bool bDefault, bool bNotify); void SyncFieldFlags(); @@ -1186,9 +1186,9 @@ protected: - CFX_WideString GetCheckValue(FX_BOOL bDefault); + CFX_WideString GetCheckValue(bool bDefault); - FX_BOOL SetCheckValue(const CFX_WideString& value, FX_BOOL bDefault, FX_BOOL bNotify); + bool SetCheckValue(const CFX_WideString& value, bool bDefault, bool bNotify); FX_FLOAT m_FontSize; @@ -1225,7 +1225,7 @@ public: - FX_BOOL IsProportionalScale(); + bool IsProportionalScale(); @@ -1235,7 +1235,7 @@ public: - FX_BOOL GetFittingBounds(); + bool GetFittingBounds(); CPDF_Dictionary* m_pDict; @@ -1283,9 +1283,9 @@ public: CFX_WideString GetExportValue(); - FX_BOOL IsChecked(); + bool IsChecked(); - FX_BOOL IsDefaultChecked(); + bool IsDefaultChecked(); @@ -1303,7 +1303,7 @@ public: - FX_BOOL HasMKEntry(CFX_ByteString csEntry); + bool HasMKEntry(CFX_ByteString csEntry); @@ -1434,7 +1434,7 @@ protected: void SetOnStateName(const CFX_ByteString& csOn); - void CheckControl(FX_BOOL bChecked); + void CheckControl(bool bChecked); FX_ARGB GetColor(int& iColorType, CFX_ByteString csEntry); @@ -1446,7 +1446,7 @@ protected: CPDF_Stream* GetIcon(CFX_ByteString csEntry); - CPDF_ApSettings GetMK(FX_BOOL bCreate); + CPDF_ApSettings GetMK(bool bCreate); CPDF_InterForm* m_pForm; @@ -1507,7 +1507,7 @@ public: return 0; } }; -FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); +bool FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict); class CPDF_PageLabel { public: @@ -1559,9 +1559,9 @@ public: ~CPDF_ViewerPreferences(); - FX_BOOL IsDirectionR2L() const; + bool IsDirectionR2L() const; - FX_BOOL PrintScaling() const; + bool PrintScaling() const; int32_t NumCopies() const; @@ -1586,7 +1586,7 @@ public: return m_pDict; } - FX_BOOL HasMKEntry(const CFX_ByteStringC& csEntry); + bool HasMKEntry(const CFX_ByteStringC& csEntry); diff --git a/core/include/fpdfdoc/fpdf_tagged.h b/core/include/fpdfdoc/fpdf_tagged.h index 706f5c04d7..9761e01c60 100644 --- a/core/include/fpdfdoc/fpdf_tagged.h +++ b/core/include/fpdfdoc/fpdf_tagged.h @@ -85,17 +85,17 @@ public: virtual CFX_PtrArray* GetObjectArray() = 0; - virtual CPDF_Object* GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_BOOL bInheritable = FALSE, FX_FLOAT fLevel = 0.0F) = 0; + virtual CPDF_Object* GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, bool bInheritable = false, FX_FLOAT fLevel = 0.0F) = 0; - virtual CFX_ByteString GetName(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, const CFX_ByteStringC& default_value, FX_BOOL bInheritable = FALSE, int subindex = -1) = 0; + virtual CFX_ByteString GetName(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, const CFX_ByteStringC& default_value, bool bInheritable = false, int subindex = -1) = 0; - virtual FX_ARGB GetColor(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_ARGB default_value, FX_BOOL bInheritable = FALSE, int subindex = -1) = 0; + virtual FX_ARGB GetColor(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_ARGB default_value, bool bInheritable = false, int subindex = -1) = 0; - virtual FX_FLOAT GetNumber(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_FLOAT default_value, FX_BOOL bInheritable = FALSE, int subindex = -1) = 0; + virtual FX_FLOAT GetNumber(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_FLOAT default_value, bool bInheritable = false, int subindex = -1) = 0; - virtual int GetInteger(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, int default_value, FX_BOOL bInheritable = FALSE, int subindex = -1) = 0; + virtual int GetInteger(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, int default_value, bool bInheritable = false, int subindex = -1) = 0; }; diff --git a/core/include/fpdfdoc/fpdf_vt.h b/core/include/fpdfdoc/fpdf_vt.h index 4baba41348..7f89e8d31e 100644 --- a/core/include/fpdfdoc/fpdf_vt.h +++ b/core/include/fpdfdoc/fpdf_vt.h @@ -39,12 +39,12 @@ struct CPVT_WordPlace { nSecIndex = nLineIndex = nWordIndex = -1; } - FX_BOOL operator == (const CPVT_WordPlace & wp) const + bool operator == (const CPVT_WordPlace & wp) const { return wp.nSecIndex == nSecIndex && wp.nLineIndex == nLineIndex && wp.nWordIndex == nWordIndex; } - FX_BOOL operator != (const CPVT_WordPlace & wp) const + bool operator != (const CPVT_WordPlace & wp) const { return wp.nSecIndex != nSecIndex || wp.nLineIndex != nLineIndex || wp.nWordIndex != nWordIndex; } @@ -142,12 +142,12 @@ struct CPVT_WordRange { SwapWordPlace(); } - FX_BOOL IsExist() const + bool IsExist() const { return BeginPos != EndPos; } - FX_BOOL operator != (const CPVT_WordRange & wr) const + bool operator != (const CPVT_WordRange & wr) const { return wr.BeginPos != BeginPos || wr.EndPos != EndPos; } @@ -290,7 +290,7 @@ public: virtual int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex) = 0; - virtual FX_BOOL IsLatinWord(FX_WORD word) = 0; + virtual bool IsLatinWord(FX_WORD word) = 0; virtual int32_t GetDefaultFontIndex() = 0; }; @@ -299,27 +299,27 @@ class IPDF_VariableText_Iterator public: virtual ~IPDF_VariableText_Iterator() { } - virtual FX_BOOL NextWord() = 0; + virtual bool NextWord() = 0; - virtual FX_BOOL PrevWord() = 0; + virtual bool PrevWord() = 0; - virtual FX_BOOL NextLine() = 0; + virtual bool NextLine() = 0; - virtual FX_BOOL PrevLine() = 0; + virtual bool PrevLine() = 0; - virtual FX_BOOL NextSection() = 0; + virtual bool NextSection() = 0; - virtual FX_BOOL PrevSection() = 0; + virtual bool PrevSection() = 0; - virtual FX_BOOL GetWord(CPVT_Word & word) const = 0; + virtual bool GetWord(CPVT_Word & word) const = 0; - virtual FX_BOOL SetWord(const CPVT_Word & word) = 0; + virtual bool SetWord(const CPVT_Word & word) = 0; - virtual FX_BOOL GetLine(CPVT_Line & line) const = 0; + virtual bool GetLine(CPVT_Line & line) const = 0; - virtual FX_BOOL GetSection(CPVT_Section & section) const = 0; + virtual bool GetSection(CPVT_Section & section) const = 0; - virtual FX_BOOL SetSection(const CPVT_Section & section) = 0; + virtual bool SetSection(const CPVT_Section & section) = 0; virtual void SetAt(int32_t nWordIndex) = 0; @@ -352,23 +352,23 @@ public: virtual void SetHorzScale(int32_t nHorzScale = 100) = 0; - virtual void SetMultiLine(FX_BOOL bMultiLine = TRUE) = 0; + virtual void SetMultiLine(bool bMultiLine = true) = 0; - virtual void SetAutoReturn(FX_BOOL bAuto = TRUE) = 0; + virtual void SetAutoReturn(bool bAuto = true) = 0; - virtual void SetAutoFontSize(FX_BOOL bAuto = TRUE) = 0; + virtual void SetAutoFontSize(bool bAuto = true) = 0; virtual void SetFontSize(FX_FLOAT fFontSize) = 0; virtual void SetLineLeading(FX_FLOAT fLineLeading) = 0; - virtual void SetRichText(FX_BOOL bRichText) = 0; + virtual void SetRichText(bool bRichText) = 0; virtual void Initialize() = 0; - virtual FX_BOOL IsValid() const = 0; + virtual bool IsValid() const = 0; - virtual FX_BOOL IsRichText() const = 0; + virtual bool IsRichText() const = 0; virtual void RearrangeAll() = 0; @@ -410,7 +410,7 @@ public: virtual int32_t GetLimitChar() const = 0; - virtual FX_BOOL IsMultiLine() const = 0; + virtual bool IsMultiLine() const = 0; virtual int32_t GetHorzScale() const = 0; @@ -440,7 +440,7 @@ public: virtual void UpdateWordPlace(CPVT_WordPlace & place) const = 0; - virtual CPVT_WordPlace AjustLineHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const = 0; + virtual CPVT_WordPlace AjustLineHeader(const CPVT_WordPlace & place, bool bPrevOrNext) const = 0; virtual int32_t WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0; diff --git a/core/include/fpdftext/fpdf_text.h b/core/include/fpdftext/fpdf_text.h index 04922c4b7f..8b54f2d325 100644 --- a/core/include/fpdftext/fpdf_text.h +++ b/core/include/fpdftext/fpdf_text.h @@ -61,9 +61,9 @@ class CPDFText_ParseOptions public: CPDFText_ParseOptions(); - FX_BOOL m_bGetCharCodeOnly; - FX_BOOL m_bNormalizeObjs; - FX_BOOL m_bOutputHyphen; + bool m_bGetCharCodeOnly; + bool m_bNormalizeObjs; + bool m_bOutputHyphen; }; class IPDF_TextPage { @@ -75,12 +75,12 @@ public: static IPDF_TextPage* CreateTextPage(const CPDF_PageObjects* pObjs, int flags = 0); static IPDF_TextPage* CreateReflowTextPage(IPDF_ReflowedPage* pRefPage); - virtual void NormalizeObjects(FX_BOOL bNormalize) = 0; + virtual void NormalizeObjects(bool bNormalize) = 0; - virtual FX_BOOL ParseTextPage() = 0; + virtual bool ParseTextPage() = 0; - virtual FX_BOOL IsParsered() const = 0; + virtual bool IsParsered() const = 0; public: virtual int CharIndexFromTextIndex(int TextIndex) const = 0; @@ -109,11 +109,11 @@ public: virtual void GetRect(int rectIndex, FX_FLOAT& left, FX_FLOAT& top, FX_FLOAT& right, FX_FLOAT &bottom) const = 0; - virtual FX_BOOL GetBaselineRotate(int rectIndex, int& Rotate) = 0; + virtual bool GetBaselineRotate(int rectIndex, int& Rotate) = 0; - virtual FX_BOOL GetBaselineRotate(const CFX_FloatRect& rect, int& Rotate) = 0; + virtual bool GetBaselineRotate(const CFX_FloatRect& rect, int& Rotate) = 0; - virtual int CountBoundedSegments(FX_FLOAT left, FX_FLOAT top, FX_FLOAT right, FX_FLOAT bottom, FX_BOOL bContains = FALSE) = 0; + virtual int CountBoundedSegments(FX_FLOAT left, FX_FLOAT top, FX_FLOAT right, FX_FLOAT bottom, bool bContains = false) = 0; virtual void GetBoundedSegment(int index, int& start, int& count) const = 0; @@ -134,11 +134,11 @@ public: static IPDF_TextPageFind* CreatePageFind(const IPDF_TextPage* pTextPage); public: - virtual FX_BOOL FindFirst(const CFX_WideString& findwhat, int flags, int startPos = 0) = 0; + virtual bool FindFirst(const CFX_WideString& findwhat, int flags, int startPos = 0) = 0; - virtual FX_BOOL FindNext() = 0; + virtual bool FindNext() = 0; - virtual FX_BOOL FindPrev() = 0; + virtual bool FindPrev() = 0; virtual void GetRectArray(CFX_RectArray& rects) const = 0; @@ -154,7 +154,7 @@ public: static IPDF_LinkExtract* CreateLinkExtract(); - virtual FX_BOOL ExtractLinks(const IPDF_TextPage* pTextPage) = 0; + virtual bool ExtractLinks(const IPDF_TextPage* pTextPage) = 0; public: virtual int CountLinks() const = 0; diff --git a/core/include/fxcodec/fx_codec.h b/core/include/fxcodec/fx_codec.h index e3d69e5dc9..553900870c 100644 --- a/core/include/fxcodec/fx_codec.h +++ b/core/include/fxcodec/fx_codec.h @@ -51,9 +51,9 @@ class ICodec_BasicModule public: virtual ~ICodec_BasicModule() {} - virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, + virtual 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, uint8_t*& dest_buf, + virtual bool A85Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size) = 0; virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc) = 0; @@ -70,7 +70,7 @@ public: virtual uint8_t* GetScanline(int line) = 0; - virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) = 0; + virtual bool SkipToScanline(int line, IFX_Pause* pPause) = 0; virtual int GetWidth() = 0; @@ -80,7 +80,7 @@ public: virtual int GetBPC() = 0; - virtual FX_BOOL IsColorTransformed() = 0; + virtual bool IsColorTransformed() = 0; virtual void ClearImageData() = 0; }; @@ -91,13 +91,13 @@ public: virtual ~ICodec_FlateModule() {} 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, + virtual FX_DWORD FlateOrLZWDecode(bool bLZW, const uint8_t* src_buf, FX_DWORD src_size, bool bEarlyChange, int predictor, int Colors, int BitsPerComponent, int Columns, 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, + virtual bool Encode(const uint8_t* src_buf, FX_DWORD src_size, int predictor, int Colors, int BitsPerComponent, int Columns, 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; + virtual bool Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size) = 0; }; class ICodec_FaxModule { @@ -106,10 +106,10 @@ public: virtual ~ICodec_FaxModule() {} 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; + int K, bool EndOfLine, bool EncodedByteAlign, bool BlackIs1, int Columns, int Rows) = 0; - virtual FX_BOOL Encode(const uint8_t* src_buf, int width, int height, int pitch, + virtual 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 @@ -121,13 +121,13 @@ public: virtual void SetPovider(IFX_JpegProvider* pJP) = 0; virtual ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, - int width, int height, int nComps, FX_BOOL ColorTransform) = 0; + int width, int height, int nComps, bool ColorTransform) = 0; - 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, + virtual bool LoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width, int& height, + int& num_components, int& bits_per_components, bool& color_transform, uint8_t** icc_buf_ptr = NULL, FX_DWORD* icc_length = NULL) = 0; - virtual FX_BOOL Encode(const class CFX_DIBSource* pSource, uint8_t*& dest_buf, FX_STRSIZE& dest_size, int quality = 75, + virtual 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; @@ -142,7 +142,7 @@ public: virtual int StartScanline(void* pContext, int down_scale) = 0; - virtual FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf) = 0; + virtual bool ReadScanline(void* pContext, uint8_t* dest_buf) = 0; virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr = NULL) = 0; @@ -153,13 +153,13 @@ public: virtual ~ICodec_JpxModule() {} - virtual void* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, FX_BOOL useColorSpace = FALSE) = 0; + virtual void* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, bool useColorSpace = false) = 0; virtual void GetImageInfo(void* ctx, FX_DWORD& width, FX_DWORD& height, FX_DWORD& codestream_nComps, FX_DWORD& output_nComps) = 0; - virtual FX_BOOL Decode(void* ctx, uint8_t* dest_data, int pitch, - FX_BOOL bTranslateColor, uint8_t* offsets) = 0; + virtual bool Decode(void* ctx, uint8_t* dest_data, int pitch, + bool bTranslateColor, uint8_t* offsets) = 0; virtual void DestroyDecoder(void* ctx) = 0; }; @@ -169,10 +169,10 @@ public: virtual ~ICodec_Jbig2Module() {} - virtual FX_BOOL Decode(FX_DWORD width, FX_DWORD height, const uint8_t* src_buf, FX_DWORD src_size, + virtual 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, + virtual bool Decode(IFX_FileRead* file_ptr, FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, uint8_t*& dest_buf) = 0; virtual void* CreateJbig2Context() = 0; @@ -251,6 +251,6 @@ public: }; 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(const void* buf, FX_DWORD dwSize, uint8_t ID[16]); +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 0b238b780e..ac69f9a7fe 100644 --- a/core/include/fxcodec/fx_codec_provider.h +++ b/core/include/fxcodec/fx_codec_provider.h @@ -14,25 +14,25 @@ class IFX_JpegProvider public: virtual void Release() = 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* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height, int nComps, bool ColorTransform) = 0; virtual void DestroyDecoder(void* pDecoder) = 0; virtual void DownScale(void* pDecoder, int dest_width, int dest_height) = 0; - virtual FX_BOOL Rewind(void* pDecoder) = 0; + virtual bool Rewind(void* pDecoder) = 0; virtual uint8_t* GetNextLine(void* pDecoder) = 0; virtual FX_DWORD GetSrcOffset(void* pDecoder) = 0; - 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, + virtual bool LoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width, int& height, + int& num_components, int& bits_per_components, bool& color_transform, uint8_t** icc_buf_ptr = NULL, FX_DWORD* icc_length = NULL) = 0; - virtual FX_BOOL Encode(const class CFX_DIBSource* pSource, uint8_t*& dest_buf, FX_STRSIZE& dest_size, int quality = 75, + virtual 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; @@ -47,7 +47,7 @@ public: virtual int StartScanline(void* pContext, int down_scale) = 0; - virtual FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf) = 0; + virtual bool ReadScanline(void* pContext, uint8_t* dest_buf) = 0; virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr = NULL) = 0; diff --git a/core/include/fxcrt/fx_arb.h b/core/include/fxcrt/fx_arb.h index 7ce21e5086..5c4173822e 100644 --- a/core/include/fxcrt/fx_arb.h +++ b/core/include/fxcrt/fx_arb.h @@ -15,9 +15,9 @@ public: static IFX_BidiChar* Create(); virtual ~IFX_BidiChar() {} - virtual void SetPolicy(FX_BOOL bSeparateNeutral = TRUE) = 0; - virtual FX_BOOL AppendChar(FX_WCHAR wch) = 0; - virtual FX_BOOL EndChar() = 0; + virtual void SetPolicy(bool bSeparateNeutral = true) = 0; + virtual bool AppendChar(FX_WCHAR wch) = 0; + virtual bool EndChar() = 0; virtual int32_t GetBidiInfo(int32_t &iStart, int32_t &iCount) = 0; virtual void Reset() = 0; }; diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h index d575df6e67..c272eb54ec 100644 --- a/core/include/fxcrt/fx_basic.h +++ b/core/include/fxcrt/fx_basic.h @@ -218,9 +218,9 @@ public: CFX_ArchiveLoader& operator >> (CFX_WideString& wstr); - FX_BOOL IsEOF(); + bool IsEOF(); - FX_BOOL Read(void* pBuf, FX_DWORD dwSize); + bool Read(void* pBuf, FX_DWORD dwSize); protected: FX_DWORD m_LoadingPos; @@ -239,7 +239,7 @@ public: virtual void Clear(); - FX_BOOL Flush(); + bool Flush(); int32_t AppendBlock(const void* pBuf, size_t size); @@ -252,7 +252,7 @@ public: protected: - virtual FX_BOOL DoWork(const void* pBuf, size_t size) = 0; + virtual bool DoWork(const void* pBuf, size_t size) = 0; FX_STRSIZE m_BufSize; @@ -269,18 +269,18 @@ public: void Clear() override; - FX_BOOL AttachFile(IFX_StreamWrite *pFile, FX_BOOL bTakeover = FALSE); + bool AttachFile(IFX_StreamWrite *pFile, bool bTakeover = false); - FX_BOOL AttachFile(const FX_WCHAR* filename); + bool AttachFile(const FX_WCHAR* filename); - FX_BOOL AttachFile(const FX_CHAR* filename); + bool AttachFile(const FX_CHAR* filename); private: - FX_BOOL DoWork(const void* pBuf, size_t size) override; + bool DoWork(const void* pBuf, size_t size) override; IFX_StreamWrite* m_pFile; - FX_BOOL m_bTakeover; + bool m_bTakeover; }; struct CFX_CharMap { @@ -362,17 +362,17 @@ protected: ~CFX_BasicArray(); - FX_BOOL SetSize(int nNewSize); + bool SetSize(int nNewSize); - FX_BOOL Append(const CFX_BasicArray& src); + bool Append(const CFX_BasicArray& src); - FX_BOOL Copy(const CFX_BasicArray& src); + bool Copy(const CFX_BasicArray& src); uint8_t* InsertSpaceAt(int nIndex, int nCount); - FX_BOOL RemoveAt(int nIndex, int nCount); + bool RemoveAt(int nIndex, int nCount); - FX_BOOL InsertAt(int nStartIndex, const CFX_BasicArray* pNewArray); + bool InsertAt(int nStartIndex, const CFX_BasicArray* pNewArray); const void* GetDataPtr(int index) const; protected: @@ -401,7 +401,7 @@ public: return m_nSize - 1; } - FX_BOOL SetSize(int nNewSize) + bool SetSize(int nNewSize) { return CFX_BasicArray::SetSize(nNewSize); } @@ -419,13 +419,13 @@ public: return ((const TYPE*)m_pData)[nIndex]; } - FX_BOOL SetAt(int nIndex, TYPE newElement) + bool SetAt(int nIndex, TYPE newElement) { if (nIndex < 0 || nIndex >= m_nSize) { - return FALSE; + return false; } ((TYPE*)m_pData)[nIndex] = newElement; - return TRUE; + return true; } TYPE& ElementAt(int nIndex) @@ -446,36 +446,36 @@ public: return (TYPE*)m_pData; } - FX_BOOL SetAtGrow(int nIndex, TYPE newElement) + bool SetAtGrow(int nIndex, TYPE newElement) { if (nIndex < 0) { - return FALSE; + return false; } if (nIndex >= m_nSize) if (!SetSize(nIndex + 1)) { - return FALSE; + return false; } ((TYPE*)m_pData)[nIndex] = newElement; - return TRUE; + return true; } - FX_BOOL Add(TYPE newElement) + bool Add(TYPE newElement) { if (m_nSize < m_nMaxSize) { m_nSize ++; } else if (!SetSize(m_nSize + 1)) { - return FALSE; + return false; } ((TYPE*)m_pData)[m_nSize - 1] = newElement; - return TRUE; + return true; } - FX_BOOL Append(const CFX_ArrayTemplate& src) + bool Append(const CFX_ArrayTemplate& src) { return CFX_BasicArray::Append(src); } - FX_BOOL Copy(const CFX_ArrayTemplate& src) + bool Copy(const CFX_ArrayTemplate& src) { return CFX_BasicArray::Copy(src); } @@ -511,23 +511,23 @@ public: return ((TYPE*)m_pData)[nIndex]; } - FX_BOOL InsertAt(int nIndex, TYPE newElement, int nCount = 1) + bool InsertAt(int nIndex, TYPE newElement, int nCount = 1) { if (!InsertSpaceAt(nIndex, nCount)) { - return FALSE; + return false; } while (nCount--) { ((TYPE*)m_pData)[nIndex++] = newElement; } - return TRUE; + return true; } - FX_BOOL RemoveAt(int nIndex, int nCount = 1) + bool RemoveAt(int nIndex, int nCount = 1) { return CFX_BasicArray::RemoveAt(nIndex, nCount); } - FX_BOOL InsertAt(int nStartIndex, const CFX_BasicArray* pNewArray) + bool InsertAt(int nStartIndex, const CFX_BasicArray* pNewArray) { return CFX_BasicArray::InsertAt(nStartIndex, pNewArray); } @@ -700,7 +700,7 @@ public: return m_UnitSize; } - void* Iterate(FX_BOOL (*callback)(void* param, void* pData), void* param) const; + void* Iterate(bool (*callback)(void* param, void* pData), void* param) const; private: int m_UnitSize; @@ -715,8 +715,8 @@ 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(const uint8_t* pSegment, int count, FX_BOOL (*callback)(void* param, void* pData), void* param) const; + void* IterateIndex(int level, int& start, void** pIndex, bool (*callback)(void* param, void* pData), void* param) const; + void* IterateSegment(const uint8_t* pSegment, int count, bool (*callback)(void* param, void* pData), void* param) const; }; template class CFX_SegmentedArray : public CFX_BaseSegmentedArray @@ -798,12 +798,12 @@ public: return m_nCount; } - FX_BOOL IsEmpty() const + bool IsEmpty() const { return m_nCount == 0; } - FX_BOOL Lookup(void* key, void*& rValue) const; + bool Lookup(void* key, void*& rValue) const; void* GetValueAt(void* key) const; @@ -814,7 +814,7 @@ public: (*this)[key] = newValue; } - FX_BOOL RemoveKey(void* key); + bool RemoveKey(void* key); void RemoveAll(); @@ -830,7 +830,7 @@ public: return m_nHashTableSize; } - void InitHashTable(FX_DWORD hashSize, FX_BOOL bAllocNow = TRUE); + void InitHashTable(FX_DWORD hashSize, bool bAllocNow = true); protected: CAssoc** m_pHashTable; @@ -858,7 +858,7 @@ class CFX_CMapDWordToDWord { public: - FX_BOOL Lookup(FX_DWORD key, FX_DWORD& value) const; + bool Lookup(FX_DWORD key, FX_DWORD& value) const; void SetAt(FX_DWORD key, FX_DWORD value); @@ -893,12 +893,12 @@ public: return m_nCount; } - FX_BOOL IsEmpty() const + bool IsEmpty() const { return m_nCount == 0; } - FX_BOOL Lookup(const CFX_ByteStringC& key, void*& rValue) const; + bool Lookup(const CFX_ByteStringC& key, void*& rValue) const; void*& operator[](const CFX_ByteStringC& key); @@ -907,7 +907,7 @@ public: (*this)[key] = newValue; } - FX_BOOL RemoveKey(const CFX_ByteStringC& key); + bool RemoveKey(const CFX_ByteStringC& key); void RemoveAll(); @@ -925,7 +925,7 @@ public: return m_nHashTableSize; } - void InitHashTable(FX_DWORD hashSize, FX_BOOL bAllocNow = TRUE); + void InitHashTable(FX_DWORD hashSize, bool bAllocNow = true); FX_DWORD HashKey(const CFX_ByteStringC& key) const; protected: @@ -966,7 +966,7 @@ public: void* GetNextValue(FX_POSITION& rNextPosition) const; - FX_BOOL Lookup(const CFX_ByteStringC& key, void*& rValue) const; + bool Lookup(const CFX_ByteStringC& key, void*& rValue) const; void SetAt(const CFX_ByteStringC& key, void* value); @@ -1090,7 +1090,7 @@ struct FX_PRIVATEDATA { PD_CALLBACK_FREEDATA m_pCallback; - FX_BOOL m_bSelfDestruct; + bool m_bSelfDestruct; }; class CFX_PrivateData { @@ -1106,27 +1106,27 @@ public: void* GetPrivateData(void* module_id); - FX_BOOL LookupPrivateData(void* module_id, void* &pData) const + bool LookupPrivateData(void* module_id, void* &pData) const { if (!module_id) { - return FALSE; + return false; } FX_DWORD nCount = m_DataList.GetSize(); for (FX_DWORD n = 0; n < nCount; n ++) { if (m_DataList[n].m_pModuleId == module_id) { pData = m_DataList[n].m_pData; - return TRUE; + return true; } } - return FALSE; + return false; } - FX_BOOL RemovePrivateData(void* module_id); + bool RemovePrivateData(void* module_id); protected: CFX_ArrayTemplate m_DataList; - void AddData(void* module_id, void* pData, PD_CALLBACK_FREEDATA callback, FX_BOOL bSelfDestruct); + void AddData(void* module_id, void* pData, PD_CALLBACK_FREEDATA callback, bool bSelfDestruct); }; class CFX_BitStream { @@ -1139,7 +1139,7 @@ public: void ByteAlign(); - FX_BOOL IsEOF() + bool IsEOF() { return m_BitPos >= m_BitSize; } @@ -1252,12 +1252,12 @@ public: return m_pObject; } - FX_BOOL IsNull() const + bool IsNull() const { return m_pObject == NULL; } - FX_BOOL NotNull() const + bool NotNull() const { return m_pObject != NULL; } @@ -1288,7 +1288,7 @@ public: m_pObject = NULL; } - FX_BOOL operator == (const Ref& ref) const + bool operator == (const Ref& ref) const { return m_pObject == ref.m_pObject; } @@ -1300,7 +1300,7 @@ class IFX_Pause { public: virtual ~IFX_Pause() { } - virtual FX_BOOL NeedToPauseNow() = 0; + virtual bool NeedToPauseNow() = 0; }; class CFX_DataFilter { @@ -1310,7 +1310,7 @@ public: void SetDestFilter(CFX_DataFilter* pFilter); - FX_BOOL IsEOF() const + bool IsEOF() const { return m_bEOF; } @@ -1330,7 +1330,7 @@ protected: virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) = 0; void ReportEOF(FX_DWORD left_input); - FX_BOOL m_bEOF; + bool m_bEOF; FX_DWORD m_SrcPos; diff --git a/core/include/fxcrt/fx_coordinates.h b/core/include/fxcrt/fx_coordinates.h index 3689a4b270..6edaf53f0b 100644 --- a/core/include/fxcrt/fx_coordinates.h +++ b/core/include/fxcrt/fx_coordinates.h @@ -68,11 +68,11 @@ public: y /= lamda; return *this; } - friend FX_BOOL operator == (const FXT_PSV &obj1, const FXT_PSV &obj2) + friend bool operator == (const FXT_PSV &obj1, const FXT_PSV &obj2) { return obj1.x == obj2.x && obj1.y == obj2.y; } - friend FX_BOOL operator != (const FXT_PSV &obj1, const FXT_PSV &obj2) + friend bool operator != (const FXT_PSV &obj1, const FXT_PSV &obj2) { return obj1.x != obj2.x || obj1.y != obj2.y; } @@ -174,21 +174,21 @@ public: { return FXT_PSV::x * v.x + FXT_PSV::y * v.y; } - FX_BOOL IsParallel(baseType otherx, baseType othery) const + bool IsParallel(baseType otherx, baseType othery) const { baseType t = FXT_PSV::x * othery - FXT_PSV::y * otherx; return FXSYS_fabs(t) < 0x0001f; } - FX_BOOL IsParallel(const FXT_VECTOR &v) const + bool IsParallel(const FXT_VECTOR &v) const { return IsParallel(v.x, v.y); } - FX_BOOL IsPerpendicular(baseType otherx, baseType othery) const + bool IsPerpendicular(baseType otherx, baseType othery) const { baseType t = DotProduct(otherx, othery); return FXSYS_fabs(t) < 0x0001f; } - FX_BOOL IsPerpendicular(const FXT_VECTOR &v) const + bool IsPerpendicular(const FXT_VECTOR &v) const { return IsPerpendicular(v.x, v.y); } @@ -340,11 +340,11 @@ public: { Deflate(rt.left, rt.top, rt.top + rt.width, rt.top + rt.height); } - FX_BOOL IsEmpty() const + bool IsEmpty() const { return width <= 0 || height <= 0; } - FX_BOOL IsEmpty(FX_FLOAT fEpsilon) const + bool IsEmpty(FX_FLOAT fEpsilon) const { return width <= fEpsilon || height <= fEpsilon; } @@ -352,15 +352,15 @@ public: { width = height = 0; } - FX_BOOL Contains(baseType x, baseType y) const + bool Contains(baseType x, baseType y) const { return x >= left && x < left + width && y >= top && y < top + height; } - FX_BOOL Contains(const FXT_POINT &p) const + bool Contains(const FXT_POINT &p) const { return Contains(p.x, p.y); } - FX_BOOL Contains(const FXT_RECT &rt) const + bool Contains(const FXT_RECT &rt) const { return rt.left >= left && rt.right() <= right() && rt.top >= top && rt.bottom() <= bottom(); } @@ -501,23 +501,23 @@ public: width = r - left; height = b - top; } - FX_BOOL IntersectWith(const FXT_RECT &rt) const + bool IntersectWith(const FXT_RECT &rt) const { FXT_RECT rect = rt; rect.Intersect(*this); return !rect.IsEmpty(); } - FX_BOOL IntersectWith(const FXT_RECT &rt, FX_FLOAT fEpsilon) const + bool IntersectWith(const FXT_RECT &rt, FX_FLOAT fEpsilon) const { FXT_RECT rect = rt; rect.Intersect(*this); return !rect.IsEmpty(fEpsilon); } - friend FX_BOOL operator == (const FXT_RECT &rc1, const FXT_RECT &rc2) + friend bool operator == (const FXT_RECT &rc1, const FXT_RECT &rc2) { return rc1.left == rc2.left && rc1.top == rc2.top && rc1.width == rc2.width && rc1.height == rc2.height; } - friend FX_BOOL operator != (const FXT_RECT &rc1, const FXT_RECT &rc2) + friend bool operator != (const FXT_RECT &rc1, const FXT_RECT &rc2) { return rc1.left != rc2.left || rc1.top != rc2.top || rc1.width != rc2.width || rc1.height != rc2.height; } @@ -561,7 +561,7 @@ struct FX_RECT { return bottom - top; } - FX_BOOL IsEmpty() const + bool IsEmpty() const { return right <= left || bottom <= top; } @@ -577,7 +577,7 @@ struct FX_RECT { void Union(const FX_RECT& other_rect); - FX_BOOL operator == (const FX_RECT& src) const + bool operator == (const FX_RECT& src) const { return left == src.left && right == src.right && top == src.top && bottom == src.bottom; } @@ -590,12 +590,12 @@ struct FX_RECT { bottom += dy; } - FX_BOOL Contains(const FX_RECT& other_rect) const + bool Contains(const FX_RECT& other_rect) const { return other_rect.left >= left && other_rect.right <= right && other_rect.top >= top && other_rect.bottom <= bottom; } - FX_BOOL Contains(int x, int y) const + bool Contains(int x, int y) const { return x >= left && x < right && y >= top && y < bottom; } @@ -637,7 +637,7 @@ public: CFX_FloatRect(const FX_RECT& rect); - FX_BOOL IsEmpty() const + bool IsEmpty() const { return left >= right || bottom >= top; } @@ -649,9 +649,9 @@ public: left = right = bottom = top = 0; } - FX_BOOL Contains(const CFX_FloatRect& other_rect) const; + bool Contains(const CFX_FloatRect& other_rect) const; - FX_BOOL Contains(FX_FLOAT x, FX_FLOAT y) const; + bool Contains(FX_FLOAT x, FX_FLOAT y) const; void Transform(const CFX_Matrix* pMatrix); @@ -786,11 +786,11 @@ public: void SetReverse(const CFX_Matrix &m); - void Concat(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, FX_BOOL bPrepended = FALSE); + void Concat(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, bool bPrepended = false); - void Concat(const CFX_Matrix &m, FX_BOOL bPrepended = FALSE); + void Concat(const CFX_Matrix &m, bool bPrepended = false); - void ConcatInverse(const CFX_Matrix& m, FX_BOOL bPrepended = FALSE); + void ConcatInverse(const CFX_Matrix& m, bool bPrepended = false); void Reset() { SetIdentity(); @@ -801,30 +801,30 @@ public: *this = m; } - FX_BOOL IsIdentity() const + bool IsIdentity() const { return a == 1 && b == 0 && c == 0 && d == 1 && e == 0 && f == 0; } - FX_BOOL IsInvertible() const; + bool IsInvertible() const; - FX_BOOL Is90Rotated() const; + bool Is90Rotated() const; - FX_BOOL IsScaled() const; + bool IsScaled() const; - void Translate(FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended = FALSE); + void Translate(FX_FLOAT x, FX_FLOAT y, bool bPrepended = false); - void TranslateI(int32_t x, int32_t y, FX_BOOL bPrepended = FALSE) + void TranslateI(int32_t x, int32_t y, bool bPrepended = false) { Translate((FX_FLOAT)x, (FX_FLOAT)y, bPrepended); } - void Scale(FX_FLOAT sx, FX_FLOAT sy, FX_BOOL bPrepended = FALSE); + void Scale(FX_FLOAT sx, FX_FLOAT sy, bool bPrepended = false); - void Rotate(FX_FLOAT fRadian, FX_BOOL bPrepended = FALSE); + void Rotate(FX_FLOAT fRadian, bool bPrepended = false); - void RotateAt(FX_FLOAT fRadian, FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended = FALSE); + void RotateAt(FX_FLOAT fRadian, FX_FLOAT x, FX_FLOAT y, bool bPrepended = false); - void Shear(FX_FLOAT fAlphaRadian, FX_FLOAT fBetaRadian, FX_BOOL bPrepended = FALSE); + void Shear(FX_FLOAT fAlphaRadian, FX_FLOAT fBetaRadian, bool bPrepended = false); void MatchRect(const CFX_FloatRect &dest, const CFX_FloatRect &src); diff --git a/core/include/fxcrt/fx_ext.h b/core/include/fxcrt/fx_ext.h index f24f4549a3..a04fc529be 100644 --- a/core/include/fxcrt/fx_ext.h +++ b/core/include/fxcrt/fx_ext.h @@ -21,11 +21,11 @@ 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) +inline bool FXSYS_islower(int32_t ch) { return ch >= 'a' && ch <= 'z'; } -inline FX_BOOL FXSYS_isupper(int32_t ch) +inline bool FXSYS_isupper(int32_t ch) { return ch >= 'A' && ch <= 'Z'; } @@ -38,8 +38,8 @@ inline int32_t FXSYS_toupper(int32_t ch) return ch < 'a' || ch > 'z' ? ch : (ch - 0x20); } -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); +FX_DWORD FX_HashCode_String_GetA(const FX_CHAR* pStr, int32_t iLength, bool bIgnoreCase = false); +FX_DWORD FX_HashCode_String_GetW(const FX_WCHAR* pStr, int32_t iLength, bool bIgnoreCase = false); #ifdef __cplusplus } diff --git a/core/include/fxcrt/fx_stream.h b/core/include/fxcrt/fx_stream.h index fdd7b11fee..b05e84d83c 100644 --- a/core/include/fxcrt/fx_stream.h +++ b/core/include/fxcrt/fx_stream.h @@ -11,8 +11,8 @@ 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); +bool FX_GetNextFile(void* handle, CFX_ByteString& filename, bool& bFolder); +bool FX_GetNextFile(void* handle, CFX_WideString& filename, bool& bFolder); void FX_CloseFolder(void* handle); FX_WCHAR FX_GetFolderSeparator(); typedef struct FX_HFILE_ { @@ -53,23 +53,23 @@ size_t FX_File_Read(FX_HFILE hFile, void* pBuffer, size_t szBuffer); size_t FX_File_ReadPos(FX_HFILE hFile, void* pBuffer, size_t szBuffer, FX_FILESIZE pos); size_t FX_File_Write(FX_HFILE hFile, const void* pBuffer, size_t szBuffer); size_t FX_File_WritePos(FX_HFILE hFile, const void* pBuffer, size_t szBuffer, FX_FILESIZE pos); -FX_BOOL FX_File_Flush(FX_HFILE hFile); -FX_BOOL FX_File_Truncate(FX_HFILE hFile, FX_FILESIZE szFile); -FX_BOOL FX_File_Exist(const CFX_ByteStringC& fileName); -FX_BOOL FX_File_Exist(const CFX_WideStringC& fileName); -FX_BOOL FX_File_Delete(const CFX_ByteStringC& fileName); -FX_BOOL FX_File_Delete(const CFX_WideStringC& fileName); -FX_BOOL FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst); -FX_BOOL FX_File_Copy(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst); -FX_BOOL FX_File_Move(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst); -FX_BOOL FX_File_Move(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst); +bool FX_File_Flush(FX_HFILE hFile); +bool FX_File_Truncate(FX_HFILE hFile, FX_FILESIZE szFile); +bool FX_File_Exist(const CFX_ByteStringC& fileName); +bool FX_File_Exist(const CFX_WideStringC& fileName); +bool FX_File_Delete(const CFX_ByteStringC& fileName); +bool FX_File_Delete(const CFX_WideStringC& fileName); +bool FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst); +bool FX_File_Copy(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst); +bool FX_File_Move(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst); +bool FX_File_Move(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst); class IFX_StreamWrite { public: virtual ~IFX_StreamWrite() { } virtual void Release() = 0; - virtual FX_BOOL WriteBlock(const void* pData, size_t size) = 0; + virtual bool WriteBlock(const void* pData, size_t size) = 0; }; class IFX_FileWrite : public IFX_StreamWrite { @@ -79,10 +79,10 @@ public: virtual FX_FILESIZE GetSize() = 0; - virtual FX_BOOL Flush() = 0; + virtual bool Flush() = 0; - virtual FX_BOOL WriteBlock(const void* pData, FX_FILESIZE offset, size_t size) = 0; - virtual FX_BOOL WriteBlock(const void* pData, size_t size) + virtual bool WriteBlock(const void* pData, FX_FILESIZE offset, size_t size) = 0; + virtual bool WriteBlock(const void* pData, size_t size) { return WriteBlock(pData, GetSize(), size); } @@ -96,7 +96,7 @@ public: virtual void Release() = 0; - virtual FX_BOOL IsEOF() = 0; + virtual bool IsEOF() = 0; virtual FX_FILESIZE GetPosition() = 0; @@ -109,9 +109,9 @@ public: virtual FX_FILESIZE GetSize() = 0; - virtual FX_BOOL IsEOF() + virtual bool IsEOF() { - return FALSE; + return false; } virtual FX_FILESIZE GetPosition() @@ -119,14 +119,14 @@ public: return 0; } - virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size) + virtual bool SetRange(FX_FILESIZE offset, FX_FILESIZE size) { - return FALSE; + return false; } virtual void ClearRange() {} - virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) = 0; + virtual bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) = 0; virtual size_t ReadBlock(void* buffer, size_t size) { @@ -145,21 +145,21 @@ public: virtual FX_FILESIZE GetSize() = 0; - virtual FX_BOOL IsEOF() = 0; + virtual bool IsEOF() = 0; virtual FX_FILESIZE GetPosition() = 0; - virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) = 0; + virtual bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) = 0; virtual size_t ReadBlock(void* buffer, size_t size) = 0; - virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) = 0; - virtual FX_BOOL WriteBlock(const void* buffer, size_t size) + virtual bool WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) = 0; + virtual bool WriteBlock(const void* buffer, size_t size) { return WriteBlock(buffer, GetSize(), size); } - virtual FX_BOOL Flush() = 0; + virtual bool Flush() = 0; }; IFX_FileStream* FX_CreateFileStream(const FX_CHAR* filename, FX_DWORD dwModes); IFX_FileStream* FX_CreateFileStream(const FX_WCHAR* filename, FX_DWORD dwModes); @@ -167,31 +167,31 @@ class IFX_MemoryStream : public IFX_FileStream { public: - virtual FX_BOOL IsConsecutive() const = 0; + virtual bool IsConsecutive() const = 0; virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) = 0; virtual uint8_t* GetBuffer() const = 0; - virtual void AttachBuffer(uint8_t* pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE) = 0; + virtual void AttachBuffer(uint8_t* pBuffer, size_t nSize, bool bTakeOver = false) = 0; virtual void DetachBuffer() = 0; }; -IFX_MemoryStream* FX_CreateMemoryStream(uint8_t* pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE); -IFX_MemoryStream* FX_CreateMemoryStream(FX_BOOL bConsecutive = FALSE); +IFX_MemoryStream* FX_CreateMemoryStream(uint8_t* pBuffer, size_t nSize, bool bTakeOver = false); +IFX_MemoryStream* FX_CreateMemoryStream(bool bConsecutive = false); class IFX_BufferRead : public IFX_StreamRead { public: virtual void Release() = 0; - virtual FX_BOOL IsEOF() = 0; + virtual bool IsEOF() = 0; virtual FX_FILESIZE GetPosition() = 0; virtual size_t ReadBlock(void* buffer, size_t size) = 0; - virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) = 0; + virtual bool ReadNextBlock(bool bRestart = false) = 0; virtual const uint8_t* GetBlockBuffer() = 0; diff --git a/core/include/fxcrt/fx_string.h b/core/include/fxcrt/fx_string.h index 8d73555814..736aa32239 100644 --- a/core/include/fxcrt/fx_string.h +++ b/core/include/fxcrt/fx_string.h @@ -670,7 +670,7 @@ public: void Empty(); - FX_BOOL IsEmpty() const + bool IsEmpty() const { return !GetLength(); } @@ -895,7 +895,7 @@ inline bool operator!= (const CFX_WideStringC& lhs, const CFX_WideString& rhs) { return rhs != lhs; } FX_FLOAT FX_atof(const CFX_ByteStringC& str); -void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData); +void FX_atonum(const CFX_ByteStringC& str, bool& bInteger, void* pData); 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(const CFX_WideStringC& wsStr) diff --git a/core/include/fxcrt/fx_system.h b/core/include/fxcrt/fx_system.h index 8bc2b4ab2a..9fcaf171bc 100644 --- a/core/include/fxcrt/fx_system.h +++ b/core/include/fxcrt/fx_system.h @@ -71,7 +71,6 @@ typedef void* FX_POSITION; // Keep until fxcrt containers gone typedef unsigned short FX_WORD; // Keep - "an efficient small type" typedef unsigned int FX_DWORD; // Keep - "an efficient type" typedef float FX_FLOAT; // Keep, allow upgrade to doubles. -typedef int FX_BOOL; // Keep, sadly not always 0 or 1. typedef char FX_CHAR; // Keep, questionable signedness. typedef wchar_t FX_WCHAR; // Keep, maybe bad platform wchars. @@ -84,14 +83,6 @@ typedef int FX_STRSIZE; #define _DEBUG #endif -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - #ifndef NULL #define NULL 0 #endif diff --git a/core/include/fxcrt/fx_ucd.h b/core/include/fxcrt/fx_ucd.h index 7b730bb81a..d9b57811c6 100644 --- a/core/include/fxcrt/fx_ucd.h +++ b/core/include/fxcrt/fx_ucd.h @@ -92,11 +92,11 @@ enum FX_CHARTYPE { FX_CHARTYPE_Arabic = (12 << FX_CHARTYPEBITS), }; FX_DWORD FX_GetUnicodeProperties(FX_WCHAR wch); -FX_BOOL FX_IsCtrlCode(FX_WCHAR ch); -FX_BOOL FX_IsRotationCode(FX_WCHAR ch); -FX_BOOL FX_IsCombinationChar(FX_WCHAR wch); -FX_BOOL FX_IsBidiChar(FX_WCHAR wch); -FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_BOOL bRTL, FX_BOOL bVertical); -FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_DWORD dwProps, FX_BOOL bRTL, FX_BOOL bVertical); +bool FX_IsCtrlCode(FX_WCHAR ch); +bool FX_IsRotationCode(FX_WCHAR ch); +bool FX_IsCombinationChar(FX_WCHAR wch); +bool FX_IsBidiChar(FX_WCHAR wch); +FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, bool bRTL, bool bVertical); +FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_DWORD dwProps, bool bRTL, bool bVertical); #endif // CORE_INCLUDE_FXCRT_FX_UCD_H_ diff --git a/core/include/fxcrt/fx_xml.h b/core/include/fxcrt/fx_xml.h index ba33b2083a..233a8f9bb6 100644 --- a/core/include/fxcrt/fx_xml.h +++ b/core/include/fxcrt/fx_xml.h @@ -38,21 +38,21 @@ public: class CXML_Content { public: - CXML_Content() : m_bCDATA(FALSE), m_Content() {} - void Set(FX_BOOL bCDATA, const CFX_WideStringC& content) + CXML_Content() : m_bCDATA(false), m_Content() {} + void Set(bool bCDATA, const CFX_WideStringC& content) { m_bCDATA = bCDATA; m_Content = content; } - FX_BOOL m_bCDATA; + bool m_bCDATA; CFX_WideString m_Content; }; class CXML_Element { public: - static CXML_Element* Parse(const void* pBuffer, size_t size, FX_BOOL bSaveSpaceChars = FALSE, FX_FILESIZE* pParsedSize = NULL); - static CXML_Element* Parse(IFX_FileRead *pFile, FX_BOOL bSaveSpaceChars = FALSE, FX_FILESIZE* pParsedSize = NULL); - static CXML_Element* Parse(IFX_BufferRead *pBuffer, FX_BOOL bSaveSpaceChars = FALSE, FX_FILESIZE* pParsedSize = NULL); + static CXML_Element* Parse(const void* pBuffer, size_t size, bool bSaveSpaceChars = false, FX_FILESIZE* pParsedSize = NULL); + static CXML_Element* Parse(IFX_FileRead *pFile, bool bSaveSpaceChars = false, FX_FILESIZE* pParsedSize = NULL); + static CXML_Element* Parse(IFX_BufferRead *pBuffer, bool bSaveSpaceChars = false, FX_FILESIZE* pParsedSize = NULL); CXML_Element(const CFX_ByteStringC& qSpace, const CFX_ByteStringC& tagName); CXML_Element(const CFX_ByteStringC& qTagName); CXML_Element(); @@ -63,9 +63,9 @@ public: - CFX_ByteString GetTagName(FX_BOOL bQualified = FALSE) const; + CFX_ByteString GetTagName(bool bQualified = false) const; - CFX_ByteString GetNamespace(FX_BOOL bQualified = FALSE) const; + CFX_ByteString GetNamespace(bool bQualified = false) const; CFX_ByteString GetNamespaceURI(const CFX_ByteStringC& qName) const; @@ -81,9 +81,9 @@ public: void GetAttrByIndex(int index, CFX_ByteString &space, CFX_ByteString &name, CFX_WideString &value) const; - FX_BOOL HasAttr(const CFX_ByteStringC& qName) const; + bool HasAttr(const CFX_ByteStringC& qName) const; - FX_BOOL GetAttrValue(const CFX_ByteStringC& name, CFX_WideString& attribute) const; + bool GetAttrValue(const CFX_ByteStringC& name, CFX_WideString& attribute) const; CFX_WideString GetAttrValue(const CFX_ByteStringC& name) const { CFX_WideString attr; @@ -91,7 +91,7 @@ public: return attr; } - FX_BOOL GetAttrValue(const CFX_ByteStringC& space, const CFX_ByteStringC& name, CFX_WideString& attribute) const; + bool GetAttrValue(const CFX_ByteStringC& space, const CFX_ByteStringC& name, CFX_WideString& attribute) const; CFX_WideString GetAttrValue(const CFX_ByteStringC& space, const CFX_ByteStringC& name) const { CFX_WideString attr; @@ -99,7 +99,7 @@ public: return attr; } - FX_BOOL GetAttrInteger(const CFX_ByteStringC& name, int& attribute) const; + bool GetAttrInteger(const CFX_ByteStringC& name, int& attribute) const; int GetAttrInteger(const CFX_ByteStringC& name) const { int attr = 0; @@ -107,7 +107,7 @@ public: return attr; } - FX_BOOL GetAttrInteger(const CFX_ByteStringC& space, const CFX_ByteStringC& name, int& attribute) const; + bool GetAttrInteger(const CFX_ByteStringC& space, const CFX_ByteStringC& name, int& attribute) const; int GetAttrInteger(const CFX_ByteStringC& space, const CFX_ByteStringC& name) const { int attr = 0; @@ -115,7 +115,7 @@ public: return attr; } - FX_BOOL GetAttrFloat(const CFX_ByteStringC& name, FX_FLOAT& attribute) const; + bool GetAttrFloat(const CFX_ByteStringC& name, FX_FLOAT& attribute) const; FX_FLOAT GetAttrFloat(const CFX_ByteStringC& name) const { FX_FLOAT attr = 0; @@ -123,7 +123,7 @@ public: return attr; } - FX_BOOL GetAttrFloat(const CFX_ByteStringC& space, const CFX_ByteStringC& name, FX_FLOAT& attribute) const; + bool GetAttrFloat(const CFX_ByteStringC& space, const CFX_ByteStringC& name, FX_FLOAT& attribute) const; FX_FLOAT GetAttrFloat(const CFX_ByteStringC& space, const CFX_ByteStringC& name) const { FX_FLOAT attr = 0; diff --git a/core/include/fxge/fpf.h b/core/include/fxge/fpf.h index fb9bf4d111..115ef55c49 100644 --- a/core/include/fxge/fpf.h +++ b/core/include/fxge/fpf.h @@ -41,8 +41,8 @@ public: virtual int32_t GetAscent() const = 0; virtual int32_t GetDescent() const = 0; - virtual FX_BOOL GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox) = 0; - virtual FX_BOOL GetBBox(FX_RECT &rtBBox) = 0; + virtual bool GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox) = 0; + virtual bool GetBBox(FX_RECT &rtBBox) = 0; virtual int32_t GetHeight() const = 0; virtual int32_t GetItalicAngle() const = 0; diff --git a/core/include/fxge/fx_dib.h b/core/include/fxge/fx_dib.h index 27fc2f987d..554fe30602 100644 --- a/core/include/fxge/fx_dib.h +++ b/core/include/fxge/fx_dib.h @@ -179,13 +179,13 @@ public: virtual const uint8_t* GetScanline(int line) const = 0; - virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) const + virtual bool SkipToScanline(int line, IFX_Pause* pPause) const { - return FALSE; + return false; } 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; + int dest_width, bool bFlipX, int clip_left, int clip_width) const = 0; virtual void SetDownSampleSize(int width, int height) const {} @@ -194,24 +194,24 @@ public: return m_bpp; } - FX_BOOL IsAlphaMask() const + bool IsAlphaMask() const { return m_AlphaFlag == 1; } - FX_BOOL HasAlpha() const + bool HasAlpha() const { - return m_AlphaFlag & 2 ? TRUE : FALSE; + return m_AlphaFlag & 2 ? true : false; } - FX_BOOL IsOpaqueImage() const + bool IsOpaqueImage() const { return !(m_AlphaFlag & 3); } - FX_BOOL IsCmykImage() const + bool IsCmykImage() const { - return m_AlphaFlag & 4 ? TRUE : FALSE; + return m_AlphaFlag & 4 ? true : false; } @@ -248,11 +248,11 @@ public: CFX_DIBitmap* GetAlphaMask(const FX_RECT* pClip = NULL) const; - FX_BOOL CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT* pClip = NULL); + bool CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT* pClip = NULL); - CFX_DIBitmap* SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_RECT* pClip = NULL) const; + CFX_DIBitmap* SwapXY(bool bXFlip, bool bYFlip, const FX_RECT* pClip = NULL) const; - CFX_DIBitmap* FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const; + CFX_DIBitmap* FlipImage(bool bXFlip, bool bYFlip) const; void GetOverlapRect(int& dest_left, int& dest_top, int& width, int& height, int src_width, int src_height, int& src_left, int& src_top, const CFX_ClipRgn* pClipRgn); @@ -276,7 +276,7 @@ protected: void BuildPalette(); - FX_BOOL BuildAlphaMask(); + bool BuildAlphaMask(); int FindPalette(FX_DWORD color) const; @@ -292,9 +292,9 @@ public: CFX_DIBitmap(const CFX_DIBitmap& src); - FX_BOOL Create(int width, int height, FXDIB_Format format, uint8_t* pBuffer = NULL, int pitch = 0); + bool Create(int width, int height, FXDIB_Format format, uint8_t* pBuffer = NULL, int pitch = 0); - FX_BOOL Copy(const CFX_DIBSource* pSrc); + bool Copy(const CFX_DIBSource* pSrc); virtual uint8_t* GetBuffer() const { @@ -307,11 +307,11 @@ public: } 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; + int dest_width, bool bFlipX, int clip_left, int clip_width) const; void TakeOver(CFX_DIBitmap* pSrcBitmap); - FX_BOOL ConvertFormat(FXDIB_Format format, void* pIccTransform = NULL); + bool ConvertFormat(FXDIB_Format format, void* pIccTransform = NULL); void Clear(FX_DWORD color); @@ -319,40 +319,40 @@ public: void SetPixel(int x, int y, FX_DWORD color); - FX_BOOL LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* pSrcBitmap, FXDIB_Channel srcChannel); + bool LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* pSrcBitmap, FXDIB_Channel srcChannel); - FX_BOOL LoadChannel(FXDIB_Channel destChannel, int value); + bool LoadChannel(FXDIB_Channel destChannel, int value); - FX_BOOL MultiplyAlpha(int alpha); + bool MultiplyAlpha(int alpha); - FX_BOOL MultiplyAlpha(const CFX_DIBSource* pAlphaMask); + bool MultiplyAlpha(const CFX_DIBSource* pAlphaMask); - FX_BOOL TransferBitmap(int dest_left, int dest_top, int width, int height, + bool TransferBitmap(int dest_left, int dest_top, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform = NULL); - FX_BOOL CompositeBitmap(int dest_left, int dest_top, int width, int height, + bool CompositeBitmap(int dest_left, int dest_top, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, - int blend_type = FXDIB_BLEND_NORMAL, const CFX_ClipRgn* pClipRgn = NULL, FX_BOOL bRgbByteOrder = FALSE, void* pIccTransform = NULL); + int blend_type = FXDIB_BLEND_NORMAL, const CFX_ClipRgn* pClipRgn = NULL, bool bRgbByteOrder = false, void* pIccTransform = NULL); - FX_BOOL TransferMask(int dest_left, int dest_top, int width, int height, + bool TransferMask(int dest_left, int dest_top, int width, int height, const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL CompositeMask(int dest_left, int dest_top, int width, int height, + bool CompositeMask(int dest_left, int dest_top, int width, int height, const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top, - int blend_type = FXDIB_BLEND_NORMAL, const CFX_ClipRgn* pClipRgn = NULL, FX_BOOL bRgbByteOrder = FALSE, int alpha_flag = 0, void* pIccTransform = NULL); + int blend_type = FXDIB_BLEND_NORMAL, const CFX_ClipRgn* pClipRgn = NULL, bool bRgbByteOrder = false, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL CompositeRect(int dest_left, int dest_top, int width, int height, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL); + bool CompositeRect(int dest_left, int dest_top, int width, int height, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor); + bool ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor); - FX_BOOL DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_RECT* pRect = NULL); + bool DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_RECT* pRect = NULL); protected: uint8_t* m_pBuffer; - FX_BOOL m_bExtBuf; + bool m_bExtBuf; - FX_BOOL GetGrayData(void* pIccTransform = NULL); + bool GetGrayData(void* pIccTransform = NULL); }; class CFX_DIBExtractor { @@ -379,7 +379,7 @@ public: ~CFX_FilteredDIB(); - void LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc = FALSE); + void LoadSrc(const CFX_DIBSource* pSrc, bool bAutoDropSrc = false); virtual FXDIB_Format GetDestFormat() = 0; @@ -392,11 +392,11 @@ public: protected: 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; + int dest_width, bool bFlipX, int clip_left, int clip_width) const; const CFX_DIBSource* m_pSrc; - FX_BOOL m_bAutoDropSrc; + bool m_bAutoDropSrc; uint8_t* m_pScanline; }; @@ -407,7 +407,7 @@ public: 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; + virtual bool SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette) = 0; }; class CFX_ScanlineCompositor { @@ -416,8 +416,8 @@ public: ~CFX_ScanlineCompositor(); - FX_BOOL Init(FXDIB_Format dest_format, FXDIB_Format src_format, int32_t width, FX_DWORD* pSrcPalette, - FX_DWORD mask_color, int blend_type, FX_BOOL bClip, FX_BOOL bRgbByteOrder = FALSE, int alpha_flag = 0, void* pIccTransform = NULL); + bool Init(FXDIB_Format dest_format, FXDIB_Format src_format, int32_t width, FX_DWORD* pSrcPalette, + FX_DWORD mask_color, int blend_type, bool bClip, bool bRgbByteOrder = false, int alpha_flag = 0, void* pIccTransform = NULL); void CompositeRgbBitmapLine(uint8_t* dest_scan, const uint8_t* src_scan, int width, const uint8_t* clip_scan, @@ -449,7 +449,7 @@ protected: void* m_pIccTransform; uint8_t* m_pCacheScanline; int m_CacheSize; - FX_BOOL m_bRgbByteOrder; + bool m_bRgbByteOrder; }; class CFX_BitmapComposer : public IFX_ScanlineComposer { @@ -461,11 +461,11 @@ public: void Compose(CFX_DIBitmap* pDest, const CFX_ClipRgn* pClipRgn, int bitmap_alpha, - FX_DWORD mask_color, FX_RECT& dest_rect, FX_BOOL bVertical, - FX_BOOL bFlipX, FX_BOOL bFlipY, FX_BOOL bRgbByteOrder = FALSE, + FX_DWORD mask_color, FX_RECT& dest_rect, bool bVertical, + bool bFlipX, bool bFlipY, bool bRgbByteOrder = false, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); - virtual FX_BOOL SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette); + virtual bool SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette); virtual void ComposeScanline(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha); @@ -480,10 +480,10 @@ protected: FX_DWORD m_MaskColor; const CFX_DIBitmap* m_pClipMask; CFX_ScanlineCompositor m_Compositor; - FX_BOOL m_bVertical, m_bFlipX, m_bFlipY; + bool m_bVertical, m_bFlipX, m_bFlipY; int m_AlphaFlag; void* m_pIccTransform; - FX_BOOL m_bRgbByteOrder; + bool m_bRgbByteOrder; int m_BlendType; void ComposeScanlineV(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha = NULL); uint8_t* m_pScanlineV; @@ -501,7 +501,7 @@ public: 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); + virtual bool SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette); CFX_DIBitmap* GetBitmap() { @@ -521,22 +521,22 @@ public: CFX_ImageStretcher(); ~CFX_ImageStretcher(); - FX_BOOL Start(IFX_ScanlineComposer* pDest, const CFX_DIBSource* pBitmap, + bool Start(IFX_ScanlineComposer* pDest, const CFX_DIBSource* pBitmap, int dest_width, int dest_height, const FX_RECT& bitmap_rect, FX_DWORD flags); - FX_BOOL Continue(IFX_Pause* pPause); - FX_BOOL StartQuickStretch(); - FX_BOOL StartStretch(); - FX_BOOL ContinueQuickStretch(IFX_Pause* pPause); - FX_BOOL ContinueStretch(IFX_Pause* pPause); + bool Continue(IFX_Pause* pPause); + bool StartQuickStretch(); + bool StartStretch(); + bool ContinueQuickStretch(IFX_Pause* pPause); + bool ContinueStretch(IFX_Pause* pPause); IFX_ScanlineComposer* m_pDest; const CFX_DIBSource* m_pSource; CStretchEngine* m_pStretchEngine; FX_DWORD m_Flags; - FX_BOOL m_bFlipX; - FX_BOOL m_bFlipY; + bool m_bFlipX; + bool m_bFlipY; int m_DestWidth; int m_DestHeight; FX_RECT m_ClipRect; @@ -552,10 +552,10 @@ public: CFX_ImageTransformer(); ~CFX_ImageTransformer(); - FX_BOOL Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pMatrix, + bool Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pMatrix, int flags, const FX_RECT* pClip); - FX_BOOL Continue(IFX_Pause* pPause); + bool Continue(IFX_Pause* pPause); CFX_AffineMatrix* m_pMatrix; FX_RECT m_StretchClip; @@ -575,14 +575,14 @@ public: CFX_ImageRenderer(); ~CFX_ImageRenderer(); - FX_BOOL Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn, + bool Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn, const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD mask_color, const CFX_AffineMatrix* pMatrix, - FX_DWORD dib_flags, FX_BOOL bRgbByteOrder = FALSE, + FX_DWORD dib_flags, bool bRgbByteOrder = false, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); - FX_BOOL Continue(IFX_Pause* pPause); + bool Continue(IFX_Pause* pPause); protected: CFX_DIBitmap* m_pDevice; @@ -598,7 +598,7 @@ protected: FX_DWORD m_Flags; int m_AlphaFlag; void* m_pIccTransform; - FX_BOOL m_bRgbByteOrder; + bool m_bRgbByteOrder; int m_BlendType; }; diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h index 2832fbfcbc..20ef5d42c2 100644 --- a/core/include/fxge/fx_font.h +++ b/core/include/fxge/fx_font.h @@ -56,12 +56,12 @@ public: CFX_Font(); ~CFX_Font(); - 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); + bool LoadSubst(const CFX_ByteString& face_name, bool bTrueType, FX_DWORD flags, + int weight, int italic_angle, int CharsetCP, bool bVertical = false); - FX_BOOL LoadEmbedded(const uint8_t* data, FX_DWORD size); + bool LoadEmbedded(const uint8_t* data, FX_DWORD size); - FX_BOOL LoadFile(IFX_FileRead* pFile); + bool LoadFile(IFX_FileRead* pFile); FXFT_Face GetFace() const { @@ -82,15 +82,15 @@ public: int GetDescent() const; - FX_BOOL GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox); + bool GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox); - FX_BOOL IsItalic(); + bool IsItalic(); - FX_BOOL IsBold(); + bool IsBold(); - FX_BOOL IsFixedWidth(); + bool IsFixedWidth(); - FX_BOOL IsVertical() const + bool IsVertical() const { return m_bVertical; } @@ -103,9 +103,9 @@ public: CFX_ByteString GetFaceName() const; - FX_BOOL IsTTFont(); + bool IsTTFont(); - FX_BOOL GetBBox(FX_RECT &bbox); + bool GetBBox(FX_RECT &bbox); int GetHeight(); @@ -118,7 +118,7 @@ public: FXFT_Face m_Face; CFX_SubstFont* m_pSubstFont; - FX_BOOL IsEmbedded() + bool IsEmbedded() { return m_bEmbedded; } @@ -133,14 +133,14 @@ public: void* m_pPlatformFont; void* m_pPlatformFontCollection; void* m_pDwFont; - FX_BOOL m_bDwLoaded; + bool m_bDwLoaded; void ReleasePlatformResource(); void DeleteFace(); protected: - FX_BOOL m_bEmbedded; - FX_BOOL m_bVertical; + bool m_bEmbedded; + bool m_bVertical; void* m_pOwnedStream; }; #define ENCODING_INTERNAL 0 @@ -182,11 +182,11 @@ public: int m_ItalicAngle; - FX_BOOL m_bSubstOfCJK; + bool m_bSubstOfCJK; int m_WeightCJK; - FX_BOOL m_bItlicCJK; + bool m_bItlicCJK; }; #define FX_FONT_FLAG_SERIF 0x01 #define FX_FONT_FLAG_FIXEDPITCH 0x02 @@ -206,9 +206,9 @@ public: ~CFX_FontMgr(); void InitFTLibrary(); FXFT_Face GetCachedFace(const CFX_ByteString& face_name, - int weight, FX_BOOL bItalic, uint8_t*& pFontData); + int weight, bool bItalic, uint8_t*& pFontData); FXFT_Face AddCachedFace(const CFX_ByteString& face_name, - int weight, FX_BOOL bItalic, uint8_t* pData, FX_DWORD size, int face_index); + int weight, bool bItalic, uint8_t* pData, FX_DWORD size, int face_index); FXFT_Face GetCachedTTCFace(int ttc_size, FX_DWORD checksum, int font_offset, uint8_t*& pFontData); FXFT_Face AddCachedTTCFace(int ttc_size, FX_DWORD checksum, @@ -217,12 +217,12 @@ public: 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, + FXFT_Face FindSubstFont(const CFX_ByteString& face_name, bool bTrueType, FX_DWORD flags, int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont); void FreeCache(); - FX_BOOL GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index); + bool GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index); CFX_FontMapper* m_pBuiltinMapper; IFX_FontMapper* m_pExtMapper; CFX_MapByteStringToPtr m_FaceMap; @@ -235,7 +235,7 @@ public: virtual ~IFX_FontMapper() {} - virtual FXFT_Face FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags, + virtual FXFT_Face FindSubstFont(const CFX_ByteString& face_name, bool bTrueType, FX_DWORD flags, int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont) = 0; CFX_FontMgr* m_pFontMgr; @@ -277,14 +277,14 @@ public: { return m_pFontEnumerator; } - virtual FXFT_Face FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags, + virtual FXFT_Face FindSubstFont(const CFX_ByteString& face_name, bool bTrueType, FX_DWORD flags, int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont); private: CFX_ByteString GetPSNameFromTT(void* hFont); CFX_ByteString MatchInstalledFonts(const CFX_ByteString& norm_name); FXFT_Face UseInternalSubst(CFX_SubstFont* pSubstFont, int iBaseFont, int italic_angle, int weight, int picthfamily); - FX_BOOL m_bListLoaded; + bool m_bListLoaded; FXFT_Face m_MMFaces[2]; CFX_ByteString m_LastFamily; CFX_DWordArray m_CharsetArray; @@ -299,12 +299,12 @@ public: static IFX_SystemFontInfo* CreateDefault(); 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, const FX_CHAR* face, int& iExact) = 0; + virtual bool EnumFontList(CFX_FontMapper* pMapper) = 0; + virtual void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* face, int& iExact) = 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 bool GetFaceName(void* hFont, CFX_ByteString& name) = 0; + virtual bool GetFontCharset(void* hFont, int& charset) = 0; virtual int GetFaceIndex(void* hFont) { return 0; @@ -326,15 +326,15 @@ public: // IFX_SytemFontInfo: void Release() override; - FX_BOOL EnumFontList(CFX_FontMapper* pMapper) override; - void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, + bool EnumFontList(CFX_FontMapper* pMapper) override; + void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* face, int& bExact) override; void* GetFont(const FX_CHAR* face) override; FX_DWORD GetFontData(void* hFont, FX_DWORD table, uint8_t* buffer, FX_DWORD size) override; void DeleteFont(void* hFont) override; - FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) override; - FX_BOOL GetFontCharset(void* hFont, int& charset) override; + bool GetFaceName(void* hFont, CFX_ByteString& name) override; + bool GetFontCharset(void* hFont, int& charset) override; protected: CFX_MapByteStringToPtr m_FontList; @@ -357,7 +357,7 @@ public: ~CFX_FontCache(); CFX_FaceCache* GetCachedFace(CFX_Font* pFont); void ReleaseCachedFace(CFX_Font* pFont); - void FreeCache(FX_BOOL bRelease = FALSE); + void FreeCache(bool bRelease = false); private: using CFX_FTCacheMap = std::map; @@ -391,7 +391,7 @@ class CFX_FaceCache { public: ~CFX_FaceCache(); - const CFX_GlyphBitmap* LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle, const CFX_AffineMatrix* pMatrix, + const CFX_GlyphBitmap* LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, bool bFontStyle, const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias, int& text_flags); const CFX_PathData* LoadGlyphPath(CFX_Font* pFont, FX_DWORD glyph_index, int dest_width); @@ -399,12 +399,12 @@ public: CFX_FaceCache(FXFT_Face face); private: FXFT_Face m_Face; - CFX_GlyphBitmap* RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle, + CFX_GlyphBitmap* RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_index, bool bFontStyle, const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias); CFX_GlyphBitmap* RenderGlyph_Nativetext(CFX_Font* pFont, FX_DWORD glyph_index, const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias); CFX_GlyphBitmap* LookUpGlyphBitmap(CFX_Font* pFont, const CFX_AffineMatrix* pMatrix, CFX_ByteStringC& FaceGlyphsKey, - FX_DWORD glyph_index, FX_BOOL bFontStyle, int dest_width, int anti_alias); + FX_DWORD glyph_index, bool bFontStyle, int dest_width, int anti_alias); CFX_MapByteStringToPtr m_SizeMap; CFX_MapPtrToPtr m_PathMap; CFX_DIBitmap* m_pBitmap; @@ -418,16 +418,16 @@ typedef struct { FX_FLOAT m_fOriginX, m_fOriginY; } FXTEXT_GLYPHPOS; FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_alias, FX_FLOAT retinaScaleX = 1.0f, FX_FLOAT retinaScaleY = 1.0f); -FX_BOOL OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size, +bool OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size, CFX_AffineMatrix* pMatrix, unsigned long glyph_index, unsigned long argb); -FX_BOOL OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size, +bool OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size, CFX_AffineMatrix* pText_matrix, unsigned short const* text, unsigned long argb); class IFX_GSUBTable { public: static IFX_GSUBTable* Create(CFX_Font* pFont); virtual ~IFX_GSUBTable() { } - virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0; + virtual bool GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0; }; #endif // CORE_INCLUDE_FXGE_FX_FONT_H_ diff --git a/core/include/fxge/fx_ge.h b/core/include/fxge/fx_ge.h index fd9c148b62..5965641a3e 100644 --- a/core/include/fxge/fx_ge.h +++ b/core/include/fxge/fx_ge.h @@ -193,11 +193,11 @@ public: void Transform(const CFX_AffineMatrix* pMatrix); - FX_BOOL IsRect() const; + bool IsRect() const; - FX_BOOL GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, FX_BOOL&bThin, FX_BOOL bAdjust) const; + bool GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, bool&bThin, bool bAdjust) const; - FX_BOOL IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* rect) const; + bool IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* rect) const; void Append(const CFX_PathData* pSrc, const CFX_AffineMatrix* pMatrix); void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top); @@ -294,10 +294,10 @@ typedef struct { FX_DWORD m_GlyphIndex; FX_FLOAT m_OriginX, m_OriginY; int m_FontCharWidth; - FX_BOOL m_bGlyphAdjust; + bool m_bGlyphAdjust; FX_FLOAT m_AdjustMatrix[4]; FX_DWORD m_ExtGID; - FX_BOOL m_bFontStyle; + bool m_bFontStyle; } FXTEXT_CHARPOS; class CFX_RenderDevice { @@ -313,7 +313,7 @@ public: return m_pDeviceDriver; } - FX_BOOL StartRendering(); + bool StartRendering(); void EndRendering(); @@ -321,7 +321,7 @@ public: void SaveState(); - void RestoreState(FX_BOOL bKeepSaved = FALSE); + void RestoreState(bool bKeepSaved = false); @@ -365,26 +365,26 @@ public: m_pBitmap = pBitmap; } - FX_BOOL CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const; + bool CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const; const FX_RECT& GetClipBox() const { return m_ClipBox; } - FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, + bool SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, int fill_mode ); - FX_BOOL SetClip_Rect(const FX_RECT* pRect); + bool SetClip_Rect(const FX_RECT* pRect); - FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, + bool SetClip_PathStroke(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState ); - FX_BOOL DrawPath(const CFX_PathData* pPathData, + bool DrawPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState, FX_DWORD fill_color, @@ -395,46 +395,46 @@ public: int blend_type = FXDIB_BLEND_NORMAL ); - FX_BOOL SetPixel(int x, int y, FX_DWORD color, + bool SetPixel(int x, int y, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD color, + bool FillRect(const FX_RECT* pRect, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); - FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color, + bool DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color, int fill_mode = 0, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); - FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL); + bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL); CFX_DIBitmap* GetBackDrop(); - FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_type = FXDIB_BLEND_NORMAL, + bool SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_type = FXDIB_BLEND_NORMAL, void* pIccTransform = NULL); - FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height, + bool StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height, FX_DWORD flags = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); - FX_BOOL SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD color, + bool SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height, + bool StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height, 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, + bool StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, 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(void* handle, IFX_Pause* pPause); + bool ContinueDIBits(void* handle, IFX_Pause* pPause); void CancelDIBits(void* handle); - FX_BOOL DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos, + bool DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache, FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device, FX_DWORD fill_color, FX_DWORD text_flags, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos, + bool DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache, FX_FLOAT font_size, const CFX_AffineMatrix* pText2User, const CFX_AffineMatrix* pUser2Device, const CFX_GraphStateData* pGraphState, @@ -477,12 +477,12 @@ public: ~CFX_FxgeDevice(); - FX_BOOL Attach(CFX_DIBitmap* pBitmap, int dither_bits = 0, FX_BOOL bRgbByteOrder = FALSE, CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE); + bool Attach(CFX_DIBitmap* pBitmap, int dither_bits = 0, bool bRgbByteOrder = false, CFX_DIBitmap* pOriDevice = NULL, bool bGroupKnockout = false); - FX_BOOL Create(int width, int height, FXDIB_Format format, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL); + bool Create(int width, int height, FXDIB_Format format, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL); protected: - FX_BOOL m_bOwnedBitmap; + bool m_bOwnedBitmap; }; class CFX_SkiaDevice : public CFX_RenderDevice { @@ -492,19 +492,19 @@ public: ~CFX_SkiaDevice(); - FX_BOOL Attach(CFX_DIBitmap* pBitmap, int dither_bits = 0, FX_BOOL bRgbByteOrder = FALSE, CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE); + bool Attach(CFX_DIBitmap* pBitmap, int dither_bits = 0, bool bRgbByteOrder = false, CFX_DIBitmap* pOriDevice = NULL, bool bGroupKnockout = false); - FX_BOOL Create(int width, int height, FXDIB_Format format, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL); + bool Create(int width, int height, FXDIB_Format format, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL); protected: - FX_BOOL m_bOwnedBitmap; + bool m_bOwnedBitmap; }; class IFX_RenderDeviceDriver { public: - static IFX_RenderDeviceDriver* CreateFxgeDriver(CFX_DIBitmap* pBitmap, FX_BOOL bRgbByteOrder = FALSE, - CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE); + static IFX_RenderDeviceDriver* CreateFxgeDriver(CFX_DIBitmap* pBitmap, bool bRgbByteOrder = false, + CFX_DIBitmap* pOriDevice = NULL, bool bGroupKnockout = false); virtual ~IFX_RenderDeviceDriver() {} virtual void Begin() { } @@ -517,14 +517,14 @@ public: return CFX_Matrix(); } - virtual FX_BOOL IsPSPrintDriver() + virtual bool IsPSPrintDriver() { - return FALSE; + return false; } - virtual FX_BOOL StartRendering() + virtual bool StartRendering() { - return TRUE; + return true; } virtual void EndRendering() {} @@ -534,23 +534,23 @@ public: virtual void SaveState() = 0; - virtual void RestoreState(FX_BOOL bKeepSaved = FALSE) = 0; + virtual void RestoreState(bool bKeepSaved = false) = 0; - virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, + virtual bool SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, int fill_mode ) = 0; - virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, + virtual bool SetClip_PathStroke(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState ) { - return FALSE; + return false; } - virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, + virtual bool DrawPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState, FX_DWORD fill_color, @@ -561,59 +561,59 @@ public: int blend_type = FXDIB_BLEND_NORMAL ) = 0; - virtual FX_BOOL SetPixel(int x, int y, FX_DWORD color, + virtual bool SetPixel(int x, int y, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL) { - return FALSE; + return false; } - virtual FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD fill_color, + virtual bool FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) { - return FALSE; + return false; } - virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color, + virtual bool DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) { - return FALSE; + return false; } - virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0; + virtual bool GetClipBox(FX_RECT* pRect) = 0; - virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE) + virtual bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, bool bDEdge = false) { - return FALSE; + return false; } virtual CFX_DIBitmap* GetBackDrop() { return NULL; } - virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, + virtual bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int dest_left, int dest_top, int blend_type, int alpha_flag = 0, void* pIccTransform = NULL) = 0; - virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, + virtual bool StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags, 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, + virtual bool StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, 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(void* handle, IFX_Pause* pPause) + virtual bool ContinueDIBits(void* handle, IFX_Pause* pPause) { - return FALSE; + return false; } virtual void CancelDIBits(void* handle) {} - virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, + virtual 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, int alpha_flag = 0, void* pIccTransform = NULL) { - return FALSE; + return false; } virtual void* GetPlatformSurface() @@ -646,13 +646,13 @@ public: ~CFX_PSRenderer(); - void Init(IFX_PSOutput* pOutput, int ps_level, int width, int height, FX_BOOL bCmykOutput); - FX_BOOL StartRendering(); + void Init(IFX_PSOutput* pOutput, int ps_level, int width, int height, bool bCmykOutput); + bool StartRendering(); void EndRendering(); void SaveState(); - void RestoreState(FX_BOOL bKeepSaved = FALSE); + void RestoreState(bool bKeepSaved = false); void SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, @@ -669,7 +669,7 @@ public: return m_ClipBox; } - FX_BOOL DrawPath(const CFX_PathData* pPathData, + bool DrawPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState, FX_DWORD fill_color, @@ -679,18 +679,18 @@ public: void* pIccTransform = NULL ); - FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, + bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, + bool StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, int dest_width, int dest_height, FX_DWORD flags, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL DrawDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, + bool DrawDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const CFX_AffineMatrix* pMatrix, FX_DWORD flags, int alpha_flag = 0, void* pIccTransform = NULL); - FX_BOOL DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache, + bool DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL); private: @@ -701,11 +701,11 @@ private: CFX_GraphStateData m_CurGraphState; - FX_BOOL m_bGraphStateSet; + bool m_bGraphStateSet; - FX_BOOL m_bCmykOutput; + bool m_bCmykOutput; - FX_BOOL m_bColorSet; + bool m_bColorSet; FX_DWORD m_LastColor; @@ -714,7 +714,7 @@ private: CFX_ArrayTemplate m_PSFontList; CFX_ArrayTemplate m_ClipBoxStack; - FX_BOOL m_bInited; + bool m_bInited; void OutputPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device); diff --git a/core/include/fxge/fx_ge_apple.h b/core/include/fxge/fx_ge_apple.h index 0fb8bedcfc..ebe61cc59f 100644 --- a/core/include/fxge/fx_ge_apple.h +++ b/core/include/fxge/fx_ge_apple.h @@ -13,15 +13,15 @@ class CFX_QuartzDevice : public CFX_RenderDevice public: CFX_QuartzDevice(); ~CFX_QuartzDevice(); - FX_BOOL Attach(CGContextRef context, int32_t nDeviceClass = FXDC_DISPLAY); - FX_BOOL Attach(CFX_DIBitmap* pBitmap); - FX_BOOL Create(int32_t width, int32_t height, FXDIB_Format format); + bool Attach(CGContextRef context, int32_t nDeviceClass = FXDC_DISPLAY); + bool Attach(CFX_DIBitmap* pBitmap); + bool Create(int32_t width, int32_t height, FXDIB_Format format); CGContextRef GetContext(); protected: CGContextRef m_pContext; - FX_BOOL m_bOwnedBitmap; + bool m_bOwnedBitmap; }; #endif diff --git a/core/include/fxge/fx_ge_win32.h b/core/include/fxge/fx_ge_win32.h index 5b16146b6a..8023bd8099 100644 --- a/core/include/fxge/fx_ge_win32.h +++ b/core/include/fxge/fx_ge_win32.h @@ -72,13 +72,13 @@ protected: class CFX_WindowsDevice : public CFX_RenderDevice { public: - static IFX_RenderDeviceDriver* CreateDriver(HDC hDC, FX_BOOL bCmykOutput = FALSE); + static IFX_RenderDeviceDriver* CreateDriver(HDC hDC, bool bCmykOutput = false); - CFX_WindowsDevice(HDC hDC, FX_BOOL bCmykOutput = FALSE, FX_BOOL bForcePSOutput = FALSE, int psLevel = 2); + CFX_WindowsDevice(HDC hDC, bool bCmykOutput = false, bool bForcePSOutput = false, int psLevel = 2); HDC GetDC() const; - FX_BOOL m_bForcePSOutput; + bool m_bForcePSOutput; static int m_psLevel; }; diff --git a/core/include/thirdparties/libjpeg/jmorecfg.h b/core/include/thirdparties/libjpeg/jmorecfg.h index 88d210954c..e0a871e023 100644 --- a/core/include/thirdparties/libjpeg/jmorecfg.h +++ b/core/include/thirdparties/libjpeg/jmorecfg.h @@ -230,7 +230,7 @@ typedef unsigned int JDIMENSION; /* - * On a few systems, type boolean and/or its values FALSE, TRUE may appear + * On a few systems, type boolean and/or its values false, true may appear * in standard header files. Or you may have conflicts with application- * specific header files that you want to include together with these files. * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. @@ -239,11 +239,11 @@ typedef unsigned int JDIMENSION; #ifndef HAVE_BOOLEAN typedef int boolean; #endif -#ifndef FALSE /* in case these macros already exist */ -#define FALSE 0 /* values of boolean */ +#ifndef false /* in case these macros already exist */ +#define false 0 /* values of boolean */ #endif -#ifndef TRUE -#define TRUE 1 +#ifndef true +#define true 1 #endif diff --git a/core/include/thirdparties/libjpeg/jpegint.h b/core/include/thirdparties/libjpeg/jpegint.h index 95b00d405c..745a4c09f2 100644 --- a/core/include/thirdparties/libjpeg/jpegint.h +++ b/core/include/thirdparties/libjpeg/jpegint.h @@ -95,7 +95,7 @@ struct jpeg_downsampler { JSAMPIMAGE output_buf, JDIMENSION out_row_group_index)); - boolean need_context_rows; /* TRUE if need rows above & below */ + boolean need_context_rows; /* true if need rows above & below */ }; /* Forward DCT (also controls coefficient quantization) */ @@ -213,7 +213,7 @@ struct jpeg_entropy_decoder { /* This is here to share code between baseline and progressive decoders; */ /* other modules probably should not use it */ - boolean insufficient_data; /* set TRUE after emitting warning */ + boolean insufficient_data; /* set true after emitting warning */ }; /* Inverse DCT (also performs dequantization) */ @@ -239,7 +239,7 @@ struct jpeg_upsampler { JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); - boolean need_context_rows; /* TRUE if need rows above & below */ + boolean need_context_rows; /* true if need rows above & below */ }; /* Colorspace conversion */ diff --git a/core/include/thirdparties/libjpeg/jpeglib.h b/core/include/thirdparties/libjpeg/jpeglib.h index 7de5ab726e..78831ac4cc 100644 --- a/core/include/thirdparties/libjpeg/jpeglib.h +++ b/core/include/thirdparties/libjpeg/jpeglib.h @@ -153,12 +153,12 @@ typedef struct { * CAUTION: IJG versions prior to v6a kept this array in zigzag order. */ UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */ - /* This field is used only during compression. It's initialized FALSE when - * the table is created, and set TRUE when it's been output to the file. - * You could suppress output of a table by setting this to TRUE. + /* This field is used only during compression. It's initialized false when + * the table is created, and set true when it's been output to the file. + * You could suppress output of a table by setting this to true. * (See jpeg_suppress_tables for an example.) */ - boolean sent_table; /* TRUE when table has been output */ + boolean sent_table; /* true when table has been output */ } JQUANT_TBL; @@ -169,12 +169,12 @@ typedef struct { UINT8 bits[17]; /* bits[k] = # of symbols with codes of */ /* length k bits; bits[0] is unused */ UINT8 huffval[256]; /* The symbols, in order of incr code length */ - /* This field is used only during compression. It's initialized FALSE when - * the table is created, and set TRUE when it's been output to the file. - * You could suppress output of a table by setting this to TRUE. + /* This field is used only during compression. It's initialized false when + * the table is created, and set true when it's been output to the file. + * You could suppress output of a table by setting this to true. * (See jpeg_suppress_tables for an example.) */ - boolean sent_table; /* TRUE when table has been output */ + boolean sent_table; /* true when table has been output */ } JHUFF_TBL; @@ -384,10 +384,10 @@ struct jpeg_compress_struct { * set num_scans and scan_info to point to an array of scan definitions. */ - boolean raw_data_in; /* TRUE=caller supplies downsampled data */ - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ + boolean raw_data_in; /* true=caller supplies downsampled data */ + boolean arith_code; /* true=arithmetic coding, false=Huffman */ + boolean optimize_coding; /* true=optimize entropy encoding parms */ + boolean CCIR601_sampling; /* true=first samples are cosited */ int smoothing_factor; /* 1..100, or 0 for no input smoothing */ J_DCT_METHOD dct_method; /* DCT algorithm selector */ @@ -427,7 +427,7 @@ struct jpeg_compress_struct { /* * These fields are computed during compression startup */ - boolean progressive_mode; /* TRUE if scan script uses progressive mode */ + boolean progressive_mode; /* true if scan script uses progressive mode */ int max_h_samp_factor; /* largest h_samp_factor */ int max_v_samp_factor; /* largest v_samp_factor */ @@ -500,17 +500,17 @@ struct jpeg_decompress_struct { double output_gamma; /* image gamma wanted in output */ - boolean buffered_image; /* TRUE=multiple output passes */ - boolean raw_data_out; /* TRUE=downsampled data wanted */ + boolean buffered_image; /* true=multiple output passes */ + boolean raw_data_out; /* true=downsampled data wanted */ J_DCT_METHOD dct_method; /* IDCT algorithm selector */ - boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */ - boolean do_block_smoothing; /* TRUE=apply interblock smoothing */ + boolean do_fancy_upsampling; /* true=apply fancy upsampling */ + boolean do_block_smoothing; /* true=apply interblock smoothing */ - boolean quantize_colors; /* TRUE=colormapped output wanted */ + boolean quantize_colors; /* true=colormapped output wanted */ /* the following are ignored if not quantize_colors: */ J_DITHER_MODE dither_mode; /* type of color dithering to use */ - boolean two_pass_quantize; /* TRUE=use two-pass color quantization */ + boolean two_pass_quantize; /* true=use two-pass color quantization */ int desired_number_of_colors; /* max # colors to use in created colormap */ /* these are significant only in buffered-image mode: */ boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */ @@ -602,8 +602,8 @@ struct jpeg_decompress_struct { jpeg_component_info * comp_info; /* comp_info[i] describes component that appears i'th in SOF */ - boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */ - boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ + boolean progressive_mode; /* true if SOFn specifies progressive mode */ + boolean arith_code; /* true=arithmetic coding, false=Huffman */ UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ @@ -614,17 +614,17 @@ struct jpeg_decompress_struct { /* These fields record data obtained from optional markers recognized by * the JPEG library. */ - boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */ - /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */ + boolean saw_JFIF_marker; /* true iff a JFIF APP0 marker was found */ + /* Data copied from JFIF marker; only valid if saw_JFIF_marker is true: */ UINT8 JFIF_major_version; /* JFIF version number */ UINT8 JFIF_minor_version; UINT8 density_unit; /* JFIF code for pixel size units */ UINT16 X_density; /* Horizontal pixel density */ UINT16 Y_density; /* Vertical pixel density */ - boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ + boolean saw_Adobe_marker; /* true iff an Adobe APP14 marker was found */ UINT8 Adobe_transform; /* Color transform code from Adobe marker */ - boolean CCIR601_sampling; /* TRUE=first samples are cosited */ + boolean CCIR601_sampling; /* true=first samples are cosited */ /* Aside from the specific data retained from APPn markers known to the * library, the uninterpreted contents of any or all APPn and COM markers @@ -1034,7 +1034,7 @@ EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo, #define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */ #define JPEG_HEADER_OK 1 /* Found valid image datastream */ #define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */ -/* If you pass require_image = TRUE (normal case), you need not check for +/* If you pass require_image = true (normal case), you need not check for * a TABLES_ONLY return code; an abbreviated file will cause an error exit. * JPEG_SUSPENDED is only possible if you use a data source module that can * give a suspension return (the stdio source module doesn't). -- cgit v1.2.3