/* * Copyright (C) 2019 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #include "SVGPathSegValue.h" namespace WebCore { class SVGPathSegClosePath final : public SVGPathSeg { public: static Ref create() { return adoptRef(*new SVGPathSegClosePath()); } private: using SVGPathSeg::SVGPathSeg; unsigned short pathSegType() const final { return PATHSEG_CLOSEPATH; } String pathSegTypeAsLetter() const final { return "Z"; } Ref clone() const final { return adoptRef(*new SVGPathSegClosePath()); } }; class SVGPathSegLinetoHorizontalAbs final : public SVGPathSegLinetoHorizontal { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegLinetoHorizontal::SVGPathSegLinetoHorizontal; unsigned short pathSegType() const final { return PATHSEG_LINETO_HORIZONTAL_ABS; } String pathSegTypeAsLetter() const final { return "H"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; class SVGPathSegLinetoHorizontalRel final : public SVGPathSegLinetoHorizontal { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegLinetoHorizontal::SVGPathSegLinetoHorizontal; unsigned short pathSegType() const final { return PATHSEG_LINETO_HORIZONTAL_REL; } String pathSegTypeAsLetter() const final { return "h"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; class SVGPathSegLinetoVerticalAbs final : public SVGPathSegLinetoVertical { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegLinetoVertical::SVGPathSegLinetoVertical; unsigned short pathSegType() const final { return PATHSEG_LINETO_VERTICAL_ABS; } String pathSegTypeAsLetter() const final { return "V"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; class SVGPathSegLinetoVerticalRel final : public SVGPathSegLinetoVertical { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegLinetoVertical::SVGPathSegLinetoVertical; unsigned short pathSegType() const final { return PATHSEG_LINETO_VERTICAL_REL; } String pathSegTypeAsLetter() const final { return "v"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; class SVGPathSegMovetoAbs final : public SVGPathSegSingleCoordinate { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate; unsigned short pathSegType() const final { return PATHSEG_MOVETO_ABS; } String pathSegTypeAsLetter() const final { return "M"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; class SVGPathSegMovetoRel final : public SVGPathSegSingleCoordinate { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate; unsigned short pathSegType() const final { return PATHSEG_MOVETO_REL; } String pathSegTypeAsLetter() const final { return "m"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; class SVGPathSegLinetoAbs final : public SVGPathSegSingleCoordinate { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate; unsigned short pathSegType() const final { return PATHSEG_LINETO_ABS; } String pathSegTypeAsLetter() const final { return "L"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; class SVGPathSegLinetoRel final : public SVGPathSegSingleCoordinate { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate; unsigned short pathSegType() const final { return PATHSEG_LINETO_REL; } String pathSegTypeAsLetter() const final { return "l"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; class SVGPathSegCurvetoQuadraticAbs final : public SVGPathSegCurvetoQuadratic { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegCurvetoQuadratic::SVGPathSegCurvetoQuadratic; unsigned short pathSegType() const final { return PATHSEG_CURVETO_QUADRATIC_ABS; } String pathSegTypeAsLetter() const final { return "Q"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; class SVGPathSegCurvetoQuadraticRel final : public SVGPathSegCurvetoQuadratic { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegCurvetoQuadratic::SVGPathSegCurvetoQuadratic; unsigned short pathSegType() const final { return PATHSEG_CURVETO_QUADRATIC_REL; } String pathSegTypeAsLetter() const final { return "q"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; class SVGPathSegCurvetoCubicAbs final : public SVGPathSegCurvetoCubic { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegCurvetoCubic::SVGPathSegCurvetoCubic; unsigned short pathSegType() const final { return PATHSEG_CURVETO_CUBIC_ABS; } String pathSegTypeAsLetter() const final { return "C"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; class SVGPathSegCurvetoCubicRel final : public SVGPathSegCurvetoCubic { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegCurvetoCubic::SVGPathSegCurvetoCubic; unsigned short pathSegType() const final { return PATHSEG_CURVETO_CUBIC_REL; } String pathSegTypeAsLetter() const final { return "c"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; class SVGPathSegArcAbs final : public SVGPathSegArc { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegArc::SVGPathSegArc; unsigned short pathSegType() const final { return PATHSEG_ARC_ABS; } String pathSegTypeAsLetter() const final { return "A"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; class SVGPathSegArcRel final : public SVGPathSegArc { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegArc::SVGPathSegArc; unsigned short pathSegType() const final { return PATHSEG_ARC_REL; } String pathSegTypeAsLetter() const final { return "a"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; class SVGPathSegCurvetoQuadraticSmoothAbs final : public SVGPathSegSingleCoordinate { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate; unsigned short pathSegType() const final { return PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS; } String pathSegTypeAsLetter() const final { return "T"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; class SVGPathSegCurvetoQuadraticSmoothRel final : public SVGPathSegSingleCoordinate { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate; unsigned short pathSegType() const final { return PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL; } String pathSegTypeAsLetter() const final { return "t"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; class SVGPathSegCurvetoCubicSmoothAbs final : public SVGPathSegCurvetoCubicSmooth { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegCurvetoCubicSmooth::SVGPathSegCurvetoCubicSmooth; unsigned short pathSegType() const final { return PATHSEG_CURVETO_CUBIC_SMOOTH_ABS; } String pathSegTypeAsLetter() const final { return "S"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; class SVGPathSegCurvetoCubicSmoothRel final : public SVGPathSegCurvetoCubicSmooth { public: constexpr static auto create = SVGPathSegValue::create; private: using SVGPathSegCurvetoCubicSmooth::SVGPathSegCurvetoCubicSmooth; unsigned short pathSegType() const final { return PATHSEG_CURVETO_CUBIC_SMOOTH_REL; } String pathSegTypeAsLetter() const final { return "s"; } Ref clone() const final { return SVGPathSegValue::clone(); } }; }