| 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/SVGAnimatedBoolean.h" | 25 #include "core/svg/SVGAnimatedBoolean.h" |
| 26 #include "core/svg/SVGAnimatedNumber.h" | 26 #include "core/svg/SVGAnimatedNumber.h" |
| 27 #include "core/svg/SVGAnimatedPath.h" | 27 #include "core/svg/SVGAnimatedPath.h" |
| 28 #include "core/svg/SVGGeometryElement.h" | 28 #include "core/svg/SVGGeometryElement.h" |
| 29 #include "core/svg/SVGPathByteStream.h" | 29 #include "core/svg/SVGPathByteStream.h" |
| 30 #include "platform/heap/Handle.h" |
| 30 #include "wtf/WeakPtr.h" | 31 #include "wtf/WeakPtr.h" |
| 31 | 32 |
| 32 namespace blink { | 33 namespace blink { |
| 33 | 34 |
| 34 class SVGPathSegArcAbs; | 35 class SVGPathSegArcAbs; |
| 35 class SVGPathSegArcRel; | 36 class SVGPathSegArcRel; |
| 36 class SVGPathSegClosePath; | 37 class SVGPathSegClosePath; |
| 37 class SVGPathSegLinetoAbs; | 38 class SVGPathSegLinetoAbs; |
| 38 class SVGPathSegLinetoRel; | 39 class SVGPathSegLinetoRel; |
| 39 class SVGPathSegMovetoAbs; | 40 class SVGPathSegMovetoAbs; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 50 class SVGPathSegCurvetoCubicSmoothRel; | 51 class SVGPathSegCurvetoCubicSmoothRel; |
| 51 class SVGPathSegCurvetoQuadraticSmoothAbs; | 52 class SVGPathSegCurvetoQuadraticSmoothAbs; |
| 52 class SVGPathSegCurvetoQuadraticSmoothRel; | 53 class SVGPathSegCurvetoQuadraticSmoothRel; |
| 53 | 54 |
| 54 class SVGPathElement final : public SVGGeometryElement { | 55 class SVGPathElement final : public SVGGeometryElement { |
| 55 DEFINE_WRAPPERTYPEINFO(); | 56 DEFINE_WRAPPERTYPEINFO(); |
| 56 public: | 57 public: |
| 57 DECLARE_NODE_FACTORY(SVGPathElement); | 58 DECLARE_NODE_FACTORY(SVGPathElement); |
| 58 | 59 |
| 59 float getTotalLength(); | 60 float getTotalLength(); |
| 60 PassRefPtr<SVGPointTearOff> getPointAtLength(float distance); | 61 PassRefPtrWillBeRawPtr<SVGPointTearOff> getPointAtLength(float distance); |
| 61 unsigned getPathSegAtLength(float distance); | 62 unsigned getPathSegAtLength(float distance); |
| 62 | 63 |
| 63 SVGAnimatedNumber* pathLength() { return m_pathLength.get(); } | 64 SVGAnimatedNumber* pathLength() { return m_pathLength.get(); } |
| 64 | 65 |
| 65 PassRefPtr<SVGPathSegClosePath> createSVGPathSegClosePath(); | 66 PassRefPtrWillBeRawPtr<SVGPathSegClosePath> createSVGPathSegClosePath(); |
| 66 PassRefPtr<SVGPathSegMovetoAbs> createSVGPathSegMovetoAbs(float x, float y); | 67 PassRefPtrWillBeRawPtr<SVGPathSegMovetoAbs> createSVGPathSegMovetoAbs(float
x, float y); |
| 67 PassRefPtr<SVGPathSegMovetoRel> createSVGPathSegMovetoRel(float x, float y); | 68 PassRefPtrWillBeRawPtr<SVGPathSegMovetoRel> createSVGPathSegMovetoRel(float
x, float y); |
| 68 PassRefPtr<SVGPathSegLinetoAbs> createSVGPathSegLinetoAbs(float x, float y); | 69 PassRefPtrWillBeRawPtr<SVGPathSegLinetoAbs> createSVGPathSegLinetoAbs(float
x, float y); |
| 69 PassRefPtr<SVGPathSegLinetoRel> createSVGPathSegLinetoRel(float x, float y); | 70 PassRefPtrWillBeRawPtr<SVGPathSegLinetoRel> createSVGPathSegLinetoRel(float
x, float y); |
| 70 PassRefPtr<SVGPathSegCurvetoCubicAbs> createSVGPathSegCurvetoCubicAbs(float
x, float y, float x1, float y1, float x2, float y2); | 71 PassRefPtrWillBeRawPtr<SVGPathSegCurvetoCubicAbs> createSVGPathSegCurvetoCub
icAbs(float x, float y, float x1, float y1, float x2, float y2); |
| 71 PassRefPtr<SVGPathSegCurvetoCubicRel> createSVGPathSegCurvetoCubicRel(float
x, float y, float x1, float y1, float x2, float y2); | 72 PassRefPtrWillBeRawPtr<SVGPathSegCurvetoCubicRel> createSVGPathSegCurvetoCub
icRel(float x, float y, float x1, float y1, float x2, float y2); |
| 72 PassRefPtr<SVGPathSegCurvetoQuadraticAbs> createSVGPathSegCurvetoQuadraticAb
s(float x, float y, float x1, float y1); | 73 PassRefPtrWillBeRawPtr<SVGPathSegCurvetoQuadraticAbs> createSVGPathSegCurvet
oQuadraticAbs(float x, float y, float x1, float y1); |
| 73 PassRefPtr<SVGPathSegCurvetoQuadraticRel> createSVGPathSegCurvetoQuadraticRe
l(float x, float y, float x1, float y1); | 74 PassRefPtrWillBeRawPtr<SVGPathSegCurvetoQuadraticRel> createSVGPathSegCurvet
oQuadraticRel(float x, float y, float x1, float y1); |
| 74 PassRefPtr<SVGPathSegArcAbs> createSVGPathSegArcAbs(float x, float y, float
r1, float r2, float angle, bool largeArcFlag, bool sweepFlag); | 75 PassRefPtrWillBeRawPtr<SVGPathSegArcAbs> createSVGPathSegArcAbs(float x, flo
at y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag); |
| 75 PassRefPtr<SVGPathSegArcRel> createSVGPathSegArcRel(float x, float y, float
r1, float r2, float angle, bool largeArcFlag, bool sweepFlag); | 76 PassRefPtrWillBeRawPtr<SVGPathSegArcRel> createSVGPathSegArcRel(float x, flo
at y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag); |
| 76 PassRefPtr<SVGPathSegLinetoHorizontalAbs> createSVGPathSegLinetoHorizontalAb
s(float x); | 77 PassRefPtrWillBeRawPtr<SVGPathSegLinetoHorizontalAbs> createSVGPathSegLineto
HorizontalAbs(float x); |
| 77 PassRefPtr<SVGPathSegLinetoHorizontalRel> createSVGPathSegLinetoHorizontalRe
l(float x); | 78 PassRefPtrWillBeRawPtr<SVGPathSegLinetoHorizontalRel> createSVGPathSegLineto
HorizontalRel(float x); |
| 78 PassRefPtr<SVGPathSegLinetoVerticalAbs> createSVGPathSegLinetoVerticalAbs(fl
oat y); | 79 PassRefPtrWillBeRawPtr<SVGPathSegLinetoVerticalAbs> createSVGPathSegLinetoVe
rticalAbs(float y); |
| 79 PassRefPtr<SVGPathSegLinetoVerticalRel> createSVGPathSegLinetoVerticalRel(fl
oat y); | 80 PassRefPtrWillBeRawPtr<SVGPathSegLinetoVerticalRel> createSVGPathSegLinetoVe
rticalRel(float y); |
| 80 PassRefPtr<SVGPathSegCurvetoCubicSmoothAbs> createSVGPathSegCurvetoCubicSmoo
thAbs(float x, float y, float x2, float y2); | 81 PassRefPtrWillBeRawPtr<SVGPathSegCurvetoCubicSmoothAbs> createSVGPathSegCurv
etoCubicSmoothAbs(float x, float y, float x2, float y2); |
| 81 PassRefPtr<SVGPathSegCurvetoCubicSmoothRel> createSVGPathSegCurvetoCubicSmoo
thRel(float x, float y, float x2, float y2); | 82 PassRefPtrWillBeRawPtr<SVGPathSegCurvetoCubicSmoothRel> createSVGPathSegCurv
etoCubicSmoothRel(float x, float y, float x2, float y2); |
| 82 PassRefPtr<SVGPathSegCurvetoQuadraticSmoothAbs> createSVGPathSegCurvetoQuadr
aticSmoothAbs(float x, float y); | 83 PassRefPtrWillBeRawPtr<SVGPathSegCurvetoQuadraticSmoothAbs> createSVGPathSeg
CurvetoQuadraticSmoothAbs(float x, float y); |
| 83 PassRefPtr<SVGPathSegCurvetoQuadraticSmoothRel> createSVGPathSegCurvetoQuadr
aticSmoothRel(float x, float y); | 84 PassRefPtrWillBeRawPtr<SVGPathSegCurvetoQuadraticSmoothRel> createSVGPathSeg
CurvetoQuadraticSmoothRel(float x, float y); |
| 84 | 85 |
| 85 // Used in the bindings only. | 86 // Used in the bindings only. |
| 86 SVGPathSegListTearOff* pathSegList() { return m_pathSegList->baseVal(); } | 87 SVGPathSegListTearOff* pathSegList() { return m_pathSegList->baseVal(); } |
| 87 SVGPathSegListTearOff* animatedPathSegList() { return m_pathSegList->animVal
(); } | 88 SVGPathSegListTearOff* animatedPathSegList() { return m_pathSegList->animVal
(); } |
| 88 | 89 |
| 89 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normaliz
ed path segment lists! | 90 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normaliz
ed path segment lists! |
| 90 SVGPathSegListTearOff* normalizedPathSegList() { return 0; } | 91 SVGPathSegListTearOff* normalizedPathSegList() { return 0; } |
| 91 SVGPathSegListTearOff* animatedNormalizedPathSegList() { return 0; } | 92 SVGPathSegListTearOff* animatedNormalizedPathSegList() { return 0; } |
| 92 | 93 |
| 93 const SVGPathByteStream* pathByteStream() const { return m_pathSegList->curr
entValue()->byteStream(); } | 94 const SVGPathByteStream* pathByteStream() const { return m_pathSegList->curr
entValue()->byteStream(); } |
| 94 | 95 |
| 95 void pathSegListChanged(ListModification = ListModificationUnknown); | 96 void pathSegListChanged(ListModification = ListModificationUnknown); |
| 96 | 97 |
| 97 virtual FloatRect getBBox() override; | 98 virtual FloatRect getBBox() override; |
| 98 | 99 |
| 100 virtual void trace(Visitor*) override; |
| 101 |
| 99 private: | 102 private: |
| 100 explicit SVGPathElement(Document&); | 103 explicit SVGPathElement(Document&); |
| 101 | 104 |
| 102 bool isSupportedAttribute(const QualifiedName&); | 105 bool isSupportedAttribute(const QualifiedName&); |
| 103 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; | 106 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; |
| 104 virtual void svgAttributeChanged(const QualifiedName&) override; | 107 virtual void svgAttributeChanged(const QualifiedName&) override; |
| 105 | 108 |
| 106 virtual Node::InsertionNotificationRequest insertedInto(ContainerNode*) over
ride; | 109 virtual Node::InsertionNotificationRequest insertedInto(ContainerNode*) over
ride; |
| 107 virtual void removedFrom(ContainerNode*) override; | 110 virtual void removedFrom(ContainerNode*) override; |
| 108 | 111 |
| 109 void invalidateMPathDependencies(); | 112 void invalidateMPathDependencies(); |
| 110 | 113 |
| 111 RefPtr<SVGAnimatedNumber> m_pathLength; | 114 RefPtrWillBeMember<SVGAnimatedNumber> m_pathLength; |
| 112 RefPtr<SVGAnimatedPath> m_pathSegList; | 115 RefPtrWillBeMember<SVGAnimatedPath> m_pathSegList; |
| 113 }; | 116 }; |
| 114 | 117 |
| 115 } // namespace blink | 118 } // namespace blink |
| 116 | 119 |
| 117 #endif // SVGPathElement_h | 120 #endif // SVGPathElement_h |
| OLD | NEW |