summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-01-21 11:04:37 -0800
committerTom Sepez <tsepez@chromium.org>2016-01-21 11:04:37 -0800
commitb5b2a9162e3e5d17b233d912399daca9be5ed51b (patch)
treee1ccbe8a5f965cfed2edbcba0cdc889e4404246e /core/include
parente19e06e430f76f1cdb126e772602c9fbc4dd1e8f (diff)
downloadpdfium-b5b2a9162e3e5d17b233d912399daca9be5ed51b.tar.xz
Mege to XFA: Redo CPDF_PageObjects - part 1
Original Review URL: https://codereview.chromium.org/1601093009 . (cherry picked from commit da9355139b5dce270be02af31db326d60f488e8c) Trivial conflicts/changes in fpdfeditpage.cpp and fpdfxfa_page.cpp. TBR=ochang@chromium.org Review URL: https://codereview.chromium.org/1613823003 .
Diffstat (limited to 'core/include')
-rw-r--r--core/include/fpdfapi/fpdf_page.h31
1 files changed, 15 insertions, 16 deletions
diff --git a/core/include/fpdfapi/fpdf_page.h b/core/include/fpdfapi/fpdf_page.h
index edcef3c0b6..2ff8a0596b 100644
--- a/core/include/fpdfapi/fpdf_page.h
+++ b/core/include/fpdfapi/fpdf_page.h
@@ -7,11 +7,12 @@
#ifndef CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_
#define CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_
+#include <memory>
+
+#include "core/include/fpdfapi/fpdf_parser.h"
+#include "core/include/fpdfapi/fpdf_resource.h"
#include "core/include/fxge/fx_dib.h"
-#include "fpdf_parser.h"
-#include "fpdf_resource.h"
-class CPDF_PageObjects;
class CPDF_Page;
class CPDF_Form;
class CPDF_ParseOptions;
@@ -27,7 +28,7 @@ class CPDF_StreamContentParser;
class CPDF_PageObjects {
public:
- CPDF_PageObjects(FX_BOOL bReleaseMembers = TRUE);
+ CPDF_PageObjects();
~CPDF_PageObjects();
void ContinueParse(IFX_Pause* pPause);
@@ -54,6 +55,7 @@ class CPDF_PageObjects {
return (CPDF_PageObject*)m_ObjectList.GetAt(pos);
}
+ void AddTail(CPDF_PageObject* obj) { m_ObjectList.AddTail(obj); }
FX_DWORD CountObjects() const { return m_ObjectList.GetCount(); }
int GetObjectIndex(CPDF_PageObject* pObj) const;
@@ -66,9 +68,12 @@ class CPDF_PageObjects {
void Transform(const CFX_Matrix& matrix);
FX_BOOL BackgroundAlphaNeeded() const { return m_bBackgroundAlphaNeeded; }
+ void SetBackgroundAlphaNeeded(FX_BOOL needed) {
+ m_bBackgroundAlphaNeeded = needed;
+ }
FX_BOOL HasImageMask() const { return m_bHasImageMask; }
-
+ void SetHasImageMask(FX_BOOL value) { m_bHasImageMask = value; }
CFX_FloatRect CalcBoundingBox() const;
CPDF_Dictionary* m_pFormDict;
@@ -80,21 +85,15 @@ class CPDF_PageObjects {
int m_Transparency;
protected:
- friend class CPDF_ContentParser;
- friend class CPDF_StreamContentParser;
- friend class CPDF_AllStates;
-
enum ParseState { CONTENT_NOT_PARSED, CONTENT_PARSING, CONTENT_PARSED };
void LoadTransInfo();
- void ClearCacheObjects();
- CFX_PtrList m_ObjectList;
FX_BOOL m_bBackgroundAlphaNeeded;
FX_BOOL m_bHasImageMask;
- FX_BOOL m_bReleaseMembers;
- CPDF_ContentParser* m_pParser;
ParseState m_ParseState;
+ std::unique_ptr<CPDF_ContentParser> m_pParser;
+ CFX_PtrList m_ObjectList;
};
class CPDF_Page : public CPDF_PageObjects, public CFX_PrivateData {
@@ -106,9 +105,7 @@ class CPDF_Page : public CPDF_PageObjects, public CFX_PrivateData {
CPDF_Dictionary* pPageDict,
FX_BOOL bPageCache = TRUE);
- void StartParse(CPDF_ParseOptions* pOptions = NULL, FX_BOOL bReParse = FALSE);
- void ParseContent(CPDF_ParseOptions* pOptions = NULL,
- FX_BOOL bReParse = FALSE);
+ void ParseContent(CPDF_ParseOptions* pOptions);
void GetDisplayMatrix(CFX_Matrix& matrix,
int xPos,
@@ -126,6 +123,8 @@ class CPDF_Page : public CPDF_PageObjects, public CFX_PrivateData {
protected:
friend class CPDF_ContentParser;
+ void StartParse(CPDF_ParseOptions* pOptions);
+
FX_FLOAT m_PageWidth;
FX_FLOAT m_PageHeight;
CFX_Matrix m_PageMatrix;