diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-27 11:55:29 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-27 11:55:29 -0700 |
commit | ff46aaf499edcf153ee2f57c7016587aa96dcfa0 (patch) | |
tree | 0a0d92713af476897899b126d180cc6294433d10 /core/include/fpdfapi | |
parent | aafeff816e22c1333c17d8a0eb4fe8927c28142d (diff) | |
download | pdfium-ff46aaf499edcf153ee2f57c7016587aa96dcfa0.tar.xz |
FX Bool considered harmful, part 3
Try to reland this patch after fixing underlying issues that
caused it to be reverted.
fx_system.h is the only manual edit.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1258093002 .
Diffstat (limited to 'core/include/fpdfapi')
-rw-r--r-- | core/include/fpdfapi/fpdf_module.h | 6 | ||||
-rw-r--r-- | core/include/fpdfapi/fpdf_objects.h | 72 | ||||
-rw-r--r-- | core/include/fpdfapi/fpdf_page.h | 26 | ||||
-rw-r--r-- | core/include/fpdfapi/fpdf_pageobj.h | 28 | ||||
-rw-r--r-- | core/include/fpdfapi/fpdf_parser.h | 200 | ||||
-rw-r--r-- | core/include/fpdfapi/fpdf_render.h | 28 | ||||
-rw-r--r-- | core/include/fpdfapi/fpdf_resource.h | 142 | ||||
-rw-r--r-- | core/include/fpdfapi/fpdf_serial.h | 28 |
8 files changed, 265 insertions, 265 deletions
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<IPDF_RenderModule> m_pRenderModule; nonstd::unique_ptr<IPDF_PageModule> 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 bd8b5c9878..2fc9de8566 100644 --- a/core/include/fpdfapi/fpdf_page.h +++ b/core/include/fpdfapi/fpdf_page.h @@ -28,12 +28,12 @@ class CPDF_StreamContentParser; class CPDF_PageObjects { public: - CPDF_PageObjects(FX_BOOL bReleaseMembers = TRUE); + CPDF_PageObjects(bool bReleaseMembers = true); ~CPDF_PageObjects(); void ContinueParse(IFX_Pause* pPause); - FX_BOOL IsParsed() const + bool IsParsed() const { return m_ParseState == CONTENT_PARSED; } @@ -76,7 +76,7 @@ public: void Transform(const CFX_AffineMatrix& matrix); - FX_BOOL BackgroundAlphaNeeded() const + bool BackgroundAlphaNeeded() const { return m_bBackgroundAlphaNeeded; } @@ -106,8 +106,8 @@ protected: void ClearCacheObjects(); CFX_PtrList m_ObjectList; - FX_BOOL m_bBackgroundAlphaNeeded; - FX_BOOL m_bReleaseMembers; + bool m_bBackgroundAlphaNeeded; + bool m_bReleaseMembers; CPDF_ContentParser* m_pParser; ParseState m_ParseState; }; @@ -120,11 +120,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; @@ -177,13 +177,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 { @@ -206,7 +206,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<CPDF_Dictionary *> 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<struct _PDF_RenderItem> 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; |