00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "config.h"
00023
00024 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
00025 #include "SVGFELightElement.h"
00026
00027 #include "SVGNames.h"
00028
00029 namespace WebCore {
00030
00031 SVGFELightElement::SVGFELightElement(const QualifiedName& tagName, Document* doc)
00032 : SVGElement(tagName, doc)
00033 , m_azimuth(0.0f)
00034 , m_elevation(0.0f)
00035 , m_x(0.0f)
00036 , m_y(0.0f)
00037 , m_z(0.0f)
00038 , m_pointsAtX(0.0f)
00039 , m_pointsAtY(0.0f)
00040 , m_pointsAtZ(0.0f)
00041 , m_specularExponent(1.0f)
00042 , m_limitingConeAngle(0.0f)
00043 {
00044 }
00045
00046 SVGFELightElement::~SVGFELightElement()
00047 {
00048 }
00049
00050 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, Azimuth, azimuth, SVGNames::azimuthAttr, m_azimuth)
00051 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, Elevation, elevation, SVGNames::elevationAttr, m_elevation)
00052 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, X, x, SVGNames::xAttr, m_x)
00053 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, Y, y, SVGNames::yAttr, m_y)
00054
00055 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, Z, z, SVGNames::zAttr, m_z)
00056 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, PointsAtX, pointsAtX, SVGNames::pointsAtXAttr, m_pointsAtX)
00057 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, PointsAtY, pointsAtY, SVGNames::pointsAtYAttr, m_pointsAtY)
00058 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, PointsAtZ, pointsAtZ, SVGNames::pointsAtZAttr, m_pointsAtZ)
00059 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, SpecularExponent, specularExponent, SVGNames::specularExponentAttr, m_specularExponent)
00060 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement, float, Number, number, LimitingConeAngle, limitingConeAngle, SVGNames::limitingConeAngleAttr, m_limitingConeAngle)
00061
00062 void SVGFELightElement::parseMappedAttribute(MappedAttribute* attr)
00063 {
00064 const String& value = attr->value();
00065 if (attr->name() == SVGNames::azimuthAttr)
00066 setAzimuthBaseValue(value.toFloat());
00067 else if (attr->name() == SVGNames::elevationAttr)
00068 setElevationBaseValue(value.toFloat());
00069 else if (attr->name() == SVGNames::xAttr)
00070 setXBaseValue(value.toFloat());
00071 else if (attr->name() == SVGNames::yAttr)
00072 setYBaseValue(value.toFloat());
00073 else if (attr->name() == SVGNames::zAttr)
00074 setZBaseValue(value.toFloat());
00075 else if (attr->name() == SVGNames::pointsAtXAttr)
00076 setPointsAtXBaseValue(value.toFloat());
00077 else if (attr->name() == SVGNames::pointsAtYAttr)
00078 setPointsAtYBaseValue(value.toFloat());
00079 else if (attr->name() == SVGNames::pointsAtZAttr)
00080 setPointsAtZBaseValue(value.toFloat());
00081 else if (attr->name() == SVGNames::specularExponentAttr)
00082 setSpecularExponentBaseValue(value.toFloat());
00083 else if (attr->name() == SVGNames::limitingConeAngleAttr)
00084 setLimitingConeAngleBaseValue(value.toFloat());
00085 else
00086 SVGElement::parseMappedAttribute(attr);
00087 }
00088
00089 }
00090
00091 #endif // ENABLE(SVG)
00092
00093