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