1 | /* |
2 | * Copyright (C) 2002, 2003 The Karbon Developers |
3 | * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
4 | * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org> |
5 | * Copyright (C) 2007, 2009, 2015 Apple Inc. All rights reserved. |
6 | * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 | * Copyright (C) 2019 Apple Inc. All rights reserved. |
8 | * |
9 | * This library is free software; you can redistribute it and/or |
10 | * modify it under the terms of the GNU Library General Public |
11 | * License as published by the Free Software Foundation; either |
12 | * version 2 of the License, or (at your option) any later version. |
13 | * |
14 | * This library is distributed in the hope that it will be useful, |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 | * Library General Public License for more details. |
18 | * |
19 | * You should have received a copy of the GNU Library General Public License |
20 | * along with this library; see the file COPYING.LIB. If not, write to |
21 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
22 | * Boston, MA 02110-1301, USA. |
23 | */ |
24 | |
25 | #pragma once |
26 | |
27 | #include "FloatPoint.h" |
28 | #include "SVGPathConsumer.h" |
29 | |
30 | namespace WebCore { |
31 | |
32 | class SVGPathSegList; |
33 | |
34 | class SVGPathSegListBuilder final : public SVGPathConsumer { |
35 | public: |
36 | SVGPathSegListBuilder(SVGPathSegList&); |
37 | |
38 | private: |
39 | void incrementPathSegmentCount() final { } |
40 | bool continueConsuming() final { return true; } |
41 | |
42 | // Used in UnalteredParsing/NormalizedParsing modes. |
43 | void moveTo(const FloatPoint&, bool closed, PathCoordinateMode) final; |
44 | void lineTo(const FloatPoint&, PathCoordinateMode) final; |
45 | void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatPoint&, PathCoordinateMode) final; |
46 | void closePath() final; |
47 | |
48 | // Only used in UnalteredParsing mode. |
49 | void lineToHorizontal(float, PathCoordinateMode) final; |
50 | void lineToVertical(float, PathCoordinateMode) final; |
51 | void curveToCubicSmooth(const FloatPoint&, const FloatPoint&, PathCoordinateMode) final; |
52 | void curveToQuadratic(const FloatPoint&, const FloatPoint&, PathCoordinateMode) final; |
53 | void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode) final; |
54 | void arcTo(float, float, float, bool largeArcFlag, bool sweepFlag, const FloatPoint&, PathCoordinateMode) final; |
55 | |
56 | SVGPathSegList& m_pathSegList; |
57 | }; |
58 | |
59 | } // namespace WebCore |
60 | |