~ubuntu-branches/ubuntu/maverick/webkit/maverick

« back to all changes in this revision

Viewing changes to WebCore/ksvg2/svg/GradientAttributes.h

  • Committer: Bazaar Package Importer
  • Author(s): Mike Hommey
  • Date: 2007-08-19 15:54:12 UTC
  • Revision ID: james.westby@ubuntu.com-20070819155412-uxxg1h9plpghmtbi
Tags: upstream-0~svn25144
ImportĀ upstreamĀ versionĀ 0~svn25144

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
 
3
 
 
4
    This file is part of the KDE project
 
5
 
 
6
    This library is free software; you can redistribute it and/or
 
7
    modify it under the terms of the GNU Library General Public
 
8
    License as published by the Free Software Foundation; either
 
9
    version 2 of the License, or (at your option) any later version.
 
10
 
 
11
    This library is distributed in the hope that it will be useful,
 
12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
    Library General Public License for more details.
 
15
 
 
16
    You should have received a copy of the GNU Library General Public License
 
17
    along with this library; see the file COPYING.LIB.  If not, write to
 
18
    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
19
    Boston, MA 02111-1307, USA.
 
20
*/
 
21
 
 
22
#ifndef GradientAttributes_h
 
23
#define GradientAttributes_h
 
24
 
 
25
#if ENABLE(SVG)
 
26
 
 
27
namespace WebCore
 
28
{
 
29
    struct GradientAttributes {
 
30
        GradientAttributes()
 
31
            : m_spreadMethod(SPREADMETHOD_PAD)
 
32
            , m_boundingBoxMode(true)
 
33
            , m_spreadMethodSet(false)
 
34
            , m_boundingBoxModeSet(false)
 
35
            , m_gradientTransformSet(false)
 
36
            , m_stopsSet(false)
 
37
        {
 
38
        }
 
39
 
 
40
        SVGGradientSpreadMethod spreadMethod() const { return m_spreadMethod; }
 
41
        bool boundingBoxMode() const { return m_boundingBoxMode; }
 
42
        AffineTransform gradientTransform() const { return m_gradientTransform; }
 
43
        const Vector<SVGGradientStop>& stops() const { return m_stops; }
 
44
 
 
45
        void setSpreadMethod(SVGGradientSpreadMethod value) { m_spreadMethod = value; m_spreadMethodSet = true; }
 
46
        void setBoundingBoxMode(bool value) { m_boundingBoxMode = value; m_boundingBoxModeSet = true; }
 
47
        void setGradientTransform(const AffineTransform& value) { m_gradientTransform = value; m_gradientTransformSet = true; }
 
48
        void setStops(const Vector<SVGGradientStop>& value) { m_stops = value; m_stopsSet = true; } 
 
49
 
 
50
        bool hasSpreadMethod() const { return m_spreadMethodSet; }
 
51
        bool hasBoundingBoxMode() const { return m_boundingBoxModeSet; }
 
52
        bool hasGradientTransform() const { return m_gradientTransformSet; }
 
53
        bool hasStops() const { return m_stopsSet; }
 
54
 
 
55
    private:
 
56
        // Properties
 
57
        SVGGradientSpreadMethod m_spreadMethod;
 
58
        bool m_boundingBoxMode;
 
59
        AffineTransform m_gradientTransform;
 
60
        Vector<SVGGradientStop> m_stops;
 
61
 
 
62
        // Property states
 
63
        bool m_spreadMethodSet : 1;
 
64
        bool m_boundingBoxModeSet : 1;
 
65
        bool m_gradientTransformSet : 1;
 
66
        bool m_stopsSet : 1;
 
67
    };
 
68
 
 
69
} // namespace WebCore
 
70
 
 
71
#endif // ENABLE(SVG)
 
72
#endif
 
73
 
 
74
// vim:ts=4:noet