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 RadialGradientAttributes_h 21 #define RadialGradientAttributes_h 22 23 #if ENABLE(SVG) 24 #include "GradientAttributes.h" 25 26 namespace WebCore { 27 struct RadialGradientAttributes : GradientAttributes { RadialGradientAttributesRadialGradientAttributes28 RadialGradientAttributes() 29 : m_cx(LengthModeWidth, "50%") 30 , m_cy(LengthModeWidth, "50%") 31 , m_r(LengthModeWidth, "50%") 32 , m_fx() 33 , m_fy() 34 , m_cxSet(false) 35 , m_cySet(false) 36 , m_rSet(false) 37 , m_fxSet(false) 38 , m_fySet(false) 39 { 40 } 41 cxRadialGradientAttributes42 SVGLength cx() const { return m_cx; } cyRadialGradientAttributes43 SVGLength cy() const { return m_cy; } rRadialGradientAttributes44 SVGLength r() const { return m_r; } fxRadialGradientAttributes45 SVGLength fx() const { return m_fx; } fyRadialGradientAttributes46 SVGLength fy() const { return m_fy; } 47 setCxRadialGradientAttributes48 void setCx(const SVGLength& value) { m_cx = value; m_cxSet = true; } setCyRadialGradientAttributes49 void setCy(const SVGLength& value) { m_cy = value; m_cySet = true; } setRRadialGradientAttributes50 void setR(const SVGLength& value) { m_r = value; m_rSet = true; } setFxRadialGradientAttributes51 void setFx(const SVGLength& value) { m_fx = value; m_fxSet = true; } setFyRadialGradientAttributes52 void setFy(const SVGLength& value) { m_fy = value; m_fySet = true; } 53 hasCxRadialGradientAttributes54 bool hasCx() const { return m_cxSet; } hasCyRadialGradientAttributes55 bool hasCy() const { return m_cySet; } hasRRadialGradientAttributes56 bool hasR() const { return m_rSet; } hasFxRadialGradientAttributes57 bool hasFx() const { return m_fxSet; } hasFyRadialGradientAttributes58 bool hasFy() const { return m_fySet; } 59 60 private: 61 // Properties 62 SVGLength m_cx; 63 SVGLength m_cy; 64 SVGLength m_r; 65 SVGLength m_fx; 66 SVGLength m_fy; 67 68 // Property states 69 bool m_cxSet : 1; 70 bool m_cySet : 1; 71 bool m_rSet : 1; 72 bool m_fxSet : 1; 73 bool m_fySet : 1; 74 }; 75 76 } // namespace WebCore 77 78 #endif // ENABLE(SVG) 79 #endif 80 81 // vim:ts=4:noet 82