OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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 XFA_FDE_FDE_GEOBJECT_H_ | 7 #ifndef XFA_FDE_CFDE_PATH_H_ |
8 #define XFA_FDE_FDE_GEOBJECT_H_ | 8 #define XFA_FDE_CFDE_PATH_H_ |
9 | 9 |
10 #include "core/fxge/include/fx_ge.h" | 10 #include "core/fxge/include/fx_ge.h" |
11 #include "xfa/fde/fde_path.h" | |
12 #include "xfa/fgas/crt/fgas_memory.h" | 11 #include "xfa/fgas/crt/fgas_memory.h" |
13 | 12 |
14 class CFDE_Path : public IFDE_Path, public CFX_Target { | 13 class CFDE_Path : public CFX_Target { |
15 public: | 14 public: |
16 virtual void Release() { delete this; } | 15 void Release() { delete this; } |
17 | 16 |
18 virtual FX_BOOL StartFigure(); | 17 FX_BOOL StartFigure(); |
19 virtual FX_BOOL CloseFigure(); | 18 FX_BOOL CloseFigure(); |
20 | 19 |
21 virtual void AddBezier(const CFX_PointsF& points); | 20 void AddBezier(const CFX_PointsF& points); |
22 virtual void AddBeziers(const CFX_PointsF& points); | 21 void AddBeziers(const CFX_PointsF& points); |
23 virtual void AddCurve(const CFX_PointsF& points, | 22 void AddCurve(const CFX_PointsF& points, |
24 FX_BOOL bClosed, | 23 FX_BOOL bClosed, |
25 FX_FLOAT fTension = 0.5f); | 24 FX_FLOAT fTension = 0.5f); |
26 virtual void AddEllipse(const CFX_RectF& rect); | 25 void AddEllipse(const CFX_RectF& rect); |
27 virtual void AddLines(const CFX_PointsF& points); | 26 void AddLines(const CFX_PointsF& points); |
28 virtual void AddLine(const CFX_PointF& pt1, const CFX_PointF& pt2); | 27 void AddLine(const CFX_PointF& pt1, const CFX_PointF& pt2); |
29 virtual void AddPath(const IFDE_Path* pSrc, FX_BOOL bConnect); | 28 void AddPath(const CFDE_Path* pSrc, FX_BOOL bConnect); |
30 virtual void AddPolygon(const CFX_PointsF& points); | 29 void AddPolygon(const CFX_PointsF& points); |
31 virtual void AddRectangle(const CFX_RectF& rect); | 30 void AddRectangle(const CFX_RectF& rect); |
32 virtual void GetBBox(CFX_RectF& bbox) const; | 31 void GetBBox(CFX_RectF& bbox) const; |
33 virtual void GetBBox(CFX_RectF& bbox, | 32 void GetBBox(CFX_RectF& bbox, |
34 FX_FLOAT fLineWidth, | 33 FX_FLOAT fLineWidth, |
35 FX_FLOAT fMiterLimit) const; | 34 FX_FLOAT fMiterLimit) const; |
36 FX_PATHPOINT* AddPoints(int32_t iCount); | 35 FX_PATHPOINT* AddPoints(int32_t iCount); |
37 FX_PATHPOINT* GetLastPoint(int32_t iCount = 1) const; | 36 FX_PATHPOINT* GetLastPoint(int32_t iCount = 1) const; |
38 FX_BOOL FigureClosed() const; | 37 FX_BOOL FigureClosed() const; |
39 void MoveTo(FX_FLOAT fx, FX_FLOAT fy); | 38 void MoveTo(FX_FLOAT fx, FX_FLOAT fy); |
40 void LineTo(FX_FLOAT fx, FX_FLOAT fy); | 39 void LineTo(FX_FLOAT fx, FX_FLOAT fy); |
41 void BezierTo(const CFX_PointF& p1, | 40 void BezierTo(const CFX_PointF& p1, |
42 const CFX_PointF& p2, | 41 const CFX_PointF& p2, |
43 const CFX_PointF& p3); | 42 const CFX_PointF& p3); |
44 void ArcTo(FX_BOOL bStart, | 43 void ArcTo(FX_BOOL bStart, |
45 const CFX_RectF& rect, | 44 const CFX_RectF& rect, |
46 FX_FLOAT startAngle, | 45 FX_FLOAT startAngle, |
47 FX_FLOAT endAngle); | 46 FX_FLOAT endAngle); |
48 void MoveTo(const CFX_PointF& p0) { MoveTo(p0.x, p0.y); } | 47 void MoveTo(const CFX_PointF& p0) { MoveTo(p0.x, p0.y); } |
49 void LineTo(const CFX_PointF& p1) { LineTo(p1.x, p1.y); } | 48 void LineTo(const CFX_PointF& p1) { LineTo(p1.x, p1.y); } |
50 void GetCurveTangents(const CFX_PointsF& points, | 49 void GetCurveTangents(const CFX_PointsF& points, |
51 CFX_PointsF& tangents, | 50 CFX_PointsF& tangents, |
52 FX_BOOL bClosed, | 51 FX_BOOL bClosed, |
53 FX_FLOAT fTension) const; | 52 FX_FLOAT fTension) const; |
54 CFX_PathData m_Path; | 53 CFX_PathData m_Path; |
55 }; | 54 }; |
56 | 55 |
57 #endif // XFA_FDE_FDE_GEOBJECT_H_ | 56 #endif // XFA_FDE_CFDE_PATH_H_ |
OLD | NEW |