OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 */ | 18 */ |
19 | 19 |
20 #ifndef SVGTextPathElement_h | 20 #ifndef SVGTextPathElement_h |
21 #define SVGTextPathElement_h | 21 #define SVGTextPathElement_h |
22 | 22 |
23 #include "core/SVGNames.h" | 23 #include "core/SVGNames.h" |
24 #include "core/svg/SVGTextContentElement.h" | 24 #include "core/svg/SVGTextContentElement.h" |
25 #include "core/svg/SVGURIReference.h" | 25 #include "core/svg/SVGURIReference.h" |
| 26 #include "platform/heap/Handle.h" |
26 | 27 |
27 namespace blink { | 28 namespace blink { |
28 | 29 |
29 enum SVGTextPathMethodType { | 30 enum SVGTextPathMethodType { |
30 SVGTextPathMethodUnknown = 0, | 31 SVGTextPathMethodUnknown = 0, |
31 SVGTextPathMethodAlign, | 32 SVGTextPathMethodAlign, |
32 SVGTextPathMethodStretch | 33 SVGTextPathMethodStretch |
33 }; | 34 }; |
34 | 35 |
35 enum SVGTextPathSpacingType { | 36 enum SVGTextPathSpacingType { |
36 SVGTextPathSpacingUnknown = 0, | 37 SVGTextPathSpacingUnknown = 0, |
37 SVGTextPathSpacingAuto, | 38 SVGTextPathSpacingAuto, |
38 SVGTextPathSpacingExact | 39 SVGTextPathSpacingExact |
39 }; | 40 }; |
40 | 41 |
41 template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGTextPath
MethodType>(); | 42 template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGTextPath
MethodType>(); |
42 template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGTextPath
SpacingType>(); | 43 template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGTextPath
SpacingType>(); |
43 | 44 |
44 class SVGTextPathElement final : public SVGTextContentElement, | 45 class SVGTextPathElement final : public SVGTextContentElement, |
45 public SVGURIReference { | 46 public SVGURIReference { |
46 DEFINE_WRAPPERTYPEINFO(); | 47 DEFINE_WRAPPERTYPEINFO(); |
| 48 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SVGTextPathElement); |
47 public: | 49 public: |
48 // Forward declare enumerations in the W3C naming scheme, for IDL generation
. | 50 // Forward declare enumerations in the W3C naming scheme, for IDL generation
. |
49 enum { | 51 enum { |
50 TEXTPATH_METHODTYPE_UNKNOWN = SVGTextPathMethodUnknown, | 52 TEXTPATH_METHODTYPE_UNKNOWN = SVGTextPathMethodUnknown, |
51 TEXTPATH_METHODTYPE_ALIGN = SVGTextPathMethodAlign, | 53 TEXTPATH_METHODTYPE_ALIGN = SVGTextPathMethodAlign, |
52 TEXTPATH_METHODTYPE_STRETCH = SVGTextPathMethodStretch, | 54 TEXTPATH_METHODTYPE_STRETCH = SVGTextPathMethodStretch, |
53 TEXTPATH_SPACINGTYPE_UNKNOWN = SVGTextPathSpacingUnknown, | 55 TEXTPATH_SPACINGTYPE_UNKNOWN = SVGTextPathSpacingUnknown, |
54 TEXTPATH_SPACINGTYPE_AUTO = SVGTextPathSpacingAuto, | 56 TEXTPATH_SPACINGTYPE_AUTO = SVGTextPathSpacingAuto, |
55 TEXTPATH_SPACINGTYPE_EXACT = SVGTextPathSpacingExact | 57 TEXTPATH_SPACINGTYPE_EXACT = SVGTextPathSpacingExact |
56 }; | 58 }; |
57 | 59 |
58 DECLARE_NODE_FACTORY(SVGTextPathElement); | 60 DECLARE_NODE_FACTORY(SVGTextPathElement); |
59 | 61 |
60 SVGAnimatedLength* startOffset() const { return m_startOffset.get(); } | 62 SVGAnimatedLength* startOffset() const { return m_startOffset.get(); } |
61 SVGAnimatedEnumeration<SVGTextPathMethodType>* method() { return m_method.ge
t(); } | 63 SVGAnimatedEnumeration<SVGTextPathMethodType>* method() { return m_method.ge
t(); } |
62 SVGAnimatedEnumeration<SVGTextPathSpacingType>* spacing() { return m_spacing
.get(); } | 64 SVGAnimatedEnumeration<SVGTextPathSpacingType>* spacing() { return m_spacing
.get(); } |
63 | 65 |
| 66 virtual void trace(Visitor*) override; |
| 67 |
64 private: | 68 private: |
65 explicit SVGTextPathElement(Document&); | 69 explicit SVGTextPathElement(Document&); |
66 | 70 |
67 virtual ~SVGTextPathElement(); | 71 virtual ~SVGTextPathElement(); |
68 | 72 |
69 void clearResourceReferences(); | 73 void clearResourceReferences(); |
70 | 74 |
71 virtual void buildPendingResource() override; | 75 virtual void buildPendingResource() override; |
72 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; | 76 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; |
73 virtual void removedFrom(ContainerNode*) override; | 77 virtual void removedFrom(ContainerNode*) override; |
74 | 78 |
75 bool isSupportedAttribute(const QualifiedName&); | 79 bool isSupportedAttribute(const QualifiedName&); |
76 virtual void svgAttributeChanged(const QualifiedName&) override; | 80 virtual void svgAttributeChanged(const QualifiedName&) override; |
77 | 81 |
78 virtual RenderObject* createRenderer(RenderStyle*) override; | 82 virtual RenderObject* createRenderer(RenderStyle*) override; |
79 virtual bool rendererIsNeeded(const RenderStyle&) override; | 83 virtual bool rendererIsNeeded(const RenderStyle&) override; |
80 | 84 |
81 virtual bool selfHasRelativeLengths() const override; | 85 virtual bool selfHasRelativeLengths() const override; |
82 | 86 |
83 RefPtr<SVGAnimatedLength> m_startOffset; | 87 RefPtrWillBeMember<SVGAnimatedLength> m_startOffset; |
84 RefPtr<SVGAnimatedEnumeration<SVGTextPathMethodType> > m_method; | 88 RefPtrWillBeMember<SVGAnimatedEnumeration<SVGTextPathMethodType> > m_method; |
85 RefPtr<SVGAnimatedEnumeration<SVGTextPathSpacingType> > m_spacing; | 89 RefPtrWillBeMember<SVGAnimatedEnumeration<SVGTextPathSpacingType> > m_spacin
g; |
86 }; | 90 }; |
87 | 91 |
88 } // namespace blink | 92 } // namespace blink |
89 | 93 |
90 #endif // SVGTextPathElement_h | 94 #endif // SVGTextPathElement_h |
OLD | NEW |