2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 #ifndef GradientAttributes_h
21 #define GradientAttributes_h
24 #include "SVGGradientElement.h"
25 #include "SVGLength.h"
29 struct GradientAttributes {
31 : m_spreadMethod(SVGSpreadMethodPad)
32 , m_gradientUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
33 , m_spreadMethodSet(false)
34 , m_gradientUnitsSet(false)
35 , m_gradientTransformSet(false)
40 SVGSpreadMethodType spreadMethod() const { return m_spreadMethod; }
41 SVGUnitTypes::SVGUnitType gradientUnits() const { return m_gradientUnits; }
42 AffineTransform gradientTransform() const { return m_gradientTransform; }
43 const Vector<Gradient::ColorStop>& stops() const { return m_stops; }
45 void setSpreadMethod(SVGSpreadMethodType value)
47 m_spreadMethod = value;
48 m_spreadMethodSet = true;
51 void setGradientUnits(SVGUnitTypes::SVGUnitType unitType)
53 m_gradientUnits = unitType;
54 m_gradientUnitsSet = true;
57 void setGradientTransform(const AffineTransform& value)
59 m_gradientTransform = value;
60 m_gradientTransformSet = true;
63 void setStops(const Vector<Gradient::ColorStop>& value)
69 bool hasSpreadMethod() const { return m_spreadMethodSet; }
70 bool hasGradientUnits() const { return m_gradientUnitsSet; }
71 bool hasGradientTransform() const { return m_gradientTransformSet; }
72 bool hasStops() const { return m_stopsSet; }
76 SVGSpreadMethodType m_spreadMethod;
77 SVGUnitTypes::SVGUnitType m_gradientUnits;
78 AffineTransform m_gradientTransform;
79 Vector<Gradient::ColorStop> m_stops;
82 bool m_spreadMethodSet : 1;
83 bool m_gradientUnitsSet : 1;
84 bool m_gradientTransformSet : 1;
88 } // namespace WebCore