2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005, 2007 Rob Buis <buis@kde.org>
4 Copyright (C) Research In Motion Limited 2010. All rights reserved.
6 Based on khtml code by:
7 Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
8 Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
9 Copyright (C) 2002-2003 Dirk Mueller (mueller@kde.org)
10 Copyright (C) 2002 Apple Computer, Inc.
12 This library is free software; you can redistribute it and/or
13 modify it under the terms of the GNU Library General Public
14 License as published by the Free Software Foundation; either
15 version 2 of the License, or (at your option) any later version.
17 This library is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Library General Public License for more details.
22 You should have received a copy of the GNU Library General Public License
23 along with this library; see the file COPYING.LIB. If not, write to
24 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 Boston, MA 02110-1301, USA.
30 #include "core/rendering/style/SVGRenderStyleDefs.h"
32 #include "core/rendering/style/SVGRenderStyle.h"
36 StyleFillData::StyleFillData()
37 : opacity(SVGRenderStyle::initialFillOpacity())
38 , paintType(SVGRenderStyle::initialFillPaintType())
39 , paintColor(SVGRenderStyle::initialFillPaintColor())
40 , paintUri(SVGRenderStyle::initialFillPaintUri())
41 , visitedLinkPaintType(SVGRenderStyle::initialStrokePaintType())
42 , visitedLinkPaintColor(SVGRenderStyle::initialFillPaintColor())
43 , visitedLinkPaintUri(SVGRenderStyle::initialFillPaintUri())
47 StyleFillData::StyleFillData(const StyleFillData& other)
48 : RefCounted<StyleFillData>()
49 , opacity(other.opacity)
50 , paintType(other.paintType)
51 , paintColor(other.paintColor)
52 , paintUri(other.paintUri)
53 , visitedLinkPaintType(other.visitedLinkPaintType)
54 , visitedLinkPaintColor(other.visitedLinkPaintColor)
55 , visitedLinkPaintUri(other.visitedLinkPaintUri)
59 bool StyleFillData::operator==(const StyleFillData& other) const
61 return opacity == other.opacity
62 && paintType == other.paintType
63 && paintColor == other.paintColor
64 && paintUri == other.paintUri
65 && visitedLinkPaintType == other.visitedLinkPaintType
66 && visitedLinkPaintColor == other.visitedLinkPaintColor
67 && visitedLinkPaintUri == other.visitedLinkPaintUri;
70 StyleStrokeData::StyleStrokeData()
71 : opacity(SVGRenderStyle::initialStrokeOpacity())
72 , miterLimit(SVGRenderStyle::initialStrokeMiterLimit())
73 , width(SVGRenderStyle::initialStrokeWidth())
74 , dashOffset(SVGRenderStyle::initialStrokeDashOffset())
75 , dashArray(SVGRenderStyle::initialStrokeDashArray())
76 , paintType(SVGRenderStyle::initialStrokePaintType())
77 , paintColor(SVGRenderStyle::initialStrokePaintColor())
78 , paintUri(SVGRenderStyle::initialStrokePaintUri())
79 , visitedLinkPaintType(SVGRenderStyle::initialStrokePaintType())
80 , visitedLinkPaintColor(SVGRenderStyle::initialStrokePaintColor())
81 , visitedLinkPaintUri(SVGRenderStyle::initialStrokePaintUri())
85 StyleStrokeData::StyleStrokeData(const StyleStrokeData& other)
86 : RefCounted<StyleStrokeData>()
87 , opacity(other.opacity)
88 , miterLimit(other.miterLimit)
89 , width(other.width->clone())
90 , dashOffset(other.dashOffset->clone())
91 , dashArray(other.dashArray->clone())
92 , paintType(other.paintType)
93 , paintColor(other.paintColor)
94 , paintUri(other.paintUri)
95 , visitedLinkPaintType(other.visitedLinkPaintType)
96 , visitedLinkPaintColor(other.visitedLinkPaintColor)
97 , visitedLinkPaintUri(other.visitedLinkPaintUri)
101 bool StyleStrokeData::operator==(const StyleStrokeData& other) const
103 return *width == *other.width
104 && opacity == other.opacity
105 && miterLimit == other.miterLimit
106 && *dashOffset == *other.dashOffset
107 && *dashArray == *other.dashArray
108 && paintType == other.paintType
109 && paintColor == other.paintColor
110 && paintUri == other.paintUri
111 && visitedLinkPaintType == other.visitedLinkPaintType
112 && visitedLinkPaintColor == other.visitedLinkPaintColor
113 && visitedLinkPaintUri == other.visitedLinkPaintUri;
116 StyleStopData::StyleStopData()
117 : opacity(SVGRenderStyle::initialStopOpacity())
118 , color(SVGRenderStyle::initialStopColor())
122 StyleStopData::StyleStopData(const StyleStopData& other)
123 : RefCounted<StyleStopData>()
124 , opacity(other.opacity)
129 bool StyleStopData::operator==(const StyleStopData& other) const
131 return color == other.color
132 && opacity == other.opacity;
135 StyleMiscData::StyleMiscData()
136 : floodColor(SVGRenderStyle::initialFloodColor())
137 , floodOpacity(SVGRenderStyle::initialFloodOpacity())
138 , lightingColor(SVGRenderStyle::initialLightingColor())
139 , baselineShiftValue(SVGRenderStyle::initialBaselineShiftValue())
143 StyleMiscData::StyleMiscData(const StyleMiscData& other)
144 : RefCounted<StyleMiscData>()
145 , floodColor(other.floodColor)
146 , floodOpacity(other.floodOpacity)
147 , lightingColor(other.lightingColor)
148 , baselineShiftValue(other.baselineShiftValue->clone())
152 bool StyleMiscData::operator==(const StyleMiscData& other) const
154 return floodOpacity == other.floodOpacity
155 && floodColor == other.floodColor
156 && lightingColor == other.lightingColor
157 && *baselineShiftValue == *other.baselineShiftValue;
160 StyleResourceData::StyleResourceData()
161 : clipper(SVGRenderStyle::initialClipperResource())
162 , filter(SVGRenderStyle::initialFilterResource())
163 , masker(SVGRenderStyle::initialMaskerResource())
167 StyleResourceData::StyleResourceData(const StyleResourceData& other)
168 : RefCounted<StyleResourceData>()
169 , clipper(other.clipper)
170 , filter(other.filter)
171 , masker(other.masker)
175 bool StyleResourceData::operator==(const StyleResourceData& other) const
177 return clipper == other.clipper
178 && filter == other.filter
179 && masker == other.masker;
182 StyleInheritedResourceData::StyleInheritedResourceData()
183 : markerStart(SVGRenderStyle::initialMarkerStartResource())
184 , markerMid(SVGRenderStyle::initialMarkerMidResource())
185 , markerEnd(SVGRenderStyle::initialMarkerEndResource())
189 StyleInheritedResourceData::StyleInheritedResourceData(const StyleInheritedResourceData& other)
190 : RefCounted<StyleInheritedResourceData>()
191 , markerStart(other.markerStart)
192 , markerMid(other.markerMid)
193 , markerEnd(other.markerEnd)
197 bool StyleInheritedResourceData::operator==(const StyleInheritedResourceData& other) const
199 return markerStart == other.markerStart
200 && markerMid == other.markerMid
201 && markerEnd == other.markerEnd;