OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 */ | 19 */ |
20 | 20 |
21 #ifndef SVGPathElement_h | 21 #ifndef SVGPathElement_h |
22 #define SVGPathElement_h | 22 #define SVGPathElement_h |
23 | 23 |
24 #include "core/SVGNames.h" | 24 #include "core/SVGNames.h" |
25 #include "core/svg/SVGAnimatedNumber.h" | 25 #include "core/svg/SVGAnimatedNumber.h" |
26 #include "core/svg/SVGAnimatedPath.h" | 26 #include "core/svg/SVGAnimatedPath.h" |
27 #include "core/svg/SVGGeometryElement.h" | 27 #include "core/svg/SVGGeometryElement.h" |
28 #include "core/svg/SVGPathByteStream.h" | |
29 #include "platform/heap/Handle.h" | 28 #include "platform/heap/Handle.h" |
30 | 29 |
31 namespace blink { | 30 namespace blink { |
32 | 31 |
33 class SVGPathElement final : public SVGGeometryElement { | 32 class SVGPathElement final : public SVGGeometryElement { |
34 DEFINE_WRAPPERTYPEINFO(); | 33 DEFINE_WRAPPERTYPEINFO(); |
35 public: | 34 public: |
36 DECLARE_NODE_FACTORY(SVGPathElement); | 35 DECLARE_NODE_FACTORY(SVGPathElement); |
37 | 36 |
38 Path asPath() const override; | 37 Path asPath() const override; |
39 | 38 |
40 float getTotalLength(); | 39 float getTotalLength(); |
41 PassRefPtrWillBeRawPtr<SVGPointTearOff> getPointAtLength(float distance); | 40 PassRefPtrWillBeRawPtr<SVGPointTearOff> getPointAtLength(float distance); |
42 unsigned getPathSegAtLength(float distance); | 41 unsigned getPathSegAtLength(float distance); |
43 | 42 |
| 43 SVGAnimatedPath* path() { return m_path.get(); } |
44 SVGAnimatedNumber* pathLength() { return m_pathLength.get(); } | 44 SVGAnimatedNumber* pathLength() { return m_pathLength.get(); } |
45 | 45 |
46 const SVGPathByteStream& pathByteStream() const { return m_path->currentValu
e()->byteStream(); } | |
47 | |
48 DECLARE_VIRTUAL_TRACE(); | 46 DECLARE_VIRTUAL_TRACE(); |
49 | 47 |
50 private: | 48 private: |
51 explicit SVGPathElement(Document&); | 49 explicit SVGPathElement(Document&); |
52 | 50 |
53 void svgAttributeChanged(const QualifiedName&) override; | 51 void svgAttributeChanged(const QualifiedName&) override; |
54 | 52 |
55 Node::InsertionNotificationRequest insertedInto(ContainerNode*) override; | 53 Node::InsertionNotificationRequest insertedInto(ContainerNode*) override; |
56 void removedFrom(ContainerNode*) override; | 54 void removedFrom(ContainerNode*) override; |
57 | 55 |
58 void invalidateMPathDependencies(); | 56 void invalidateMPathDependencies(); |
59 | 57 |
60 RefPtrWillBeMember<SVGAnimatedNumber> m_pathLength; | 58 RefPtrWillBeMember<SVGAnimatedNumber> m_pathLength; |
61 RefPtrWillBeMember<SVGAnimatedPath> m_path; | 59 RefPtrWillBeMember<SVGAnimatedPath> m_path; |
62 }; | 60 }; |
63 | 61 |
64 } // namespace blink | 62 } // namespace blink |
65 | 63 |
66 #endif // SVGPathElement_h | 64 #endif // SVGPathElement_h |
OLD | NEW |