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, |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGLineElement) | 39 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGLineElement) |
40 REGISTER_LOCAL_ANIMATED_PROPERTY(x1) | 40 REGISTER_LOCAL_ANIMATED_PROPERTY(x1) |
41 REGISTER_LOCAL_ANIMATED_PROPERTY(y1) | 41 REGISTER_LOCAL_ANIMATED_PROPERTY(y1) |
42 REGISTER_LOCAL_ANIMATED_PROPERTY(x2) | 42 REGISTER_LOCAL_ANIMATED_PROPERTY(x2) |
43 REGISTER_LOCAL_ANIMATED_PROPERTY(y2) | 43 REGISTER_LOCAL_ANIMATED_PROPERTY(y2) |
44 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | 44 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) |
45 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) | 45 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) |
46 END_REGISTER_ANIMATED_PROPERTIES | 46 END_REGISTER_ANIMATED_PROPERTIES |
47 | 47 |
48 inline SVGLineElement::SVGLineElement(const QualifiedName& tagName, Document& do
cument) | 48 inline SVGLineElement::SVGLineElement(Document& document) |
49 : SVGGeometryElement(tagName, document) | 49 : SVGGeometryElement(SVGNames::lineTag, document) |
50 , m_x1(LengthModeWidth) | 50 , m_x1(LengthModeWidth) |
51 , m_y1(LengthModeHeight) | 51 , m_y1(LengthModeHeight) |
52 , m_x2(LengthModeWidth) | 52 , m_x2(LengthModeWidth) |
53 , m_y2(LengthModeHeight) | 53 , m_y2(LengthModeHeight) |
54 { | 54 { |
55 ASSERT(hasTagName(SVGNames::lineTag)); | |
56 ScriptWrappable::init(this); | 55 ScriptWrappable::init(this); |
57 registerAnimatedPropertiesForSVGLineElement(); | 56 registerAnimatedPropertiesForSVGLineElement(); |
58 } | 57 } |
59 | 58 |
60 PassRefPtr<SVGLineElement> SVGLineElement::create(const QualifiedName& tagName,
Document& document) | 59 PassRefPtr<SVGLineElement> SVGLineElement::create(Document& document) |
61 { | 60 { |
62 return adoptRef(new SVGLineElement(tagName, document)); | 61 return adoptRef(new SVGLineElement(document)); |
63 } | 62 } |
64 | 63 |
65 bool SVGLineElement::isSupportedAttribute(const QualifiedName& attrName) | 64 bool SVGLineElement::isSupportedAttribute(const QualifiedName& attrName) |
66 { | 65 { |
67 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 66 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
68 if (supportedAttributes.isEmpty()) { | 67 if (supportedAttributes.isEmpty()) { |
69 SVGLangSpace::addSupportedAttributes(supportedAttributes); | 68 SVGLangSpace::addSupportedAttributes(supportedAttributes); |
70 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); | 69 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); |
71 supportedAttributes.add(SVGNames::x1Attr); | 70 supportedAttributes.add(SVGNames::x1Attr); |
72 supportedAttributes.add(SVGNames::x2Attr); | 71 supportedAttributes.add(SVGNames::x2Attr); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 134 |
136 bool SVGLineElement::selfHasRelativeLengths() const | 135 bool SVGLineElement::selfHasRelativeLengths() const |
137 { | 136 { |
138 return x1CurrentValue().isRelative() | 137 return x1CurrentValue().isRelative() |
139 || y1CurrentValue().isRelative() | 138 || y1CurrentValue().isRelative() |
140 || x2CurrentValue().isRelative() | 139 || x2CurrentValue().isRelative() |
141 || y2CurrentValue().isRelative(); | 140 || y2CurrentValue().isRelative(); |
142 } | 141 } |
143 | 142 |
144 } | 143 } |
OLD | NEW |