| 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 |
| 32 #include "bindings/core/dart/DartSVGPathSeg.h" |
| 33 |
| 34 #include "bindings/core/dart/DartDOMWrapper.h" |
| 35 #include "bindings/core/dart/DartSVGPathSegArcAbs.h" |
| 36 #include "bindings/core/dart/DartSVGPathSegArcRel.h" |
| 37 #include "bindings/core/dart/DartSVGPathSegClosePath.h" |
| 38 #include "bindings/core/dart/DartSVGPathSegCurvetoCubicAbs.h" |
| 39 #include "bindings/core/dart/DartSVGPathSegCurvetoCubicRel.h" |
| 40 #include "bindings/core/dart/DartSVGPathSegCurvetoCubicSmoothAbs.h" |
| 41 #include "bindings/core/dart/DartSVGPathSegCurvetoCubicSmoothRel.h" |
| 42 #include "bindings/core/dart/DartSVGPathSegCurvetoQuadraticAbs.h" |
| 43 #include "bindings/core/dart/DartSVGPathSegCurvetoQuadraticRel.h" |
| 44 #include "bindings/core/dart/DartSVGPathSegCurvetoQuadraticSmoothAbs.h" |
| 45 #include "bindings/core/dart/DartSVGPathSegCurvetoQuadraticSmoothRel.h" |
| 46 #include "bindings/core/dart/DartSVGPathSegLinetoAbs.h" |
| 47 #include "bindings/core/dart/DartSVGPathSegLinetoHorizontalAbs.h" |
| 48 #include "bindings/core/dart/DartSVGPathSegLinetoHorizontalRel.h" |
| 49 #include "bindings/core/dart/DartSVGPathSegLinetoRel.h" |
| 50 #include "bindings/core/dart/DartSVGPathSegLinetoVerticalAbs.h" |
| 51 #include "bindings/core/dart/DartSVGPathSegLinetoVerticalRel.h" |
| 52 #include "bindings/core/dart/DartSVGPathSegMovetoAbs.h" |
| 53 #include "bindings/core/dart/DartSVGPathSegMovetoRel.h" |
| 54 #include "bindings/core/dart/DartWindow.h" |
| 55 |
| 56 |
| 57 namespace blink { |
| 58 |
| 59 Dart_Handle DartSVGPathSeg::createWrapper(DartDOMData* domData, SVGPathSeg* valu
e) |
| 60 { |
| 61 if (!value) |
| 62 return Dart_Null(); |
| 63 switch (value->pathSegType()) { |
| 64 case SVGPathSeg::PATHSEG_CLOSEPATH: |
| 65 return DartSVGPathSegClosePath::createWrapper(domData, static_cast<SVGPa
thSegClosePath*>(value)); |
| 66 case SVGPathSeg::PATHSEG_MOVETO_ABS: |
| 67 return DartSVGPathSegMovetoAbs::createWrapper(domData, static_cast<SVGPa
thSegMovetoAbs*>(value)); |
| 68 case SVGPathSeg::PATHSEG_MOVETO_REL: |
| 69 return DartSVGPathSegMovetoRel::createWrapper(domData, static_cast<SVGPa
thSegMovetoRel*>(value)); |
| 70 case SVGPathSeg::PATHSEG_LINETO_ABS: |
| 71 return DartSVGPathSegLinetoAbs::createWrapper(domData, static_cast<SVGPa
thSegLinetoAbs*>(value)); |
| 72 case SVGPathSeg::PATHSEG_LINETO_REL: |
| 73 return DartSVGPathSegLinetoRel::createWrapper(domData, static_cast<SVGPa
thSegLinetoRel*>(value)); |
| 74 case SVGPathSeg::PATHSEG_CURVETO_CUBIC_ABS: |
| 75 return DartSVGPathSegCurvetoCubicAbs::createWrapper(domData, static_cast
<SVGPathSegCurvetoCubicAbs*>(value)); |
| 76 case SVGPathSeg::PATHSEG_CURVETO_CUBIC_REL: |
| 77 return DartSVGPathSegCurvetoCubicRel::createWrapper(domData, static_cast
<SVGPathSegCurvetoCubicRel*>(value)); |
| 78 case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_ABS: |
| 79 return DartSVGPathSegCurvetoQuadraticAbs::createWrapper(domData, static_
cast<SVGPathSegCurvetoQuadraticAbs*>(value)); |
| 80 case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_REL: |
| 81 return DartSVGPathSegCurvetoQuadraticRel::createWrapper(domData, static_
cast<SVGPathSegCurvetoQuadraticRel*>(value)); |
| 82 case SVGPathSeg::PATHSEG_ARC_ABS: |
| 83 return DartSVGPathSegArcAbs::createWrapper(domData, static_cast<SVGPathS
egArcAbs*>(value)); |
| 84 case SVGPathSeg::PATHSEG_ARC_REL: |
| 85 return DartSVGPathSegArcRel::createWrapper(domData, static_cast<SVGPathS
egArcRel*>(value)); |
| 86 case SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_ABS: |
| 87 return DartSVGPathSegLinetoHorizontalAbs::createWrapper(domData, static_
cast<SVGPathSegLinetoHorizontalAbs*>(value)); |
| 88 case SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_REL: |
| 89 return DartSVGPathSegLinetoHorizontalRel::createWrapper(domData, static_
cast<SVGPathSegLinetoHorizontalRel*>(value)); |
| 90 case SVGPathSeg::PATHSEG_LINETO_VERTICAL_ABS: |
| 91 return DartSVGPathSegLinetoVerticalAbs::createWrapper(domData, static_ca
st<SVGPathSegLinetoVerticalAbs*>(value)); |
| 92 case SVGPathSeg::PATHSEG_LINETO_VERTICAL_REL: |
| 93 return DartSVGPathSegLinetoVerticalRel::createWrapper(domData, static_ca
st<SVGPathSegLinetoVerticalRel*>(value)); |
| 94 case SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: |
| 95 return DartSVGPathSegCurvetoCubicSmoothAbs::createWrapper(domData, stati
c_cast<SVGPathSegCurvetoCubicSmoothAbs*>(value)); |
| 96 case SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_REL: |
| 97 return DartSVGPathSegCurvetoCubicSmoothRel::createWrapper(domData, stati
c_cast<SVGPathSegCurvetoCubicSmoothRel*>(value)); |
| 98 case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: |
| 99 return DartSVGPathSegCurvetoQuadraticSmoothAbs::createWrapper(domData, s
tatic_cast<SVGPathSegCurvetoQuadraticSmoothAbs*>(value)); |
| 100 case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: |
| 101 return DartSVGPathSegCurvetoQuadraticSmoothRel::createWrapper(domData, s
tatic_cast<SVGPathSegCurvetoQuadraticSmoothRel*>(value)); |
| 102 } |
| 103 ASSERT_NOT_REACHED(); |
| 104 return Dart_Null(); |
| 105 } |
| 106 |
| 107 } |
| OLD | NEW |