PageRenderTime 19ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/platform/external/webkit/WebCore/bindings/objc/DOMSVGPathSegInternal.mm

https://github.com/aharish/totoro-gb-opensource-update2
Objective C++ | 103 lines | 72 code | 6 blank | 25 comment | 1 complexity | edb5622242c80519a83abd1cea45d549 MD5 | raw file
  1/*
  2 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
  3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
  4 *
  5 * Redistribution and use in source and binary forms, with or without
  6 * modification, are permitted provided that the following conditions
  7 * are met:
  8 * 1. Redistributions of source code must retain the above copyright
  9 *    notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 *    notice, this list of conditions and the following disclaimer in the
 12 *    documentation and/or other materials provided with the distribution.
 13 *
 14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 25 */
 26 
 27#import "config.h"
 28
 29#if ENABLE(SVG)
 30
 31#import "DOMSVGPathSegInternal.h"
 32
 33#import "DOMSVGPathSegArcAbs.h"
 34#import "DOMSVGPathSegArcRel.h"
 35#import "DOMSVGPathSegClosePath.h"
 36#import "DOMSVGPathSegCurvetoCubicAbs.h"
 37#import "DOMSVGPathSegCurvetoCubicRel.h"
 38#import "DOMSVGPathSegCurvetoCubicSmoothAbs.h"
 39#import "DOMSVGPathSegCurvetoCubicSmoothRel.h"
 40#import "DOMSVGPathSegCurvetoQuadraticAbs.h"
 41#import "DOMSVGPathSegCurvetoQuadraticRel.h"
 42#import "DOMSVGPathSegCurvetoQuadraticSmoothAbs.h"
 43#import "DOMSVGPathSegCurvetoQuadraticSmoothRel.h"
 44#import "DOMSVGPathSegLinetoAbs.h"
 45#import "DOMSVGPathSegLinetoHorizontalAbs.h"
 46#import "DOMSVGPathSegLinetoHorizontalRel.h"
 47#import "DOMSVGPathSegLinetoRel.h"
 48#import "DOMSVGPathSegLinetoVerticalAbs.h"
 49#import "DOMSVGPathSegLinetoVerticalRel.h"
 50#import "DOMSVGPathSegList.h"
 51#import "DOMSVGPathSegMovetoAbs.h"
 52#import "DOMSVGPathSegMovetoRel.h"
 53#import "SVGPathSeg.h"
 54
 55Class kitClass(WebCore::SVGPathSeg* impl)
 56{
 57    switch (impl->pathSegType()) {
 58        case WebCore::SVGPathSeg::PATHSEG_UNKNOWN:
 59            return [DOMSVGPathSeg class];
 60        case WebCore::SVGPathSeg::PATHSEG_CLOSEPATH:
 61            return [DOMSVGPathSegClosePath class];
 62        case WebCore::SVGPathSeg::PATHSEG_MOVETO_ABS:
 63            return [DOMSVGPathSegMovetoAbs class];
 64        case WebCore::SVGPathSeg::PATHSEG_MOVETO_REL:
 65            return [DOMSVGPathSegMovetoRel class];
 66        case WebCore::SVGPathSeg::PATHSEG_LINETO_ABS:
 67            return [DOMSVGPathSegLinetoAbs class];
 68        case WebCore::SVGPathSeg::PATHSEG_LINETO_REL:
 69            return [DOMSVGPathSegLinetoRel class];
 70        case WebCore::SVGPathSeg::PATHSEG_CURVETO_CUBIC_ABS:
 71            return [DOMSVGPathSegCurvetoCubicAbs class];
 72        case WebCore::SVGPathSeg::PATHSEG_CURVETO_CUBIC_REL:
 73            return [DOMSVGPathSegCurvetoCubicRel class];
 74        case WebCore::SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_ABS:
 75            return [DOMSVGPathSegCurvetoQuadraticAbs class];
 76        case WebCore::SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_REL:
 77            return [DOMSVGPathSegCurvetoQuadraticRel class];
 78        case WebCore::SVGPathSeg::PATHSEG_ARC_ABS:
 79            return [DOMSVGPathSegArcAbs class];
 80        case WebCore::SVGPathSeg::PATHSEG_ARC_REL:
 81            return [DOMSVGPathSegArcRel class];
 82        case WebCore::SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_ABS:
 83            return [DOMSVGPathSegLinetoHorizontalAbs class];
 84        case WebCore::SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_REL:
 85            return [DOMSVGPathSegLinetoHorizontalRel class];
 86        case WebCore::SVGPathSeg::PATHSEG_LINETO_VERTICAL_ABS:
 87            return [DOMSVGPathSegLinetoVerticalAbs class];
 88        case WebCore::SVGPathSeg::PATHSEG_LINETO_VERTICAL_REL:
 89            return [DOMSVGPathSegLinetoVerticalRel class];
 90        case WebCore::SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
 91            return [DOMSVGPathSegCurvetoCubicSmoothAbs class];
 92        case WebCore::SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
 93            return [DOMSVGPathSegCurvetoCubicSmoothRel class];
 94        case WebCore::SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
 95            return [DOMSVGPathSegCurvetoQuadraticSmoothAbs class];
 96        case WebCore::SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
 97            return [DOMSVGPathSegCurvetoQuadraticSmoothRel class];
 98    }
 99    ASSERT_NOT_REACHED();
100    return nil;
101}
102
103#endif // ENABLE(SVG)