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