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_FPDFAPI_FPDF_PAGE_PAGEINT_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ |
8 #define CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ | 8 #define CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 }; | 98 }; |
99 }; | 99 }; |
100 #define _FPDF_MAX_FORM_LEVEL_ 30 | 100 #define _FPDF_MAX_FORM_LEVEL_ 30 |
101 #define _FPDF_MAX_TYPE3_FORM_LEVEL_ 4 | 101 #define _FPDF_MAX_TYPE3_FORM_LEVEL_ 4 |
102 #define _FPDF_MAX_OBJECT_STACK_SIZE_ 512 | 102 #define _FPDF_MAX_OBJECT_STACK_SIZE_ 512 |
103 class CPDF_StreamContentParser { | 103 class CPDF_StreamContentParser { |
104 public: | 104 public: |
105 CPDF_StreamContentParser(CPDF_Document* pDoc, | 105 CPDF_StreamContentParser(CPDF_Document* pDoc, |
106 CPDF_Dictionary* pPageResources, | 106 CPDF_Dictionary* pPageResources, |
107 CPDF_Dictionary* pParentResources, | 107 CPDF_Dictionary* pParentResources, |
108 CFX_Matrix* pmtContentToUser, | 108 const CFX_Matrix* pmtContentToUser, |
109 CPDF_PageObjectHolder* pObjectHolder, | 109 CPDF_PageObjectHolder* pObjectHolder, |
110 CPDF_Dictionary* pResources, | 110 CPDF_Dictionary* pResources, |
111 CFX_FloatRect* pBBox, | 111 CFX_FloatRect* pBBox, |
112 CPDF_AllStates* pAllStates, | 112 CPDF_AllStates* pAllStates, |
113 int level); | 113 int level); |
114 ~CPDF_StreamContentParser(); | 114 ~CPDF_StreamContentParser(); |
115 | 115 |
116 CPDF_PageObjectHolder* GetPageObjectHolder() const { return m_pObjectHolder; } | 116 CPDF_PageObjectHolder* GetPageObjectHolder() const { return m_pObjectHolder; } |
117 CPDF_AllStates* GetCurStates() const { return m_pCurStates.get(); } | 117 CPDF_AllStates* GetCurStates() const { return m_pCurStates.get(); } |
118 FX_BOOL IsColored() const { return m_bColored; } | 118 FX_BOOL IsColored() const { return m_bColored; } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 void AddDuplicateImage(); | 150 void AddDuplicateImage(); |
151 void AddForm(CPDF_Stream* pStream); | 151 void AddForm(CPDF_Stream* pStream); |
152 void SetGraphicStates(CPDF_PageObject* pObj, | 152 void SetGraphicStates(CPDF_PageObject* pObj, |
153 FX_BOOL bColor, | 153 FX_BOOL bColor, |
154 FX_BOOL bText, | 154 FX_BOOL bText, |
155 FX_BOOL bGraph); | 155 FX_BOOL bGraph); |
156 void SaveStates(CPDF_AllStates* pState); | 156 void SaveStates(CPDF_AllStates* pState); |
157 void RestoreStates(CPDF_AllStates* pState); | 157 void RestoreStates(CPDF_AllStates* pState); |
158 CPDF_Font* FindFont(const CFX_ByteString& name); | 158 CPDF_Font* FindFont(const CFX_ByteString& name); |
159 CPDF_ColorSpace* FindColorSpace(const CFX_ByteString& name); | 159 CPDF_ColorSpace* FindColorSpace(const CFX_ByteString& name); |
160 CPDF_Pattern* FindPattern(const CFX_ByteString& name, FX_BOOL bShading); | 160 CPDF_Pattern* FindPattern(const CFX_ByteString& name, bool bShading); |
161 CPDF_Object* FindResourceObj(const CFX_ByteStringC& type, | 161 CPDF_Object* FindResourceObj(const CFX_ByteStringC& type, |
162 const CFX_ByteString& name); | 162 const CFX_ByteString& name); |
163 | 163 |
164 protected: | 164 protected: |
165 using OpCodes = | 165 using OpCodes = |
166 std::unordered_map<uint32_t, void (CPDF_StreamContentParser::*)()>; | 166 std::unordered_map<uint32_t, void (CPDF_StreamContentParser::*)()>; |
167 static OpCodes InitializeOpCodes(); | 167 static OpCodes InitializeOpCodes(); |
168 | 168 |
169 void Handle_CloseFillStrokePath(); | 169 void Handle_CloseFillStrokePath(); |
170 void Handle_FillStrokePath(); | 170 void Handle_FillStrokePath(); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 public: | 281 public: |
282 enum ParseStatus { Ready, ToBeContinued, Done }; | 282 enum ParseStatus { Ready, ToBeContinued, Done }; |
283 | 283 |
284 CPDF_ContentParser(); | 284 CPDF_ContentParser(); |
285 ~CPDF_ContentParser(); | 285 ~CPDF_ContentParser(); |
286 | 286 |
287 ParseStatus GetStatus() const { return m_Status; } | 287 ParseStatus GetStatus() const { return m_Status; } |
288 void Start(CPDF_Page* pPage); | 288 void Start(CPDF_Page* pPage); |
289 void Start(CPDF_Form* pForm, | 289 void Start(CPDF_Form* pForm, |
290 CPDF_AllStates* pGraphicStates, | 290 CPDF_AllStates* pGraphicStates, |
291 CFX_Matrix* pParentMatrix, | 291 const CFX_Matrix* pParentMatrix, |
292 CPDF_Type3Char* pType3Char, | 292 CPDF_Type3Char* pType3Char, |
293 int level); | 293 int level); |
294 void Continue(IFX_Pause* pPause); | 294 void Continue(IFX_Pause* pPause); |
295 | 295 |
296 private: | 296 private: |
297 enum InternalStage { | 297 enum InternalStage { |
298 STAGE_GETCONTENT = 1, | 298 STAGE_GETCONTENT = 1, |
299 STAGE_PARSE, | 299 STAGE_PARSE, |
300 STAGE_CHECKCLIP, | 300 STAGE_CHECKCLIP, |
301 }; | 301 }; |
(...skipping 21 matching lines...) Expand all Loading... |
323 CPDF_Font* GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnly); | 323 CPDF_Font* GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnly); |
324 CPDF_Font* GetStandardFont(const CFX_ByteStringC& fontName, | 324 CPDF_Font* GetStandardFont(const CFX_ByteStringC& fontName, |
325 CPDF_FontEncoding* pEncoding); | 325 CPDF_FontEncoding* pEncoding); |
326 void ReleaseFont(CPDF_Dictionary* pFontDict); | 326 void ReleaseFont(CPDF_Dictionary* pFontDict); |
327 CPDF_ColorSpace* GetColorSpace(CPDF_Object* pCSObj, | 327 CPDF_ColorSpace* GetColorSpace(CPDF_Object* pCSObj, |
328 const CPDF_Dictionary* pResources); | 328 const CPDF_Dictionary* pResources); |
329 CPDF_ColorSpace* GetCopiedColorSpace(CPDF_Object* pCSObj); | 329 CPDF_ColorSpace* GetCopiedColorSpace(CPDF_Object* pCSObj); |
330 void ReleaseColorSpace(CPDF_Object* pColorSpace); | 330 void ReleaseColorSpace(CPDF_Object* pColorSpace); |
331 CPDF_Pattern* GetPattern(CPDF_Object* pPatternObj, | 331 CPDF_Pattern* GetPattern(CPDF_Object* pPatternObj, |
332 FX_BOOL bShading, | 332 FX_BOOL bShading, |
333 const CFX_Matrix* matrix); | 333 const CFX_Matrix& matrix); |
334 void ReleasePattern(CPDF_Object* pPatternObj); | 334 void ReleasePattern(CPDF_Object* pPatternObj); |
335 CPDF_Image* GetImage(CPDF_Object* pImageStream); | 335 CPDF_Image* GetImage(CPDF_Object* pImageStream); |
336 void ReleaseImage(CPDF_Object* pImageStream); | 336 void ReleaseImage(CPDF_Object* pImageStream); |
337 CPDF_IccProfile* GetIccProfile(CPDF_Stream* pIccProfileStream); | 337 CPDF_IccProfile* GetIccProfile(CPDF_Stream* pIccProfileStream); |
338 void ReleaseIccProfile(CPDF_IccProfile* pIccProfile); | 338 void ReleaseIccProfile(CPDF_IccProfile* pIccProfile); |
339 CPDF_StreamAcc* GetFontFileStreamAcc(CPDF_Stream* pFontStream); | 339 CPDF_StreamAcc* GetFontFileStreamAcc(CPDF_Stream* pFontStream); |
340 void ReleaseFontFileStreamAcc(CPDF_Stream* pFontStream, | 340 void ReleaseFontFileStreamAcc(CPDF_Stream* pFontStream, |
341 FX_BOOL bForce = FALSE); | 341 FX_BOOL bForce = FALSE); |
342 FX_BOOL IsForceClear() const { return m_bForceClear; } | 342 FX_BOOL IsForceClear() const { return m_bForceClear; } |
343 CPDF_CountedColorSpace* FindColorSpacePtr(CPDF_Object* pCSObj) const; | 343 CPDF_CountedColorSpace* FindColorSpacePtr(CPDF_Object* pCSObj) const; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 }; | 526 }; |
527 | 527 |
528 CFX_ByteStringC PDF_FindKeyAbbreviationForTesting(const CFX_ByteStringC& abbr); | 528 CFX_ByteStringC PDF_FindKeyAbbreviationForTesting(const CFX_ByteStringC& abbr); |
529 CFX_ByteStringC PDF_FindValueAbbreviationForTesting( | 529 CFX_ByteStringC PDF_FindValueAbbreviationForTesting( |
530 const CFX_ByteStringC& abbr); | 530 const CFX_ByteStringC& abbr); |
531 | 531 |
532 void PDF_ReplaceAbbr(CPDF_Object* pObj); | 532 void PDF_ReplaceAbbr(CPDF_Object* pObj); |
533 bool IsPathOperator(const uint8_t* buf, size_t len); | 533 bool IsPathOperator(const uint8_t* buf, size_t len); |
534 | 534 |
535 #endif // CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ | 535 #endif // CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ |
OLD | NEW |