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 | |
Tom Sepez
2015/07/23 21:00:41
note: dead code.
| |
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; | 41 int EstimateParseProgress() const; |
Lei Zhang
2015/07/23 21:08:59
Also dead, along with CPDF_ContentParser::Estimate
| |
54 | 42 |
55 | |
56 | |
57 | |
58 FX_POSITION GetFirstObjectPosition() const | 43 FX_POSITION GetFirstObjectPosition() const |
59 { | 44 { |
60 return m_ObjectList.GetHeadPosition(); | 45 return m_ObjectList.GetHeadPosition(); |
61 } | 46 } |
62 | 47 |
63 FX_POSITION GetLastObjectPosition() const | 48 FX_POSITION GetLastObjectPosition() const |
64 { | 49 { |
65 return m_ObjectList.GetTailPosition(); | 50 return m_ObjectList.GetTailPosition(); |
66 } | 51 } |
67 | 52 |
(...skipping 14 matching lines...) Expand all Loading... | |
82 | 67 |
83 FX_DWORD CountObjects() const | 68 FX_DWORD CountObjects() const |
84 { | 69 { |
85 return m_ObjectList.GetCount(); | 70 return m_ObjectList.GetCount(); |
86 } | 71 } |
87 | 72 |
88 int GetObjectIndex(CPDF_PageObject* pObj) co nst; | 73 int GetObjectIndex(CPDF_PageObject* pObj) co nst; |
89 | 74 |
90 CPDF_PageObject* GetObjectByIndex(int index) const; | 75 CPDF_PageObject* GetObjectByIndex(int index) const; |
91 | 76 |
92 | |
93 | |
94 | |
95 | |
96 FX_POSITION InsertObject(FX_POSITION posInsertAfter, CPDF_Pa geObject* pNewObject); | 77 FX_POSITION InsertObject(FX_POSITION posInsertAfter, CPDF_Pa geObject* pNewObject); |
97 | 78 |
98 void Transform(const CFX_AffineMatrix& matrix ); | 79 void Transform(const CFX_AffineMatrix& matrix ); |
99 | 80 |
100 FX_BOOL BackgroundAlphaNeeded() const | 81 FX_BOOL BackgroundAlphaNeeded() const |
101 { | 82 { |
102 return m_bBackgroundAlphaNeeded; | 83 return m_bBackgroundAlphaNeeded; |
103 } | 84 } |
104 | 85 |
105 CFX_FloatRect CalcBoundingBox() const; | 86 CFX_FloatRect CalcBoundingBox() const; |
106 | 87 |
107 CPDF_Dictionary* m_pFormDict; | 88 CPDF_Dictionary* m_pFormDict; |
108 | |
109 CPDF_Stream* m_pFormStream; | 89 CPDF_Stream* m_pFormStream; |
110 | |
111 CPDF_Document* m_pDocument; | 90 CPDF_Document* m_pDocument; |
112 | |
113 CPDF_Dictionary* m_pPageResources; | 91 CPDF_Dictionary* m_pPageResources; |
114 | |
115 CPDF_Dictionary* m_pResources; | 92 CPDF_Dictionary* m_pResources; |
116 | |
117 CFX_FloatRect m_BBox; | 93 CFX_FloatRect m_BBox; |
118 | |
119 int m_Transparency; | 94 int m_Transparency; |
120 | 95 |
121 protected: | 96 protected: |
122 friend class CPDF_ContentParser; | 97 friend class CPDF_ContentParser; |
123 friend class CPDF_StreamContentParser; | 98 friend class CPDF_StreamContentParser; |
124 friend class CPDF_AllStates; | 99 friend class CPDF_AllStates; |
125 | 100 |
126 CFX_PtrList»» » m_ObjectList; | 101 enum ParseState { |
102 CONTENT_NOT_PARSED, | |
103 CONTENT_PARSING, | |
104 CONTENT_PARSED | |
105 }; | |
127 | 106 |
128 FX_BOOL m_bBackgroundAlphaNeeded; | |
129 | |
130 FX_BOOL m_bReleaseMembers; | |
131 void LoadTransInfo(); | 107 void LoadTransInfo(); |
132 void ClearCacheObjects(); | 108 void ClearCacheObjects(); |
133 | 109 |
110 CFX_PtrList m_ObjectList; | |
111 FX_BOOL m_bBackgroundAlphaNeeded; | |
112 FX_BOOL m_bReleaseMembers; | |
134 CPDF_ContentParser* m_pParser; | 113 CPDF_ContentParser* m_pParser; |
114 ParseState m_ParseState; | |
115 }; | |
135 | 116 |
136 FX_BOOL m_ParseState; | |
137 }; | |
138 class CPDF_Page : public CPDF_PageObjects, public CFX_PrivateData | 117 class CPDF_Page : public CPDF_PageObjects, public CFX_PrivateData |
139 { | 118 { |
140 public: | 119 public: |
141 | 120 |
142 CPDF_Page(); | 121 CPDF_Page(); |
143 | 122 |
144 ~CPDF_Page(); | 123 ~CPDF_Page(); |
145 | 124 |
146 void Load(CPDF_Document* pDocument, CPDF_Dict ionary* pPageDict, FX_BOOL bPageCache = TRUE); | 125 void Load(CPDF_Document* pDocument, CPDF_Dict ionary* pPageDict, FX_BOOL bPageCache = TRUE); |
147 | 126 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
236 void ProcessImage(CFX_ByteTextBuf& buf, CPDF_ImageObject* pImageO bj); | 215 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); | 216 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); | 217 CFX_ByteString RealizeResource(CPDF_Object* pResourceObj, const FX_CHAR* sz Type); |
239 private: | 218 private: |
240 CPDF_Page* m_pPage; | 219 CPDF_Page* m_pPage; |
241 CPDF_Document* m_pDocument; | 220 CPDF_Document* m_pDocument; |
242 CFX_PtrArray m_pageObjects; | 221 CFX_PtrArray m_pageObjects; |
243 }; | 222 }; |
244 | 223 |
245 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ | 224 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ |
OLD | NEW |