OSDN Git Service

Merge Webkit at r70949: Initial merge by git.
[android-x86/external-webkit.git] / WebCore / svg / SVGPathSegCurvetoCubicSmooth.h
1 /*
2  * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
3  * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org>
4  *
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.
9  *
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.
14  *
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.
19  */
20
21 #ifndef SVGPathSegCurvetoCubicSmooth_h
22 #define SVGPathSegCurvetoCubicSmooth_h
23
24 #if ENABLE(SVG)
25
26 #include "PlatformString.h"
27 #include "SVGPathSeg.h"
28
29 namespace WebCore {
30
31     class SVGPathSegCurvetoCubicSmooth : public SVGPathSeg {
32     public:
33         SVGPathSegCurvetoCubicSmooth(float x, float y, float x2, float y2)
34             : m_x(x)
35             , m_y(y)
36             , m_x2(x2)
37             , m_y2(y2)
38         {
39         }
40
41         void setX(float x) { m_x = x; }
42         float x() const { return m_x; }
43
44         void setY(float y) { m_y = y; }
45         float y() const { return m_y; }
46
47         void setX2(float x2) { m_x2 = x2; }
48         float x2() const { return m_x2; }
49
50         void setY2(float y2) { m_y2 = y2; }
51         float y2() const { return m_y2; }
52
53     private:
54         float m_x;
55         float m_y;
56         float m_x2;
57         float m_y2;
58     };
59
60     class SVGPathSegCurvetoCubicSmoothAbs : public SVGPathSegCurvetoCubicSmooth { 
61     public:
62         static PassRefPtr<SVGPathSegCurvetoCubicSmoothAbs> create(float x, float y, float x2, float y2) { return adoptRef(new SVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2)); }
63
64     private:
65         SVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2);
66
67         virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_SMOOTH_ABS; }
68         virtual String pathSegTypeAsLetter() const { return "S"; }
69     };
70
71     class SVGPathSegCurvetoCubicSmoothRel : public SVGPathSegCurvetoCubicSmooth { 
72     public:
73         static PassRefPtr<SVGPathSegCurvetoCubicSmoothRel> create(float x, float y, float x2, float y2) { return adoptRef(new SVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2)); }
74
75     private:
76         SVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2);
77
78         virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_SMOOTH_REL; }
79         virtual String pathSegTypeAsLetter() const { return "s"; }
80     };
81
82 } // namespace WebCore
83
84 #endif // ENABLE(SVG)
85 #endif