| 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" |
| 11 #include "fpdf_parser.h" | 11 #include "fpdf_parser.h" |
| 12 #include "fpdf_resource.h" | 12 #include "fpdf_resource.h" |
| 13 | 13 |
| 14 class CPDF_PageObjects; | 14 class CPDF_PageObjects; |
| 15 class CPDF_Page; | 15 class CPDF_Page; |
| 16 class CPDF_Form; | 16 class CPDF_Form; |
| 17 class CPDF_ParseOptions; | 17 class CPDF_ParseOptions; |
| 18 class CPDF_PageObject; | 18 class CPDF_PageObject; |
| 19 class CPDF_PageRenderCache; | 19 class CPDF_PageRenderCache; |
| 20 class CPDF_StreamFilter; | 20 class CPDF_StreamFilter; |
| 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 #define PDF_CONTENT_NOT_PARSED» 0 | 27 |
| 28 #define PDF_CONTENT_PARSING» » 1 | |
| 29 #define PDF_CONTENT_PARSED» » 2 | |
| 30 class CPDF_PageObjects | 28 class CPDF_PageObjects |
| 31 { | 29 { |
| 32 public: | 30 public: |
| 33 | |
| 34 CPDF_PageObjects(FX_BOOL bReleaseMembers = TRUE); | 31 CPDF_PageObjects(FX_BOOL bReleaseMembers = TRUE); |
| 35 | |
| 36 ~CPDF_PageObjects(); | 32 ~CPDF_PageObjects(); |
| 37 | 33 |
| 38 | |
| 39 | |
| 40 | |
| 41 void ContinueParse(IFX_Pause* pPause); | 34 void ContinueParse(IFX_Pause* pPause); |
| 42 | 35 |
| 43 int GetParseState() const | |
| 44 { | |
| 45 return m_ParseState; | |
| 46 } | |
| 47 | |
| 48 FX_BOOL IsParsed() const | 36 FX_BOOL IsParsed() const |
| 49 { | 37 { |
| 50 return m_ParseState == PDF_CONTENT_PARSED; | 38 return m_ParseState == CONTENT_PARSED; |
| 51 } | 39 } |
| 52 | 40 |
| 53 int EstimateParseProgress() const; | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 FX_POSITION GetFirstObjectPosition() const | 41 FX_POSITION GetFirstObjectPosition() const |
| 59 { | 42 { |
| 60 return m_ObjectList.GetHeadPosition(); | 43 return m_ObjectList.GetHeadPosition(); |
| 61 } | 44 } |
| 62 | 45 |
| 63 FX_POSITION GetLastObjectPosition() const | 46 FX_POSITION GetLastObjectPosition() const |
| 64 { | 47 { |
| 65 return m_ObjectList.GetTailPosition(); | 48 return m_ObjectList.GetTailPosition(); |
| 66 } | 49 } |
| 67 | 50 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 82 | 65 |
| 83 FX_DWORD CountObjects() const | 66 FX_DWORD CountObjects() const |
| 84 { | 67 { |
| 85 return m_ObjectList.GetCount(); | 68 return m_ObjectList.GetCount(); |
| 86 } | 69 } |
| 87 | 70 |
| 88 int GetObjectIndex(CPDF_PageObject* pObj) co
nst; | 71 int GetObjectIndex(CPDF_PageObject* pObj) co
nst; |
| 89 | 72 |
| 90 CPDF_PageObject* GetObjectByIndex(int index) const; | 73 CPDF_PageObject* GetObjectByIndex(int index) const; |
| 91 | 74 |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 FX_POSITION InsertObject(FX_POSITION posInsertAfter, CPDF_Pa
geObject* pNewObject); | 75 FX_POSITION InsertObject(FX_POSITION posInsertAfter, CPDF_Pa
geObject* pNewObject); |
| 97 | 76 |
| 98 void Transform(const CFX_AffineMatrix& matrix
); | 77 void Transform(const CFX_AffineMatrix& matrix
); |
| 99 | 78 |
| 100 FX_BOOL BackgroundAlphaNeeded() const | 79 FX_BOOL BackgroundAlphaNeeded() const |
| 101 { | 80 { |
| 102 return m_bBackgroundAlphaNeeded; | 81 return m_bBackgroundAlphaNeeded; |
| 103 } | 82 } |
| 104 | 83 |
| 105 CFX_FloatRect CalcBoundingBox() const; | 84 CFX_FloatRect CalcBoundingBox() const; |
| 106 | 85 |
| 107 CPDF_Dictionary* m_pFormDict; | 86 CPDF_Dictionary* m_pFormDict; |
| 108 | |
| 109 CPDF_Stream* m_pFormStream; | 87 CPDF_Stream* m_pFormStream; |
| 110 | |
| 111 CPDF_Document* m_pDocument; | 88 CPDF_Document* m_pDocument; |
| 112 | |
| 113 CPDF_Dictionary* m_pPageResources; | 89 CPDF_Dictionary* m_pPageResources; |
| 114 | |
| 115 CPDF_Dictionary* m_pResources; | 90 CPDF_Dictionary* m_pResources; |
| 116 | |
| 117 CFX_FloatRect m_BBox; | 91 CFX_FloatRect m_BBox; |
| 118 | |
| 119 int m_Transparency; | 92 int m_Transparency; |
| 120 | 93 |
| 121 protected: | 94 protected: |
| 122 friend class CPDF_ContentParser; | 95 friend class CPDF_ContentParser; |
| 123 friend class CPDF_StreamContentParser; | 96 friend class CPDF_StreamContentParser; |
| 124 friend class CPDF_AllStates; | 97 friend class CPDF_AllStates; |
| 125 | 98 |
| 126 CFX_PtrList»» » m_ObjectList; | 99 enum ParseState { |
| 100 CONTENT_NOT_PARSED, |
| 101 CONTENT_PARSING, |
| 102 CONTENT_PARSED |
| 103 }; |
| 127 | 104 |
| 128 FX_BOOL m_bBackgroundAlphaNeeded; | |
| 129 | |
| 130 FX_BOOL m_bReleaseMembers; | |
| 131 void LoadTransInfo(); | 105 void LoadTransInfo(); |
| 132 void ClearCacheObjects(); | 106 void ClearCacheObjects(); |
| 133 | 107 |
| 108 CFX_PtrList m_ObjectList; |
| 109 FX_BOOL m_bBackgroundAlphaNeeded; |
| 110 FX_BOOL m_bReleaseMembers; |
| 134 CPDF_ContentParser* m_pParser; | 111 CPDF_ContentParser* m_pParser; |
| 112 ParseState m_ParseState; |
| 113 }; |
| 135 | 114 |
| 136 FX_BOOL m_ParseState; | |
| 137 }; | |
| 138 class CPDF_Page : public CPDF_PageObjects, public CFX_PrivateData | 115 class CPDF_Page : public CPDF_PageObjects, public CFX_PrivateData |
| 139 { | 116 { |
| 140 public: | 117 public: |
| 141 | 118 |
| 142 CPDF_Page(); | 119 CPDF_Page(); |
| 143 | 120 |
| 144 ~CPDF_Page(); | 121 ~CPDF_Page(); |
| 145 | 122 |
| 146 void Load(CPDF_Document* pDocument, CPDF_Dict
ionary* pPageDict, FX_BOOL bPageCache = TRUE); | 123 void Load(CPDF_Document* pDocument, CPDF_Dict
ionary* pPageDict, FX_BOOL bPageCache = TRUE); |
| 147 | 124 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 void ProcessImage(CFX_ByteTextBuf& buf, CPDF_ImageObject* pImageO
bj); | 213 void ProcessImage(CFX_ByteTextBuf& buf, CPDF_ImageObject* pImageO
bj); |
| 237 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); |
| 238 CFX_ByteString RealizeResource(CPDF_Object* pResourceObj, const FX_CHAR* sz
Type); | 215 CFX_ByteString RealizeResource(CPDF_Object* pResourceObj, const FX_CHAR* sz
Type); |
| 239 private: | 216 private: |
| 240 CPDF_Page* m_pPage; | 217 CPDF_Page* m_pPage; |
| 241 CPDF_Document* m_pDocument; | 218 CPDF_Document* m_pDocument; |
| 242 CFX_PtrArray m_pageObjects; | 219 CFX_PtrArray m_pageObjects; |
| 243 }; | 220 }; |
| 244 | 221 |
| 245 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ | 222 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ |
| OLD | NEW |