File indexing completed on 2024-04-28 11:39:19

0001 /*
0002     Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
0003                   2004, 2005, 2006 Rob Buis <buis@kde.org>
0004 
0005     This file is part of the KDE project
0006 
0007     This library is free software; you can redistribute it and/or
0008     modify it under the terms of the GNU Library General Public
0009     License as published by the Free Software Foundation; either
0010     version 2 of the License, or (at your option) any later version.
0011 
0012     This library is distributed in the hope that it will be useful,
0013     but WITHOUT ANY WARRANTY; without even the implied warranty of
0014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015     Library General Public License for more details.
0016 
0017     You should have received a copy of the GNU Library General Public License
0018     along with this library; see the file COPYING.LIB.  If not, write to
0019     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0020     Boston, MA 02110-1301, USA.
0021 */
0022 
0023 #ifndef SVGPathSegCurvetoCubicSmooth_h
0024 #define SVGPathSegCurvetoCubicSmooth_h
0025 
0026 #if ENABLE(SVG)
0027 
0028 #include "SVGPathSeg.h"
0029 
0030 namespace WebCore
0031 {
0032 
0033 class SVGPathSegCurvetoCubicSmoothAbs : public SVGPathSeg
0034 {
0035 public:
0036     static PassRefPtr<SVGPathSegCurvetoCubicSmoothAbs> create(float x, float y, float x2, float y2)
0037     {
0038         return adoptRef(new SVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2));
0039     }
0040     virtual ~SVGPathSegCurvetoCubicSmoothAbs();
0041 
0042     unsigned short pathSegType() const override
0043     {
0044         return PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;
0045     }
0046     String pathSegTypeAsLetter() const override
0047     {
0048         return "S";
0049     }
0050     String toString() const override
0051     {
0052         return String::format("S %.6lg %.6lg %.6lg %.6lg", m_x2, m_y2, m_x, m_y);
0053     }
0054 
0055     void setX(float);
0056     float x() const;
0057 
0058     void setY(float);
0059     float y() const;
0060 
0061     void setX2(float);
0062     float x2() const;
0063 
0064     void setY2(float);
0065     float y2() const;
0066 
0067 private:
0068     SVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2);
0069 
0070     float m_x;
0071     float m_y;
0072     float m_x2;
0073     float m_y2;
0074 };
0075 
0076 class SVGPathSegCurvetoCubicSmoothRel : public SVGPathSeg
0077 {
0078 public:
0079     static PassRefPtr<SVGPathSegCurvetoCubicSmoothRel> create(float x, float y, float x2, float y2)
0080     {
0081         return adoptRef(new SVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2));
0082     }
0083     virtual ~SVGPathSegCurvetoCubicSmoothRel();
0084 
0085     unsigned short pathSegType() const override
0086     {
0087         return PATHSEG_CURVETO_CUBIC_SMOOTH_REL;
0088     }
0089     String pathSegTypeAsLetter() const override
0090     {
0091         return "s";
0092     }
0093     String toString() const override
0094     {
0095         return String::format("s %.6lg %.6lg %.6lg %.6lg", m_x2, m_y2, m_x, m_y);
0096     }
0097 
0098     void setX(float);
0099     float x() const;
0100 
0101     void setY(float);
0102     float y() const;
0103 
0104     void setX2(float);
0105     float x2() const;
0106 
0107     void setY2(float);
0108     float y2() const;
0109 
0110 private:
0111     SVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2);
0112 
0113     float m_x;
0114     float m_y;
0115     float m_x2;
0116     float m_y2;
0117 };
0118 
0119 } // namespace WebCore
0120 
0121 #endif // ENABLE(SVG)
0122 #endif
0123