1 /* 2 Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> 3 4 This file is part of the KDE project 5 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. 10 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. 15 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. 20 */ 21 22 #ifndef LinearGradientAttributes_h 23 #define LinearGradientAttributes_h 24 25 #include "GradientAttributes.h" 26 27 #if ENABLE(SVG) 28 29 namespace WebCore { 30 struct LinearGradientAttributes : GradientAttributes { LinearGradientAttributesLinearGradientAttributes31 LinearGradientAttributes() 32 : m_x1(0.0) 33 , m_y1(0.0) 34 , m_x2(1.0) 35 , m_y2(0.0) 36 , m_x1Set(false) 37 , m_y1Set(false) 38 , m_x2Set(false) 39 , m_y2Set(false) 40 { 41 } 42 x1LinearGradientAttributes43 double x1() const { return m_x1; } y1LinearGradientAttributes44 double y1() const { return m_y1; } x2LinearGradientAttributes45 double x2() const { return m_x2; } y2LinearGradientAttributes46 double y2() const { return m_y2; } 47 setX1LinearGradientAttributes48 void setX1(double value) { m_x1 = value; m_x1Set = true; } setY1LinearGradientAttributes49 void setY1(double value) { m_y1 = value; m_y1Set = true; } setX2LinearGradientAttributes50 void setX2(double value) { m_x2 = value; m_x2Set = true; } setY2LinearGradientAttributes51 void setY2(double value) { m_y2 = value; m_y2Set = true; } 52 hasX1LinearGradientAttributes53 bool hasX1() const { return m_x1Set; } hasY1LinearGradientAttributes54 bool hasY1() const { return m_y1Set; } hasX2LinearGradientAttributes55 bool hasX2() const { return m_x2Set; } hasY2LinearGradientAttributes56 bool hasY2() const { return m_y2Set; } 57 58 private: 59 // Properties 60 double m_x1; 61 double m_y1; 62 double m_x2; 63 double m_y2; 64 65 // Property states 66 bool m_x1Set : 1; 67 bool m_y1Set : 1; 68 bool m_x2Set : 1; 69 bool m_y2Set : 1; 70 }; 71 72 } // namespace WebCore 73 74 #endif // ENABLE(SVG) 75 #endif 76 77 // vim:ts=4:noet 78