2 Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 #ifndef SVGPathSegCurvetoQuadratic_h
22 #define SVGPathSegCurvetoQuadratic_h
26 #include "SVGPathSeg.h"
30 class SVGPathSegCurvetoQuadratic
: public SVGPathSeg
{
32 SVGPathSegCurvetoQuadratic(float x
, float y
, float x1
, float y1
)
33 : SVGPathSeg(), m_x(x
), m_y(y
), m_x1(x1
), m_y1(y1
) {}
35 virtual String
toString() const { return pathSegTypeAsLetter() + String::format(" %.6lg %.6lg %.6lg %.6lg", m_x1
, m_y1
, m_x
, m_y
); }
37 void setX(float x
) { m_x
= x
; }
38 float x() const { return m_x
; }
40 void setY(float y
) { m_y
= y
; }
41 float y() const { return m_y
; }
43 void setX1(float x1
) { m_x1
= x1
; }
44 float x1() const { return m_x1
; }
46 void setY1(float y1
) { m_y1
= y1
; }
47 float y1() const { return m_y1
; }
56 class SVGPathSegCurvetoQuadraticAbs
: public SVGPathSegCurvetoQuadratic
{
58 static PassRefPtr
<SVGPathSegCurvetoQuadraticAbs
> create(float x
, float y
, float x1
, float y1
) { return adoptRef(new SVGPathSegCurvetoQuadraticAbs(x
, y
, x1
, y1
)); }
60 virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_ABS
; }
61 virtual String
pathSegTypeAsLetter() const { return "Q"; }
64 SVGPathSegCurvetoQuadraticAbs(float x
, float y
, float x1
, float y1
);
67 class SVGPathSegCurvetoQuadraticRel
: public SVGPathSegCurvetoQuadratic
{
69 static PassRefPtr
<SVGPathSegCurvetoQuadraticRel
> create(float x
, float y
, float x1
, float y1
) { return adoptRef(new SVGPathSegCurvetoQuadraticRel(x
, y
, x1
, y1
)); }
71 virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_REL
; }
72 virtual String
pathSegTypeAsLetter() const { return "q"; }
75 SVGPathSegCurvetoQuadraticRel(float x
, float y
, float x1
, float y1
);
78 } // namespace WebCore