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 13 matching lines...) Expand all Loading... |
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 #define PDF_CONTENT_NOT_PARSED 0 |
28 #define PDF_CONTENT_PARSING 1 | 28 #define PDF_CONTENT_PARSING 1 |
29 #define PDF_CONTENT_PARSED 2 | 29 #define PDF_CONTENT_PARSED 2 |
30 class CPDF_PageObjects | 30 class CPDF_PageObjects |
31 { | 31 { |
32 public: | 32 public: |
33 | 33 |
34 CPDF_PageObjects(FX_BOOL bReleaseMembers = TRUE); | 34 CPDF_PageObjects(bool bReleaseMembers = true); |
35 | 35 |
36 ~CPDF_PageObjects(); | 36 ~CPDF_PageObjects(); |
37 | 37 |
38 | 38 |
39 | 39 |
40 | 40 |
41 void ContinueParse(IFX_Pause* pPause); | 41 void ContinueParse(IFX_Pause* pPause); |
42 | 42 |
43 int GetParseState() const | 43 int GetParseState() const |
44 { | 44 { |
45 return m_ParseState; | 45 return m_ParseState; |
46 } | 46 } |
47 | 47 |
48 FX_BOOL» » » » IsParsed() const | 48 bool» » » » IsParsed() const |
49 { | 49 { |
50 return m_ParseState == PDF_CONTENT_PARSED; | 50 return m_ParseState == PDF_CONTENT_PARSED; |
51 } | 51 } |
52 | 52 |
53 int EstimateParseProgress() const; | 53 int EstimateParseProgress() const; |
54 | 54 |
55 | 55 |
56 | 56 |
57 | 57 |
58 FX_POSITION GetFirstObjectPosition() const | 58 FX_POSITION GetFirstObjectPosition() const |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 CPDF_PageObject* GetObjectByIndex(int index) const; | 90 CPDF_PageObject* GetObjectByIndex(int index) const; |
91 | 91 |
92 | 92 |
93 | 93 |
94 | 94 |
95 | 95 |
96 FX_POSITION InsertObject(FX_POSITION posInsertAfter, CPDF_Pa
geObject* pNewObject); | 96 FX_POSITION InsertObject(FX_POSITION posInsertAfter, CPDF_Pa
geObject* pNewObject); |
97 | 97 |
98 void Transform(const CFX_AffineMatrix& matrix
); | 98 void Transform(const CFX_AffineMatrix& matrix
); |
99 | 99 |
100 FX_BOOL» » » » BackgroundAlphaNeeded() const | 100 bool» » » » BackgroundAlphaNeeded() const |
101 { | 101 { |
102 return m_bBackgroundAlphaNeeded; | 102 return m_bBackgroundAlphaNeeded; |
103 } | 103 } |
104 | 104 |
105 CFX_FloatRect CalcBoundingBox() const; | 105 CFX_FloatRect CalcBoundingBox() const; |
106 | 106 |
107 CPDF_Dictionary* m_pFormDict; | 107 CPDF_Dictionary* m_pFormDict; |
108 | 108 |
109 CPDF_Stream* m_pFormStream; | 109 CPDF_Stream* m_pFormStream; |
110 | 110 |
111 CPDF_Document* m_pDocument; | 111 CPDF_Document* m_pDocument; |
112 | 112 |
113 CPDF_Dictionary* m_pPageResources; | 113 CPDF_Dictionary* m_pPageResources; |
114 | 114 |
115 CPDF_Dictionary* m_pResources; | 115 CPDF_Dictionary* m_pResources; |
116 | 116 |
117 CFX_FloatRect m_BBox; | 117 CFX_FloatRect m_BBox; |
118 | 118 |
119 int m_Transparency; | 119 int m_Transparency; |
120 | 120 |
121 protected: | 121 protected: |
122 friend class CPDF_ContentParser; | 122 friend class CPDF_ContentParser; |
123 friend class CPDF_StreamContentParser; | 123 friend class CPDF_StreamContentParser; |
124 friend class CPDF_AllStates; | 124 friend class CPDF_AllStates; |
125 | 125 |
126 CFX_PtrList m_ObjectList; | 126 CFX_PtrList m_ObjectList; |
127 | 127 |
128 FX_BOOL» » » » m_bBackgroundAlphaNeeded; | 128 bool» » » » m_bBackgroundAlphaNeeded; |
129 | 129 |
130 FX_BOOL» » » » m_bReleaseMembers; | 130 bool» » » » m_bReleaseMembers; |
131 void LoadTransInfo(); | 131 void LoadTransInfo(); |
132 void ClearCacheObjects(); | 132 void ClearCacheObjects(); |
133 | 133 |
134 CPDF_ContentParser* m_pParser; | 134 CPDF_ContentParser* m_pParser; |
135 | 135 |
136 FX_BOOL» » » » m_ParseState; | 136 bool» » » » m_ParseState; |
137 }; | 137 }; |
138 class CPDF_Page : public CPDF_PageObjects, public CFX_PrivateData | 138 class CPDF_Page : public CPDF_PageObjects, public CFX_PrivateData |
139 { | 139 { |
140 public: | 140 public: |
141 | 141 |
142 CPDF_Page(); | 142 CPDF_Page(); |
143 | 143 |
144 ~CPDF_Page(); | 144 ~CPDF_Page(); |
145 | 145 |
146 void» » » » Load(CPDF_Document* pDocument, CPDF_Dict
ionary* pPageDict, FX_BOOL bPageCache = TRUE); | 146 void» » » » Load(CPDF_Document* pDocument, CPDF_Dict
ionary* pPageDict, bool bPageCache = true); |
147 | 147 |
148 void» » » » StartParse(CPDF_ParseOptions* pOptions =
NULL, FX_BOOL bReParse = FALSE); | 148 void» » » » StartParse(CPDF_ParseOptions* pOptions =
NULL, bool bReParse = false); |
149 | 149 |
150 void» » » » ParseContent(CPDF_ParseOptions* pOptions
= NULL, FX_BOOL bReParse = FALSE); | 150 void» » » » ParseContent(CPDF_ParseOptions* pOptions
= NULL, bool bReParse = false); |
151 | 151 |
152 void GetDisplayMatrix(CFX_AffineMatrix& matri
x, int xPos, int yPos, | 152 void GetDisplayMatrix(CFX_AffineMatrix& matri
x, int xPos, int yPos, |
153 int xSize, int ySize, int iRotate) cons
t; | 153 int xSize, int ySize, int iRotate) cons
t; |
154 | 154 |
155 FX_FLOAT GetPageWidth() const | 155 FX_FLOAT GetPageWidth() const |
156 { | 156 { |
157 return m_PageWidth; | 157 return m_PageWidth; |
158 } | 158 } |
159 | 159 |
160 FX_FLOAT GetPageHeight() const | 160 FX_FLOAT GetPageHeight() const |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 CFX_AffineMatrix m_PageMatrix; | 193 CFX_AffineMatrix m_PageMatrix; |
194 | 194 |
195 CPDF_PageRenderCache* m_pPageRender; | 195 CPDF_PageRenderCache* m_pPageRender; |
196 }; | 196 }; |
197 class CPDF_ParseOptions | 197 class CPDF_ParseOptions |
198 { | 198 { |
199 public: | 199 public: |
200 | 200 |
201 CPDF_ParseOptions(); | 201 CPDF_ParseOptions(); |
202 | 202 |
203 FX_BOOL» » » » m_bTextOnly; | 203 bool» » » » m_bTextOnly; |
204 | 204 |
205 FX_BOOL» » » » m_bMarkedContent; | 205 bool» » » » m_bMarkedContent; |
206 | 206 |
207 FX_BOOL» » » » m_bSeparateForm; | 207 bool» » » » m_bSeparateForm; |
208 | 208 |
209 FX_BOOL» » » » m_bDecodeInlineImage; | 209 bool» » » » m_bDecodeInlineImage; |
210 }; | 210 }; |
211 class CPDF_Form : public CPDF_PageObjects | 211 class CPDF_Form : public CPDF_PageObjects |
212 { | 212 { |
213 public: | 213 public: |
214 | 214 |
215 CPDF_Form(CPDF_Document* pDocument, CPDF_Dictionary* pPageResources, CPDF_St
ream* pFormStream, CPDF_Dictionary* pParentResources = NULL); | 215 CPDF_Form(CPDF_Document* pDocument, CPDF_Dictionary* pPageResources, CPDF_St
ream* pFormStream, CPDF_Dictionary* pParentResources = NULL); |
216 | 216 |
217 ~CPDF_Form(); | 217 ~CPDF_Form(); |
218 | 218 |
219 void StartParse(CPDF_AllStates* pGraphicState
s, CFX_AffineMatrix* pParentMatrix, | 219 void StartParse(CPDF_AllStates* pGraphicState
s, CFX_AffineMatrix* pParentMatrix, |
220 CPDF_Type3Char* pType3Char, CPDF_ParseOptions
* pOptions, int level = 0); | 220 CPDF_Type3Char* pType3Char, CPDF_ParseOptions
* pOptions, int level = 0); |
221 | 221 |
222 void ParseContent(CPDF_AllStates* pGraphicSta
tes, CFX_AffineMatrix* pParentMatrix, | 222 void ParseContent(CPDF_AllStates* pGraphicSta
tes, CFX_AffineMatrix* pParentMatrix, |
223 CPDF_Type3Char* pType3Char, CPDF_ParseOptio
ns* pOptions, int level = 0); | 223 CPDF_Type3Char* pType3Char, CPDF_ParseOptio
ns* pOptions, int level = 0); |
224 | 224 |
225 CPDF_Form* Clone() const; | 225 CPDF_Form* Clone() const; |
226 }; | 226 }; |
227 class CPDF_PageContentGenerate | 227 class CPDF_PageContentGenerate |
228 { | 228 { |
229 public: | 229 public: |
230 CPDF_PageContentGenerate(CPDF_Page* pPage); | 230 CPDF_PageContentGenerate(CPDF_Page* pPage); |
231 ~CPDF_PageContentGenerate(); | 231 ~CPDF_PageContentGenerate(); |
232 FX_BOOL InsertPageObject(CPDF_PageObject* pPageObject); | 232 bool InsertPageObject(CPDF_PageObject* pPageObject); |
233 void GenerateContent(); | 233 void GenerateContent(); |
234 void TransformContent(CFX_Matrix& matrix); | 234 void TransformContent(CFX_Matrix& matrix); |
235 protected: | 235 protected: |
236 void ProcessImage(CFX_ByteTextBuf& buf, CPDF_ImageObject* pImageO
bj); | 236 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); | 237 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); | 238 CFX_ByteString RealizeResource(CPDF_Object* pResourceObj, const FX_CHAR* sz
Type); |
239 private: | 239 private: |
240 CPDF_Page* m_pPage; | 240 CPDF_Page* m_pPage; |
241 CPDF_Document* m_pDocument; | 241 CPDF_Document* m_pDocument; |
242 CFX_PtrArray m_pageObjects; | 242 CFX_PtrArray m_pageObjects; |
243 }; | 243 }; |
244 | 244 |
245 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ | 245 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ |
OLD | NEW |