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_SRC_FPDFAPI_FPDF_PAGE_PAGEINT_H_ | 7 #ifndef CORE_SRC_FPDFAPI_FPDF_PAGE_PAGEINT_H_ |
8 #define CORE_SRC_FPDFAPI_FPDF_PAGE_PAGEINT_H_ | 8 #define CORE_SRC_FPDFAPI_FPDF_PAGE_PAGEINT_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 }; | 87 }; |
88 #define _FPDF_MAX_FORM_LEVEL_ 30 | 88 #define _FPDF_MAX_FORM_LEVEL_ 30 |
89 #define _FPDF_MAX_TYPE3_FORM_LEVEL_ 4 | 89 #define _FPDF_MAX_TYPE3_FORM_LEVEL_ 4 |
90 #define _FPDF_MAX_OBJECT_STACK_SIZE_ 512 | 90 #define _FPDF_MAX_OBJECT_STACK_SIZE_ 512 |
91 class CPDF_StreamContentParser { | 91 class CPDF_StreamContentParser { |
92 public: | 92 public: |
93 CPDF_StreamContentParser(CPDF_Document* pDoc, | 93 CPDF_StreamContentParser(CPDF_Document* pDoc, |
94 CPDF_Dictionary* pPageResources, | 94 CPDF_Dictionary* pPageResources, |
95 CPDF_Dictionary* pParentResources, | 95 CPDF_Dictionary* pParentResources, |
96 CFX_Matrix* pmtContentToUser, | 96 CFX_Matrix* pmtContentToUser, |
97 CPDF_PageObjectList* pObjList, | 97 CPDF_PageObjectHolder* pObjHolder, |
98 CPDF_Dictionary* pResources, | 98 CPDF_Dictionary* pResources, |
99 CFX_FloatRect* pBBox, | 99 CFX_FloatRect* pBBox, |
100 CPDF_ParseOptions* pOptions, | 100 CPDF_ParseOptions* pOptions, |
101 CPDF_AllStates* pAllStates, | 101 CPDF_AllStates* pAllStates, |
102 int level); | 102 int level); |
103 ~CPDF_StreamContentParser(); | 103 ~CPDF_StreamContentParser(); |
104 | 104 |
105 CPDF_PageObjectList* GetObjectList() const { return m_pObjectList; } | 105 CPDF_PageObjectHolder* GetPageObjectHolder() const { return m_pObjectHolder; } |
106 CPDF_AllStates* GetCurStates() const { return m_pCurStates.get(); } | 106 CPDF_AllStates* GetCurStates() const { return m_pCurStates.get(); } |
107 FX_BOOL IsColored() const { return m_bColored; } | 107 FX_BOOL IsColored() const { return m_bColored; } |
108 const FX_FLOAT* GetType3Data() const { return m_Type3Data; } | 108 const FX_FLOAT* GetType3Data() const { return m_Type3Data; } |
109 | 109 |
110 void AddNumberParam(const FX_CHAR* str, int len); | 110 void AddNumberParam(const FX_CHAR* str, int len); |
111 void AddObjectParam(CPDF_Object* pObj); | 111 void AddObjectParam(CPDF_Object* pObj); |
112 void AddNameParam(const FX_CHAR* name, int size); | 112 void AddNameParam(const FX_CHAR* name, int size); |
113 int GetNextParamPos(); | 113 int GetNextParamPos(); |
114 void ClearAllParams(); | 114 void ClearAllParams(); |
115 CPDF_Object* GetObject(FX_DWORD index); | 115 CPDF_Object* GetObject(FX_DWORD index); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 void Handle_EOClip(); | 229 void Handle_EOClip(); |
230 void Handle_CurveTo_13(); | 230 void Handle_CurveTo_13(); |
231 void Handle_NextLineShowText(); | 231 void Handle_NextLineShowText(); |
232 void Handle_NextLineShowText_Space(); | 232 void Handle_NextLineShowText_Space(); |
233 void Handle_Invalid(); | 233 void Handle_Invalid(); |
234 | 234 |
235 CPDF_Document* const m_pDocument; | 235 CPDF_Document* const m_pDocument; |
236 CPDF_Dictionary* m_pPageResources; | 236 CPDF_Dictionary* m_pPageResources; |
237 CPDF_Dictionary* m_pParentResources; | 237 CPDF_Dictionary* m_pParentResources; |
238 CPDF_Dictionary* m_pResources; | 238 CPDF_Dictionary* m_pResources; |
239 CPDF_PageObjectList* m_pObjectList; | 239 CPDF_PageObjectHolder* m_pObjectHolder; |
240 int m_Level; | 240 int m_Level; |
241 CFX_Matrix m_mtContentToUser; | 241 CFX_Matrix m_mtContentToUser; |
242 CFX_FloatRect m_BBox; | 242 CFX_FloatRect m_BBox; |
243 CPDF_ParseOptions m_Options; | 243 CPDF_ParseOptions m_Options; |
244 ContentParam m_ParamBuf[PARAM_BUF_SIZE]; | 244 ContentParam m_ParamBuf[PARAM_BUF_SIZE]; |
245 FX_DWORD m_ParamStartPos; | 245 FX_DWORD m_ParamStartPos; |
246 FX_DWORD m_ParamCount; | 246 FX_DWORD m_ParamCount; |
247 CPDF_StreamParser* m_pSyntax; | 247 CPDF_StreamParser* m_pSyntax; |
248 std::unique_ptr<CPDF_AllStates> m_pCurStates; | 248 std::unique_ptr<CPDF_AllStates> m_pCurStates; |
249 CPDF_ContentMark m_CurContentMark; | 249 CPDF_ContentMark m_CurContentMark; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 291 |
292 private: | 292 private: |
293 enum InternalStage { | 293 enum InternalStage { |
294 STAGE_GETCONTENT = 1, | 294 STAGE_GETCONTENT = 1, |
295 STAGE_PARSE, | 295 STAGE_PARSE, |
296 STAGE_CHECKCLIP, | 296 STAGE_CHECKCLIP, |
297 }; | 297 }; |
298 | 298 |
299 ParseStatus m_Status; | 299 ParseStatus m_Status; |
300 InternalStage m_InternalStage; | 300 InternalStage m_InternalStage; |
301 CPDF_PageObjectList* m_pObjects; | 301 CPDF_PageObjectHolder* m_pObjects; |
302 FX_BOOL m_bForm; | 302 FX_BOOL m_bForm; |
303 CPDF_ParseOptions m_Options; | 303 CPDF_ParseOptions m_Options; |
304 CPDF_Type3Char* m_pType3Char; | 304 CPDF_Type3Char* m_pType3Char; |
305 FX_DWORD m_nStreams; | 305 FX_DWORD m_nStreams; |
306 std::unique_ptr<CPDF_StreamAcc> m_pSingleStream; | 306 std::unique_ptr<CPDF_StreamAcc> m_pSingleStream; |
307 std::vector<std::unique_ptr<CPDF_StreamAcc>> m_StreamArray; | 307 std::vector<std::unique_ptr<CPDF_StreamAcc>> m_StreamArray; |
308 uint8_t* m_pData; | 308 uint8_t* m_pData; |
309 FX_DWORD m_Size; | 309 FX_DWORD m_Size; |
310 FX_DWORD m_CurrentOffset; | 310 FX_DWORD m_CurrentOffset; |
311 std::unique_ptr<CPDF_StreamContentParser> m_pParser; | 311 std::unique_ptr<CPDF_StreamContentParser> m_pParser; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 | 453 |
454 private: | 454 private: |
455 CPDF_ColorSpace* m_pBaseCS; | 455 CPDF_ColorSpace* m_pBaseCS; |
456 CPDF_CountedColorSpace* m_pCountedBaseCS; | 456 CPDF_CountedColorSpace* m_pCountedBaseCS; |
457 }; | 457 }; |
458 | 458 |
459 void PDF_ReplaceAbbr(CPDF_Object* pObj); | 459 void PDF_ReplaceAbbr(CPDF_Object* pObj); |
460 bool IsPathOperator(const uint8_t* buf, size_t len); | 460 bool IsPathOperator(const uint8_t* buf, size_t len); |
461 | 461 |
462 #endif // CORE_SRC_FPDFAPI_FPDF_PAGE_PAGEINT_H_ | 462 #endif // CORE_SRC_FPDFAPI_FPDF_PAGE_PAGEINT_H_ |
OLD | NEW |