• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2     Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 
4     This library is free software; you can redistribute it and/or
5     modify it under the terms of the GNU Library General Public
6     License as published by the Free Software Foundation; either
7     version 2 of the License, or (at your option) any later version.
8 
9     This library is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12     Library General Public License for more details.
13 
14     You should have received a copy of the GNU Library General Public License
15     along with this library; see the file COPYING.LIB.  If not, write to
16     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17     Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef PatternAttributes_h
21 #define PatternAttributes_h
22 
23 #if ENABLE(SVG)
24 
25 namespace WebCore {
26     struct PatternAttributes {
PatternAttributesPatternAttributes27         PatternAttributes()
28             : m_x()
29             , m_y()
30             , m_width()
31             , m_height()
32             , m_boundingBoxMode(true)
33             , m_boundingBoxModeContent(false)
34             , m_patternContentElement(0)
35             , m_xSet(false)
36             , m_ySet(false)
37             , m_widthSet(false)
38             , m_heightSet(false)
39             , m_boundingBoxModeSet(false)
40             , m_boundingBoxModeContentSet(false)
41             , m_patternTransformSet(false)
42             , m_patternContentElementSet(false)
43         {
44         }
45 
xPatternAttributes46         SVGLength x() const { return m_x; }
yPatternAttributes47         SVGLength y() const { return m_y; }
widthPatternAttributes48         SVGLength width() const { return m_width; }
heightPatternAttributes49         SVGLength height() const { return m_height; }
boundingBoxModePatternAttributes50         bool boundingBoxMode() const { return m_boundingBoxMode; }
boundingBoxModeContentPatternAttributes51         bool boundingBoxModeContent() const { return m_boundingBoxModeContent; }
patternTransformPatternAttributes52         AffineTransform patternTransform() const { return m_patternTransform; }
patternContentElementPatternAttributes53         const SVGPatternElement* patternContentElement() const { return m_patternContentElement; }
54 
setXPatternAttributes55         void setX(const SVGLength& value) { m_x = value; m_xSet = true; }
setYPatternAttributes56         void setY(const SVGLength& value) { m_y = value; m_ySet = true; }
setWidthPatternAttributes57         void setWidth(const SVGLength& value) { m_width = value; m_widthSet = true; }
setHeightPatternAttributes58         void setHeight(const SVGLength& value) { m_height = value; m_heightSet = true; }
setBoundingBoxModePatternAttributes59         void setBoundingBoxMode(bool value) { m_boundingBoxMode = value; m_boundingBoxModeSet = true; }
setBoundingBoxModeContentPatternAttributes60         void setBoundingBoxModeContent(bool value) { m_boundingBoxModeContent = value; m_boundingBoxModeContentSet = true; }
setPatternTransformPatternAttributes61         void setPatternTransform(const AffineTransform& value) { m_patternTransform = value; m_patternTransformSet = true; }
setPatternContentElementPatternAttributes62         void setPatternContentElement(const SVGPatternElement* value) { m_patternContentElement = value; m_patternContentElementSet = true; }
63 
hasXPatternAttributes64         bool hasX() const { return m_xSet; }
hasYPatternAttributes65         bool hasY() const { return m_ySet; }
hasWidthPatternAttributes66         bool hasWidth() const { return m_widthSet; }
hasHeightPatternAttributes67         bool hasHeight() const { return m_heightSet; }
hasBoundingBoxModePatternAttributes68         bool hasBoundingBoxMode() const { return m_boundingBoxModeSet; }
hasBoundingBoxModeContentPatternAttributes69         bool hasBoundingBoxModeContent() const { return m_boundingBoxModeContentSet; }
hasPatternTransformPatternAttributes70         bool hasPatternTransform() const { return m_patternTransformSet; }
hasPatternContentElementPatternAttributes71         bool hasPatternContentElement() const { return m_patternContentElementSet; }
72 
73     private:
74         // Properties
75         SVGLength m_x;
76         SVGLength m_y;
77         SVGLength m_width;
78         SVGLength m_height;
79         bool m_boundingBoxMode;
80         bool m_boundingBoxModeContent;
81         AffineTransform m_patternTransform;
82         const SVGPatternElement* m_patternContentElement;
83 
84         // Property states
85         bool m_xSet : 1;
86         bool m_ySet : 1;
87         bool m_widthSet : 1;
88         bool m_heightSet : 1;
89         bool m_boundingBoxModeSet : 1;
90         bool m_boundingBoxModeContentSet : 1;
91         bool m_patternTransformSet : 1;
92         bool m_patternContentElementSet : 1;
93     };
94 
95 } // namespace WebCore
96 
97 #endif // ENABLE(SVG)
98 #endif
99 
100 // vim:ts=4:noet
101