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 SVGPathSegCurvetoQuadratic_h 0024 #define SVGPathSegCurvetoQuadratic_h 0025 0026 #if ENABLE(SVG) 0027 0028 #include "SVGPathSeg.h" 0029 0030 namespace WebCore 0031 { 0032 0033 class SVGPathSegCurvetoQuadraticAbs : public SVGPathSeg 0034 { 0035 public: 0036 static PassRefPtr<SVGPathSegCurvetoQuadraticAbs> create(float x, float y, float x1, float y1) 0037 { 0038 return adoptRef(new SVGPathSegCurvetoQuadraticAbs(x, y, x1, y1)); 0039 } 0040 virtual ~SVGPathSegCurvetoQuadraticAbs(); 0041 0042 unsigned short pathSegType() const override 0043 { 0044 return PATHSEG_CURVETO_QUADRATIC_ABS; 0045 } 0046 String pathSegTypeAsLetter() const override 0047 { 0048 return "Q"; 0049 } 0050 String toString() const override 0051 { 0052 return String::format("Q %.6lg %.6lg %.6lg %.6lg", m_x1, m_y1, 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 setX1(float); 0062 float x1() const; 0063 0064 void setY1(float); 0065 float y1() const; 0066 0067 private: 0068 SVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1); 0069 0070 float m_x; 0071 float m_y; 0072 float m_x1; 0073 float m_y1; 0074 }; 0075 0076 class SVGPathSegCurvetoQuadraticRel : public SVGPathSeg 0077 { 0078 public: 0079 static PassRefPtr<SVGPathSegCurvetoQuadraticRel> create(float x, float y, float x1, float y1) 0080 { 0081 return adoptRef(new SVGPathSegCurvetoQuadraticRel(x, y, x1, y1)); 0082 } 0083 virtual ~SVGPathSegCurvetoQuadraticRel(); 0084 0085 unsigned short pathSegType() const override 0086 { 0087 return PATHSEG_CURVETO_QUADRATIC_REL; 0088 } 0089 String pathSegTypeAsLetter() const override 0090 { 0091 return "q"; 0092 } 0093 String toString() const override 0094 { 0095 return String::format("q %.6lg %.6lg %.6lg %.6lg", m_x1, m_y1, 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 setX1(float); 0105 float x1() const; 0106 0107 void setY1(float); 0108 float y1() const; 0109 0110 private: 0111 SVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1); 0112 0113 float m_x; 0114 float m_y; 0115 float m_x1; 0116 float m_y1; 0117 }; 0118 0119 } // namespace WebCore 0120 0121 #endif // ENABLE(SVG) 0122 #endif 0123