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 "SVGNames.h" | 24 #include "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/SVGExternalResourcesRequired.h" | |
28 #include "core/svg/SVGGraphicsElement.h" | 27 #include "core/svg/SVGGraphicsElement.h" |
29 #include "core/svg/SVGPathByteStream.h" | 28 #include "core/svg/SVGPathByteStream.h" |
30 #include "core/svg/SVGPathSegList.h" | 29 #include "core/svg/SVGPathSegList.h" |
31 | 30 |
32 namespace WebCore { | 31 namespace WebCore { |
33 | 32 |
34 class SVGPathSegArcAbs; | 33 class SVGPathSegArcAbs; |
35 class SVGPathSegArcRel; | 34 class SVGPathSegArcRel; |
36 class SVGPathSegClosePath; | 35 class SVGPathSegClosePath; |
37 class SVGPathSegLinetoAbs; | 36 class SVGPathSegLinetoAbs; |
38 class SVGPathSegLinetoRel; | 37 class SVGPathSegLinetoRel; |
39 class SVGPathSegMovetoAbs; | 38 class SVGPathSegMovetoAbs; |
40 class SVGPathSegMovetoRel; | 39 class SVGPathSegMovetoRel; |
41 class SVGPathSegCurvetoCubicAbs; | 40 class SVGPathSegCurvetoCubicAbs; |
42 class SVGPathSegCurvetoCubicRel; | 41 class SVGPathSegCurvetoCubicRel; |
43 class SVGPathSegLinetoVerticalAbs; | 42 class SVGPathSegLinetoVerticalAbs; |
44 class SVGPathSegLinetoVerticalRel; | 43 class SVGPathSegLinetoVerticalRel; |
45 class SVGPathSegLinetoHorizontalAbs; | 44 class SVGPathSegLinetoHorizontalAbs; |
46 class SVGPathSegLinetoHorizontalRel; | 45 class SVGPathSegLinetoHorizontalRel; |
47 class SVGPathSegCurvetoQuadraticAbs; | 46 class SVGPathSegCurvetoQuadraticAbs; |
48 class SVGPathSegCurvetoQuadraticRel; | 47 class SVGPathSegCurvetoQuadraticRel; |
49 class SVGPathSegCurvetoCubicSmoothAbs; | 48 class SVGPathSegCurvetoCubicSmoothAbs; |
50 class SVGPathSegCurvetoCubicSmoothRel; | 49 class SVGPathSegCurvetoCubicSmoothRel; |
51 class SVGPathSegCurvetoQuadraticSmoothAbs; | 50 class SVGPathSegCurvetoQuadraticSmoothAbs; |
52 class SVGPathSegCurvetoQuadraticSmoothRel; | 51 class SVGPathSegCurvetoQuadraticSmoothRel; |
53 class SVGPathSegListPropertyTearOff; | 52 class SVGPathSegListPropertyTearOff; |
54 | 53 |
55 class SVGPathElement FINAL : public SVGGraphicsElement, | 54 class SVGPathElement FINAL : public SVGGraphicsElement { |
56 public SVGExternalResourcesRequired { | |
57 public: | 55 public: |
58 static PassRefPtr<SVGPathElement> create(const QualifiedName&, Document&); | 56 static PassRefPtr<SVGPathElement> create(const QualifiedName&, Document&); |
59 | 57 |
60 float getTotalLength(); | 58 float getTotalLength(); |
61 SVGPoint getPointAtLength(float distance); | 59 SVGPoint getPointAtLength(float distance); |
62 unsigned getPathSegAtLength(float distance); | 60 unsigned getPathSegAtLength(float distance); |
63 | 61 |
64 PassRefPtr<SVGPathSegClosePath> createSVGPathSegClosePath(SVGPathSegRole rol
e = PathSegUndefinedRole); | 62 PassRefPtr<SVGPathSegClosePath> createSVGPathSegClosePath(SVGPathSegRole rol
e = PathSegUndefinedRole); |
65 PassRefPtr<SVGPathSegMovetoAbs> createSVGPathSegMovetoAbs(float x, float y,
SVGPathSegRole role = PathSegUndefinedRole); | 63 PassRefPtr<SVGPathSegMovetoAbs> createSVGPathSegMovetoAbs(float x, float y,
SVGPathSegRole role = PathSegUndefinedRole); |
66 PassRefPtr<SVGPathSegMovetoRel> createSVGPathSegMovetoRel(float x, float y,
SVGPathSegRole role = PathSegUndefinedRole); | 64 PassRefPtr<SVGPathSegMovetoRel> createSVGPathSegMovetoRel(float x, float y,
SVGPathSegRole role = PathSegUndefinedRole); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 105 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; |
108 virtual void svgAttributeChanged(const QualifiedName&); | 106 virtual void svgAttributeChanged(const QualifiedName&); |
109 virtual bool supportsMarkers() const { return true; } | 107 virtual bool supportsMarkers() const { return true; } |
110 | 108 |
111 // Custom 'd' property | 109 // Custom 'd' property |
112 static void synchronizeD(SVGElement* contextElement); | 110 static void synchronizeD(SVGElement* contextElement); |
113 static PassRefPtr<SVGAnimatedProperty> lookupOrCreateDWrapper(SVGElement* co
ntextElement); | 111 static PassRefPtr<SVGAnimatedProperty> lookupOrCreateDWrapper(SVGElement* co
ntextElement); |
114 | 112 |
115 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGPathElement) | 113 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGPathElement) |
116 DECLARE_ANIMATED_NUMBER(PathLength, pathLength) | 114 DECLARE_ANIMATED_NUMBER(PathLength, pathLength) |
117 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesReq
uired) | |
118 END_DECLARE_ANIMATED_PROPERTIES | 115 END_DECLARE_ANIMATED_PROPERTIES |
119 | 116 |
120 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; | 117 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; |
121 | 118 |
122 virtual Node::InsertionNotificationRequest insertedInto(ContainerNode*) OVER
RIDE; | 119 virtual Node::InsertionNotificationRequest insertedInto(ContainerNode*) OVER
RIDE; |
123 virtual void removedFrom(ContainerNode*) OVERRIDE; | 120 virtual void removedFrom(ContainerNode*) OVERRIDE; |
124 | 121 |
125 void invalidateMPathDependencies(); | 122 void invalidateMPathDependencies(); |
126 | 123 |
127 private: | 124 private: |
128 OwnPtr<SVGPathByteStream> m_pathByteStream; | 125 OwnPtr<SVGPathByteStream> m_pathByteStream; |
129 mutable SVGSynchronizableAnimatedProperty<SVGPathSegList> m_pathSegList; | 126 mutable SVGSynchronizableAnimatedProperty<SVGPathSegList> m_pathSegList; |
130 bool m_isAnimValObserved; | 127 bool m_isAnimValObserved; |
131 }; | 128 }; |
132 | 129 |
133 DEFINE_NODE_TYPE_CASTS(SVGPathElement, hasTagName(SVGNames::pathTag)); | 130 DEFINE_NODE_TYPE_CASTS(SVGPathElement, hasTagName(SVGNames::pathTag)); |
134 | 131 |
135 } // namespace WebCore | 132 } // namespace WebCore |
136 | 133 |
137 #endif | 134 #endif |
OLD | NEW |