• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
3  *
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.
8  *
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.
13  *
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.
18  */
19 
20 #ifndef LinearGradientAttributes_h
21 #define LinearGradientAttributes_h
22 
23 #if ENABLE(SVG)
24 #include "GradientAttributes.h"
25 
26 namespace WebCore {
27 struct LinearGradientAttributes : GradientAttributes {
LinearGradientAttributesLinearGradientAttributes28     LinearGradientAttributes()
29         : m_x1()
30         , m_y1()
31         , m_x2(LengthModeWidth, "100%")
32         , m_y2()
33         , m_x1Set(false)
34         , m_y1Set(false)
35         , m_x2Set(false)
36         , m_y2Set(false)
37     {
38     }
39 
x1LinearGradientAttributes40     SVGLength x1() const { return m_x1; }
y1LinearGradientAttributes41     SVGLength y1() const { return m_y1; }
x2LinearGradientAttributes42     SVGLength x2() const { return m_x2; }
y2LinearGradientAttributes43     SVGLength y2() const { return m_y2; }
44 
setX1LinearGradientAttributes45     void setX1(const SVGLength& value) { m_x1 = value; m_x1Set = true; }
setY1LinearGradientAttributes46     void setY1(const SVGLength& value) { m_y1 = value; m_y1Set = true; }
setX2LinearGradientAttributes47     void setX2(const SVGLength& value) { m_x2 = value; m_x2Set = true; }
setY2LinearGradientAttributes48     void setY2(const SVGLength& value) { m_y2 = value; m_y2Set = true; }
49 
hasX1LinearGradientAttributes50     bool hasX1() const { return m_x1Set; }
hasY1LinearGradientAttributes51     bool hasY1() const { return m_y1Set; }
hasX2LinearGradientAttributes52     bool hasX2() const { return m_x2Set; }
hasY2LinearGradientAttributes53     bool hasY2() const { return m_y2Set; }
54 
55 private:
56     // Properties
57     SVGLength m_x1;
58     SVGLength m_y1;
59     SVGLength m_x2;
60     SVGLength m_y2;
61 
62     // Property states
63     bool m_x1Set : 1;
64     bool m_y1Set : 1;
65     bool m_x2Set : 1;
66     bool m_y2Set : 1;
67 };
68 
69 } // namespace WebCore
70 
71 #endif // ENABLE(SVG)
72 #endif
73 
74 // vim:ts=4:noet
75