summaryrefslogtreecommitdiff
path: root/core/include/fpdfapi/fpdf_pageobj.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-01-26 13:20:26 -0800
committerTom Sepez <tsepez@chromium.org>2016-01-26 13:20:26 -0800
commit8e5cd19d174f259bfda5f7a9699b08fdc4289b56 (patch)
tree6c2382c4cfe0475ecbfafc1af981dcaa0a801c35 /core/include/fpdfapi/fpdf_pageobj.h
parentd834d55f902ccd18cba85f93ecf51e30c5e7e47b (diff)
downloadpdfium-8e5cd19d174f259bfda5f7a9699b08fdc4289b56.tar.xz
Merge to XFA: War on #defines, part 1.
Contains additional XFA-specific changes. Original Review URL: https://codereview.chromium.org/1632143002 . (cherry picked from commit 66a9dc9dd65ed2b9c7ede448d046b770140f16d5) R=thestig@chromium.org Review URL: https://codereview.chromium.org/1636503006 .
Diffstat (limited to 'core/include/fpdfapi/fpdf_pageobj.h')
-rw-r--r--core/include/fpdfapi/fpdf_pageobj.h42
1 files changed, 13 insertions, 29 deletions
diff --git a/core/include/fpdfapi/fpdf_pageobj.h b/core/include/fpdfapi/fpdf_pageobj.h
index 2b6f78e63f..ca062b3461 100644
--- a/core/include/fpdfapi/fpdf_pageobj.h
+++ b/core/include/fpdfapi/fpdf_pageobj.h
@@ -328,12 +328,6 @@ class CPDF_ContentMark : public CFX_CountRef<CPDF_ContentMarkData> {
CPDF_Dictionary*& pDict) const;
};
-#define PDFPAGE_TEXT 1
-#define PDFPAGE_PATH 2
-#define PDFPAGE_IMAGE 3
-#define PDFPAGE_SHADING 4
-#define PDFPAGE_FORM 5
-
class CPDF_GraphicStates {
public:
void CopyStates(const CPDF_GraphicStates& src);
@@ -353,47 +347,42 @@ class CPDF_GraphicStates {
class CPDF_PageObject : public CPDF_GraphicStates {
public:
+ enum Type {
+ TEXT = 1,
+ PATH,
+ IMAGE,
+ SHADING,
+ FORM,
+ };
+
static CPDF_PageObject* Create(int type);
virtual ~CPDF_PageObject();
CPDF_PageObject* Clone() const;
-
void Copy(const CPDF_PageObject* pSrcObject);
virtual void Transform(const CFX_Matrix& matrix) = 0;
void RemoveClipPath();
-
void AppendClipPath(CPDF_Path path, int type, FX_BOOL bAutoMerge);
-
void CopyClipPath(CPDF_PageObject* pObj);
-
void TransformClipPath(CFX_Matrix& matrix);
-
void TransformGeneralState(CFX_Matrix& matrix);
-
void SetColorState(CPDF_ColorState state) { m_ColorState = state; }
-
FX_RECT GetBBox(const CFX_Matrix* pMatrix) const;
- int m_Type;
-
+ const Type m_Type;
FX_FLOAT m_Left;
-
FX_FLOAT m_Right;
-
FX_FLOAT m_Top;
-
FX_FLOAT m_Bottom;
-
CPDF_ContentMark m_ContentMark;
protected:
virtual void CopyData(const CPDF_PageObject* pSrcObject) = 0;
void RecalcBBox();
-
- CPDF_PageObject() {}
+ CPDF_PageObject(Type type) : m_Type(type) {}
};
struct CPDF_TextObjectItem {
@@ -490,7 +479,7 @@ class CPDF_TextObject : public CPDF_PageObject {
class CPDF_PathObject : public CPDF_PageObject {
public:
- CPDF_PathObject() { m_Type = PDFPAGE_PATH; }
+ CPDF_PathObject() : CPDF_PageObject(PATH) {}
~CPDF_PathObject() override {}
void Transform(const CFX_Matrix& maxtrix) override;
@@ -547,20 +536,15 @@ class CPDF_ShadingObject : public CPDF_PageObject {
class CPDF_FormObject : public CPDF_PageObject {
public:
- CPDF_FormObject() {
- m_Type = PDFPAGE_FORM;
- m_pForm = NULL;
- }
+ CPDF_FormObject() : CPDF_PageObject(FORM), m_pForm(nullptr) {}
~CPDF_FormObject() override;
void Transform(const CFX_Matrix& matrix) override;
+ void CalcBoundingBox();
CPDF_Form* m_pForm;
-
CFX_Matrix m_FormMatrix;
- void CalcBoundingBox();
-
protected:
void CopyData(const CPDF_PageObject* pSrcObject) override;
};