Home | History | Annotate | Download | only in svg
      1 /*
      2     Copyright (C) 2006 Nikolas Zimmermann <zimmermann (at) 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 #include "GradientAttributes.h"
     24 
     25 #if ENABLE(SVG)
     26 
     27 namespace WebCore {
     28     struct RadialGradientAttributes : GradientAttributes {
     29         RadialGradientAttributes()
     30             : m_cx(LengthModeWidth, "50%")
     31             , m_cy(LengthModeWidth, "50%")
     32             , m_r(LengthModeWidth, "50%")
     33             , m_fx()
     34             , m_fy()
     35             , m_cxSet(false)
     36             , m_cySet(false)
     37             , m_rSet(false)
     38             , m_fxSet(false)
     39             , m_fySet(false)
     40         {
     41         }
     42 
     43         SVGLength cx() const { return m_cx; }
     44         SVGLength cy() const { return m_cy; }
     45         SVGLength r() const { return m_r; }
     46         SVGLength fx() const { return m_fx; }
     47         SVGLength fy() const { return m_fy; }
     48 
     49         void setCx(const SVGLength& value) { m_cx = value; m_cxSet = true; }
     50         void setCy(const SVGLength& value) { m_cy = value; m_cySet = true; }
     51         void setR(const SVGLength& value) { m_r = value; m_rSet = true; }
     52         void setFx(const SVGLength& value) { m_fx = value; m_fxSet = true; }
     53         void setFy(const SVGLength& value) { m_fy = value; m_fySet = true; }
     54 
     55         bool hasCx() const { return m_cxSet; }
     56         bool hasCy() const { return m_cySet; }
     57         bool hasR() const { return m_rSet; }
     58         bool hasFx() const { return m_fxSet; }
     59         bool hasFy() const { return m_fySet; }
     60 
     61     private:
     62         // Properties
     63         SVGLength m_cx;
     64         SVGLength m_cy;
     65         SVGLength m_r;
     66         SVGLength m_fx;
     67         SVGLength m_fy;
     68 
     69         // Property states
     70         bool m_cxSet : 1;
     71         bool m_cySet : 1;
     72         bool m_rSet : 1;
     73         bool m_fxSet : 1;
     74         bool m_fySet : 1;
     75     };
     76 
     77 } // namespace WebCore
     78 
     79 #endif // ENABLE(SVG)
     80 #endif
     81 
     82 // vim:ts=4:noet
     83