Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Side by Side Diff: core/fpdfapi/fpdf_page/include/cpdf_page.h

Issue 1918113002: Clean up CPDF_Page. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: More cleanup, fix build Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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; 21 class CPDF_ParseOptions;
20 22
21 CPDF_Object* FPDFAPI_GetPageAttr(CPDF_Dictionary* pPageDict, 23 CPDF_Object* FPDFAPI_GetPageAttr(CPDF_Dictionary* pPageDict,
22 const CFX_ByteStringC& name); 24 const CFX_ByteStringC& name);
23 25
24 class CPDF_Page : public CPDF_PageObjectHolder, public CFX_PrivateData { 26 class CPDF_Page : public CPDF_PageObjectHolder, public CFX_PrivateData {
25 public: 27 public:
26 CPDF_Page(); 28 CPDF_Page(CPDF_Document* pDocument,
29 CPDF_Dictionary* pPageDict,
30 bool bPageCache);
27 ~CPDF_Page(); 31 ~CPDF_Page();
28 32
29 void Load(CPDF_Document* pDocument, 33 void ParseContent();
30 CPDF_Dictionary* pPageDict,
31 FX_BOOL bPageCache = TRUE);
32
33 void ParseContent(CPDF_ParseOptions* pOptions);
34 34
35 void GetDisplayMatrix(CFX_Matrix& matrix, 35 void GetDisplayMatrix(CFX_Matrix& matrix,
36 int xPos, 36 int xPos,
37 int yPos, 37 int yPos,
38 int xSize, 38 int xSize,
39 int ySize, 39 int ySize,
40 int iRotate) const; 40 int iRotate) const;
41 41
42 FX_FLOAT GetPageWidth() const { return m_PageWidth; } 42 FX_FLOAT GetPageWidth() const { return m_PageWidth; }
43 FX_FLOAT GetPageHeight() const { return m_PageHeight; } 43 FX_FLOAT GetPageHeight() const { return m_PageHeight; }
44 CFX_FloatRect GetPageBBox() const { return m_BBox; } 44 CFX_FloatRect GetPageBBox() const { return m_BBox; }
45 const CFX_Matrix& GetPageMatrix() const { return m_PageMatrix; } 45 const CFX_Matrix& GetPageMatrix() const { return m_PageMatrix; }
46 CPDF_Object* GetPageAttr(const CFX_ByteStringC& name) const; 46 CPDF_Object* GetPageAttr(const CFX_ByteStringC& name) const;
47 CPDF_PageRenderCache* GetRenderCache() const { return m_pPageRender; } 47 CPDF_PageRenderCache* GetRenderCache() const { return m_pPageRender.get(); }
48 48
49 protected: 49 protected:
50 friend class CPDF_ContentParser; 50 friend class CPDF_ContentParser;
51 51
52 void StartParse(CPDF_ParseOptions* pOptions); 52 void StartParse();
53 53
54 FX_FLOAT m_PageWidth; 54 FX_FLOAT m_PageWidth;
55 FX_FLOAT m_PageHeight; 55 FX_FLOAT m_PageHeight;
56 CFX_Matrix m_PageMatrix; 56 CFX_Matrix m_PageMatrix;
57 CPDF_PageRenderCache* m_pPageRender; 57 std::unique_ptr<CPDF_PageRenderCache> m_pPageRender;
58 }; 58 };
59 59
60 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGE_H_ 60 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698