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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 }; | 160 }; |
161 } _ContentParam; | 161 } _ContentParam; |
162 #define _FPDF_MAX_FORM_LEVEL_ 30 | 162 #define _FPDF_MAX_FORM_LEVEL_ 30 |
163 #define _FPDF_MAX_TYPE3_FORM_LEVEL_ 4 | 163 #define _FPDF_MAX_TYPE3_FORM_LEVEL_ 4 |
164 #define _FPDF_MAX_OBJECT_STACK_SIZE_ 512 | 164 #define _FPDF_MAX_OBJECT_STACK_SIZE_ 512 |
165 class CPDF_StreamContentParser { | 165 class CPDF_StreamContentParser { |
166 public: | 166 public: |
167 CPDF_StreamContentParser(CPDF_Document* pDoc, | 167 CPDF_StreamContentParser(CPDF_Document* pDoc, |
168 CPDF_Dictionary* pPageResources, | 168 CPDF_Dictionary* pPageResources, |
169 CPDF_Dictionary* pParentResources, | 169 CPDF_Dictionary* pParentResources, |
170 CFX_AffineMatrix* pmtContentToUser, | 170 CFX_Matrix* pmtContentToUser, |
171 CPDF_PageObjects* pObjList, | 171 CPDF_PageObjects* pObjList, |
172 CPDF_Dictionary* pResources, | 172 CPDF_Dictionary* pResources, |
173 CFX_FloatRect* pBBox, | 173 CFX_FloatRect* pBBox, |
174 CPDF_ParseOptions* pOptions, | 174 CPDF_ParseOptions* pOptions, |
175 CPDF_AllStates* pAllStates, | 175 CPDF_AllStates* pAllStates, |
176 int level); | 176 int level); |
177 ~CPDF_StreamContentParser(); | 177 ~CPDF_StreamContentParser(); |
178 | 178 |
179 CPDF_PageObjects* GetObjectList() const { return m_pObjectList; } | 179 CPDF_PageObjects* GetObjectList() const { return m_pObjectList; } |
180 CPDF_AllStates* GetCurStates() const { return m_pCurStates.get(); } | 180 CPDF_AllStates* GetCurStates() const { return m_pCurStates.get(); } |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 void Handle_NextLineShowText(); | 305 void Handle_NextLineShowText(); |
306 void Handle_NextLineShowText_Space(); | 306 void Handle_NextLineShowText_Space(); |
307 void Handle_Invalid(); | 307 void Handle_Invalid(); |
308 | 308 |
309 CPDF_Document* const m_pDocument; | 309 CPDF_Document* const m_pDocument; |
310 CPDF_Dictionary* m_pPageResources; | 310 CPDF_Dictionary* m_pPageResources; |
311 CPDF_Dictionary* m_pParentResources; | 311 CPDF_Dictionary* m_pParentResources; |
312 CPDF_Dictionary* m_pResources; | 312 CPDF_Dictionary* m_pResources; |
313 CPDF_PageObjects* m_pObjectList; | 313 CPDF_PageObjects* m_pObjectList; |
314 int m_Level; | 314 int m_Level; |
315 CFX_AffineMatrix m_mtContentToUser; | 315 CFX_Matrix m_mtContentToUser; |
316 CFX_FloatRect m_BBox; | 316 CFX_FloatRect m_BBox; |
317 CPDF_ParseOptions m_Options; | 317 CPDF_ParseOptions m_Options; |
318 _ContentParam m_ParamBuf1[PARAM_BUF_SIZE]; | 318 _ContentParam m_ParamBuf1[PARAM_BUF_SIZE]; |
319 FX_DWORD m_ParamStartPos; | 319 FX_DWORD m_ParamStartPos; |
320 FX_DWORD m_ParamCount; | 320 FX_DWORD m_ParamCount; |
321 CPDF_StreamParser* m_pSyntax; | 321 CPDF_StreamParser* m_pSyntax; |
322 nonstd::unique_ptr<CPDF_AllStates> m_pCurStates; | 322 nonstd::unique_ptr<CPDF_AllStates> m_pCurStates; |
323 CPDF_ContentMark m_CurContentMark; | 323 CPDF_ContentMark m_CurContentMark; |
324 CFX_ArrayTemplate<CPDF_TextObject*> m_ClipTextList; | 324 CFX_ArrayTemplate<CPDF_TextObject*> m_ClipTextList; |
325 CPDF_TextObject* m_pLastTextObject; | 325 CPDF_TextObject* m_pLastTextObject; |
(...skipping 24 matching lines...) Expand all Loading... |
350 public: | 350 public: |
351 enum ParseStatus { Ready, ToBeContinued, Done }; | 351 enum ParseStatus { Ready, ToBeContinued, Done }; |
352 | 352 |
353 CPDF_ContentParser(); | 353 CPDF_ContentParser(); |
354 ~CPDF_ContentParser(); | 354 ~CPDF_ContentParser(); |
355 | 355 |
356 ParseStatus GetStatus() { return m_Status; } | 356 ParseStatus GetStatus() { return m_Status; } |
357 void Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions); | 357 void Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions); |
358 void Start(CPDF_Form* pForm, | 358 void Start(CPDF_Form* pForm, |
359 CPDF_AllStates* pGraphicStates, | 359 CPDF_AllStates* pGraphicStates, |
360 CFX_AffineMatrix* pParentMatrix, | 360 CFX_Matrix* pParentMatrix, |
361 CPDF_Type3Char* pType3Char, | 361 CPDF_Type3Char* pType3Char, |
362 CPDF_ParseOptions* pOptions, | 362 CPDF_ParseOptions* pOptions, |
363 int level); | 363 int level); |
364 void Continue(IFX_Pause* pPause); | 364 void Continue(IFX_Pause* pPause); |
365 | 365 |
366 protected: | 366 protected: |
367 void Clear(); | 367 void Clear(); |
368 ParseStatus m_Status; | 368 ParseStatus m_Status; |
369 CPDF_PageObjects* m_pObjects; | 369 CPDF_PageObjects* m_pObjects; |
370 FX_BOOL m_bForm; | 370 FX_BOOL m_bForm; |
371 CPDF_ParseOptions m_Options; | 371 CPDF_ParseOptions m_Options; |
372 CPDF_Type3Char* m_pType3Char; | 372 CPDF_Type3Char* m_pType3Char; |
373 int m_InternalStage; | 373 int m_InternalStage; |
374 CPDF_StreamAcc* m_pSingleStream; | 374 CPDF_StreamAcc* m_pSingleStream; |
375 CPDF_StreamAcc** m_pStreamArray; | 375 CPDF_StreamAcc** m_pStreamArray; |
376 FX_DWORD m_nStreams; | 376 FX_DWORD m_nStreams; |
377 uint8_t* m_pData; | 377 uint8_t* m_pData; |
378 FX_DWORD m_Size; | 378 FX_DWORD m_Size; |
379 class CPDF_StreamContentParser* m_pParser; | 379 class CPDF_StreamContentParser* m_pParser; |
380 FX_DWORD m_CurrentOffset; | 380 FX_DWORD m_CurrentOffset; |
381 }; | 381 }; |
382 class CPDF_AllStates : public CPDF_GraphicStates { | 382 class CPDF_AllStates : public CPDF_GraphicStates { |
383 public: | 383 public: |
384 CPDF_AllStates(); | 384 CPDF_AllStates(); |
385 ~CPDF_AllStates(); | 385 ~CPDF_AllStates(); |
386 void Copy(const CPDF_AllStates& src); | 386 void Copy(const CPDF_AllStates& src); |
387 void ProcessExtGS(CPDF_Dictionary* pGS, CPDF_StreamContentParser* pParser); | 387 void ProcessExtGS(CPDF_Dictionary* pGS, CPDF_StreamContentParser* pParser); |
388 void SetLineDash(CPDF_Array*, FX_FLOAT, FX_FLOAT scale); | 388 void SetLineDash(CPDF_Array*, FX_FLOAT, FX_FLOAT scale); |
389 CFX_AffineMatrix m_TextMatrix, m_CTM, m_ParentMatrix; | 389 CFX_Matrix m_TextMatrix, m_CTM, m_ParentMatrix; |
390 FX_FLOAT m_TextX, m_TextY, m_TextLineX, m_TextLineY; | 390 FX_FLOAT m_TextX, m_TextY, m_TextLineX, m_TextLineY; |
391 FX_FLOAT m_TextLeading, m_TextRise, m_TextHorzScale; | 391 FX_FLOAT m_TextLeading, m_TextRise, m_TextHorzScale; |
392 }; | 392 }; |
393 | 393 |
394 class CPDF_DocPageData { | 394 class CPDF_DocPageData { |
395 public: | 395 public: |
396 explicit CPDF_DocPageData(CPDF_Document* pPDFDoc); | 396 explicit CPDF_DocPageData(CPDF_Document* pPDFDoc); |
397 ~CPDF_DocPageData(); | 397 ~CPDF_DocPageData(); |
398 | 398 |
399 void Clear(FX_BOOL bRelease = FALSE); | 399 void Clear(FX_BOOL bRelease = FALSE); |
400 CPDF_Font* GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnly); | 400 CPDF_Font* GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnly); |
401 CPDF_Font* GetStandardFont(const CFX_ByteStringC& fontName, | 401 CPDF_Font* GetStandardFont(const CFX_ByteStringC& fontName, |
402 CPDF_FontEncoding* pEncoding); | 402 CPDF_FontEncoding* pEncoding); |
403 void ReleaseFont(CPDF_Dictionary* pFontDict); | 403 void ReleaseFont(CPDF_Dictionary* pFontDict); |
404 CPDF_ColorSpace* GetColorSpace(CPDF_Object* pCSObj, | 404 CPDF_ColorSpace* GetColorSpace(CPDF_Object* pCSObj, |
405 const CPDF_Dictionary* pResources); | 405 const CPDF_Dictionary* pResources); |
406 CPDF_ColorSpace* GetCopiedColorSpace(CPDF_Object* pCSObj); | 406 CPDF_ColorSpace* GetCopiedColorSpace(CPDF_Object* pCSObj); |
407 void ReleaseColorSpace(CPDF_Object* pColorSpace); | 407 void ReleaseColorSpace(CPDF_Object* pColorSpace); |
408 CPDF_Pattern* GetPattern(CPDF_Object* pPatternObj, | 408 CPDF_Pattern* GetPattern(CPDF_Object* pPatternObj, |
409 FX_BOOL bShading, | 409 FX_BOOL bShading, |
410 const CFX_AffineMatrix* matrix); | 410 const CFX_Matrix* matrix); |
411 void ReleasePattern(CPDF_Object* pPatternObj); | 411 void ReleasePattern(CPDF_Object* pPatternObj); |
412 CPDF_Image* GetImage(CPDF_Object* pImageStream); | 412 CPDF_Image* GetImage(CPDF_Object* pImageStream); |
413 void ReleaseImage(CPDF_Object* pImageStream); | 413 void ReleaseImage(CPDF_Object* pImageStream); |
414 CPDF_IccProfile* GetIccProfile(CPDF_Stream* pIccProfileStream); | 414 CPDF_IccProfile* GetIccProfile(CPDF_Stream* pIccProfileStream); |
415 void ReleaseIccProfile(CPDF_IccProfile* pIccProfile); | 415 void ReleaseIccProfile(CPDF_IccProfile* pIccProfile); |
416 CPDF_StreamAcc* GetFontFileStreamAcc(CPDF_Stream* pFontStream); | 416 CPDF_StreamAcc* GetFontFileStreamAcc(CPDF_Stream* pFontStream); |
417 void ReleaseFontFileStreamAcc(CPDF_Stream* pFontStream, | 417 void ReleaseFontFileStreamAcc(CPDF_Stream* pFontStream, |
418 FX_BOOL bForce = FALSE); | 418 FX_BOOL bForce = FALSE); |
419 FX_BOOL IsForceClear() const { return m_bForceClear; } | 419 FX_BOOL IsForceClear() const { return m_bForceClear; } |
420 CPDF_CountedColorSpace* FindColorSpacePtr(CPDF_Object* pCSObj) const; | 420 CPDF_CountedColorSpace* FindColorSpacePtr(CPDF_Object* pCSObj) const; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 FX_FLOAT& G, | 519 FX_FLOAT& G, |
520 FX_FLOAT& B) const override; | 520 FX_FLOAT& B) const override; |
521 CPDF_ColorSpace* GetBaseCS() const override; | 521 CPDF_ColorSpace* GetBaseCS() const override; |
522 | 522 |
523 private: | 523 private: |
524 CPDF_ColorSpace* m_pBaseCS; | 524 CPDF_ColorSpace* m_pBaseCS; |
525 CPDF_CountedColorSpace* m_pCountedBaseCS; | 525 CPDF_CountedColorSpace* m_pCountedBaseCS; |
526 }; | 526 }; |
527 | 527 |
528 #endif // CORE_SRC_FPDFAPI_FPDF_PAGE_PAGEINT_H_ | 528 #endif // CORE_SRC_FPDFAPI_FPDF_PAGE_PAGEINT_H_ |
OLD | NEW |