OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007, 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 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 return s_propertyInfo; | 45 return s_propertyInfo; |
46 } | 46 } |
47 | 47 |
48 // Animated property definitions | 48 // Animated property definitions |
49 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::refXAttr, RefX, refX) | 49 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::refXAttr, RefX, refX) |
50 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::refYAttr, RefY, refY) | 50 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::refYAttr, RefY, refY) |
51 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::markerWidthAttr, MarkerWidth,
markerWidth) | 51 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::markerWidthAttr, MarkerWidth,
markerWidth) |
52 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::markerHeightAttr, MarkerHeigh
t, markerHeight) | 52 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::markerHeightAttr, MarkerHeigh
t, markerHeight) |
53 DEFINE_ANIMATED_ENUMERATION(SVGMarkerElement, SVGNames::markerUnitsAttr, MarkerU
nits, markerUnits, SVGMarkerUnitsType) | 53 DEFINE_ANIMATED_ENUMERATION(SVGMarkerElement, SVGNames::markerUnitsAttr, MarkerU
nits, markerUnits, SVGMarkerUnitsType) |
54 DEFINE_ANIMATED_ANGLE_AND_ENUMERATION(SVGMarkerElement, SVGNames::orientAttr, or
ientAngleIdentifier(), OrientAngle, orientAngle) | 54 DEFINE_ANIMATED_ANGLE_AND_ENUMERATION(SVGMarkerElement, SVGNames::orientAttr, or
ientAngleIdentifier(), OrientAngle, orientAngle) |
55 DEFINE_ANIMATED_BOOLEAN(SVGMarkerElement, SVGNames::externalResourcesRequiredAtt
r, ExternalResourcesRequired, externalResourcesRequired) | |
56 DEFINE_ANIMATED_RECT(SVGMarkerElement, SVGNames::viewBoxAttr, ViewBox, viewBox) | 55 DEFINE_ANIMATED_RECT(SVGMarkerElement, SVGNames::viewBoxAttr, ViewBox, viewBox) |
57 DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGMarkerElement, SVGNames::preserveAspectRa
tioAttr, PreserveAspectRatio, preserveAspectRatio) | 56 DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGMarkerElement, SVGNames::preserveAspectRa
tioAttr, PreserveAspectRatio, preserveAspectRatio) |
58 | 57 |
59 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGMarkerElement) | 58 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGMarkerElement) |
60 REGISTER_LOCAL_ANIMATED_PROPERTY(refX) | 59 REGISTER_LOCAL_ANIMATED_PROPERTY(refX) |
61 REGISTER_LOCAL_ANIMATED_PROPERTY(refY) | 60 REGISTER_LOCAL_ANIMATED_PROPERTY(refY) |
62 REGISTER_LOCAL_ANIMATED_PROPERTY(markerWidth) | 61 REGISTER_LOCAL_ANIMATED_PROPERTY(markerWidth) |
63 REGISTER_LOCAL_ANIMATED_PROPERTY(markerHeight) | 62 REGISTER_LOCAL_ANIMATED_PROPERTY(markerHeight) |
64 REGISTER_LOCAL_ANIMATED_PROPERTY(markerUnits) | 63 REGISTER_LOCAL_ANIMATED_PROPERTY(markerUnits) |
65 REGISTER_LOCAL_ANIMATED_PROPERTY(orientAngle) | 64 REGISTER_LOCAL_ANIMATED_PROPERTY(orientAngle) |
66 REGISTER_LOCAL_ANIMATED_PROPERTY(orientType) | 65 REGISTER_LOCAL_ANIMATED_PROPERTY(orientType) |
67 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | |
68 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox) | 66 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox) |
69 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) | 67 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) |
70 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) | 68 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) |
71 END_REGISTER_ANIMATED_PROPERTIES | 69 END_REGISTER_ANIMATED_PROPERTIES |
72 | 70 |
73 inline SVGMarkerElement::SVGMarkerElement(const QualifiedName& tagName, Document
& document) | 71 inline SVGMarkerElement::SVGMarkerElement(const QualifiedName& tagName, Document
& document) |
74 : SVGElement(tagName, document) | 72 : SVGElement(tagName, document) |
75 , m_refX(LengthModeWidth) | 73 , m_refX(LengthModeWidth) |
76 , m_refY(LengthModeHeight) | 74 , m_refY(LengthModeHeight) |
77 , m_markerWidth(LengthModeWidth, "3") | 75 , m_markerWidth(LengthModeWidth, "3") |
(...skipping 26 matching lines...) Expand all Loading... |
104 | 102 |
105 AffineTransform SVGMarkerElement::viewBoxToViewTransform(float viewWidth, float
viewHeight) const | 103 AffineTransform SVGMarkerElement::viewBoxToViewTransform(float viewWidth, float
viewHeight) const |
106 { | 104 { |
107 return SVGFitToViewBox::viewBoxToViewTransform(viewBoxCurrentValue(), preser
veAspectRatioCurrentValue(), viewWidth, viewHeight); | 105 return SVGFitToViewBox::viewBoxToViewTransform(viewBoxCurrentValue(), preser
veAspectRatioCurrentValue(), viewWidth, viewHeight); |
108 } | 106 } |
109 | 107 |
110 bool SVGMarkerElement::isSupportedAttribute(const QualifiedName& attrName) | 108 bool SVGMarkerElement::isSupportedAttribute(const QualifiedName& attrName) |
111 { | 109 { |
112 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 110 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
113 if (supportedAttributes.isEmpty()) { | 111 if (supportedAttributes.isEmpty()) { |
114 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); | |
115 SVGFitToViewBox::addSupportedAttributes(supportedAttributes); | 112 SVGFitToViewBox::addSupportedAttributes(supportedAttributes); |
116 supportedAttributes.add(SVGNames::markerUnitsAttr); | 113 supportedAttributes.add(SVGNames::markerUnitsAttr); |
117 supportedAttributes.add(SVGNames::refXAttr); | 114 supportedAttributes.add(SVGNames::refXAttr); |
118 supportedAttributes.add(SVGNames::refYAttr); | 115 supportedAttributes.add(SVGNames::refYAttr); |
119 supportedAttributes.add(SVGNames::markerWidthAttr); | 116 supportedAttributes.add(SVGNames::markerWidthAttr); |
120 supportedAttributes.add(SVGNames::markerHeightAttr); | 117 supportedAttributes.add(SVGNames::markerHeightAttr); |
121 supportedAttributes.add(SVGNames::orientAttr); | 118 supportedAttributes.add(SVGNames::orientAttr); |
122 } | 119 } |
123 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 120 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
124 } | 121 } |
(...skipping 16 matching lines...) Expand all Loading... |
141 setMarkerWidthBaseValue(SVGLength::construct(LengthModeWidth, value, par
seError)); | 138 setMarkerWidthBaseValue(SVGLength::construct(LengthModeWidth, value, par
seError)); |
142 else if (name == SVGNames::markerHeightAttr) | 139 else if (name == SVGNames::markerHeightAttr) |
143 setMarkerHeightBaseValue(SVGLength::construct(LengthModeHeight, value, p
arseError)); | 140 setMarkerHeightBaseValue(SVGLength::construct(LengthModeHeight, value, p
arseError)); |
144 else if (name == SVGNames::orientAttr) { | 141 else if (name == SVGNames::orientAttr) { |
145 SVGAngle angle; | 142 SVGAngle angle; |
146 SVGMarkerOrientType orientType = SVGPropertyTraits<SVGMarkerOrientType>:
:fromString(value, angle); | 143 SVGMarkerOrientType orientType = SVGPropertyTraits<SVGMarkerOrientType>:
:fromString(value, angle); |
147 if (orientType > 0) | 144 if (orientType > 0) |
148 setOrientTypeBaseValue(orientType); | 145 setOrientTypeBaseValue(orientType); |
149 if (orientType == SVGMarkerOrientAngle) | 146 if (orientType == SVGMarkerOrientAngle) |
150 setOrientAngleBaseValue(angle); | 147 setOrientAngleBaseValue(angle); |
151 } else if (SVGExternalResourcesRequired::parseAttribute(name, value) | 148 } else if (SVGFitToViewBox::parseAttribute(this, name, value)) { |
152 || SVGFitToViewBox::parseAttribute(this, name, value)) { | |
153 } else | 149 } else |
154 ASSERT_NOT_REACHED(); | 150 ASSERT_NOT_REACHED(); |
155 | 151 |
156 reportAttributeParsingError(parseError, name, value); | 152 reportAttributeParsingError(parseError, name, value); |
157 } | 153 } |
158 | 154 |
159 void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName) | 155 void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName) |
160 { | 156 { |
161 if (!isSupportedAttribute(attrName)) { | 157 if (!isSupportedAttribute(attrName)) { |
162 SVGElement::svgAttributeChanged(attrName); | 158 SVGElement::svgAttributeChanged(attrName); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 (ownerType, orientTypePropertyInfo(), ownerType->m_orientType.value); | 242 (ownerType, orientTypePropertyInfo(), ownerType->m_orientType.value); |
247 } | 243 } |
248 | 244 |
249 PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> > SVGMarke
rElement::orientType() | 245 PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> > SVGMarke
rElement::orientType() |
250 { | 246 { |
251 m_orientType.shouldSynchronize = true; | 247 m_orientType.shouldSynchronize = true; |
252 return static_pointer_cast<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOr
ientType> >(lookupOrCreateOrientTypeWrapper(this)); | 248 return static_pointer_cast<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOr
ientType> >(lookupOrCreateOrientTypeWrapper(this)); |
253 } | 249 } |
254 | 250 |
255 } | 251 } |
OLD | NEW |