Remove unused variable movedSectionLogicalTop from table layout code.
[chromium-blink-merge.git] / third_party / WebKit / Source / core / svg / LinearGradientAttributes.h
blobe1f35677a12e0d57740715831105f574294a3cf6
1 /*
2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
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.
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.
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.
20 #ifndef LinearGradientAttributes_h
21 #define LinearGradientAttributes_h
23 #include "core/svg/GradientAttributes.h"
24 #include "core/svg/SVGLength.h"
25 #include "platform/heap/Handle.h"
27 namespace blink {
29 struct LinearGradientAttributes : GradientAttributes {
30 DISALLOW_ALLOCATION();
31 public:
32 LinearGradientAttributes()
33 : m_x1(SVGLength::create(SVGLengthMode::Width))
34 , m_y1(SVGLength::create(SVGLengthMode::Height))
35 , m_x2(SVGLength::create(SVGLengthMode::Width))
36 , m_y2(SVGLength::create(SVGLengthMode::Height))
37 , m_x1Set(false)
38 , m_y1Set(false)
39 , m_x2Set(false)
40 , m_y2Set(false)
42 m_x2->setValueAsString("100%", ASSERT_NO_EXCEPTION);
45 SVGLength* x1() const { return m_x1.get(); }
46 SVGLength* y1() const { return m_y1.get(); }
47 SVGLength* x2() const { return m_x2.get(); }
48 SVGLength* y2() const { return m_y2.get(); }
50 void setX1(PassRefPtrWillBeRawPtr<SVGLength> value) { m_x1 = value; m_x1Set = true; }
51 void setY1(PassRefPtrWillBeRawPtr<SVGLength> value) { m_y1 = value; m_y1Set = true; }
52 void setX2(PassRefPtrWillBeRawPtr<SVGLength> value) { m_x2 = value; m_x2Set = true; }
53 void setY2(PassRefPtrWillBeRawPtr<SVGLength> value) { m_y2 = value; m_y2Set = true; }
55 bool hasX1() const { return m_x1Set; }
56 bool hasY1() const { return m_y1Set; }
57 bool hasX2() const { return m_x2Set; }
58 bool hasY2() const { return m_y2Set; }
60 DEFINE_INLINE_TRACE()
62 visitor->trace(m_x1);
63 visitor->trace(m_y1);
64 visitor->trace(m_x2);
65 visitor->trace(m_y2);
68 private:
69 // Properties
70 RefPtrWillBeMember<SVGLength> m_x1;
71 RefPtrWillBeMember<SVGLength> m_y1;
72 RefPtrWillBeMember<SVGLength> m_x2;
73 RefPtrWillBeMember<SVGLength> m_y2;
75 // Property states
76 bool m_x1Set : 1;
77 bool m_y1Set : 1;
78 bool m_x2Set : 1;
79 bool m_y2Set : 1;
82 #if ENABLE(OILPAN)
83 // Wrapper object for the LinearGradientAttributes part object.
84 class LinearGradientAttributesWrapper : public GarbageCollectedFinalized<LinearGradientAttributesWrapper> {
85 public:
86 static LinearGradientAttributesWrapper* create()
88 return new LinearGradientAttributesWrapper;
91 LinearGradientAttributes& attributes() { return m_attributes; }
92 void set(const LinearGradientAttributes& attributes) { m_attributes = attributes; }
93 DEFINE_INLINE_TRACE() { visitor->trace(m_attributes); }
95 private:
96 LinearGradientAttributesWrapper()
100 LinearGradientAttributes m_attributes;
102 #endif
104 } // namespace blink
106 #endif
108 // vim:ts=4:noet