KHtml

RadialGradientAttributes.h
1 /*
2  Copyright (C) 2006 Nikolas Zimmermann <[email protected]>
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 RadialGradientAttributes_h
23 #define RadialGradientAttributes_h
24 
25 #include "GradientAttributes.h"
26 
27 #if ENABLE(SVG)
28 
29 namespace WebCore
30 {
31 struct RadialGradientAttributes : GradientAttributes {
32  RadialGradientAttributes()
33  : m_cx(0.5)
34  , m_cy(0.5)
35  , m_r(0.5)
36  , m_fx(0.0)
37  , m_fy(0.0)
38  , m_cxSet(false)
39  , m_cySet(false)
40  , m_rSet(false)
41  , m_fxSet(false)
42  , m_fySet(false)
43  {
44  }
45 
46  double cx() const
47  {
48  return m_cx;
49  }
50  double cy() const
51  {
52  return m_cy;
53  }
54  double r() const
55  {
56  return m_r;
57  }
58  double fx() const
59  {
60  return m_fx;
61  }
62  double fy() const
63  {
64  return m_fy;
65  }
66 
67  void setCx(double value)
68  {
69  m_cx = value;
70  m_cxSet = true;
71  }
72  void setCy(double value)
73  {
74  m_cy = value;
75  m_cySet = true;
76  }
77  void setR(double value)
78  {
79  m_r = value;
80  m_rSet = true;
81  }
82  void setFx(double value)
83  {
84  m_fx = value;
85  m_fxSet = true;
86  }
87  void setFy(double value)
88  {
89  m_fy = value;
90  m_fySet = true;
91  }
92 
93  bool hasCx() const
94  {
95  return m_cxSet;
96  }
97  bool hasCy() const
98  {
99  return m_cySet;
100  }
101  bool hasR() const
102  {
103  return m_rSet;
104  }
105  bool hasFx() const
106  {
107  return m_fxSet;
108  }
109  bool hasFy() const
110  {
111  return m_fySet;
112  }
113 
114 private:
115  // Properties
116  double m_cx;
117  double m_cy;
118  double m_r;
119  double m_fx;
120  double m_fy;
121 
122  // Property states
123  bool m_cxSet : 1;
124  bool m_cySet : 1;
125  bool m_rSet : 1;
126  bool m_fxSet : 1;
127  bool m_fySet : 1;
128 };
129 
130 } // namespace WebCore
131 
132 #endif // ENABLE(SVG)
133 #endif
134 
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 26 2021 22:48:06 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.