OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 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 | 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, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 */ | 18 */ |
19 | 19 |
20 #ifndef SVGRect_h | 20 #ifndef SVGRect_h |
21 #define SVGRect_h | 21 #define SVGRect_h |
22 | 22 |
| 23 #include "core/svg/SVGParsingError.h" |
23 #include "core/svg/properties/SVGPropertyHelper.h" | 24 #include "core/svg/properties/SVGPropertyHelper.h" |
24 #include "platform/geometry/FloatRect.h" | 25 #include "platform/geometry/FloatRect.h" |
25 #include "wtf/Allocator.h" | 26 #include "wtf/Allocator.h" |
26 | 27 |
27 namespace blink { | 28 namespace blink { |
28 | 29 |
29 class SVGRectTearOff; | 30 class SVGRectTearOff; |
30 | 31 |
31 class SVGRect : public SVGPropertyHelper<SVGRect> { | 32 class SVGRect : public SVGPropertyHelper<SVGRect> { |
32 public: | 33 public: |
(...skipping 24 matching lines...) Expand all Loading... |
57 float x() const { return m_value.x(); } | 58 float x() const { return m_value.x(); } |
58 float y() const { return m_value.y(); } | 59 float y() const { return m_value.y(); } |
59 float width() const { return m_value.width(); } | 60 float width() const { return m_value.width(); } |
60 float height() const { return m_value.height(); } | 61 float height() const { return m_value.height(); } |
61 void setX(float f) { m_value.setX(f); } | 62 void setX(float f) { m_value.setX(f); } |
62 void setY(float f) { m_value.setY(f); } | 63 void setY(float f) { m_value.setY(f); } |
63 void setWidth(float f) { m_value.setWidth(f); } | 64 void setWidth(float f) { m_value.setWidth(f); } |
64 void setHeight(float f) { m_value.setHeight(f); } | 65 void setHeight(float f) { m_value.setHeight(f); } |
65 | 66 |
66 String valueAsString() const override; | 67 String valueAsString() const override; |
67 void setValueAsString(const String&, ExceptionState&); | 68 SVGParsingError setValueAsString(const String&); |
68 | 69 |
69 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; | 70 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; |
70 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from, PassRefPtrWillBeRawP
tr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndOfDuratio
nValue, SVGElement* contextElement) override; | 71 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from, PassRefPtrWillBeRawP
tr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndOfDuratio
nValue, SVGElement* contextElement) override; |
71 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt* contextElement) override; | 72 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt* contextElement) override; |
72 | 73 |
73 bool isValid() const { return m_isValid; } | 74 bool isValid() const { return m_isValid; } |
74 void setInvalid(); | 75 void setInvalid(); |
75 | 76 |
76 static AnimatedPropertyType classType() { return AnimatedRect; } | 77 static AnimatedPropertyType classType() { return AnimatedRect; } |
77 | 78 |
78 private: | 79 private: |
79 SVGRect(); | 80 SVGRect(); |
80 SVGRect(const FloatRect&); | 81 SVGRect(const FloatRect&); |
81 | 82 |
82 template<typename CharType> | 83 template<typename CharType> |
83 void parse(const CharType*& ptr, const CharType* end, ExceptionState&); | 84 bool parse(const CharType*& ptr, const CharType* end); |
84 | 85 |
85 bool m_isValid; | 86 bool m_isValid; |
86 FloatRect m_value; | 87 FloatRect m_value; |
87 }; | 88 }; |
88 | 89 |
89 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGRect); | 90 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGRect); |
90 | 91 |
91 } // namespace blink | 92 } // namespace blink |
92 | 93 |
93 #endif // SVGRect_h | 94 #endif // SVGRect_h |
OLD | NEW |