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.
24 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
25 #include "SVGFELightElement.h"
31 SVGFELightElement::SVGFELightElement(const QualifiedName
& tagName
, Document
* doc
)
32 : SVGElement(tagName
, doc
)
41 , m_specularExponent(1.0f
)
42 , m_limitingConeAngle(0.0f
)
46 SVGFELightElement::~SVGFELightElement()
50 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement
, float, Number
, number
, Azimuth
, azimuth
, SVGNames::azimuthAttr
, m_azimuth
)
51 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement
, float, Number
, number
, Elevation
, elevation
, SVGNames::elevationAttr
, m_elevation
)
52 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement
, float, Number
, number
, X
, x
, SVGNames::xAttr
, m_x
)
53 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement
, float, Number
, number
, Y
, y
, SVGNames::yAttr
, m_y
)
55 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement
, float, Number
, number
, Z
, z
, SVGNames::zAttr
, m_z
)
56 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement
, float, Number
, number
, PointsAtX
, pointsAtX
, SVGNames::pointsAtXAttr
, m_pointsAtX
)
57 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement
, float, Number
, number
, PointsAtY
, pointsAtY
, SVGNames::pointsAtYAttr
, m_pointsAtY
)
58 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement
, float, Number
, number
, PointsAtZ
, pointsAtZ
, SVGNames::pointsAtZAttr
, m_pointsAtZ
)
59 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement
, float, Number
, number
, SpecularExponent
, specularExponent
, SVGNames::specularExponentAttr
, m_specularExponent
)
60 ANIMATED_PROPERTY_DEFINITIONS(SVGFELightElement
, float, Number
, number
, LimitingConeAngle
, limitingConeAngle
, SVGNames::limitingConeAngleAttr
, m_limitingConeAngle
)
62 void SVGFELightElement::parseMappedAttribute(MappedAttribute
* attr
)
64 const String
& value
= attr
->value();
65 if (attr
->name() == SVGNames::azimuthAttr
)
66 setAzimuthBaseValue(value
.toFloat());
67 else if (attr
->name() == SVGNames::elevationAttr
)
68 setElevationBaseValue(value
.toFloat());
69 else if (attr
->name() == SVGNames::xAttr
)
70 setXBaseValue(value
.toFloat());
71 else if (attr
->name() == SVGNames::yAttr
)
72 setYBaseValue(value
.toFloat());
73 else if (attr
->name() == SVGNames::zAttr
)
74 setZBaseValue(value
.toFloat());
75 else if (attr
->name() == SVGNames::pointsAtXAttr
)
76 setPointsAtXBaseValue(value
.toFloat());
77 else if (attr
->name() == SVGNames::pointsAtYAttr
)
78 setPointsAtYBaseValue(value
.toFloat());
79 else if (attr
->name() == SVGNames::pointsAtZAttr
)
80 setPointsAtZBaseValue(value
.toFloat());
81 else if (attr
->name() == SVGNames::specularExponentAttr
)
82 setSpecularExponentBaseValue(value
.toFloat());
83 else if (attr
->name() == SVGNames::limitingConeAngleAttr
)
84 setLimitingConeAngleBaseValue(value
.toFloat());
86 SVGElement::parseMappedAttribute(attr
);