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

Unified Diff: core/include/fpdfapi/fpdf_pageobj.h

Issue 1636503006: Merge to XFA: War on #defines, part 1. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Dircet -> Direct typo. Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/include/fpdfapi/fpdf_objects.h ('k') | core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fpdfapi/fpdf_pageobj.h
diff --git a/core/include/fpdfapi/fpdf_pageobj.h b/core/include/fpdfapi/fpdf_pageobj.h
index 2b6f78e63f703eb409dc2d44e0f7caf428d6fa55..ca062b34618fd4d4abd7f1059cf399c8d82f9c6f 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;
};
« no previous file with comments | « core/include/fpdfapi/fpdf_objects.h ('k') | core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698