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 SVGPatternElement_h | 21 #ifndef SVGPatternElement_h |
22 #define SVGPatternElement_h | 22 #define SVGPatternElement_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/SVGAnimatedEnumeration.h" | 26 #include "core/svg/SVGAnimatedEnumeration.h" |
27 #include "core/svg/SVGAnimatedLength.h" | 27 #include "core/svg/SVGAnimatedLength.h" |
28 #include "core/svg/SVGAnimatedPreserveAspectRatio.h" | |
29 #include "core/svg/SVGAnimatedRect.h" | |
30 #include "core/svg/SVGAnimatedTransformList.h" | 28 #include "core/svg/SVGAnimatedTransformList.h" |
31 #include "core/svg/SVGElement.h" | 29 #include "core/svg/SVGElement.h" |
32 #include "core/svg/SVGFitToViewBox.h" | 30 #include "core/svg/SVGFitToViewBox.h" |
33 #include "core/svg/SVGTests.h" | 31 #include "core/svg/SVGTests.h" |
34 #include "core/svg/SVGURIReference.h" | 32 #include "core/svg/SVGURIReference.h" |
35 #include "core/svg/SVGUnitTypes.h" | 33 #include "core/svg/SVGUnitTypes.h" |
36 | 34 |
37 namespace WebCore { | 35 namespace WebCore { |
38 | 36 |
39 struct PatternAttributes; | 37 struct PatternAttributes; |
40 | 38 |
41 class SVGPatternElement FINAL : public SVGElement, | 39 class SVGPatternElement FINAL : public SVGElement, |
42 public SVGURIReference, | 40 public SVGURIReference, |
43 public SVGTests, | 41 public SVGTests, |
44 public SVGFitToViewBox { | 42 public SVGFitToViewBox { |
45 public: | 43 public: |
46 static PassRefPtr<SVGPatternElement> create(Document&); | 44 static PassRefPtr<SVGPatternElement> create(Document&); |
47 | 45 |
48 void collectPatternAttributes(PatternAttributes&) const; | 46 void collectPatternAttributes(PatternAttributes&) const; |
49 | 47 |
50 virtual AffineTransform localCoordinateSpaceTransform(SVGElement::CTMScope)
const OVERRIDE; | 48 virtual AffineTransform localCoordinateSpaceTransform(SVGElement::CTMScope)
const OVERRIDE; |
51 | 49 |
52 SVGAnimatedLength* x() const { return m_x.get(); } | 50 SVGAnimatedLength* x() const { return m_x.get(); } |
53 SVGAnimatedLength* y() const { return m_y.get(); } | 51 SVGAnimatedLength* y() const { return m_y.get(); } |
54 SVGAnimatedLength* width() const { return m_width.get(); } | 52 SVGAnimatedLength* width() const { return m_width.get(); } |
55 SVGAnimatedLength* height() const { return m_height.get(); } | 53 SVGAnimatedLength* height() const { return m_height.get(); } |
56 SVGAnimatedRect* viewBox() const { return m_viewBox.get(); } | |
57 SVGAnimatedPreserveAspectRatio* preserveAspectRatio() const { return m_prese
rveAspectRatio.get(); } | |
58 | 54 |
59 private: | 55 private: |
60 explicit SVGPatternElement(Document&); | 56 explicit SVGPatternElement(Document&); |
61 | 57 |
62 virtual bool isValid() const OVERRIDE { return SVGTests::isValid(); } | 58 virtual bool isValid() const OVERRIDE { return SVGTests::isValid(); } |
63 virtual bool needsPendingResourceHandling() const OVERRIDE { return false; } | 59 virtual bool needsPendingResourceHandling() const OVERRIDE { return false; } |
64 | 60 |
65 bool isSupportedAttribute(const QualifiedName&); | 61 bool isSupportedAttribute(const QualifiedName&); |
66 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 62 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; |
67 virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE; | 63 virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE; |
68 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang
e = 0, Node* afterChange = 0, int childCountDelta = 0) OVERRIDE; | 64 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang
e = 0, Node* afterChange = 0, int childCountDelta = 0) OVERRIDE; |
69 | 65 |
70 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; | 66 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; |
71 | 67 |
72 virtual bool selfHasRelativeLengths() const OVERRIDE; | 68 virtual bool selfHasRelativeLengths() const OVERRIDE; |
73 | 69 |
74 RefPtr<SVGAnimatedLength> m_x; | 70 RefPtr<SVGAnimatedLength> m_x; |
75 RefPtr<SVGAnimatedLength> m_y; | 71 RefPtr<SVGAnimatedLength> m_y; |
76 RefPtr<SVGAnimatedLength> m_width; | 72 RefPtr<SVGAnimatedLength> m_width; |
77 RefPtr<SVGAnimatedLength> m_height; | 73 RefPtr<SVGAnimatedLength> m_height; |
78 RefPtr<SVGAnimatedRect> m_viewBox; | |
79 RefPtr<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio; | |
80 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGPatternElement) | 74 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGPatternElement) |
81 DECLARE_ANIMATED_ENUMERATION(PatternUnits, patternUnits, SVGUnitTypes::S
VGUnitType) | 75 DECLARE_ANIMATED_ENUMERATION(PatternUnits, patternUnits, SVGUnitTypes::S
VGUnitType) |
82 DECLARE_ANIMATED_ENUMERATION(PatternContentUnits, patternContentUnits, S
VGUnitTypes::SVGUnitType) | 76 DECLARE_ANIMATED_ENUMERATION(PatternContentUnits, patternContentUnits, S
VGUnitTypes::SVGUnitType) |
83 DECLARE_ANIMATED_TRANSFORM_LIST(PatternTransform, patternTransform) | 77 DECLARE_ANIMATED_TRANSFORM_LIST(PatternTransform, patternTransform) |
84 END_DECLARE_ANIMATED_PROPERTIES | 78 END_DECLARE_ANIMATED_PROPERTIES |
85 }; | 79 }; |
86 | 80 |
87 DEFINE_NODE_TYPE_CASTS(SVGPatternElement, hasTagName(SVGNames::patternTag)); | 81 DEFINE_NODE_TYPE_CASTS(SVGPatternElement, hasTagName(SVGNames::patternTag)); |
88 | 82 |
89 } // namespace WebCore | 83 } // namespace WebCore |
90 | 84 |
91 #endif | 85 #endif |
OLD | NEW |