• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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., 51 Franklin Street, Fifth Floor,
19     Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef PatternAttributes_h
23 #define PatternAttributes_h
24 
25 #if ENABLE(SVG)
26 
27 namespace WebCore {
28     struct PatternAttributes {
PatternAttributesPatternAttributes29         PatternAttributes()
30             : m_x()
31             , m_y()
32             , m_width()
33             , m_height()
34             , m_boundingBoxMode(true)
35             , m_boundingBoxModeContent(false)
36             , m_patternContentElement(0)
37             , m_xSet(false)
38             , m_ySet(false)
39             , m_widthSet(false)
40             , m_heightSet(false)
41             , m_boundingBoxModeSet(false)
42             , m_boundingBoxModeContentSet(false)
43             , m_patternTransformSet(false)
44             , m_patternContentElementSet(false)
45         {
46         }
47 
xPatternAttributes48         SVGLength x() const { return m_x; }
yPatternAttributes49         SVGLength y() const { return m_y; }
widthPatternAttributes50         SVGLength width() const { return m_width; }
heightPatternAttributes51         SVGLength height() const { return m_height; }
boundingBoxModePatternAttributes52         bool boundingBoxMode() const { return m_boundingBoxMode; }
boundingBoxModeContentPatternAttributes53         bool boundingBoxModeContent() const { return m_boundingBoxModeContent; }
patternTransformPatternAttributes54         TransformationMatrix patternTransform() const { return m_patternTransform; }
patternContentElementPatternAttributes55         const SVGPatternElement* patternContentElement() const { return m_patternContentElement; }
56 
setXPatternAttributes57         void setX(const SVGLength& value) { m_x = value; m_xSet = true; }
setYPatternAttributes58         void setY(const SVGLength& value) { m_y = value; m_ySet = true; }
setWidthPatternAttributes59         void setWidth(const SVGLength& value) { m_width = value; m_widthSet = true; }
setHeightPatternAttributes60         void setHeight(const SVGLength& value) { m_height = value; m_heightSet = true; }
setBoundingBoxModePatternAttributes61         void setBoundingBoxMode(bool value) { m_boundingBoxMode = value; m_boundingBoxModeSet = true; }
setBoundingBoxModeContentPatternAttributes62         void setBoundingBoxModeContent(bool value) { m_boundingBoxModeContent = value; m_boundingBoxModeContentSet = true; }
setPatternTransformPatternAttributes63         void setPatternTransform(const TransformationMatrix& value) { m_patternTransform = value; m_patternTransformSet = true; }
setPatternContentElementPatternAttributes64         void setPatternContentElement(const SVGPatternElement* value) { m_patternContentElement = value; m_patternContentElementSet = true; }
65 
hasXPatternAttributes66         bool hasX() const { return m_xSet; }
hasYPatternAttributes67         bool hasY() const { return m_ySet; }
hasWidthPatternAttributes68         bool hasWidth() const { return m_widthSet; }
hasHeightPatternAttributes69         bool hasHeight() const { return m_heightSet; }
hasBoundingBoxModePatternAttributes70         bool hasBoundingBoxMode() const { return m_boundingBoxModeSet; }
hasBoundingBoxModeContentPatternAttributes71         bool hasBoundingBoxModeContent() const { return m_boundingBoxModeContentSet; }
hasPatternTransformPatternAttributes72         bool hasPatternTransform() const { return m_patternTransformSet; }
hasPatternContentElementPatternAttributes73         bool hasPatternContentElement() const { return m_patternContentElementSet; }
74 
75     private:
76         // Properties
77         SVGLength m_x;
78         SVGLength m_y;
79         SVGLength m_width;
80         SVGLength m_height;
81         bool m_boundingBoxMode;
82         bool m_boundingBoxModeContent;
83         TransformationMatrix m_patternTransform;
84         const SVGPatternElement* m_patternContentElement;
85 
86         // Property states
87         bool m_xSet : 1;
88         bool m_ySet : 1;
89         bool m_widthSet : 1;
90         bool m_heightSet : 1;
91         bool m_boundingBoxModeSet : 1;
92         bool m_boundingBoxModeContentSet : 1;
93         bool m_patternTransformSet : 1;
94         bool m_patternContentElementSet : 1;
95     };
96 
97 } // namespace WebCore
98 
99 #endif // ENABLE(SVG)
100 #endif
101 
102 // vim:ts=4:noet
103