File indexing completed on 2024-04-28 15:24:39
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 SVGPathSegCurvetoQuadraticSmooth_h 0024 #define SVGPathSegCurvetoQuadraticSmooth_h 0025 0026 #if ENABLE(SVG) 0027 0028 #include "SVGPathSeg.h" 0029 0030 namespace WebCore 0031 { 0032 0033 class SVGPathSegCurvetoQuadraticSmoothAbs : public SVGPathSeg 0034 { 0035 public: 0036 static PassRefPtr<SVGPathSegCurvetoQuadraticSmoothAbs> create(float x, float y) 0037 { 0038 return adoptRef(new SVGPathSegCurvetoQuadraticSmoothAbs(x, y)); 0039 } 0040 virtual ~SVGPathSegCurvetoQuadraticSmoothAbs(); 0041 0042 unsigned short pathSegType() const override 0043 { 0044 return PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS; 0045 } 0046 String pathSegTypeAsLetter() const override 0047 { 0048 return "T"; 0049 } 0050 String toString() const override 0051 { 0052 return String::format("T %.6lg %.6lg", 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 private: 0062 SVGPathSegCurvetoQuadraticSmoothAbs(float x, float y); 0063 0064 float m_x; 0065 float m_y; 0066 }; 0067 0068 class SVGPathSegCurvetoQuadraticSmoothRel : public SVGPathSeg 0069 { 0070 public: 0071 static PassRefPtr<SVGPathSegCurvetoQuadraticSmoothRel> create(float x, float y) 0072 { 0073 return adoptRef(new SVGPathSegCurvetoQuadraticSmoothRel(x, y)); 0074 } 0075 virtual ~SVGPathSegCurvetoQuadraticSmoothRel(); 0076 0077 unsigned short pathSegType() const override 0078 { 0079 return PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL; 0080 } 0081 String pathSegTypeAsLetter() const override 0082 { 0083 return "t"; 0084 } 0085 String toString() const override 0086 { 0087 return String::format("t %.6lg %.6lg", m_x, m_y); 0088 } 0089 0090 void setX(float); 0091 float x() const; 0092 0093 void setY(float); 0094 float y() const; 0095 0096 private: 0097 SVGPathSegCurvetoQuadraticSmoothRel(float x, float y); 0098 0099 float m_x; 0100 float m_y; 0101 }; 0102 0103 } // namespace WebCore 0104 0105 #endif // ENABLE(SVG) 0106 #endif 0107