OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2011. 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 SVGAnimatedType_h | 20 #ifndef SVGAnimatedType_h |
21 #define SVGAnimatedType_h | 21 #define SVGAnimatedType_h |
22 | 22 |
23 #include "core/platform/graphics/FloatRect.h" | |
24 #include "core/svg/SVGAngle.h" | 23 #include "core/svg/SVGAngle.h" |
25 #include "core/svg/SVGColor.h" | 24 #include "core/svg/SVGColor.h" |
26 #include "core/svg/SVGLength.h" | 25 #include "core/svg/SVGLength.h" |
27 #include "core/svg/SVGLengthList.h" | 26 #include "core/svg/SVGLengthList.h" |
28 #include "core/svg/SVGNumberList.h" | 27 #include "core/svg/SVGNumberList.h" |
29 #include "core/svg/SVGPointList.h" | 28 #include "core/svg/SVGPointList.h" |
30 #include "core/svg/SVGPreserveAspectRatio.h" | 29 #include "core/svg/SVGPreserveAspectRatio.h" |
| 30 #include "core/svg/SVGRect.h" |
31 #include "core/svg/SVGTransformList.h" | 31 #include "core/svg/SVGTransformList.h" |
32 #include "core/svg/properties/SVGPropertyInfo.h" | 32 #include "core/svg/properties/SVGPropertyInfo.h" |
33 | 33 |
34 namespace WebCore { | 34 namespace WebCore { |
35 | 35 |
36 class SVGPathByteStream; | 36 class SVGPathByteStream; |
37 | 37 |
38 class SVGAnimatedType { | 38 class SVGAnimatedType { |
39 WTF_MAKE_FAST_ALLOCATED; | 39 WTF_MAKE_FAST_ALLOCATED; |
40 public: | 40 public: |
41 virtual ~SVGAnimatedType(); | 41 virtual ~SVGAnimatedType(); |
42 | 42 |
43 static PassOwnPtr<SVGAnimatedType> createAngleAndEnumeration(std::pair<SVGAn
gle, unsigned>*); | 43 static PassOwnPtr<SVGAnimatedType> createAngleAndEnumeration(std::pair<SVGAn
gle, unsigned>*); |
44 static PassOwnPtr<SVGAnimatedType> createBoolean(bool*); | 44 static PassOwnPtr<SVGAnimatedType> createBoolean(bool*); |
45 static PassOwnPtr<SVGAnimatedType> createColor(Color*); | 45 static PassOwnPtr<SVGAnimatedType> createColor(Color*); |
46 static PassOwnPtr<SVGAnimatedType> createEnumeration(unsigned*); | 46 static PassOwnPtr<SVGAnimatedType> createEnumeration(unsigned*); |
47 static PassOwnPtr<SVGAnimatedType> createInteger(int*); | 47 static PassOwnPtr<SVGAnimatedType> createInteger(int*); |
48 static PassOwnPtr<SVGAnimatedType> createIntegerOptionalInteger(std::pair<in
t, int>*); | 48 static PassOwnPtr<SVGAnimatedType> createIntegerOptionalInteger(std::pair<in
t, int>*); |
49 static PassOwnPtr<SVGAnimatedType> createLength(SVGLength*); | 49 static PassOwnPtr<SVGAnimatedType> createLength(SVGLength*); |
50 static PassOwnPtr<SVGAnimatedType> createLengthList(SVGLengthList*); | 50 static PassOwnPtr<SVGAnimatedType> createLengthList(SVGLengthList*); |
51 static PassOwnPtr<SVGAnimatedType> createNumber(float*); | 51 static PassOwnPtr<SVGAnimatedType> createNumber(float*); |
52 static PassOwnPtr<SVGAnimatedType> createNumberList(SVGNumberList*); | 52 static PassOwnPtr<SVGAnimatedType> createNumberList(SVGNumberList*); |
53 static PassOwnPtr<SVGAnimatedType> createNumberOptionalNumber(std::pair<floa
t, float>*); | 53 static PassOwnPtr<SVGAnimatedType> createNumberOptionalNumber(std::pair<floa
t, float>*); |
54 static PassOwnPtr<SVGAnimatedType> createPath(PassOwnPtr<SVGPathByteStream>)
; | 54 static PassOwnPtr<SVGAnimatedType> createPath(PassOwnPtr<SVGPathByteStream>)
; |
55 static PassOwnPtr<SVGAnimatedType> createPointList(SVGPointList*); | 55 static PassOwnPtr<SVGAnimatedType> createPointList(SVGPointList*); |
56 static PassOwnPtr<SVGAnimatedType> createPreserveAspectRatio(SVGPreserveAspe
ctRatio*); | 56 static PassOwnPtr<SVGAnimatedType> createPreserveAspectRatio(SVGPreserveAspe
ctRatio*); |
57 static PassOwnPtr<SVGAnimatedType> createRect(FloatRect*); | 57 static PassOwnPtr<SVGAnimatedType> createRect(SVGRect*); |
58 static PassOwnPtr<SVGAnimatedType> createString(String*); | 58 static PassOwnPtr<SVGAnimatedType> createString(String*); |
59 static PassOwnPtr<SVGAnimatedType> createTransformList(SVGTransformList*); | 59 static PassOwnPtr<SVGAnimatedType> createTransformList(SVGTransformList*); |
60 static bool supportsAnimVal(AnimatedPropertyType); | 60 static bool supportsAnimVal(AnimatedPropertyType); |
61 | 61 |
62 AnimatedPropertyType type() const { return m_type; } | 62 AnimatedPropertyType type() const { return m_type; } |
63 | 63 |
64 // Non-mutable accessors. | 64 // Non-mutable accessors. |
65 const std::pair<SVGAngle, unsigned>& angleAndEnumeration() const | 65 const std::pair<SVGAngle, unsigned>& angleAndEnumeration() const |
66 { | 66 { |
67 ASSERT(m_type == AnimatedAngle); | 67 ASSERT(m_type == AnimatedAngle); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 ASSERT(m_type == AnimatedPoints); | 139 ASSERT(m_type == AnimatedPoints); |
140 return *m_data.pointList; | 140 return *m_data.pointList; |
141 } | 141 } |
142 | 142 |
143 const SVGPreserveAspectRatio& preserveAspectRatio() const | 143 const SVGPreserveAspectRatio& preserveAspectRatio() const |
144 { | 144 { |
145 ASSERT(m_type == AnimatedPreserveAspectRatio); | 145 ASSERT(m_type == AnimatedPreserveAspectRatio); |
146 return *m_data.preserveAspectRatio; | 146 return *m_data.preserveAspectRatio; |
147 } | 147 } |
148 | 148 |
149 const FloatRect& rect() const | 149 const SVGRect& rect() const |
150 { | 150 { |
151 ASSERT(m_type == AnimatedRect); | 151 ASSERT(m_type == AnimatedRect); |
152 return *m_data.rect; | 152 return *m_data.rect; |
153 } | 153 } |
154 | 154 |
155 const String& string() const | 155 const String& string() const |
156 { | 156 { |
157 ASSERT(m_type == AnimatedString); | 157 ASSERT(m_type == AnimatedString); |
158 return *m_data.string; | 158 return *m_data.string; |
159 } | 159 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 ASSERT(m_type == AnimatedPoints); | 242 ASSERT(m_type == AnimatedPoints); |
243 return *m_data.pointList; | 243 return *m_data.pointList; |
244 } | 244 } |
245 | 245 |
246 SVGPreserveAspectRatio& preserveAspectRatio() | 246 SVGPreserveAspectRatio& preserveAspectRatio() |
247 { | 247 { |
248 ASSERT(m_type == AnimatedPreserveAspectRatio); | 248 ASSERT(m_type == AnimatedPreserveAspectRatio); |
249 return *m_data.preserveAspectRatio; | 249 return *m_data.preserveAspectRatio; |
250 } | 250 } |
251 | 251 |
252 FloatRect& rect() | 252 SVGRect& rect() |
253 { | 253 { |
254 ASSERT(m_type == AnimatedRect); | 254 ASSERT(m_type == AnimatedRect); |
255 return *m_data.rect; | 255 return *m_data.rect; |
256 } | 256 } |
257 | 257 |
258 String& string() | 258 String& string() |
259 { | 259 { |
260 ASSERT(m_type == AnimatedString); | 260 ASSERT(m_type == AnimatedString); |
261 return *m_data.string; | 261 return *m_data.string; |
262 } | 262 } |
(...skipping 25 matching lines...) Expand all Loading... |
288 int* integer; | 288 int* integer; |
289 std::pair<int, int>* integerOptionalInteger; | 289 std::pair<int, int>* integerOptionalInteger; |
290 SVGLength* length; | 290 SVGLength* length; |
291 SVGLengthList* lengthList; | 291 SVGLengthList* lengthList; |
292 float* number; | 292 float* number; |
293 SVGNumberList* numberList; | 293 SVGNumberList* numberList; |
294 std::pair<float, float>* numberOptionalNumber; | 294 std::pair<float, float>* numberOptionalNumber; |
295 SVGPathByteStream* path; | 295 SVGPathByteStream* path; |
296 SVGPreserveAspectRatio* preserveAspectRatio; | 296 SVGPreserveAspectRatio* preserveAspectRatio; |
297 SVGPointList* pointList; | 297 SVGPointList* pointList; |
298 FloatRect* rect; | 298 SVGRect* rect; |
299 String* string; | 299 String* string; |
300 SVGTransformList* transformList; | 300 SVGTransformList* transformList; |
301 } m_data; | 301 } m_data; |
302 }; | 302 }; |
303 | 303 |
304 } // namespace WebCore | 304 } // namespace WebCore |
305 | 305 |
306 #endif // SVGAnimatedType_h | 306 #endif // SVGAnimatedType_h |
OLD | NEW |