OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef SVGPoint_h | 31 #ifndef SVGPoint_h |
32 #define SVGPoint_h | 32 #define SVGPoint_h |
33 | 33 |
| 34 #include "core/svg/SVGParsingError.h" |
34 #include "core/svg/properties/SVGPropertyHelper.h" | 35 #include "core/svg/properties/SVGPropertyHelper.h" |
35 #include "platform/geometry/FloatPoint.h" | 36 #include "platform/geometry/FloatPoint.h" |
36 | 37 |
37 namespace blink { | 38 namespace blink { |
38 | 39 |
39 class AffineTransform; | 40 class AffineTransform; |
40 class SVGPointTearOff; | 41 class SVGPointTearOff; |
41 | 42 |
42 class SVGPoint : public SVGPropertyHelper<SVGPoint> { | 43 class SVGPoint : public SVGPropertyHelper<SVGPoint> { |
43 public: | 44 public: |
(...skipping 15 matching lines...) Expand all Loading... |
59 void setValue(const FloatPoint& value) { m_value = value; } | 60 void setValue(const FloatPoint& value) { m_value = value; } |
60 | 61 |
61 float x() const { return m_value.x(); } | 62 float x() const { return m_value.x(); } |
62 float y() const { return m_value.y(); } | 63 float y() const { return m_value.y(); } |
63 void setX(float f) { m_value.setX(f); } | 64 void setX(float f) { m_value.setX(f); } |
64 void setY(float f) { m_value.setY(f); } | 65 void setY(float f) { m_value.setY(f); } |
65 | 66 |
66 FloatPoint matrixTransform(const AffineTransform&) const; | 67 FloatPoint matrixTransform(const AffineTransform&) const; |
67 | 68 |
68 String valueAsString() const override; | 69 String valueAsString() const override; |
69 void setValueAsString(const String&, ExceptionState&); | 70 SVGParsingError setValueAsString(const String&); |
70 | 71 |
71 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; | 72 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; |
72 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from, PassRefPtrWillBeRawP
tr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndOfDuratio
nValue, SVGElement* contextElement) override; | 73 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from, PassRefPtrWillBeRawP
tr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndOfDuratio
nValue, SVGElement* contextElement) override; |
73 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt* contextElement) override; | 74 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt* contextElement) override; |
74 | 75 |
75 static AnimatedPropertyType classType() { return AnimatedPoint; } | 76 static AnimatedPropertyType classType() { return AnimatedPoint; } |
76 | 77 |
77 private: | 78 private: |
78 SVGPoint(); | 79 SVGPoint(); |
79 explicit SVGPoint(const FloatPoint&); | 80 explicit SVGPoint(const FloatPoint&); |
80 | 81 |
81 template<typename CharType> | 82 template<typename CharType> |
82 void parse(const CharType*& ptr, const CharType* end, ExceptionState&); | 83 bool parse(const CharType*& ptr, const CharType* end); |
83 | 84 |
84 FloatPoint m_value; | 85 FloatPoint m_value; |
85 }; | 86 }; |
86 | 87 |
87 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGPoint); | 88 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGPoint); |
88 | 89 |
89 } // namespace blink | 90 } // namespace blink |
90 | 91 |
91 #endif // SVGPoint_h | 92 #endif // SVGPoint_h |
OLD | NEW |