diff options
author | Nico Weber <thakis@chromium.org> | 2015-08-04 12:19:10 -0700 |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2015-08-04 12:19:10 -0700 |
commit | b048f791a15f2da781a01eba5b09eb9d389f9c11 (patch) | |
tree | 6850a73c18bbc41eaf4b1fdc6b3c96646d45587b /core/include/fpdfapi/fpdf_pageobj.h | |
parent | c8eeed31f217d99a706b0cbf5e4ce0bcc12beb64 (diff) | |
download | pdfium-b048f791a15f2da781a01eba5b09eb9d389f9c11.tar.xz |
clang-format all pdfium code.
No behavior change.
Generated by:
find . -name '*.cpp' -o -name '*.h' | \
grep -E -v 'third_party|thirdparties|lpng_v163' | \
xargs ../../buildtools/mac/clang-format -i
See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion.
BUG=none
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1265503005 .
Diffstat (limited to 'core/include/fpdfapi/fpdf_pageobj.h')
-rw-r--r-- | core/include/fpdfapi/fpdf_pageobj.h | 792 |
1 files changed, 330 insertions, 462 deletions
diff --git a/core/include/fpdfapi/fpdf_pageobj.h b/core/include/fpdfapi/fpdf_pageobj.h index 73540a3eb3..be81244ef4 100644 --- a/core/include/fpdfapi/fpdf_pageobj.h +++ b/core/include/fpdfapi/fpdf_pageobj.h @@ -31,672 +31,540 @@ class CPDF_ShadingObject; class CPDF_FormObject; typedef CFX_PathData CPDF_PathData; -class CPDF_Path : public CFX_CountRef<CFX_PathData> -{ -public: - int GetPointCount() - { - return m_pObject->m_PointCount; - } - - int GetFlag(int index) - { - return m_pObject->m_pPoints[index].m_Flag; - } - - FX_FLOAT GetPointX(int index) - { - return m_pObject->m_pPoints[index].m_PointX; - } - - FX_FLOAT GetPointY(int index) - { - return m_pObject->m_pPoints[index].m_PointY; - } - - - - - FX_PATHPOINT* GetPoints() - { - return m_pObject->m_pPoints; - } - - - CFX_FloatRect GetBoundingBox() const - { - return m_pObject->GetBoundingBox(); - } - - CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const - { - return m_pObject->GetBoundingBox(line_width, miter_limit); - } - - void Transform(const CFX_AffineMatrix* pMatrix) - { - GetModify()->Transform(pMatrix); - } - - void Append(CPDF_Path src, const CFX_AffineMatrix* pMatrix) - { - m_pObject->Append(src.m_pObject, pMatrix); - } - - void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top) - { - m_pObject->AppendRect(left, bottom, right, top); - } - - FX_BOOL IsRect() const - { - return m_pObject->IsRect(); - } -}; -class CPDF_ClipPathData -{ -public: +class CPDF_Path : public CFX_CountRef<CFX_PathData> { + public: + int GetPointCount() { return m_pObject->m_PointCount; } + + int GetFlag(int index) { return m_pObject->m_pPoints[index].m_Flag; } - CPDF_ClipPathData(); + FX_FLOAT GetPointX(int index) { return m_pObject->m_pPoints[index].m_PointX; } - CPDF_ClipPathData(const CPDF_ClipPathData&); + FX_FLOAT GetPointY(int index) { return m_pObject->m_pPoints[index].m_PointY; } - ~CPDF_ClipPathData(); + FX_PATHPOINT* GetPoints() { return m_pObject->m_pPoints; } - void SetCount(int path_count, int text_count); -public: + CFX_FloatRect GetBoundingBox() const { return m_pObject->GetBoundingBox(); } - int m_PathCount; + CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, + FX_FLOAT miter_limit) const { + return m_pObject->GetBoundingBox(line_width, miter_limit); + } - CPDF_Path* m_pPathList; + void Transform(const CFX_AffineMatrix* pMatrix) { + GetModify()->Transform(pMatrix); + } - uint8_t* m_pTypeList; + void Append(CPDF_Path src, const CFX_AffineMatrix* pMatrix) { + m_pObject->Append(src.m_pObject, pMatrix); + } - int m_TextCount; + void AppendRect(FX_FLOAT left, + FX_FLOAT bottom, + FX_FLOAT right, + FX_FLOAT top) { + m_pObject->AppendRect(left, bottom, right, top); + } - CPDF_TextObject** m_pTextList; + FX_BOOL IsRect() const { return m_pObject->IsRect(); } }; -class CPDF_ClipPath : public CFX_CountRef<CPDF_ClipPathData> -{ -public: +class CPDF_ClipPathData { + public: + CPDF_ClipPathData(); - FX_DWORD GetPathCount() const - { - return m_pObject->m_PathCount; - } + CPDF_ClipPathData(const CPDF_ClipPathData&); - CPDF_Path GetPath(int i) const - { - return m_pObject->m_pPathList[i]; - } + ~CPDF_ClipPathData(); - int GetClipType(int i) const - { - return m_pObject->m_pTypeList[i]; - } + void SetCount(int path_count, int text_count); - FX_DWORD GetTextCount() const - { - return m_pObject->m_TextCount; - } + public: + int m_PathCount; - CPDF_TextObject* GetText(int i) const - { - return m_pObject->m_pTextList[i]; - } + CPDF_Path* m_pPathList; - CFX_FloatRect GetClipBox() const; + uint8_t* m_pTypeList; - void AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge); + int m_TextCount; - void DeletePath(int layer_index); + CPDF_TextObject** m_pTextList; +}; +class CPDF_ClipPath : public CFX_CountRef<CPDF_ClipPathData> { + public: + FX_DWORD GetPathCount() const { return m_pObject->m_PathCount; } - void AppendTexts(CPDF_TextObject** pTexts, int count); + CPDF_Path GetPath(int i) const { return m_pObject->m_pPathList[i]; } - void Transform(const CFX_AffineMatrix& matrix); -}; -class CPDF_ColorStateData -{ -public: + int GetClipType(int i) const { return m_pObject->m_pTypeList[i]; } - CPDF_ColorStateData(): m_FillRGB(0), m_StrokeRGB(0) {} + FX_DWORD GetTextCount() const { return m_pObject->m_TextCount; } - CPDF_ColorStateData(const CPDF_ColorStateData& src); + CPDF_TextObject* GetText(int i) const { return m_pObject->m_pTextList[i]; } - void Default(); + CFX_FloatRect GetClipBox() const; - CPDF_Color m_FillColor; + void AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge); - FX_DWORD m_FillRGB; + void DeletePath(int layer_index); - CPDF_Color m_StrokeColor; + void AppendTexts(CPDF_TextObject** pTexts, int count); - FX_DWORD m_StrokeRGB; + void Transform(const CFX_AffineMatrix& matrix); }; -class CPDF_ColorState : public CFX_CountRef<CPDF_ColorStateData> -{ -public: +class CPDF_ColorStateData { + public: + CPDF_ColorStateData() : m_FillRGB(0), m_StrokeRGB(0) {} - CPDF_Color* GetFillColor() const - { - return m_pObject ? &m_pObject->m_FillColor : NULL; - } + CPDF_ColorStateData(const CPDF_ColorStateData& src); - CPDF_Color* GetStrokeColor() const - { - return m_pObject ? &m_pObject->m_StrokeColor : NULL; - } + void Default(); - void SetFillColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues); + CPDF_Color m_FillColor; - void SetStrokeColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues); + FX_DWORD m_FillRGB; - void SetFillPattern(CPDF_Pattern* pattern, FX_FLOAT* pValue, int nValues); + CPDF_Color m_StrokeColor; - void SetStrokePattern(CPDF_Pattern* pattern, FX_FLOAT* pValue, int nValues); -private: - void SetColor(CPDF_Color& color, FX_DWORD& rgb, CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues); -}; -typedef CFX_GraphStateData CPDF_GraphStateData; -class CPDF_GraphState : public CFX_CountRef<CFX_GraphStateData> -{ -public: + FX_DWORD m_StrokeRGB; }; -class CPDF_TextStateData -{ -public: +class CPDF_ColorState : public CFX_CountRef<CPDF_ColorStateData> { + public: + CPDF_Color* GetFillColor() const { + return m_pObject ? &m_pObject->m_FillColor : NULL; + } - CPDF_TextStateData(); + CPDF_Color* GetStrokeColor() const { + return m_pObject ? &m_pObject->m_StrokeColor : NULL; + } - CPDF_TextStateData(const CPDF_TextStateData& src); + void SetFillColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues); - ~CPDF_TextStateData(); + void SetStrokeColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues); - CPDF_Font* m_pFont; + void SetFillPattern(CPDF_Pattern* pattern, FX_FLOAT* pValue, int nValues); - CPDF_Document* m_pDocument; + void SetStrokePattern(CPDF_Pattern* pattern, FX_FLOAT* pValue, int nValues); - FX_FLOAT m_FontSize; + private: + void SetColor(CPDF_Color& color, + FX_DWORD& rgb, + CPDF_ColorSpace* pCS, + FX_FLOAT* pValue, + int nValues); +}; +typedef CFX_GraphStateData CPDF_GraphStateData; +class CPDF_GraphState : public CFX_CountRef<CFX_GraphStateData> { + public: +}; +class CPDF_TextStateData { + public: + CPDF_TextStateData(); - FX_FLOAT m_CharSpace; + CPDF_TextStateData(const CPDF_TextStateData& src); - FX_FLOAT m_WordSpace; + ~CPDF_TextStateData(); - FX_FLOAT m_Matrix[4]; + CPDF_Font* m_pFont; - int m_TextMode; + CPDF_Document* m_pDocument; - FX_FLOAT m_CTM[4]; -}; -class CPDF_TextState : public CFX_CountRef<CPDF_TextStateData> -{ -public: + FX_FLOAT m_FontSize; + + FX_FLOAT m_CharSpace; - CPDF_Font* GetFont() const - { - return m_pObject->m_pFont; - } + FX_FLOAT m_WordSpace; - void SetFont(CPDF_Font* pFont); + FX_FLOAT m_Matrix[4]; - FX_FLOAT GetFontSize() const - { - return m_pObject->m_FontSize; - } + int m_TextMode; - FX_FLOAT* GetMatrix() const - { - return m_pObject->m_Matrix; - } + FX_FLOAT m_CTM[4]; +}; +class CPDF_TextState : public CFX_CountRef<CPDF_TextStateData> { + public: + CPDF_Font* GetFont() const { return m_pObject->m_pFont; } + void SetFont(CPDF_Font* pFont); + FX_FLOAT GetFontSize() const { return m_pObject->m_FontSize; } - FX_FLOAT GetFontSizeV() const; + FX_FLOAT* GetMatrix() const { return m_pObject->m_Matrix; } - FX_FLOAT GetFontSizeH() const; + FX_FLOAT GetFontSizeV() const; - FX_FLOAT GetBaselineAngle() const; + FX_FLOAT GetFontSizeH() const; - FX_FLOAT GetShearAngle() const; + FX_FLOAT GetBaselineAngle() const; + FX_FLOAT GetShearAngle() const; }; class CPDF_TransferFunc; -class CPDF_GeneralStateData -{ -public: - - CPDF_GeneralStateData(); +class CPDF_GeneralStateData { + public: + CPDF_GeneralStateData(); - CPDF_GeneralStateData(const CPDF_GeneralStateData& src); - ~CPDF_GeneralStateData(); + CPDF_GeneralStateData(const CPDF_GeneralStateData& src); + ~CPDF_GeneralStateData(); - void SetBlendMode(const CFX_ByteStringC& blend_mode); + void SetBlendMode(const CFX_ByteStringC& blend_mode); - char m_BlendMode[16]; + char m_BlendMode[16]; - int m_BlendType; + int m_BlendType; - CPDF_Object* m_pSoftMask; + CPDF_Object* m_pSoftMask; - FX_FLOAT m_SMaskMatrix[6]; + FX_FLOAT m_SMaskMatrix[6]; - FX_FLOAT m_StrokeAlpha; + FX_FLOAT m_StrokeAlpha; - FX_FLOAT m_FillAlpha; + FX_FLOAT m_FillAlpha; - CPDF_Object* m_pTR; + CPDF_Object* m_pTR; - CPDF_TransferFunc* m_pTransferFunc; + CPDF_TransferFunc* m_pTransferFunc; - CFX_Matrix m_Matrix; + CFX_Matrix m_Matrix; - int m_RenderIntent; + int m_RenderIntent; - FX_BOOL m_StrokeAdjust; + FX_BOOL m_StrokeAdjust; - FX_BOOL m_AlphaSource; + FX_BOOL m_AlphaSource; - FX_BOOL m_TextKnockout; + FX_BOOL m_TextKnockout; - FX_BOOL m_StrokeOP; + FX_BOOL m_StrokeOP; - FX_BOOL m_FillOP; + FX_BOOL m_FillOP; - int m_OPMode; + int m_OPMode; - CPDF_Object* m_pBG; + CPDF_Object* m_pBG; - CPDF_Object* m_pUCR; + CPDF_Object* m_pUCR; - CPDF_Object* m_pHT; + CPDF_Object* m_pHT; - FX_FLOAT m_Flatness; + FX_FLOAT m_Flatness; - FX_FLOAT m_Smoothness; + FX_FLOAT m_Smoothness; }; -class CPDF_GeneralState : public CFX_CountRef<CPDF_GeneralStateData> -{ -public: - - void SetRenderIntent(const CFX_ByteString& ri); - - int GetBlendType() const - { - return m_pObject ? m_pObject->m_BlendType : FXDIB_BLEND_NORMAL; - } - - int GetAlpha(FX_BOOL bStroke) const - { - return m_pObject ? FXSYS_round((bStroke ? m_pObject->m_StrokeAlpha : m_pObject->m_FillAlpha) * 255) : 255; - } +class CPDF_GeneralState : public CFX_CountRef<CPDF_GeneralStateData> { + public: + void SetRenderIntent(const CFX_ByteString& ri); + + int GetBlendType() const { + return m_pObject ? m_pObject->m_BlendType : FXDIB_BLEND_NORMAL; + } + + int GetAlpha(FX_BOOL bStroke) const { + return m_pObject ? FXSYS_round((bStroke ? m_pObject->m_StrokeAlpha + : m_pObject->m_FillAlpha) * + 255) + : 255; + } }; -class CPDF_ContentMarkItem -{ -public: - - typedef enum { - None, - PropertiesDict, - DirectDict, - MCID - } ParamType; +class CPDF_ContentMarkItem { + public: + typedef enum { None, PropertiesDict, DirectDict, MCID } ParamType; - CPDF_ContentMarkItem(); + CPDF_ContentMarkItem(); - CPDF_ContentMarkItem(const CPDF_ContentMarkItem& src); + CPDF_ContentMarkItem(const CPDF_ContentMarkItem& src); - ~CPDF_ContentMarkItem(); + ~CPDF_ContentMarkItem(); - inline const CFX_ByteString& GetName() const - { - return m_MarkName; - } + inline const CFX_ByteString& GetName() const { return m_MarkName; } - inline ParamType GetParamType() const - { - return m_ParamType; - } + inline ParamType GetParamType() const { return m_ParamType; } - inline void* GetParam() const - { - return m_pParam; - } + inline void* GetParam() const { return m_pParam; } - inline FX_BOOL HasMCID() const; + inline FX_BOOL HasMCID() const; - inline void SetName(const CFX_ByteString& name) - { - m_MarkName = name; - } + inline void SetName(const CFX_ByteString& name) { m_MarkName = name; } - inline void SetParam(ParamType type, void* param) - { - m_ParamType = type; - m_pParam = param; - } -private: + inline void SetParam(ParamType type, void* param) { + m_ParamType = type; + m_pParam = param; + } - CFX_ByteString m_MarkName; + private: + CFX_ByteString m_MarkName; - ParamType m_ParamType; + ParamType m_ParamType; - void* m_pParam; + void* m_pParam; }; -class CPDF_ContentMarkData -{ -public: +class CPDF_ContentMarkData { + public: + CPDF_ContentMarkData() {} - CPDF_ContentMarkData() { } + CPDF_ContentMarkData(const CPDF_ContentMarkData& src); - CPDF_ContentMarkData(const CPDF_ContentMarkData& src); + inline int CountItems() const { return m_Marks.GetSize(); } - inline int CountItems() const - { - return m_Marks.GetSize(); - } + inline CPDF_ContentMarkItem& GetItem(int index) const { + return m_Marks[index]; + } - inline CPDF_ContentMarkItem& GetItem(int index) const - { - return m_Marks[index]; - } + int GetMCID() const; - int GetMCID() const; + void AddMark(const CFX_ByteString& name, + CPDF_Dictionary* pDict, + FX_BOOL bDictNeedClone); - void AddMark(const CFX_ByteString& name, CPDF_Dictionary* pDict, FX_BOOL bDictNeedClone); + void DeleteLastMark(); - void DeleteLastMark(); -private: - - CFX_ObjectArray<CPDF_ContentMarkItem> m_Marks; + private: + CFX_ObjectArray<CPDF_ContentMarkItem> m_Marks; }; -class CPDF_ContentMark : public CFX_CountRef<CPDF_ContentMarkData> -{ -public: - - int GetMCID() const - { - return m_pObject ? m_pObject->GetMCID() : -1; - } +class CPDF_ContentMark : public CFX_CountRef<CPDF_ContentMarkData> { + public: + int GetMCID() const { return m_pObject ? m_pObject->GetMCID() : -1; } - FX_BOOL HasMark(const CFX_ByteStringC& mark) const; + FX_BOOL HasMark(const CFX_ByteStringC& mark) const; - FX_BOOL LookupMark(const CFX_ByteStringC& mark, CPDF_Dictionary*& pDict) const; + FX_BOOL LookupMark(const CFX_ByteStringC& mark, + CPDF_Dictionary*& pDict) const; }; -#define PDFPAGE_TEXT 1 -#define PDFPAGE_PATH 2 -#define PDFPAGE_IMAGE 3 -#define PDFPAGE_SHADING 4 -#define PDFPAGE_FORM 5 +#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); +class CPDF_GraphicStates { + public: + void CopyStates(const CPDF_GraphicStates& src); - void DefaultStates(); + void DefaultStates(); - CPDF_ClipPath m_ClipPath; + CPDF_ClipPath m_ClipPath; - CPDF_GraphState m_GraphState; + CPDF_GraphState m_GraphState; - CPDF_ColorState m_ColorState; + CPDF_ColorState m_ColorState; - CPDF_TextState m_TextState; + CPDF_TextState m_TextState; - CPDF_GeneralState m_GeneralState; + CPDF_GeneralState m_GeneralState; }; -class CPDF_PageObject : public CPDF_GraphicStates -{ -public: - static CPDF_PageObject* Create(int type); - virtual ~CPDF_PageObject(); - - CPDF_PageObject* Clone() const; +class CPDF_PageObject : public CPDF_GraphicStates { + public: + static CPDF_PageObject* Create(int type); + virtual ~CPDF_PageObject(); - void Copy(const CPDF_PageObject* pSrcObject); + CPDF_PageObject* Clone() const; - virtual void Transform(const CFX_AffineMatrix& matrix) = 0; + void Copy(const CPDF_PageObject* pSrcObject); - void RemoveClipPath(); + virtual void Transform(const CFX_AffineMatrix& matrix) = 0; - void AppendClipPath(CPDF_Path path, int type, FX_BOOL bAutoMerge); + void RemoveClipPath(); - void CopyClipPath(CPDF_PageObject* pObj); + void AppendClipPath(CPDF_Path path, int type, FX_BOOL bAutoMerge); - void TransformClipPath(CFX_AffineMatrix& matrix); + void CopyClipPath(CPDF_PageObject* pObj); - void TransformGeneralState(CFX_AffineMatrix& matrix); + void TransformClipPath(CFX_AffineMatrix& matrix); - void SetColorState(CPDF_ColorState state) - { - m_ColorState = state; - } + void TransformGeneralState(CFX_AffineMatrix& matrix); - FX_RECT GetBBox(const CFX_AffineMatrix* pMatrix) const; + void SetColorState(CPDF_ColorState state) { m_ColorState = state; } - int m_Type; + FX_RECT GetBBox(const CFX_AffineMatrix* pMatrix) const; - FX_FLOAT m_Left; + int m_Type; - FX_FLOAT m_Right; + FX_FLOAT m_Left; - FX_FLOAT m_Top; + FX_FLOAT m_Right; - FX_FLOAT m_Bottom; + FX_FLOAT m_Top; - CPDF_ContentMark m_ContentMark; + FX_FLOAT m_Bottom; -protected: - virtual void CopyData(const CPDF_PageObject* pSrcObject) = 0; + CPDF_ContentMark m_ContentMark; - void RecalcBBox(); + protected: + virtual void CopyData(const CPDF_PageObject* pSrcObject) = 0; - CPDF_PageObject() {} + void RecalcBBox(); + CPDF_PageObject() {} }; struct CPDF_TextObjectItem { - FX_DWORD m_CharCode; - FX_FLOAT m_OriginX; - FX_FLOAT m_OriginY; + FX_DWORD m_CharCode; + FX_FLOAT m_OriginX; + FX_FLOAT m_OriginY; }; -class CPDF_TextObject : public CPDF_PageObject -{ -public: - CPDF_TextObject(); - ~CPDF_TextObject() override; +class CPDF_TextObject : public CPDF_PageObject { + public: + CPDF_TextObject(); + ~CPDF_TextObject() override; - int CountItems() const - { - return m_nChars; - } + int CountItems() const { return m_nChars; } - void GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const; + void GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const; - int CountChars() const; + int CountChars() const; - void GetCharInfo(int index, FX_DWORD& charcode, FX_FLOAT& kerning) const; - void GetCharInfo(int index, CPDF_TextObjectItem* pInfo) const; + void GetCharInfo(int index, FX_DWORD& charcode, FX_FLOAT& kerning) const; + void GetCharInfo(int index, CPDF_TextObjectItem* pInfo) const; - void GetCharRect(int index, CFX_FloatRect& rect) const; + void GetCharRect(int index, CFX_FloatRect& rect) const; - FX_FLOAT GetCharWidth(FX_DWORD charcode) const; - FX_FLOAT GetSpaceCharWidth() const; + FX_FLOAT GetCharWidth(FX_DWORD charcode) const; + FX_FLOAT GetSpaceCharWidth() const; - FX_FLOAT GetPosX() const - { - return m_PosX; - } + FX_FLOAT GetPosX() const { return m_PosX; } - FX_FLOAT GetPosY() const - { - return m_PosY; - } + FX_FLOAT GetPosY() const { return m_PosY; } - void GetTextMatrix(CFX_AffineMatrix* pMatrix) const; + void GetTextMatrix(CFX_AffineMatrix* pMatrix) const; - CPDF_Font* GetFont() const - { - return m_TextState.GetFont(); - } + CPDF_Font* GetFont() const { return m_TextState.GetFont(); } - FX_FLOAT GetFontSize() const - { - return m_TextState.GetFontSize(); - } + FX_FLOAT GetFontSize() const { return m_TextState.GetFontSize(); } - void SetEmpty(); + void SetEmpty(); - void SetText(const CFX_ByteString& text); + void SetText(const CFX_ByteString& text); - void SetText(CFX_ByteString* pStrs, FX_FLOAT* pKerning, int nSegs); + void SetText(CFX_ByteString* pStrs, FX_FLOAT* pKerning, int nSegs); - void SetText(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pKernings); + void SetText(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pKernings); - void SetPosition(FX_FLOAT x, FX_FLOAT y); + void SetPosition(FX_FLOAT x, FX_FLOAT y); - void SetTextState(CPDF_TextState TextState); + void SetTextState(CPDF_TextState TextState); - // CPDF_PageObject: - void Transform(const CFX_AffineMatrix& matrix) override; + // CPDF_PageObject: + void Transform(const CFX_AffineMatrix& matrix) override; - void CalcCharPos(FX_FLOAT* pPosArray) const; + void CalcCharPos(FX_FLOAT* pPosArray) const; - void SetData(int nChars, - FX_DWORD* pCharCodes, - FX_FLOAT* pCharPos, - FX_FLOAT x, - FX_FLOAT y); + void SetData(int nChars, + FX_DWORD* pCharCodes, + FX_FLOAT* pCharPos, + FX_FLOAT x, + FX_FLOAT y); - void GetData(int& nChars, FX_DWORD*& pCharCodes, FX_FLOAT*& pCharPos) - { - nChars = m_nChars; - pCharCodes = m_pCharCodes; - pCharPos = m_pCharPos; - } + void GetData(int& nChars, FX_DWORD*& pCharCodes, FX_FLOAT*& pCharPos) { + nChars = m_nChars; + pCharCodes = m_pCharCodes; + pCharPos = m_pCharPos; + } + void RecalcPositionData() { CalcPositionData(nullptr, nullptr, 1); } - void RecalcPositionData() - { - CalcPositionData(nullptr, nullptr, 1); - } + protected: + friend class CPDF_RenderStatus; + friend class CPDF_StreamContentParser; + friend class CPDF_TextRenderer; + friend class CTextPage; -protected: - friend class CPDF_RenderStatus; - friend class CPDF_StreamContentParser; - friend class CPDF_TextRenderer; - friend class CTextPage; + // CPDF_PageObject: + void CopyData(const CPDF_PageObject* pSrcObject) override; - // CPDF_PageObject: - void CopyData(const CPDF_PageObject* pSrcObject) override; + void SetSegments(const CFX_ByteString* pStrs, FX_FLOAT* pKerning, int nSegs); - void SetSegments(const CFX_ByteString* pStrs, - FX_FLOAT* pKerning, - int nSegs); + void CalcPositionData(FX_FLOAT* pTextAdvanceX, + FX_FLOAT* pTextAdvanceY, + FX_FLOAT horz_scale, + int level = 0); - void CalcPositionData(FX_FLOAT* pTextAdvanceX, - FX_FLOAT* pTextAdvanceY, - FX_FLOAT horz_scale, - int level = 0); + FX_FLOAT m_PosX; + FX_FLOAT m_PosY; - FX_FLOAT m_PosX; - FX_FLOAT m_PosY; + int m_nChars; - int m_nChars; + FX_DWORD* m_pCharCodes; - FX_DWORD* m_pCharCodes; - - FX_FLOAT* m_pCharPos; + FX_FLOAT* m_pCharPos; }; -class CPDF_PathObject : public CPDF_PageObject -{ -public: - CPDF_PathObject() - { - m_Type = PDFPAGE_PATH; - } - - virtual ~CPDF_PathObject() {} - void Transform(const CFX_AffineMatrix& maxtrix) override; +class CPDF_PathObject : public CPDF_PageObject { + public: + CPDF_PathObject() { m_Type = PDFPAGE_PATH; } - void SetGraphState(CPDF_GraphState GraphState); + virtual ~CPDF_PathObject() {} + void Transform(const CFX_AffineMatrix& maxtrix) override; - CPDF_Path m_Path; + void SetGraphState(CPDF_GraphState GraphState); - int m_FillType; + CPDF_Path m_Path; - FX_BOOL m_bStroke; + int m_FillType; - CFX_AffineMatrix m_Matrix; + FX_BOOL m_bStroke; + CFX_AffineMatrix m_Matrix; - void CalcBoundingBox(); + void CalcBoundingBox(); -protected: - void CopyData(const CPDF_PageObject* pSrcObject) override; + protected: + void CopyData(const CPDF_PageObject* pSrcObject) override; }; -class CPDF_ImageObject : public CPDF_PageObject -{ -public: - CPDF_ImageObject(); +class CPDF_ImageObject : public CPDF_PageObject { + public: + CPDF_ImageObject(); - virtual ~CPDF_ImageObject(); - void Transform(const CFX_AffineMatrix& matrix) override; + virtual ~CPDF_ImageObject(); + void Transform(const CFX_AffineMatrix& matrix) override; - CPDF_Image* m_pImage; + CPDF_Image* m_pImage; - CFX_AffineMatrix m_Matrix; + CFX_AffineMatrix m_Matrix; - void CalcBoundingBox(); + void CalcBoundingBox(); -private: - void CopyData(const CPDF_PageObject* pSrcObject) override; + private: + void CopyData(const CPDF_PageObject* pSrcObject) override; }; -class CPDF_ShadingObject : public CPDF_PageObject -{ -public: - CPDF_ShadingObject(); +class CPDF_ShadingObject : public CPDF_PageObject { + public: + CPDF_ShadingObject(); - virtual ~CPDF_ShadingObject(); + virtual ~CPDF_ShadingObject(); - CPDF_ShadingPattern* m_pShading; + CPDF_ShadingPattern* m_pShading; - CFX_AffineMatrix m_Matrix; + CFX_AffineMatrix m_Matrix; - void Transform(const CFX_AffineMatrix& matrix) override; + void Transform(const CFX_AffineMatrix& matrix) override; - void CalcBoundingBox(); + void CalcBoundingBox(); -protected: - void CopyData(const CPDF_PageObject* pSrcObject) override; + protected: + void CopyData(const CPDF_PageObject* pSrcObject) override; }; -class CPDF_FormObject : public CPDF_PageObject -{ -public: - CPDF_FormObject() - { - m_Type = PDFPAGE_FORM; - m_pForm = NULL; - } +class CPDF_FormObject : public CPDF_PageObject { + public: + CPDF_FormObject() { + m_Type = PDFPAGE_FORM; + m_pForm = NULL; + } - virtual ~CPDF_FormObject(); - void Transform(const CFX_AffineMatrix& matrix) override; + virtual ~CPDF_FormObject(); + void Transform(const CFX_AffineMatrix& matrix) override; - CPDF_Form* m_pForm; + CPDF_Form* m_pForm; - CFX_AffineMatrix m_FormMatrix; + CFX_AffineMatrix m_FormMatrix; - void CalcBoundingBox(); + void CalcBoundingBox(); -protected: - void CopyData(const CPDF_PageObject* pSrcObject) override; + protected: + void CopyData(const CPDF_PageObject* pSrcObject) override; }; #endif // CORE_INCLUDE_FPDFAPI_FPDF_PAGEOBJ_H_ |