| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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_INCLUDE_CPDF_PAGE_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGE_H_ |
| 8 #define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGE_H_ | 8 #define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGE_H_ |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" | 12 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" |
| 11 #include "core/fxcrt/include/fx_basic.h" | 13 #include "core/fxcrt/include/fx_basic.h" |
| 12 #include "core/fxcrt/include/fx_coordinates.h" | 14 #include "core/fxcrt/include/fx_coordinates.h" |
| 13 #include "core/fxcrt/include/fx_system.h" | 15 #include "core/fxcrt/include/fx_system.h" |
| 14 | 16 |
| 17 class CPDF_Dictionary; |
| 15 class CPDF_Document; | 18 class CPDF_Document; |
| 16 class CPDF_Dictionary; | |
| 17 class CPDF_Object; | 19 class CPDF_Object; |
| 18 class CPDF_PageRenderCache; | 20 class CPDF_PageRenderCache; |
| 19 class CPDF_ParseOptions; | |
| 20 | |
| 21 CPDF_Object* FPDFAPI_GetPageAttr(CPDF_Dictionary* pPageDict, | |
| 22 const CFX_ByteStringC& name); | |
| 23 | 21 |
| 24 class CPDF_Page : public CPDF_PageObjectHolder, public CFX_PrivateData { | 22 class CPDF_Page : public CPDF_PageObjectHolder, public CFX_PrivateData { |
| 25 public: | 23 public: |
| 26 CPDF_Page(); | 24 CPDF_Page(CPDF_Document* pDocument, |
| 25 CPDF_Dictionary* pPageDict, |
| 26 bool bPageCache); |
| 27 ~CPDF_Page(); | 27 ~CPDF_Page(); |
| 28 | 28 |
| 29 void Load(CPDF_Document* pDocument, | 29 void ParseContent(); |
| 30 CPDF_Dictionary* pPageDict, | |
| 31 FX_BOOL bPageCache = TRUE); | |
| 32 | |
| 33 void ParseContent(CPDF_ParseOptions* pOptions); | |
| 34 | 30 |
| 35 void GetDisplayMatrix(CFX_Matrix& matrix, | 31 void GetDisplayMatrix(CFX_Matrix& matrix, |
| 36 int xPos, | 32 int xPos, |
| 37 int yPos, | 33 int yPos, |
| 38 int xSize, | 34 int xSize, |
| 39 int ySize, | 35 int ySize, |
| 40 int iRotate) const; | 36 int iRotate) const; |
| 41 | 37 |
| 42 FX_FLOAT GetPageWidth() const { return m_PageWidth; } | 38 FX_FLOAT GetPageWidth() const { return m_PageWidth; } |
| 43 FX_FLOAT GetPageHeight() const { return m_PageHeight; } | 39 FX_FLOAT GetPageHeight() const { return m_PageHeight; } |
| 44 CFX_FloatRect GetPageBBox() const { return m_BBox; } | 40 CFX_FloatRect GetPageBBox() const { return m_BBox; } |
| 45 const CFX_Matrix& GetPageMatrix() const { return m_PageMatrix; } | 41 const CFX_Matrix& GetPageMatrix() const { return m_PageMatrix; } |
| 46 CPDF_Object* GetPageAttr(const CFX_ByteStringC& name) const; | 42 CPDF_Object* GetPageAttr(const CFX_ByteString& name) const; |
| 47 CPDF_PageRenderCache* GetRenderCache() const { return m_pPageRender; } | 43 CPDF_PageRenderCache* GetRenderCache() const { return m_pPageRender.get(); } |
| 48 | 44 |
| 49 protected: | 45 protected: |
| 50 friend class CPDF_ContentParser; | 46 friend class CPDF_ContentParser; |
| 51 | 47 |
| 52 void StartParse(CPDF_ParseOptions* pOptions); | 48 void StartParse(); |
| 53 | 49 |
| 54 FX_FLOAT m_PageWidth; | 50 FX_FLOAT m_PageWidth; |
| 55 FX_FLOAT m_PageHeight; | 51 FX_FLOAT m_PageHeight; |
| 56 CFX_Matrix m_PageMatrix; | 52 CFX_Matrix m_PageMatrix; |
| 57 CPDF_PageRenderCache* m_pPageRender; | 53 std::unique_ptr<CPDF_PageRenderCache> m_pPageRender; |
| 58 }; | 54 }; |
| 59 | 55 |
| 60 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGE_H_ | 56 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGE_H_ |
| OLD | NEW |