diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-23 13:36:00 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-23 13:36:00 -0700 |
commit | f1e7c461dfabbff6b65a072f24f6711b34159361 (patch) | |
tree | 3b0bb772a59669f06b86824a444fd06642592d4b /core/include/fpdfapi | |
parent | 320b2313d19869333ed453af546e61a9fc2b81c9 (diff) | |
download | pdfium-f1e7c461dfabbff6b65a072f24f6711b34159361.tar.xz |
Revert "FX_BOOL considered harmful, part 2."
This reverts commit 320b2313d19869333ed453af546e61a9fc2b81c9.
Reason for revert: build failure.
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1255693002 .
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 | 28 | ||||
-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, 266 insertions, 266 deletions
diff --git a/core/include/fpdfapi/fpdf_module.h b/core/include/fpdfapi/fpdf_module.h index b6f8de0c9f..5877e11372 100644 --- a/core/include/fpdfapi/fpdf_module.h +++ b/core/include/fpdfapi/fpdf_module.h @@ -60,9 +60,9 @@ public: void InitRenderModule(); - void SetDownloadCallback(bool (*callback)(const FX_CHAR* module_name)); + void SetDownloadCallback(FX_BOOL (*callback)(const FX_CHAR* module_name)); - bool DownloadModule(const FX_CHAR* module_name); + FX_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; - bool (*m_pDownloadCallback)(const FX_CHAR* module_name); + FX_BOOL (*m_pDownloadCallback)(const FX_CHAR* module_name); CFX_MapByteStringToPtr m_SecurityHandlerMap; diff --git a/core/include/fpdfapi/fpdf_objects.h b/core/include/fpdfapi/fpdf_objects.h index 8d954ff719..45b7cc63cb 100644 --- a/core/include/fpdfapi/fpdf_objects.h +++ b/core/include/fpdfapi/fpdf_objects.h @@ -57,9 +57,9 @@ public: return m_GenNum; } - bool IsIdentical(CPDF_Object* pObj) const; + FX_BOOL IsIdentical(CPDF_Object* pObj) const; - CPDF_Object* Clone(bool bDirect = false) const; + CPDF_Object* Clone(FX_BOOL bDirect = FALSE) const; CPDF_Object* CloneRef(CPDF_IndirectObjects* pObjs) const; @@ -88,9 +88,9 @@ public: int GetDirectType() const; - bool IsModified() const + FX_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(bool bDirect, CFX_MapPtrToPtr* visited) const; + CPDF_Object* CloneInternal(FX_BOOL bDirect, CFX_MapPtrToPtr* visited) const; }; class CPDF_Boolean : public CPDF_Object { public: - static CPDF_Boolean* Create(bool value) + static CPDF_Boolean* Create(FX_BOOL value) { return new CPDF_Boolean(value); } CPDF_Boolean() : CPDF_Object(PDFOBJ_BOOLEAN), m_bValue(false) { } - CPDF_Boolean(bool value) : CPDF_Object(PDFOBJ_BOOLEAN), m_bValue(value) { } + CPDF_Boolean(FX_BOOL value) : CPDF_Object(PDFOBJ_BOOLEAN), m_bValue(value) { } - bool Identical(CPDF_Boolean* pOther) const + FX_BOOL Identical(CPDF_Boolean* pOther) const { return m_bValue == pOther->m_bValue; } protected: - bool m_bValue; + FX_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(bool bInteger, void* pData) + static CPDF_Number* Create(FX_BOOL bInteger, void* pData) { return new CPDF_Number(bInteger, pData); } CPDF_Number() : CPDF_Object(PDFOBJ_NUMBER), m_bInteger(false), m_Integer(0) { } - CPDF_Number(bool bInteger, void* pData); + CPDF_Number(FX_BOOL bInteger, void* pData); CPDF_Number(int value); @@ -165,13 +165,13 @@ public: CPDF_Number(const CFX_ByteStringC& str); - bool Identical(CPDF_Number* pOther) const; + FX_BOOL Identical(CPDF_Number* pOther) const; CFX_ByteString GetString() const; void SetString(const CFX_ByteStringC& str); - bool IsInteger() const + FX_BOOL IsInteger() const { return m_bInteger; } @@ -199,7 +199,7 @@ public: } protected: - bool m_bInteger; + FX_BOOL m_bInteger; union { @@ -213,7 +213,7 @@ class CPDF_String : public CPDF_Object { public: - static CPDF_String* Create(const CFX_ByteString& str, bool bHex = false) + static CPDF_String* Create(const CFX_ByteString& str, FX_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, bool bHex = false) + CPDF_String(const CFX_ByteString& str, FX_BOOL bHex = FALSE) : CPDF_Object(PDFOBJ_STRING), m_String(str), m_bHex(bHex) { } @@ -236,12 +236,12 @@ public: return m_String; } - bool Identical(CPDF_String* pOther) const + FX_BOOL Identical(CPDF_String* pOther) const { return m_String == pOther->m_String; } - bool IsHex() const + FX_BOOL IsHex() const { return m_bHex; } @@ -249,7 +249,7 @@ protected: CFX_ByteString m_String; - bool m_bHex; + FX_BOOL m_bHex; friend class CPDF_Object; }; class CPDF_Name : public CPDF_Object @@ -280,7 +280,7 @@ public: return m_Name; } - bool Identical(CPDF_Name* pOther) const + FX_BOOL Identical(CPDF_Name* pOther) const { return m_Name == pOther->m_Name; } @@ -378,7 +378,7 @@ public: AddNumber(value); } - bool Identical(CPDF_Array* pOther) const; + FX_BOOL Identical(CPDF_Array* pOther) const; protected: ~CPDF_Array(); @@ -419,7 +419,7 @@ public: int GetInteger(const CFX_ByteStringC& key, int default_int) const; - bool GetBoolean(const CFX_ByteStringC& key, bool bDefault = false) const; + FX_BOOL GetBoolean(const CFX_ByteStringC& key, FX_BOOL bDefault = FALSE) const; FX_FLOAT GetNumber(const CFX_ByteStringC& key) const; @@ -439,7 +439,7 @@ public: } - bool KeyExist(const CFX_ByteStringC& key) const; + FX_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, bool bValue); + void SetAtBoolean(const CFX_ByteStringC& key, FX_BOOL bValue); @@ -487,7 +487,7 @@ public: void ReplaceKey(const CFX_ByteStringC& oldkey, const CFX_ByteStringC& newkey); - bool Identical(CPDF_Dictionary* pDict) const; + FX_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, bool bCompressed, bool bKeepBuf); + void SetData(const uint8_t* pData, FX_DWORD size, FX_BOOL bCompressed, FX_BOOL bKeepBuf); void InitStream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDict); void InitStream(IFX_FileRead *pFile, CPDF_Dictionary* pDict); - bool Identical(CPDF_Stream* pOther) const; + FX_BOOL Identical(CPDF_Stream* pOther) const; - CPDF_StreamFilter* GetStreamFilter(bool bRaw = false) const; + CPDF_StreamFilter* GetStreamFilter(FX_BOOL bRaw = FALSE) const; @@ -536,15 +536,15 @@ public: return m_dwSize; } - bool ReadRawData(FX_FILESIZE start_pos, uint8_t* pBuf, FX_DWORD buf_size) const; + FX_BOOL ReadRawData(FX_FILESIZE start_pos, uint8_t* pBuf, FX_DWORD buf_size) const; - bool IsMemoryBased() const + FX_BOOL IsMemoryBased() const { return m_GenNum == (FX_DWORD) - 1; } - CPDF_Stream* Clone(bool bDirect, FPDF_LPFCloneStreamCallback lpfCallback, void* pUserData) const; + CPDF_Stream* Clone(FX_BOOL bDirect, FPDF_LPFCloneStreamCallback lpfCallback, void* pUserData) const; protected: ~CPDF_Stream(); @@ -579,8 +579,8 @@ public: ~CPDF_StreamAcc(); - void LoadAllData(const CPDF_Stream* pStream, bool bRawAccess = false, - FX_DWORD estimated_size = 0, bool bImageAcc = false); + void LoadAllData(const CPDF_Stream* pStream, FX_BOOL bRawAccess = FALSE, + FX_DWORD estimated_size = 0, FX_BOOL bImageAcc = FALSE); const CPDF_Stream* GetStream() const { @@ -613,7 +613,7 @@ protected: FX_DWORD m_dwSize; - bool m_bNewBuf; + FX_BOOL m_bNewBuf; CFX_ByteString m_ImageDecoder; @@ -691,7 +691,7 @@ public: void SetRef(CPDF_IndirectObjects* pDoc, FX_DWORD objnum); - bool Identical(CPDF_Reference* pOther) const + FX_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 d76920ad1a..7aed626fae 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(bool bReleaseMembers = true); + CPDF_PageObjects(FX_BOOL bReleaseMembers = TRUE); ~CPDF_PageObjects(); @@ -45,7 +45,7 @@ public: return m_ParseState; } - bool IsParsed() const + FX_BOOL IsParsed() const { return m_ParseState == PDF_CONTENT_PARSED; } @@ -97,7 +97,7 @@ public: void Transform(const CFX_AffineMatrix& matrix); - bool BackgroundAlphaNeeded() const + FX_BOOL BackgroundAlphaNeeded() const { return m_bBackgroundAlphaNeeded; } @@ -125,15 +125,15 @@ protected: CFX_PtrList m_ObjectList; - bool m_bBackgroundAlphaNeeded; + FX_BOOL m_bBackgroundAlphaNeeded; - bool m_bReleaseMembers; + FX_BOOL m_bReleaseMembers; void LoadTransInfo(); void ClearCacheObjects(); CPDF_ContentParser* m_pParser; - bool m_ParseState; + FX_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, bool bPageCache = true); + void Load(CPDF_Document* pDocument, CPDF_Dictionary* pPageDict, FX_BOOL bPageCache = TRUE); - void StartParse(CPDF_ParseOptions* pOptions = NULL, bool bReParse = false); + void StartParse(CPDF_ParseOptions* pOptions = NULL, FX_BOOL bReParse = FALSE); - void ParseContent(CPDF_ParseOptions* pOptions = NULL, bool bReParse = false); + void ParseContent(CPDF_ParseOptions* pOptions = NULL, FX_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(); - bool m_bTextOnly; + FX_BOOL m_bTextOnly; - bool m_bMarkedContent; + FX_BOOL m_bMarkedContent; - bool m_bSeparateForm; + FX_BOOL m_bSeparateForm; - bool m_bDecodeInlineImage; + FX_BOOL m_bDecodeInlineImage; }; class CPDF_Form : public CPDF_PageObjects { @@ -229,7 +229,7 @@ class CPDF_PageContentGenerate public: CPDF_PageContentGenerate(CPDF_Page* pPage); ~CPDF_PageContentGenerate(); - bool InsertPageObject(CPDF_PageObject* pPageObject); + FX_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 c140de6c82..73540a3eb3 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); } - bool IsRect() const + FX_BOOL IsRect() const { return m_pObject->IsRect(); } @@ -147,7 +147,7 @@ public: CFX_FloatRect GetClipBox() const; - void AppendPath(CPDF_Path path, int type, bool bAutoMerge); + void AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge); void DeletePath(int layer_index); @@ -292,15 +292,15 @@ public: int m_RenderIntent; - bool m_StrokeAdjust; + FX_BOOL m_StrokeAdjust; - bool m_AlphaSource; + FX_BOOL m_AlphaSource; - bool m_TextKnockout; + FX_BOOL m_TextKnockout; - bool m_StrokeOP; + FX_BOOL m_StrokeOP; - bool m_FillOP; + FX_BOOL m_FillOP; int m_OPMode; @@ -325,7 +325,7 @@ public: return m_pObject ? m_pObject->m_BlendType : FXDIB_BLEND_NORMAL; } - int GetAlpha(bool bStroke) const + int GetAlpha(FX_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 bool HasMCID() const; + inline FX_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, bool bDictNeedClone); + void AddMark(const CFX_ByteString& name, CPDF_Dictionary* pDict, FX_BOOL bDictNeedClone); void DeleteLastMark(); private: @@ -418,9 +418,9 @@ public: return m_pObject ? m_pObject->GetMCID() : -1; } - bool HasMark(const CFX_ByteStringC& mark) const; + FX_BOOL HasMark(const CFX_ByteStringC& mark) const; - bool LookupMark(const CFX_ByteStringC& mark, CPDF_Dictionary*& pDict) const; + FX_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, bool bAutoMerge); + void AppendClipPath(CPDF_Path path, int type, FX_BOOL bAutoMerge); void CopyClipPath(CPDF_PageObject* pObj); @@ -629,7 +629,7 @@ public: int m_FillType; - bool m_bStroke; + FX_BOOL m_bStroke; CFX_AffineMatrix m_Matrix; diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h index 7a43947384..a856433a08 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(bool bCheckRevision = false) const; + FX_DWORD GetUserPermissions(FX_BOOL bCheckRevision = FALSE) const; - bool IsOwner() const; + FX_BOOL IsOwner() const; @@ -112,14 +112,14 @@ public: void ClearRenderFont(); - bool IsFormStream(FX_DWORD objnum, bool& bForm) const; + FX_BOOL IsFormStream(FX_DWORD objnum, FX_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, bool bShading, const CFX_AffineMatrix* matrix = NULL); + CPDF_Pattern* LoadPattern(CPDF_Object* pObj, FX_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, bool bVert, bool bTranslateName = false); - CPDF_Font* AddWindowsFont(LOGFONTW* pLogFont, bool bVert, bool bTranslateName = false); + CPDF_Font* AddWindowsFont(LOGFONTA* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE); + CPDF_Font* AddWindowsFont(LOGFONTW* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE); #endif #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - CPDF_Font* AddMacFont(CTFontRef pFont, bool bVert, bool bTranslateName = false); + CPDF_Font* AddMacFont(CTFontRef pFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE); #endif CPDF_Font* AddStandardFont(const FX_CHAR* font, CPDF_FontEncoding* pEncoding); - CPDF_Font* AddFont(CFX_Font* pFont, int charset, bool bVert); + CPDF_Font* AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert); void CreateNewDoc(); @@ -161,7 +161,7 @@ protected: CFX_ByteString m_ID2; - bool m_bLinearized; + FX_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); - bool IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* pPageDict); - bool CheckOCGVisible(CPDF_Dictionary* pOCG, bool bPrinting); + FX_BOOL IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* pPageDict); + FX_BOOL CheckOCGVisible(CPDF_Dictionary* pOCG, FX_BOOL bPrinting); CPDF_DocPageData* GetValidatePageData(); CPDF_DocRenderData* GetValidateRenderData(); friend class CPDF_Creator; @@ -204,14 +204,14 @@ public: CFX_ByteStringC GetWord(); - bool SearchToken(const CFX_ByteStringC& token); + FX_BOOL SearchToken(const CFX_ByteStringC& token); - bool SkipWord(const CFX_ByteStringC& token); + FX_BOOL SkipWord(const CFX_ByteStringC& token); - bool FindTagPair(const CFX_ByteStringC& start_token, const CFX_ByteStringC& end_token, + FX_BOOL FindTagPair(const CFX_ByteStringC& start_token, const CFX_ByteStringC& end_token, FX_DWORD& start_pos, FX_DWORD& end_pos); - bool FindTagParam(const CFX_ByteStringC& token, int nParams); + FX_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, bool bDecrypt = true); + CPDF_Object* GetObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, struct PARSE_CONTEXT* pContext = NULL, FX_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(); - bool SearchWord(const CFX_ByteStringC& word, bool bWholeWord, bool bForward, FX_FILESIZE limit); + FX_BOOL SearchWord(const CFX_ByteStringC& word, FX_BOOL bWholeWord, FX_BOOL bForward, FX_FILESIZE limit); - int SearchMultiWord(const CFX_ByteStringC& words, bool bWholeWord, FX_FILESIZE limit); + int SearchMultiWord(const CFX_ByteStringC& words, FX_BOOL bWholeWord, FX_FILESIZE limit); FX_FILESIZE FindTag(const CFX_ByteStringC& tag, FX_FILESIZE limit); @@ -282,27 +282,27 @@ public: m_pCryptoHandler = pCryptoHandler; } - bool IsEncrypted() + FX_BOOL IsEncrypted() { return m_pCryptoHandler != NULL; } - bool GetCharAt(FX_FILESIZE pos, uint8_t& ch); + FX_BOOL GetCharAt(FX_FILESIZE pos, uint8_t& ch); - bool ReadBlock(uint8_t* pBuf, FX_DWORD size); + FX_BOOL ReadBlock(uint8_t* pBuf, FX_DWORD size); - CFX_ByteString GetNextWord(bool& bIsNumber); + CFX_ByteString GetNextWord(FX_BOOL& bIsNumber); protected: static const int kParserMaxRecursionDepth = 64; static int s_CurrentRecursionDepth; - virtual bool GetNextChar(uint8_t& ch); + virtual FX_BOOL GetNextChar(uint8_t& ch); - bool GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch); + FX_BOOL GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch); void GetNextWord(); - bool IsWholeWord(FX_FILESIZE startpos, FX_FILESIZE limit, const uint8_t* tag, FX_DWORD taglen); + FX_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; - bool m_bFileStream; + FX_BOOL m_bFileStream; int m_MetadataObjnum; @@ -334,7 +334,7 @@ protected: FX_DWORD m_WordSize; - bool m_bIsNumber; + FX_BOOL m_bIsNumber; FX_FILESIZE m_dwWordPos; friend class CPDF_Parser; @@ -345,7 +345,7 @@ protected: #define PDFPARSE_NOSTREAM 2 struct PARSE_CONTEXT { - bool m_Flags; + FX_BOOL m_Flags; FX_FILESIZE m_DictStart; @@ -369,15 +369,15 @@ public: CPDF_Parser(); ~CPDF_Parser(); - 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); + FX_DWORD StartParse(const FX_CHAR* filename, FX_BOOL bReParse = FALSE); + FX_DWORD StartParse(const FX_WCHAR* filename, FX_BOOL bReParse = FALSE); + FX_DWORD StartParse(IFX_FileRead* pFile, FX_BOOL bReParse = FALSE, FX_BOOL bOwnFileRead = TRUE); - void CloseParser(bool bReParse = false); + void CloseParser(FX_BOOL bReParse = FALSE); - FX_DWORD GetPermissions(bool bCheckRevision = false); + FX_DWORD GetPermissions(FX_BOOL bCheckRevision = FALSE); - bool IsOwner(); + FX_BOOL IsOwner(); void SetPassword(const FX_CHAR* password) { @@ -399,7 +399,7 @@ public: return m_Syntax.m_pCryptoHandler; } - void SetSecurityHandler(CPDF_SecurityHandler* pSecurityHandler, bool bForced = false); + void SetSecurityHandler(CPDF_SecurityHandler* pSecurityHandler, FX_BOOL bForced = FALSE); CFX_ByteString GetRecipient() { @@ -435,7 +435,7 @@ public: return m_pEncryptDict; } - bool IsEncrypted() + FX_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(); - bool IsFormStream(FX_DWORD objnum, bool& bForm); + FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm); FX_FILESIZE GetObjectOffset(FX_DWORD objnum); @@ -456,12 +456,12 @@ public: void GetIndirectBinary(FX_DWORD objnum, uint8_t*& pBuffer, FX_DWORD& size); - bool GetFileStreamOption() + FX_BOOL GetFileStreamOption() { return m_Syntax.m_bFileStream; } - void SetFileStreamOption(bool b) + void SetFileStreamOption(FX_BOOL b) { m_Syntax.m_bFileStream = b; } @@ -476,7 +476,7 @@ public: return m_FileVersion; } - bool IsXRefStream() const + FX_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, bool bReParse = false, bool bOwnFileRead = true); + FX_DWORD StartAsynParse(IFX_FileRead* pFile, FX_BOOL bReParse = FALSE, FX_BOOL bOwnFileRead = TRUE); FX_DWORD GetFirstPageNo() { @@ -496,30 +496,30 @@ protected: CPDF_Document* m_pDocument; CPDF_SyntaxParser m_Syntax; - bool m_bOwnFileRead; + FX_BOOL m_bOwnFileRead; CPDF_Object* ParseDirect(CPDF_Object* pObj); - bool LoadAllCrossRefV4(FX_FILESIZE pos); + FX_BOOL LoadAllCrossRefV4(FX_FILESIZE pos); - bool LoadAllCrossRefV5(FX_FILESIZE pos); + FX_BOOL LoadAllCrossRefV5(FX_FILESIZE pos); - bool LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, bool bSkip, bool bFirst); + FX_BOOL LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, FX_BOOL bSkip, FX_BOOL bFirst); - bool LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, bool bMainXRef); + FX_BOOL LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, FX_BOOL bMainXRef); CPDF_Dictionary* LoadTrailerV4(); - bool RebuildCrossRef(); + FX_BOOL RebuildCrossRef(); FX_DWORD SetEncryptHandler(); void ReleaseEncryptHandler(); - bool LoadLinearizedAllCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount); + FX_BOOL LoadLinearizedAllCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount); - bool LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount); + FX_BOOL LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount); - bool LoadLinearizedAllCrossRefV5(FX_FILESIZE pos); + FX_BOOL LoadLinearizedAllCrossRefV5(FX_FILESIZE pos); FX_DWORD LoadLinearizedMainXRefTable(); @@ -527,7 +527,7 @@ protected: CPDF_StreamAcc* GetObjectStream(FX_DWORD number); - bool IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset); + FX_BOOL IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset); @@ -540,12 +540,12 @@ protected: FX_FILESIZE m_LastXRefOffset; - bool m_bXRefStream; + FX_BOOL m_bXRefStream; CPDF_SecurityHandler* m_pSecurityHandler; - bool m_bForceUseSecurityHandler; + FX_BOOL m_bForceUseSecurityHandler; CFX_ByteString m_bsRecipient; @@ -562,7 +562,7 @@ protected: CFX_WordArray m_ObjVersion; CFX_ArrayTemplate<CPDF_Dictionary *> m_Trailers; - bool m_bVersionUpdated; + FX_BOOL m_bVersionUpdated; CPDF_Object* m_pLinearized; @@ -582,17 +582,17 @@ public: virtual ~CPDF_SecurityHandler() {} - virtual bool OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict) = 0; + virtual FX_BOOL OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict) = 0; virtual FX_DWORD GetPermissions() = 0; - virtual bool IsOwner() = 0; + virtual FX_BOOL IsOwner() = 0; - virtual bool GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen) = 0; + virtual FX_BOOL GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen) = 0; - virtual bool IsMetadataEncrypted() + virtual FX_BOOL IsMetadataEncrypted() { - return true; + return TRUE; } virtual CPDF_CryptoHandler* CreateCryptoHandler() = 0; @@ -609,14 +609,14 @@ public: CPDF_StandardSecurityHandler(); virtual ~CPDF_StandardSecurityHandler(); - virtual bool OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict); + virtual FX_BOOL OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict); virtual FX_DWORD GetPermissions(); - virtual bool IsOwner() + virtual FX_BOOL IsOwner() { return m_bOwner; } - virtual bool GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen); - virtual bool IsMetadataEncrypted(); + virtual FX_BOOL GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen); + virtual FX_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, bool bOwner, uint8_t* key); - int CheckPassword(const uint8_t* password, FX_DWORD pass_size, bool bOwner, uint8_t* key, int key_len); + int CheckPassword(const uint8_t* password, FX_DWORD pass_size, FX_BOOL bOwner, uint8_t* key); + int CheckPassword(const uint8_t* password, FX_DWORD pass_size, FX_BOOL bOwner, uint8_t* key, int key_len); private: int m_Version; @@ -653,22 +653,22 @@ private: CPDF_Dictionary* m_pEncryptDict; - bool LoadDict(CPDF_Dictionary* pEncryptDict); - bool LoadDict(CPDF_Dictionary* pEncryptDict, FX_DWORD type, int& cipher, int& key_len); + FX_BOOL LoadDict(CPDF_Dictionary* pEncryptDict); + FX_BOOL LoadDict(CPDF_Dictionary* pEncryptDict, FX_DWORD type, int& cipher, int& key_len); - bool CheckUserPassword(const uint8_t* password, FX_DWORD pass_size, - bool bIgnoreEncryptMeta, uint8_t* key, int32_t key_len); + FX_BOOL CheckUserPassword(const uint8_t* password, FX_DWORD pass_size, + FX_BOOL bIgnoreEncryptMeta, uint8_t* key, int32_t key_len); - 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); + FX_BOOL CheckOwnerPassword(const uint8_t* password, FX_DWORD pass_size, uint8_t* key, int32_t key_len); + FX_BOOL AES256_CheckPassword(const uint8_t* password, FX_DWORD size, FX_BOOL bOwner, uint8_t* key); + void AES256_SetPassword(CPDF_Dictionary* pEncryptDict, const uint8_t* password, FX_DWORD size, FX_BOOL bOwner, const uint8_t* key); + void AES256_SetPerms(CPDF_Dictionary* pEncryptDict, FX_DWORD permission, FX_BOOL bEncryptMetadata, const uint8_t* key); void OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray, const uint8_t* user_pass, FX_DWORD user_size, - const uint8_t* owner_pass, FX_DWORD owner_size, bool bDefault, FX_DWORD type); - bool CheckSecurity(int32_t key_len); + const uint8_t* owner_pass, FX_DWORD owner_size, FX_BOOL bDefault, FX_DWORD type); + FX_BOOL CheckSecurity(int32_t key_len); - bool m_bOwner; + FX_BOOL m_bOwner; FX_DWORD m_Permissions; @@ -684,20 +684,20 @@ public: virtual ~CPDF_CryptoHandler() {} - virtual bool Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler) = 0; + virtual FX_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 bool DecryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) = 0; + virtual FX_BOOL DecryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) = 0; - virtual bool DecryptFinish(void* context, CFX_BinaryBuf& dest_buf) = 0; + virtual FX_BOOL DecryptFinish(void* context, CFX_BinaryBuf& dest_buf) = 0; virtual FX_DWORD EncryptGetSize(FX_DWORD objnum, FX_DWORD version, const uint8_t* src_buf, FX_DWORD src_size) = 0; - virtual bool EncryptContent(FX_DWORD objnum, FX_DWORD version, const uint8_t* src_buf, FX_DWORD src_size, + virtual FX_BOOL EncryptContent(FX_DWORD objnum, FX_DWORD version, const uint8_t* src_buf, FX_DWORD src_size, uint8_t* dest_buf, FX_DWORD& dest_size) = 0; void Decrypt(FX_DWORD objnum, FX_DWORD version, CFX_ByteString& str); @@ -710,22 +710,22 @@ public: virtual ~CPDF_StandardCryptoHandler(); - bool Init(int cipher, const uint8_t* key, int keylen); - virtual bool Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler); + FX_BOOL Init(int cipher, const uint8_t* key, int keylen); + virtual FX_BOOL Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler); virtual FX_DWORD DecryptGetSize(FX_DWORD src_size); virtual void* DecryptStart(FX_DWORD objnum, FX_DWORD gennum); - 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_BOOL DecryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf); + virtual FX_BOOL DecryptFinish(void* context, CFX_BinaryBuf& dest_buf); virtual FX_DWORD EncryptGetSize(FX_DWORD objnum, FX_DWORD version, const uint8_t* src_buf, FX_DWORD src_size); - virtual bool EncryptContent(FX_DWORD objnum, FX_DWORD version, const uint8_t* src_buf, FX_DWORD src_size, + virtual FX_BOOL EncryptContent(FX_DWORD objnum, FX_DWORD version, const uint8_t* src_buf, FX_DWORD src_size, uint8_t* dest_buf, FX_DWORD& dest_size); protected: - virtual void CryptBlock(bool bEncrypt, FX_DWORD objnum, FX_DWORD gennum, const uint8_t* src_buf, FX_DWORD src_size, + virtual void CryptBlock(FX_BOOL bEncrypt, FX_DWORD objnum, FX_DWORD gennum, const uint8_t* src_buf, FX_DWORD src_size, uint8_t* dest_buf, FX_DWORD& dest_size); - virtual void* CryptStart(FX_DWORD objnum, FX_DWORD gennum, 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); + virtual void* CryptStart(FX_DWORD objnum, FX_DWORD gennum, FX_BOOL bEncrypt); + virtual FX_BOOL CryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt); + virtual FX_BOOL CryptFinish(void* context, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt); uint8_t m_EncryptKey[32]; @@ -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, bool bHex = false); +CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, FX_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, bool bOwnFile = false); + static CFDF_Document* ParseFile(IFX_FileRead *pFile, FX_BOOL bOwnFile = FALSE); static CFDF_Document* ParseMemory(const uint8_t* pData, FX_DWORD size); ~CFDF_Document(); - bool WriteBuf(CFX_ByteTextBuf& buf) const; + FX_BOOL WriteBuf(CFX_ByteTextBuf& buf) const; CPDF_Dictionary* GetRoot() const { @@ -785,10 +785,10 @@ public: protected: CFDF_Document(); - void ParseStream(IFX_FileRead *pFile, bool bOwnFile); + void ParseStream(IFX_FileRead *pFile, FX_BOOL bOwnFile); CPDF_Dictionary* m_pRootDict; IFX_FileRead* m_pFile; - bool m_bOwnFile; + FX_BOOL m_bOwnFile; }; CFX_WideString FPDF_FileSpec_GetWin32Path(const CPDF_Object* pFileSpec); @@ -816,7 +816,7 @@ class IFX_FileAvail { public: virtual ~IFX_FileAvail() { } - virtual bool IsDataAvail( FX_FILESIZE offset, FX_DWORD size) = 0; + virtual FX_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 bool IsDocAvail(IFX_DownloadHints* pHints) = 0; + virtual FX_BOOL IsDocAvail(IFX_DownloadHints* pHints) = 0; virtual void SetDocument(CPDF_Document* pDoc) = 0; - virtual bool IsPageAvail(int iPage, IFX_DownloadHints* pHints) = 0; - virtual bool IsLinearized() = 0; + virtual FX_BOOL IsPageAvail(int iPage, IFX_DownloadHints* pHints) = 0; + virtual FX_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); - bool Find(FX_DWORD dwObjNum); + FX_BOOL Find(FX_DWORD dwObjNum); void RemoveAll() { @@ -867,7 +867,7 @@ public: } protected: - bool BinarySearch(FX_DWORD value, int &iNext); + FX_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 37e8a540c1..f3590095ad 100644 --- a/core/include/fpdfapi/fpdf_render.h +++ b/core/include/fpdfapi/fpdf_render.h @@ -33,9 +33,9 @@ public: virtual ~IPDF_OCContext() {} - virtual bool CheckOCGVisible(const CPDF_Dictionary* pOCG) = 0; + virtual FX_BOOL CheckOCGVisible(const CPDF_Dictionary* pOCG) = 0; - bool CheckObjectVisible(const CPDF_PageObject* pObj); + FX_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, bool bFirstLayer = true); + void Create(CPDF_Page* pPage, FX_BOOL bFirstLayer = TRUE); void Create(CPDF_Document* pDoc = NULL, CPDF_PageRenderCache* pPageCache = NULL, - CPDF_Dictionary* pPageResources = NULL, bool bFirstLayer = true); + CPDF_Dictionary* pPageResources = NULL, FX_BOOL bFirstLayer = TRUE); ~CPDF_RenderContext(); @@ -126,7 +126,7 @@ protected: CFX_ArrayTemplate<struct _PDF_RenderItem> m_ContentList; - bool m_bFirstLayer; + FX_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 bool DrawTextPath(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, + static FX_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 bool DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, + static FX_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 bool DrawType3Text(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, + static FX_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, - bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false, + FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_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: - bool StartGetCachedBitmap(CPDF_Stream* pStream, bool bStdCS = false, FX_DWORD GroupFamily = 0, - bool bLoadMask = false, CPDF_RenderStatus* pRenderStatus = NULL, + FX_BOOL StartGetCachedBitmap(CPDF_Stream* pStream, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, + FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, int32_t downsampleWidth = 0, int32_t downsampleHeight = 0); - bool Continue(IFX_Pause* pPause); + FX_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; - bool m_bCurFindCache; + FX_BOOL m_bCurFindCache; }; class CPDF_RenderConfig { diff --git a/core/include/fpdfapi/fpdf_resource.h b/core/include/fpdfapi/fpdf_resource.h index c60737d36e..5c8cc85217 100644 --- a/core/include/fpdfapi/fpdf_resource.h +++ b/core/include/fpdfapi/fpdf_resource.h @@ -116,7 +116,7 @@ public: return m_Flags; } - virtual bool IsVertWriting()const; + virtual FX_BOOL IsVertWriting()const; @@ -142,14 +142,14 @@ public: } - bool IsEmbedded() const + FX_BOOL IsEmbedded() const { return m_FontType == PDFFONT_TYPE3 || m_pFontFile != NULL; } - virtual bool IsUnicodeCompatible() const + virtual FX_BOOL IsUnicodeCompatible() const { - return false; + return FALSE; } CPDF_StreamAcc* GetFontFile() const @@ -162,7 +162,7 @@ public: return m_pFontDict; } - bool IsStandardFont() const; + FX_BOOL IsStandardFont() const; FXFT_Face GetFace() const { @@ -199,7 +199,7 @@ public: - virtual int GlyphFromCharCode(FX_DWORD charcode, bool *pVertGlyph = NULL) = 0; + virtual int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph = NULL) = 0; virtual int GlyphFromCharCodeExt(FX_DWORD charcode) { return GlyphFromCharCode(charcode); @@ -265,11 +265,11 @@ public: protected: explicit CPDF_Font(int fonttype); - bool Initialize(); + FX_BOOL Initialize(); - bool Load(); + FX_BOOL Load(); - virtual bool _Load() = 0; + virtual FX_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, bool bEmbedded, bool bTrueType); + CFX_ByteString*& pCharNames, FX_BOOL bEmbedded, FX_BOOL bTrueType); void LoadFontDescriptor(CPDF_Dictionary*); @@ -298,7 +298,7 @@ protected: CPDF_ToUnicodeMap* m_pToUnicodeMap; - bool m_bToUnicodeLoaded; + FX_BOOL m_bToUnicodeLoaded; @@ -338,7 +338,7 @@ public: void LoadEncoding(CPDF_Object* pEncoding); - bool IsIdentical(CPDF_FontEncoding* pAnother) const; + FX_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, bool *pVertGlyph = NULL) override; - bool IsUnicodeCompatible() const override; + int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph = NULL) override; + FX_BOOL IsUnicodeCompatible() const override; protected: - bool LoadCommon(); + FX_BOOL LoadCommon(); void LoadSubstFont(); @@ -401,7 +401,7 @@ protected: int m_BaseEncoding; FX_WORD m_CharWidth[256]; FX_SMALL_RECT m_CharBBox[256]; - bool m_bUseFontWidth; + FX_BOOL m_bUseFontWidth; }; class CPDF_Type1Font : public CPDF_SimpleFont @@ -416,7 +416,7 @@ public: } virtual int GlyphFromCharCodeExt(FX_DWORD charcode); protected: - virtual bool _Load(); + virtual FX_BOOL _Load(); int m_Base14Font; virtual void LoadGlyphMap(); @@ -427,7 +427,7 @@ public: CPDF_TrueTypeFont(); protected: - virtual bool _Load(); + virtual FX_BOOL _Load(); virtual void LoadGlyphMap(); }; class CPDF_Type3Char @@ -438,11 +438,11 @@ public: ~CPDF_Type3Char(); - bool LoadBitmap(CPDF_RenderContext* pContext); + FX_BOOL LoadBitmap(CPDF_RenderContext* pContext); - bool m_bColored; + FX_BOOL m_bColored; - bool m_bPageRequired; + FX_BOOL m_bPageRequired; @@ -484,7 +484,7 @@ protected: CFX_AffineMatrix m_FontMatrix; private: - bool _Load() override; + FX_BOOL _Load() override; void LoadGlyphMap() override {} int m_CharWidthL[256]; @@ -511,13 +511,13 @@ public: ~CPDF_CIDFont() override; - bool LoadGB2312(); - int GlyphFromCharCode(FX_DWORD charcode, bool *pVertGlyph = NULL) override; + FX_BOOL LoadGB2312(); + int GlyphFromCharCode(FX_DWORD charcode, FX_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; - bool IsTrueType() const + FX_BOOL IsTrueType() const { return !m_bType1; } @@ -533,19 +533,19 @@ public: } const uint8_t* GetCIDTransform(FX_WORD CID) const; - bool IsVertWriting() const override; + FX_BOOL IsVertWriting() const override; short GetVertWidth(FX_WORD CID) const; void GetVertOrigin(FX_WORD CID, short& vx, short& vy) const; - bool IsUnicodeCompatible() const override; - virtual bool IsFontStyleFromCharCode(FX_DWORD charcode) const; + FX_BOOL IsUnicodeCompatible() const override; + virtual FX_BOOL IsFontStyleFromCharCode(FX_DWORD charcode) const; protected: friend class CPDF_Font; - bool _Load() override; + FX_BOOL _Load() override; FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const override; FX_DWORD _CharCodeFromUnicode(FX_WCHAR Unicode) const override; - int GetGlyphIndex(FX_DWORD unicodeb, bool *pVertGlyph); + int GetGlyphIndex(FX_DWORD unicodeb, FX_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; - bool m_bType1; + FX_BOOL m_bType1; CPDF_StreamAcc* m_pCIDToGIDMap; - bool m_bCIDIsGID; + FX_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; - bool m_bAdobeCourierStd; + FX_BOOL m_bAdobeCourierStd; CFX_CTTGSUBTable* m_pTTGSUBTable; }; @@ -612,27 +612,27 @@ public: max = 1.0f; } - bool sRGB() const; + FX_BOOL sRGB() const; - virtual bool GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const = 0; + virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const = 0; - virtual bool SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const + virtual FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const { - return false; + return FALSE; } - bool GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const; + FX_BOOL GetCMYK(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; + FX_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, bool bTransMask = false) const; + int image_width, int image_height, FX_BOOL bTransMask = FALSE) const; CPDF_Array*& GetArray() { @@ -646,7 +646,7 @@ public: return NULL; } - virtual void EnableStdConversion(bool bEnabled); + virtual void EnableStdConversion(FX_BOOL bEnabled); CPDF_Document* const m_pDocument; @@ -659,17 +659,17 @@ protected: m_dwStdConversion(0) { } virtual ~CPDF_ColorSpace() {} - virtual bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) + virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) { - return true; + return TRUE; } - virtual bool v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const + virtual FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const { - return false; + return FALSE; } - virtual bool v_SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const + virtual FX_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(); - bool IsNull() const + FX_BOOL IsNull() const { return m_pBuffer == NULL; } - bool IsEqual(const CPDF_Color& other) const; + FX_BOOL IsEqual(const CPDF_Color& other) const; - bool IsPattern() const + FX_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); - bool GetRGB(int& R, int& G, int& B) const; + FX_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(bool bForceClear) { m_bForceClear = bForceClear; } + void SetForceClear(FX_BOOL bForceClear) { m_bForceClear = bForceClear; } CPDF_Object* m_pPatternObj; @@ -747,7 +747,7 @@ public: protected: CPDF_Pattern(const CFX_AffineMatrix* pParentMatrix); - bool m_bForceClear; + FX_BOOL m_bForceClear; }; class CPDF_TilingPattern : public CPDF_Pattern @@ -758,11 +758,11 @@ public: virtual ~CPDF_TilingPattern(); - bool Load(); + FX_BOOL Load(); - bool m_bColored; + FX_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, bool bShading, const CFX_AffineMatrix* parentMatrix); + CPDF_ShadingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* parentMatrix); virtual ~CPDF_ShadingPattern(); CPDF_Object* m_pShadingObj; - bool m_bShadingObj; + FX_BOOL m_bShadingObj; - bool Load(); + FX_BOOL Load(); - bool Reload(); + FX_BOOL Reload(); int m_ShadingType; @@ -810,7 +810,7 @@ class CPDF_MeshStream { public: - bool Load(CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS); + FX_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); - bool GetVertexRow(CPDF_MeshVertex* vertex, int count, CFX_AffineMatrix* pObject2Bitmap); + FX_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(); - bool LoadImageF(CPDF_Stream* pImageStream, bool bInline); + FX_BOOL LoadImageF(CPDF_Stream* pImageStream, FX_BOOL bInline); void Release(); CPDF_Image* Clone(); - bool IsInline() + FX_BOOL IsInline() { return m_bInline; } @@ -908,17 +908,17 @@ public: } - bool IsMask() const + FX_BOOL IsMask() const { return m_bIsMask; } - bool IsInterpol() const + FX_BOOL IsInterpol() const { return m_bInterpolate; } - CFX_DIBSource* LoadDIBSource(CFX_DIBSource** ppMask = NULL, FX_DWORD* pMatteColor = NULL, bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false) const; + CFX_DIBSource* LoadDIBSource(CFX_DIBSource** ppMask = NULL, FX_DWORD* pMatteColor = NULL, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE) const; @@ -931,8 +931,8 @@ public: void ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pDIBitmap); public: - bool StartLoadDIBSource(CPDF_Dictionary* pFormResource, CPDF_Dictionary* pPageResource, bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false); - bool Continue(IFX_Pause* pPause); + 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); CFX_DIBSource* DetachBitmap(); CFX_DIBSource* DetachMask(); CFX_DIBSource* m_pDIBSource; @@ -941,16 +941,16 @@ public: private: CPDF_Stream* m_pStream; - bool m_bInline; + FX_BOOL m_bInline; CPDF_Dictionary* m_pInlineDict; int32_t m_Height; int32_t m_Width; - bool m_bIsMask; + FX_BOOL m_bIsMask; - bool m_bInterpolate; + FX_BOOL m_bInterpolate; CPDF_Document* m_pDocument; diff --git a/core/include/fpdfapi/fpdf_serial.h b/core/include/fpdfapi/fpdf_serial.h index 06cf213d99..1877ef8866 100644 --- a/core/include/fpdfapi/fpdf_serial.h +++ b/core/include/fpdfapi/fpdf_serial.h @@ -117,35 +117,35 @@ public: void RemoveSecurity(); - bool Create(const FX_WCHAR* filename, FX_DWORD flags = 0); + FX_BOOL Create(const FX_WCHAR* filename, FX_DWORD flags = 0); - bool Create(const FX_CHAR* filename, FX_DWORD flags = 0); + FX_BOOL Create(const FX_CHAR* filename, FX_DWORD flags = 0); - bool Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0); + FX_BOOL Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0); int32_t Continue(IFX_Pause *pPause = NULL); - bool SetFileVersion(int32_t fileVersion = 17); + FX_BOOL SetFileVersion(int32_t fileVersion = 17); protected: CPDF_Document* m_pDocument; CPDF_Parser* m_pParser; - bool m_bCompress; + FX_BOOL m_bCompress; - bool m_bSecurityChanged; + FX_BOOL m_bSecurityChanged; CPDF_Dictionary* m_pEncryptDict; FX_DWORD m_dwEnryptObjNum; - bool m_bEncryptCloned; + FX_BOOL m_bEncryptCloned; - bool m_bStandardSecurity; + FX_BOOL m_bStandardSecurity; CPDF_CryptoHandler* m_pCryptoHandler; - bool m_bNewCrypto; + FX_BOOL m_bNewCrypto; - bool m_bEncryptMetadata; + FX_BOOL m_bEncryptMetadata; CPDF_Object* m_pMetadata; @@ -154,7 +154,7 @@ protected: int32_t m_ObjectStreamSize; FX_DWORD m_dwLastObjNum; - bool Create(FX_DWORD flags); + FX_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(bool bIncremental, IFX_Pause *pPause); + int32_t WriteNewObjs(FX_BOOL bIncremental, IFX_Pause *pPause); int32_t WriteIndirectObj(const CPDF_Object* pObj); - int32_t WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, bool bEncrypt = true); + int32_t WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, FX_BOOL bEncrypt = TRUE); int32_t WriteIndirectObjectToStream(const CPDF_Object* pObj); int32_t WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj); int32_t WriteIndirectObjectToStream(FX_DWORD objnum, const uint8_t* pBuffer, FX_DWORD dwSize); int32_t AppendObjectNumberToXRef(FX_DWORD objnum); - void InitID(bool bDefault = true); + void InitID(FX_BOOL bDefault = TRUE); int32_t WriteStream(const CPDF_Object* pStream, FX_DWORD objnum, CPDF_CryptoHandler* pCrypto); int32_t m_iStage; |