| 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 | #pragma once |
| 21 | |
| 22 | #include "GradientAttributes.h" |
| 23 | |
| 24 | namespace WebCore { |
| 25 | |
| 26 | struct RadialGradientAttributes : GradientAttributes { |
| 27 | RadialGradientAttributes() |
| 28 | : m_cx(LengthModeWidth, "50%" ) |
| 29 | , m_cy(LengthModeWidth, "50%" ) |
| 30 | , m_r(LengthModeWidth, "50%" ) |
| 31 | , m_cxSet(false) |
| 32 | , m_cySet(false) |
| 33 | , m_rSet(false) |
| 34 | , m_fxSet(false) |
| 35 | , m_fySet(false) |
| 36 | , m_frSet(false) |
| 37 | { |
| 38 | } |
| 39 | |
| 40 | SVGLengthValue cx() const { return m_cx; } |
| 41 | SVGLengthValue cy() const { return m_cy; } |
| 42 | SVGLengthValue r() const { return m_r; } |
| 43 | SVGLengthValue fx() const { return m_fx; } |
| 44 | SVGLengthValue fy() const { return m_fy; } |
| 45 | SVGLengthValue fr() const { return m_fr; } |
| 46 | |
| 47 | void setCx(SVGLengthValue value) { m_cx = value; m_cxSet = true; } |
| 48 | void setCy(SVGLengthValue value) { m_cy = value; m_cySet = true; } |
| 49 | void setR(SVGLengthValue value) { m_r = value; m_rSet = true; } |
| 50 | void setFx(SVGLengthValue value) { m_fx = value; m_fxSet = true; } |
| 51 | void setFy(SVGLengthValue value) { m_fy = value; m_fySet = true; } |
| 52 | void setFr(SVGLengthValue value) { m_fr = value; m_frSet = true; } |
| 53 | |
| 54 | bool hasCx() const { return m_cxSet; } |
| 55 | bool hasCy() const { return m_cySet; } |
| 56 | bool hasR() const { return m_rSet; } |
| 57 | bool hasFx() const { return m_fxSet; } |
| 58 | bool hasFy() const { return m_fySet; } |
| 59 | bool hasFr() const { return m_frSet; } |
| 60 | |
| 61 | private: |
| 62 | // Properties |
| 63 | SVGLengthValue m_cx; |
| 64 | SVGLengthValue m_cy; |
| 65 | SVGLengthValue m_r; |
| 66 | SVGLengthValue m_fx; |
| 67 | SVGLengthValue m_fy; |
| 68 | SVGLengthValue m_fr; |
| 69 | |
| 70 | // Property states |
| 71 | bool m_cxSet : 1; |
| 72 | bool m_cySet : 1; |
| 73 | bool m_rSet : 1; |
| 74 | bool m_fxSet : 1; |
| 75 | bool m_fySet : 1; |
| 76 | bool m_frSet : 1; |
| 77 | }; |
| 78 | |
| 79 | } // namespace WebCore |
| 80 | |