| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (C) 2010 Google Inc. 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 | |
| 31 #include "config.h" | |
| 32 #include "bindings/core/v8/V8SVGPathSeg.h" | |
| 33 | |
| 34 #include "bindings/core/v8/V8SVGPathSegArcAbs.h" | |
| 35 #include "bindings/core/v8/V8SVGPathSegArcRel.h" | |
| 36 #include "bindings/core/v8/V8SVGPathSegClosePath.h" | |
| 37 #include "bindings/core/v8/V8SVGPathSegCurvetoCubicAbs.h" | |
| 38 #include "bindings/core/v8/V8SVGPathSegCurvetoCubicRel.h" | |
| 39 #include "bindings/core/v8/V8SVGPathSegCurvetoCubicSmoothAbs.h" | |
| 40 #include "bindings/core/v8/V8SVGPathSegCurvetoCubicSmoothRel.h" | |
| 41 #include "bindings/core/v8/V8SVGPathSegCurvetoQuadraticAbs.h" | |
| 42 #include "bindings/core/v8/V8SVGPathSegCurvetoQuadraticRel.h" | |
| 43 #include "bindings/core/v8/V8SVGPathSegCurvetoQuadraticSmoothAbs.h" | |
| 44 #include "bindings/core/v8/V8SVGPathSegCurvetoQuadraticSmoothRel.h" | |
| 45 #include "bindings/core/v8/V8SVGPathSegLinetoAbs.h" | |
| 46 #include "bindings/core/v8/V8SVGPathSegLinetoHorizontalAbs.h" | |
| 47 #include "bindings/core/v8/V8SVGPathSegLinetoHorizontalRel.h" | |
| 48 #include "bindings/core/v8/V8SVGPathSegLinetoRel.h" | |
| 49 #include "bindings/core/v8/V8SVGPathSegLinetoVerticalAbs.h" | |
| 50 #include "bindings/core/v8/V8SVGPathSegLinetoVerticalRel.h" | |
| 51 #include "bindings/core/v8/V8SVGPathSegMovetoAbs.h" | |
| 52 #include "bindings/core/v8/V8SVGPathSegMovetoRel.h" | |
| 53 #include "bindings/core/v8/V8Window.h" | |
| 54 #include "bindings/v8/V8DOMWrapper.h" | |
| 55 | |
| 56 namespace WebCore { | |
| 57 | |
| 58 v8::Handle<v8::Object> wrap(SVGPathSeg* impl, v8::Handle<v8::Object> creationCon
text, v8::Isolate* isolate) | |
| 59 { | |
| 60 ASSERT(impl); | |
| 61 switch (impl->pathSegType()) { | |
| 62 case SVGPathSeg::PATHSEG_CLOSEPATH: | |
| 63 return wrap(static_cast<SVGPathSegClosePath*>(impl), creationContext, is
olate); | |
| 64 case SVGPathSeg::PATHSEG_MOVETO_ABS: | |
| 65 return wrap(static_cast<SVGPathSegMovetoAbs*>(impl), creationContext, is
olate); | |
| 66 case SVGPathSeg::PATHSEG_MOVETO_REL: | |
| 67 return wrap(static_cast<SVGPathSegMovetoRel*>(impl), creationContext, is
olate); | |
| 68 case SVGPathSeg::PATHSEG_LINETO_ABS: | |
| 69 return wrap(static_cast<SVGPathSegLinetoAbs*>(impl), creationContext, is
olate); | |
| 70 case SVGPathSeg::PATHSEG_LINETO_REL: | |
| 71 return wrap(static_cast<SVGPathSegLinetoRel*>(impl), creationContext, is
olate); | |
| 72 case SVGPathSeg::PATHSEG_CURVETO_CUBIC_ABS: | |
| 73 return wrap(static_cast<SVGPathSegCurvetoCubicAbs*>(impl), creationConte
xt, isolate); | |
| 74 case SVGPathSeg::PATHSEG_CURVETO_CUBIC_REL: | |
| 75 return wrap(static_cast<SVGPathSegCurvetoCubicRel*>(impl), creationConte
xt, isolate); | |
| 76 case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_ABS: | |
| 77 return wrap(static_cast<SVGPathSegCurvetoQuadraticAbs*>(impl), creationC
ontext, isolate); | |
| 78 case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_REL: | |
| 79 return wrap(static_cast<SVGPathSegCurvetoQuadraticRel*>(impl), creationC
ontext, isolate); | |
| 80 case SVGPathSeg::PATHSEG_ARC_ABS: | |
| 81 return wrap(static_cast<SVGPathSegArcAbs*>(impl), creationContext, isola
te); | |
| 82 case SVGPathSeg::PATHSEG_ARC_REL: | |
| 83 return wrap(static_cast<SVGPathSegArcRel*>(impl), creationContext, isola
te); | |
| 84 case SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_ABS: | |
| 85 return wrap(static_cast<SVGPathSegLinetoHorizontalAbs*>(impl), creationC
ontext, isolate); | |
| 86 case SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_REL: | |
| 87 return wrap(static_cast<SVGPathSegLinetoHorizontalRel*>(impl), creationC
ontext, isolate); | |
| 88 case SVGPathSeg::PATHSEG_LINETO_VERTICAL_ABS: | |
| 89 return wrap(static_cast<SVGPathSegLinetoVerticalAbs*>(impl), creationCon
text, isolate); | |
| 90 case SVGPathSeg::PATHSEG_LINETO_VERTICAL_REL: | |
| 91 return wrap(static_cast<SVGPathSegLinetoVerticalRel*>(impl), creationCon
text, isolate); | |
| 92 case SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: | |
| 93 return wrap(static_cast<SVGPathSegCurvetoCubicSmoothAbs*>(impl), creatio
nContext, isolate); | |
| 94 case SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_REL: | |
| 95 return wrap(static_cast<SVGPathSegCurvetoCubicSmoothRel*>(impl), creatio
nContext, isolate); | |
| 96 case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: | |
| 97 return wrap(static_cast<SVGPathSegCurvetoQuadraticSmoothAbs*>(impl), cre
ationContext, isolate); | |
| 98 case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: | |
| 99 return wrap(static_cast<SVGPathSegCurvetoQuadraticSmoothRel*>(impl), cre
ationContext, isolate); | |
| 100 } | |
| 101 ASSERT_NOT_REACHED(); | |
| 102 return V8SVGPathSeg::createWrapper(impl, creationContext, isolate); | |
| 103 } | |
| 104 | |
| 105 } // namespace WebCore | |
| OLD | NEW |