Rubber-stamped by Brady Eidson.
[webbrowser.git] / WebCore / svg / SVGFELightElement.cpp
blobbb954eb4a4bb759cc38fafcd5328e3e72e257088
1 /*
2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005, 2006 Rob Buis <buis@kde.org>
4 2005 Oliver Hunt <oliver@nerget.com>
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
22 #include "config.h"
24 #if ENABLE(SVG) && ENABLE(FILTERS)
25 #include "SVGFELightElement.h"
27 #include "MappedAttribute.h"
28 #include "SVGNames.h"
30 namespace WebCore {
32 char SVGFELightElementIdentifier[] = "SVGFELightElement";
34 SVGFELightElement::SVGFELightElement(const QualifiedName& tagName, Document* doc)
35 : SVGElement(tagName, doc)
36 , m_azimuth(this, SVGNames::azimuthAttr)
37 , m_elevation(this, SVGNames::elevationAttr)
38 , m_x(this, SVGNames::xAttr)
39 , m_y(this, SVGNames::yAttr)
40 , m_z(this, SVGNames::zAttr)
41 , m_pointsAtX(this, SVGNames::pointsAtXAttr)
42 , m_pointsAtY(this, SVGNames::pointsAtYAttr)
43 , m_pointsAtZ(this, SVGNames::pointsAtZAttr)
44 , m_specularExponent(this, SVGNames::specularExponentAttr, 1.0f)
45 , m_limitingConeAngle(this, SVGNames::limitingConeAngleAttr)
49 SVGFELightElement::~SVGFELightElement()
53 void SVGFELightElement::parseMappedAttribute(MappedAttribute* attr)
55 const String& value = attr->value();
56 if (attr->name() == SVGNames::azimuthAttr)
57 setAzimuthBaseValue(value.toFloat());
58 else if (attr->name() == SVGNames::elevationAttr)
59 setElevationBaseValue(value.toFloat());
60 else if (attr->name() == SVGNames::xAttr)
61 setXBaseValue(value.toFloat());
62 else if (attr->name() == SVGNames::yAttr)
63 setYBaseValue(value.toFloat());
64 else if (attr->name() == SVGNames::zAttr)
65 setZBaseValue(value.toFloat());
66 else if (attr->name() == SVGNames::pointsAtXAttr)
67 setPointsAtXBaseValue(value.toFloat());
68 else if (attr->name() == SVGNames::pointsAtYAttr)
69 setPointsAtYBaseValue(value.toFloat());
70 else if (attr->name() == SVGNames::pointsAtZAttr)
71 setPointsAtZBaseValue(value.toFloat());
72 else if (attr->name() == SVGNames::specularExponentAttr)
73 setSpecularExponentBaseValue(value.toFloat());
74 else if (attr->name() == SVGNames::limitingConeAngleAttr)
75 setLimitingConeAngleBaseValue(value.toFloat());
76 else
77 SVGElement::parseMappedAttribute(attr);
82 #endif // ENABLE(SVG)
84 // vim:ts=4:noet