OLD | NEW |
| (Empty) |
1 // Copyright 2011, Google Inc. | |
2 // All rights reserved. | |
3 // | |
4 // Redistribution and use in source and binary forms, with or without | |
5 // modification, are permitted provided that the following conditions are | |
6 // met: | |
7 // | |
8 // * Redistributions of source code must retain the above copyright | |
9 // notice, this list of conditions and the following disclaimer. | |
10 // * Redistributions in binary form must reproduce the above | |
11 // copyright notice, this list of conditions and the following disclaimer | |
12 // in the documentation and/or other materials provided with the | |
13 // distribution. | |
14 // * Neither the name of Google Inc. nor the names of its | |
15 // contributors may be used to endorse or promote products derived from | |
16 // this software without specific prior written permission. | |
17 // | |
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
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. | |
29 | |
30 #include "config.h" | |
31 #include "DartSVGPathSeg.h" | |
32 | |
33 #if ENABLE(SVG) | |
34 | |
35 #include "DartDOMWindow.h" | |
36 #include "DartDOMWrapper.h" | |
37 #include "DartSVGPathSegArcAbs.h" | |
38 #include "DartSVGPathSegArcRel.h" | |
39 #include "DartSVGPathSegClosePath.h" | |
40 #include "DartSVGPathSegCurvetoCubicAbs.h" | |
41 #include "DartSVGPathSegCurvetoCubicRel.h" | |
42 #include "DartSVGPathSegCurvetoCubicSmoothAbs.h" | |
43 #include "DartSVGPathSegCurvetoCubicSmoothRel.h" | |
44 #include "DartSVGPathSegCurvetoQuadraticAbs.h" | |
45 #include "DartSVGPathSegCurvetoQuadraticRel.h" | |
46 #include "DartSVGPathSegCurvetoQuadraticSmoothAbs.h" | |
47 #include "DartSVGPathSegCurvetoQuadraticSmoothRel.h" | |
48 #include "DartSVGPathSegLinetoAbs.h" | |
49 #include "DartSVGPathSegLinetoHorizontalAbs.h" | |
50 #include "DartSVGPathSegLinetoHorizontalRel.h" | |
51 #include "DartSVGPathSegLinetoRel.h" | |
52 #include "DartSVGPathSegLinetoVerticalAbs.h" | |
53 #include "DartSVGPathSegLinetoVerticalRel.h" | |
54 #include "DartSVGPathSegMovetoAbs.h" | |
55 #include "DartSVGPathSegMovetoRel.h" | |
56 | |
57 | |
58 namespace WebCore { | |
59 | |
60 Dart_Handle toDartValue(SVGPathSeg* value) | |
61 { | |
62 if (!value) | |
63 return 0; | |
64 switch (value->pathSegType()) { | |
65 case SVGPathSeg::PATHSEG_CLOSEPATH: | |
66 return toDartValue(static_cast<SVGPathSegClosePath*>(value)); | |
67 case SVGPathSeg::PATHSEG_MOVETO_ABS: | |
68 return toDartValue(static_cast<SVGPathSegMovetoAbs*>(value)); | |
69 case SVGPathSeg::PATHSEG_MOVETO_REL: | |
70 return toDartValue(static_cast<SVGPathSegMovetoRel*>(value)); | |
71 case SVGPathSeg::PATHSEG_LINETO_ABS: | |
72 return toDartValue(static_cast<SVGPathSegLinetoAbs*>(value)); | |
73 case SVGPathSeg::PATHSEG_LINETO_REL: | |
74 return toDartValue(static_cast<SVGPathSegLinetoRel*>(value)); | |
75 case SVGPathSeg::PATHSEG_CURVETO_CUBIC_ABS: | |
76 return toDartValue(static_cast<SVGPathSegCurvetoCubicAbs*>(value)); | |
77 case SVGPathSeg::PATHSEG_CURVETO_CUBIC_REL: | |
78 return toDartValue(static_cast<SVGPathSegCurvetoCubicRel*>(value)); | |
79 case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_ABS: | |
80 return toDartValue(static_cast<SVGPathSegCurvetoQuadraticAbs*>(value)); | |
81 case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_REL: | |
82 return toDartValue(static_cast<SVGPathSegCurvetoQuadraticRel*>(value)); | |
83 case SVGPathSeg::PATHSEG_ARC_ABS: | |
84 return toDartValue(static_cast<SVGPathSegArcAbs*>(value)); | |
85 case SVGPathSeg::PATHSEG_ARC_REL: | |
86 return toDartValue(static_cast<SVGPathSegArcRel*>(value)); | |
87 case SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_ABS: | |
88 return toDartValue(static_cast<SVGPathSegLinetoHorizontalAbs*>(value)); | |
89 case SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_REL: | |
90 return toDartValue(static_cast<SVGPathSegLinetoHorizontalRel*>(value)); | |
91 case SVGPathSeg::PATHSEG_LINETO_VERTICAL_ABS: | |
92 return toDartValue(static_cast<SVGPathSegLinetoVerticalAbs*>(value)); | |
93 case SVGPathSeg::PATHSEG_LINETO_VERTICAL_REL: | |
94 return toDartValue(static_cast<SVGPathSegLinetoVerticalRel*>(value)); | |
95 case SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: | |
96 return toDartValue(static_cast<SVGPathSegCurvetoCubicSmoothAbs*>(value))
; | |
97 case SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_REL: | |
98 return toDartValue(static_cast<SVGPathSegCurvetoCubicSmoothRel*>(value))
; | |
99 case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: | |
100 return toDartValue(static_cast<SVGPathSegCurvetoQuadraticSmoothAbs*>(val
ue)); | |
101 case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: | |
102 return toDartValue(static_cast<SVGPathSegCurvetoQuadraticSmoothRel*>(val
ue)); | |
103 } | |
104 ASSERT_NOT_REACHED(); | |
105 return 0; | |
106 } | |
107 | |
108 } | |
109 | |
110 #endif // ENABLE(SVG) | |
OLD | NEW |