| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 return s_propertyInfo; | 44 return s_propertyInfo; |
| 45 } | 45 } |
| 46 | 46 |
| 47 // Animated property definitions | 47 // Animated property definitions |
| 48 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::refXAttr, RefX, refX) | 48 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::refXAttr, RefX, refX) |
| 49 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::refYAttr, RefY, refY) | 49 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::refYAttr, RefY, refY) |
| 50 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::markerWidthAttr, MarkerWidth,
markerWidth) | 50 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::markerWidthAttr, MarkerWidth,
markerWidth) |
| 51 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::markerHeightAttr, MarkerHeigh
t, markerHeight) | 51 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::markerHeightAttr, MarkerHeigh
t, markerHeight) |
| 52 DEFINE_ANIMATED_ENUMERATION(SVGMarkerElement, SVGNames::markerUnitsAttr, MarkerU
nits, markerUnits, SVGMarkerUnitsType) | 52 DEFINE_ANIMATED_ENUMERATION(SVGMarkerElement, SVGNames::markerUnitsAttr, MarkerU
nits, markerUnits, SVGMarkerUnitsType) |
| 53 DEFINE_ANIMATED_ANGLE_AND_ENUMERATION(SVGMarkerElement, SVGNames::orientAttr, or
ientAngleIdentifier(), OrientAngle, orientAngle) | 53 DEFINE_ANIMATED_ANGLE_AND_ENUMERATION(SVGMarkerElement, SVGNames::orientAttr, or
ientAngleIdentifier(), OrientAngle, orientAngle) |
| 54 DEFINE_ANIMATED_BOOLEAN(SVGMarkerElement, SVGNames::externalResourcesRequiredAtt
r, ExternalResourcesRequired, externalResourcesRequired) | |
| 55 DEFINE_ANIMATED_RECT(SVGMarkerElement, SVGNames::viewBoxAttr, ViewBox, viewBox) | 54 DEFINE_ANIMATED_RECT(SVGMarkerElement, SVGNames::viewBoxAttr, ViewBox, viewBox) |
| 56 DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGMarkerElement, SVGNames::preserveAspectRa
tioAttr, PreserveAspectRatio, preserveAspectRatio) | 55 DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGMarkerElement, SVGNames::preserveAspectRa
tioAttr, PreserveAspectRatio, preserveAspectRatio) |
| 57 | 56 |
| 58 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGMarkerElement) | 57 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGMarkerElement) |
| 59 REGISTER_LOCAL_ANIMATED_PROPERTY(refX) | 58 REGISTER_LOCAL_ANIMATED_PROPERTY(refX) |
| 60 REGISTER_LOCAL_ANIMATED_PROPERTY(refY) | 59 REGISTER_LOCAL_ANIMATED_PROPERTY(refY) |
| 61 REGISTER_LOCAL_ANIMATED_PROPERTY(markerWidth) | 60 REGISTER_LOCAL_ANIMATED_PROPERTY(markerWidth) |
| 62 REGISTER_LOCAL_ANIMATED_PROPERTY(markerHeight) | 61 REGISTER_LOCAL_ANIMATED_PROPERTY(markerHeight) |
| 63 REGISTER_LOCAL_ANIMATED_PROPERTY(markerUnits) | 62 REGISTER_LOCAL_ANIMATED_PROPERTY(markerUnits) |
| 64 REGISTER_LOCAL_ANIMATED_PROPERTY(orientAngle) | 63 REGISTER_LOCAL_ANIMATED_PROPERTY(orientAngle) |
| 65 REGISTER_LOCAL_ANIMATED_PROPERTY(orientType) | 64 REGISTER_LOCAL_ANIMATED_PROPERTY(orientType) |
| 66 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | |
| 67 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox) | 65 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox) |
| 68 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) | 66 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) |
| 69 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) | 67 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) |
| 70 END_REGISTER_ANIMATED_PROPERTIES | 68 END_REGISTER_ANIMATED_PROPERTIES |
| 71 | 69 |
| 72 inline SVGMarkerElement::SVGMarkerElement(Document& document) | 70 inline SVGMarkerElement::SVGMarkerElement(Document& document) |
| 73 : SVGElement(SVGNames::markerTag, document) | 71 : SVGElement(SVGNames::markerTag, document) |
| 74 , m_orientType(SVGMarkerOrientAngle) | 72 , m_orientType(SVGMarkerOrientAngle) |
| 75 , m_refX(LengthModeWidth) | 73 , m_refX(LengthModeWidth) |
| 76 , m_refY(LengthModeHeight) | 74 , m_refY(LengthModeHeight) |
| (...skipping 25 matching lines...) Expand all Loading... |
| 102 | 100 |
| 103 AffineTransform SVGMarkerElement::viewBoxToViewTransform(float viewWidth, float
viewHeight) const | 101 AffineTransform SVGMarkerElement::viewBoxToViewTransform(float viewWidth, float
viewHeight) const |
| 104 { | 102 { |
| 105 return SVGFitToViewBox::viewBoxToViewTransform(viewBoxCurrentValue(), preser
veAspectRatioCurrentValue(), viewWidth, viewHeight); | 103 return SVGFitToViewBox::viewBoxToViewTransform(viewBoxCurrentValue(), preser
veAspectRatioCurrentValue(), viewWidth, viewHeight); |
| 106 } | 104 } |
| 107 | 105 |
| 108 bool SVGMarkerElement::isSupportedAttribute(const QualifiedName& attrName) | 106 bool SVGMarkerElement::isSupportedAttribute(const QualifiedName& attrName) |
| 109 { | 107 { |
| 110 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 108 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
| 111 if (supportedAttributes.isEmpty()) { | 109 if (supportedAttributes.isEmpty()) { |
| 112 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); | |
| 113 SVGFitToViewBox::addSupportedAttributes(supportedAttributes); | 110 SVGFitToViewBox::addSupportedAttributes(supportedAttributes); |
| 114 supportedAttributes.add(SVGNames::markerUnitsAttr); | 111 supportedAttributes.add(SVGNames::markerUnitsAttr); |
| 115 supportedAttributes.add(SVGNames::refXAttr); | 112 supportedAttributes.add(SVGNames::refXAttr); |
| 116 supportedAttributes.add(SVGNames::refYAttr); | 113 supportedAttributes.add(SVGNames::refYAttr); |
| 117 supportedAttributes.add(SVGNames::markerWidthAttr); | 114 supportedAttributes.add(SVGNames::markerWidthAttr); |
| 118 supportedAttributes.add(SVGNames::markerHeightAttr); | 115 supportedAttributes.add(SVGNames::markerHeightAttr); |
| 119 supportedAttributes.add(SVGNames::orientAttr); | 116 supportedAttributes.add(SVGNames::orientAttr); |
| 120 } | 117 } |
| 121 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 118 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
| 122 } | 119 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 139 setMarkerWidthBaseValue(SVGLength::construct(LengthModeWidth, value, par
seError)); | 136 setMarkerWidthBaseValue(SVGLength::construct(LengthModeWidth, value, par
seError)); |
| 140 else if (name == SVGNames::markerHeightAttr) | 137 else if (name == SVGNames::markerHeightAttr) |
| 141 setMarkerHeightBaseValue(SVGLength::construct(LengthModeHeight, value, p
arseError)); | 138 setMarkerHeightBaseValue(SVGLength::construct(LengthModeHeight, value, p
arseError)); |
| 142 else if (name == SVGNames::orientAttr) { | 139 else if (name == SVGNames::orientAttr) { |
| 143 SVGAngle angle; | 140 SVGAngle angle; |
| 144 SVGMarkerOrientType orientType = SVGPropertyTraits<SVGMarkerOrientType>:
:fromString(value, angle); | 141 SVGMarkerOrientType orientType = SVGPropertyTraits<SVGMarkerOrientType>:
:fromString(value, angle); |
| 145 if (orientType > 0) | 142 if (orientType > 0) |
| 146 setOrientTypeBaseValue(orientType); | 143 setOrientTypeBaseValue(orientType); |
| 147 if (orientType == SVGMarkerOrientAngle) | 144 if (orientType == SVGMarkerOrientAngle) |
| 148 setOrientAngleBaseValue(angle); | 145 setOrientAngleBaseValue(angle); |
| 149 } else if (SVGExternalResourcesRequired::parseAttribute(name, value) | 146 } else if (SVGFitToViewBox::parseAttribute(this, name, value)) { |
| 150 || SVGFitToViewBox::parseAttribute(this, name, value)) { | |
| 151 } else | 147 } else |
| 152 ASSERT_NOT_REACHED(); | 148 ASSERT_NOT_REACHED(); |
| 153 | 149 |
| 154 reportAttributeParsingError(parseError, name, value); | 150 reportAttributeParsingError(parseError, name, value); |
| 155 } | 151 } |
| 156 | 152 |
| 157 void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName) | 153 void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName) |
| 158 { | 154 { |
| 159 if (!isSupportedAttribute(attrName)) { | 155 if (!isSupportedAttribute(attrName)) { |
| 160 SVGElement::svgAttributeChanged(attrName); | 156 SVGElement::svgAttributeChanged(attrName); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 (ownerType, orientTypePropertyInfo(), ownerType->m_orientType.value); | 241 (ownerType, orientTypePropertyInfo(), ownerType->m_orientType.value); |
| 246 } | 242 } |
| 247 | 243 |
| 248 PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> > SVGMarke
rElement::orientType() | 244 PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> > SVGMarke
rElement::orientType() |
| 249 { | 245 { |
| 250 m_orientType.shouldSynchronize = true; | 246 m_orientType.shouldSynchronize = true; |
| 251 return static_pointer_cast<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOr
ientType> >(lookupOrCreateOrientTypeWrapper(this)); | 247 return static_pointer_cast<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOr
ientType> >(lookupOrCreateOrientTypeWrapper(this)); |
| 252 } | 248 } |
| 253 | 249 |
| 254 } | 250 } |
| OLD | NEW |