| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ | 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ |
| 8 #define CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ | 8 #define CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ |
| 9 | 9 |
| 10 #include "../fxge/fx_dib.h" | 10 #include "../fxge/fx_dib.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class CPDF_AllStates; | 21 class CPDF_AllStates; |
| 22 class CPDF_ContentParser; | 22 class CPDF_ContentParser; |
| 23 class CPDF_StreamContentParser; | 23 class CPDF_StreamContentParser; |
| 24 #define PDFTRANS_GROUP 0x0100 | 24 #define PDFTRANS_GROUP 0x0100 |
| 25 #define PDFTRANS_ISOLATED 0x0200 | 25 #define PDFTRANS_ISOLATED 0x0200 |
| 26 #define PDFTRANS_KNOCKOUT 0x0400 | 26 #define PDFTRANS_KNOCKOUT 0x0400 |
| 27 | 27 |
| 28 class CPDF_PageObjects | 28 class CPDF_PageObjects |
| 29 { | 29 { |
| 30 public: | 30 public: |
| 31 CPDF_PageObjects(bool bReleaseMembers = true); | 31 CPDF_PageObjects(FX_BOOL bReleaseMembers = TRUE); |
| 32 ~CPDF_PageObjects(); | 32 ~CPDF_PageObjects(); |
| 33 | 33 |
| 34 void ContinueParse(IFX_Pause* pPause); | 34 void ContinueParse(IFX_Pause* pPause); |
| 35 | 35 |
| 36 bool» » » » IsParsed() const | 36 FX_BOOL» » » » IsParsed() const |
| 37 { | 37 { |
| 38 return m_ParseState == CONTENT_PARSED; | 38 return m_ParseState == CONTENT_PARSED; |
| 39 } | 39 } |
| 40 | 40 |
| 41 FX_POSITION GetFirstObjectPosition() const | 41 FX_POSITION GetFirstObjectPosition() const |
| 42 { | 42 { |
| 43 return m_ObjectList.GetHeadPosition(); | 43 return m_ObjectList.GetHeadPosition(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 FX_POSITION GetLastObjectPosition() const | 46 FX_POSITION GetLastObjectPosition() const |
| (...skipping 22 matching lines...) Expand all Loading... |
| 69 } | 69 } |
| 70 | 70 |
| 71 int GetObjectIndex(CPDF_PageObject* pObj) co
nst; | 71 int GetObjectIndex(CPDF_PageObject* pObj) co
nst; |
| 72 | 72 |
| 73 CPDF_PageObject* GetObjectByIndex(int index) const; | 73 CPDF_PageObject* GetObjectByIndex(int index) const; |
| 74 | 74 |
| 75 FX_POSITION InsertObject(FX_POSITION posInsertAfter, CPDF_Pa
geObject* pNewObject); | 75 FX_POSITION InsertObject(FX_POSITION posInsertAfter, CPDF_Pa
geObject* pNewObject); |
| 76 | 76 |
| 77 void Transform(const CFX_AffineMatrix& matrix
); | 77 void Transform(const CFX_AffineMatrix& matrix
); |
| 78 | 78 |
| 79 bool» » » » BackgroundAlphaNeeded() const | 79 FX_BOOL» » » » BackgroundAlphaNeeded() const |
| 80 { | 80 { |
| 81 return m_bBackgroundAlphaNeeded; | 81 return m_bBackgroundAlphaNeeded; |
| 82 } | 82 } |
| 83 | 83 |
| 84 CFX_FloatRect CalcBoundingBox() const; | 84 CFX_FloatRect CalcBoundingBox() const; |
| 85 | 85 |
| 86 CPDF_Dictionary* m_pFormDict; | 86 CPDF_Dictionary* m_pFormDict; |
| 87 CPDF_Stream* m_pFormStream; | 87 CPDF_Stream* m_pFormStream; |
| 88 CPDF_Document* m_pDocument; | 88 CPDF_Document* m_pDocument; |
| 89 CPDF_Dictionary* m_pPageResources; | 89 CPDF_Dictionary* m_pPageResources; |
| 90 CPDF_Dictionary* m_pResources; | 90 CPDF_Dictionary* m_pResources; |
| 91 CFX_FloatRect m_BBox; | 91 CFX_FloatRect m_BBox; |
| 92 int m_Transparency; | 92 int m_Transparency; |
| 93 | 93 |
| 94 protected: | 94 protected: |
| 95 friend class CPDF_ContentParser; | 95 friend class CPDF_ContentParser; |
| 96 friend class CPDF_StreamContentParser; | 96 friend class CPDF_StreamContentParser; |
| 97 friend class CPDF_AllStates; | 97 friend class CPDF_AllStates; |
| 98 | 98 |
| 99 enum ParseState { | 99 enum ParseState { |
| 100 CONTENT_NOT_PARSED, | 100 CONTENT_NOT_PARSED, |
| 101 CONTENT_PARSING, | 101 CONTENT_PARSING, |
| 102 CONTENT_PARSED | 102 CONTENT_PARSED |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 void LoadTransInfo(); | 105 void LoadTransInfo(); |
| 106 void ClearCacheObjects(); | 106 void ClearCacheObjects(); |
| 107 | 107 |
| 108 CFX_PtrList m_ObjectList; | 108 CFX_PtrList m_ObjectList; |
| 109 bool» » » » m_bBackgroundAlphaNeeded; | 109 FX_BOOL» » » » m_bBackgroundAlphaNeeded; |
| 110 bool» » » » m_bReleaseMembers; | 110 FX_BOOL» » » » m_bReleaseMembers; |
| 111 CPDF_ContentParser* m_pParser; | 111 CPDF_ContentParser* m_pParser; |
| 112 ParseState m_ParseState; | 112 ParseState m_ParseState; |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 class CPDF_Page : public CPDF_PageObjects, public CFX_PrivateData | 115 class CPDF_Page : public CPDF_PageObjects, public CFX_PrivateData |
| 116 { | 116 { |
| 117 public: | 117 public: |
| 118 | 118 |
| 119 CPDF_Page(); | 119 CPDF_Page(); |
| 120 | 120 |
| 121 ~CPDF_Page(); | 121 ~CPDF_Page(); |
| 122 | 122 |
| 123 void» » » » Load(CPDF_Document* pDocument, CPDF_Dict
ionary* pPageDict, bool bPageCache = true); | 123 void» » » » Load(CPDF_Document* pDocument, CPDF_Dict
ionary* pPageDict, FX_BOOL bPageCache = TRUE); |
| 124 | 124 |
| 125 void» » » » StartParse(CPDF_ParseOptions* pOptions =
NULL, bool bReParse = false); | 125 void» » » » StartParse(CPDF_ParseOptions* pOptions =
NULL, FX_BOOL bReParse = FALSE); |
| 126 | 126 |
| 127 void» » » » ParseContent(CPDF_ParseOptions* pOptions
= NULL, bool bReParse = false); | 127 void» » » » ParseContent(CPDF_ParseOptions* pOptions
= NULL, FX_BOOL bReParse = FALSE); |
| 128 | 128 |
| 129 void GetDisplayMatrix(CFX_AffineMatrix& matri
x, int xPos, int yPos, | 129 void GetDisplayMatrix(CFX_AffineMatrix& matri
x, int xPos, int yPos, |
| 130 int xSize, int ySize, int iRotate) cons
t; | 130 int xSize, int ySize, int iRotate) cons
t; |
| 131 | 131 |
| 132 FX_FLOAT GetPageWidth() const | 132 FX_FLOAT GetPageWidth() const |
| 133 { | 133 { |
| 134 return m_PageWidth; | 134 return m_PageWidth; |
| 135 } | 135 } |
| 136 | 136 |
| 137 FX_FLOAT GetPageHeight() const | 137 FX_FLOAT GetPageHeight() const |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 CFX_AffineMatrix m_PageMatrix; | 170 CFX_AffineMatrix m_PageMatrix; |
| 171 | 171 |
| 172 CPDF_PageRenderCache* m_pPageRender; | 172 CPDF_PageRenderCache* m_pPageRender; |
| 173 }; | 173 }; |
| 174 class CPDF_ParseOptions | 174 class CPDF_ParseOptions |
| 175 { | 175 { |
| 176 public: | 176 public: |
| 177 | 177 |
| 178 CPDF_ParseOptions(); | 178 CPDF_ParseOptions(); |
| 179 | 179 |
| 180 bool» » » » m_bTextOnly; | 180 FX_BOOL» » » » m_bTextOnly; |
| 181 | 181 |
| 182 bool» » » » m_bMarkedContent; | 182 FX_BOOL» » » » m_bMarkedContent; |
| 183 | 183 |
| 184 bool» » » » m_bSeparateForm; | 184 FX_BOOL» » » » m_bSeparateForm; |
| 185 | 185 |
| 186 bool» » » » m_bDecodeInlineImage; | 186 FX_BOOL» » » » m_bDecodeInlineImage; |
| 187 }; | 187 }; |
| 188 class CPDF_Form : public CPDF_PageObjects | 188 class CPDF_Form : public CPDF_PageObjects |
| 189 { | 189 { |
| 190 public: | 190 public: |
| 191 | 191 |
| 192 CPDF_Form(CPDF_Document* pDocument, CPDF_Dictionary* pPageResources, CPDF_St
ream* pFormStream, CPDF_Dictionary* pParentResources = NULL); | 192 CPDF_Form(CPDF_Document* pDocument, CPDF_Dictionary* pPageResources, CPDF_St
ream* pFormStream, CPDF_Dictionary* pParentResources = NULL); |
| 193 | 193 |
| 194 ~CPDF_Form(); | 194 ~CPDF_Form(); |
| 195 | 195 |
| 196 void StartParse(CPDF_AllStates* pGraphicState
s, CFX_AffineMatrix* pParentMatrix, | 196 void StartParse(CPDF_AllStates* pGraphicState
s, CFX_AffineMatrix* pParentMatrix, |
| 197 CPDF_Type3Char* pType3Char, CPDF_ParseOptions
* pOptions, int level = 0); | 197 CPDF_Type3Char* pType3Char, CPDF_ParseOptions
* pOptions, int level = 0); |
| 198 | 198 |
| 199 void ParseContent(CPDF_AllStates* pGraphicSta
tes, CFX_AffineMatrix* pParentMatrix, | 199 void ParseContent(CPDF_AllStates* pGraphicSta
tes, CFX_AffineMatrix* pParentMatrix, |
| 200 CPDF_Type3Char* pType3Char, CPDF_ParseOptio
ns* pOptions, int level = 0); | 200 CPDF_Type3Char* pType3Char, CPDF_ParseOptio
ns* pOptions, int level = 0); |
| 201 | 201 |
| 202 CPDF_Form* Clone() const; | 202 CPDF_Form* Clone() const; |
| 203 }; | 203 }; |
| 204 class CPDF_PageContentGenerate | 204 class CPDF_PageContentGenerate |
| 205 { | 205 { |
| 206 public: | 206 public: |
| 207 CPDF_PageContentGenerate(CPDF_Page* pPage); | 207 CPDF_PageContentGenerate(CPDF_Page* pPage); |
| 208 ~CPDF_PageContentGenerate(); | 208 ~CPDF_PageContentGenerate(); |
| 209 bool InsertPageObject(CPDF_PageObject* pPageObject); | 209 FX_BOOL InsertPageObject(CPDF_PageObject* pPageObject); |
| 210 void GenerateContent(); | 210 void GenerateContent(); |
| 211 void TransformContent(CFX_Matrix& matrix); | 211 void TransformContent(CFX_Matrix& matrix); |
| 212 protected: | 212 protected: |
| 213 void ProcessImage(CFX_ByteTextBuf& buf, CPDF_ImageObject* pImageO
bj); | 213 void ProcessImage(CFX_ByteTextBuf& buf, CPDF_ImageObject* pImageO
bj); |
| 214 void ProcessForm(CFX_ByteTextBuf& buf, const uint8_t* data, FX_DW
ORD size, CFX_Matrix& matrix); | 214 void ProcessForm(CFX_ByteTextBuf& buf, const uint8_t* data, FX_DW
ORD size, CFX_Matrix& matrix); |
| 215 CFX_ByteString RealizeResource(CPDF_Object* pResourceObj, const FX_CHAR* sz
Type); | 215 CFX_ByteString RealizeResource(CPDF_Object* pResourceObj, const FX_CHAR* sz
Type); |
| 216 private: | 216 private: |
| 217 CPDF_Page* m_pPage; | 217 CPDF_Page* m_pPage; |
| 218 CPDF_Document* m_pDocument; | 218 CPDF_Document* m_pDocument; |
| 219 CFX_PtrArray m_pageObjects; | 219 CFX_PtrArray m_pageObjects; |
| 220 }; | 220 }; |
| 221 | 221 |
| 222 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ | 222 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ |
| OLD | NEW |