OLD | NEW |
| (Empty) |
1 /* | |
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. | |
5 | |
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. | |
11 | |
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. | |
16 | |
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. | |
21 | |
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. | |
26 */ | |
27 | |
28 #include "config.h" | |
29 #include "core/layout/style/SVGLayoutStyleDefs.h" | |
30 | |
31 #include "core/layout/style/SVGLayoutStyle.h" | |
32 | |
33 namespace blink { | |
34 | |
35 StyleFillData::StyleFillData() | |
36 : opacity(SVGLayoutStyle::initialFillOpacity()) | |
37 , paintType(SVGLayoutStyle::initialFillPaintType()) | |
38 , paintColor(SVGLayoutStyle::initialFillPaintColor()) | |
39 , paintUri(SVGLayoutStyle::initialFillPaintUri()) | |
40 , visitedLinkPaintType(SVGLayoutStyle::initialStrokePaintType()) | |
41 , visitedLinkPaintColor(SVGLayoutStyle::initialFillPaintColor()) | |
42 , visitedLinkPaintUri(SVGLayoutStyle::initialFillPaintUri()) | |
43 { | |
44 } | |
45 | |
46 StyleFillData::StyleFillData(const StyleFillData& other) | |
47 : RefCounted<StyleFillData>() | |
48 , opacity(other.opacity) | |
49 , paintType(other.paintType) | |
50 , paintColor(other.paintColor) | |
51 , paintUri(other.paintUri) | |
52 , visitedLinkPaintType(other.visitedLinkPaintType) | |
53 , visitedLinkPaintColor(other.visitedLinkPaintColor) | |
54 , visitedLinkPaintUri(other.visitedLinkPaintUri) | |
55 { | |
56 } | |
57 | |
58 bool StyleFillData::operator==(const StyleFillData& other) const | |
59 { | |
60 return opacity == other.opacity | |
61 && paintType == other.paintType | |
62 && paintColor == other.paintColor | |
63 && paintUri == other.paintUri | |
64 && visitedLinkPaintType == other.visitedLinkPaintType | |
65 && visitedLinkPaintColor == other.visitedLinkPaintColor | |
66 && visitedLinkPaintUri == other.visitedLinkPaintUri; | |
67 } | |
68 | |
69 StyleStrokeData::StyleStrokeData() | |
70 : opacity(SVGLayoutStyle::initialStrokeOpacity()) | |
71 , miterLimit(SVGLayoutStyle::initialStrokeMiterLimit()) | |
72 , width(SVGLayoutStyle::initialStrokeWidth()) | |
73 , dashOffset(SVGLayoutStyle::initialStrokeDashOffset()) | |
74 , dashArray(SVGLayoutStyle::initialStrokeDashArray()) | |
75 , paintType(SVGLayoutStyle::initialStrokePaintType()) | |
76 , paintColor(SVGLayoutStyle::initialStrokePaintColor()) | |
77 , paintUri(SVGLayoutStyle::initialStrokePaintUri()) | |
78 , visitedLinkPaintType(SVGLayoutStyle::initialStrokePaintType()) | |
79 , visitedLinkPaintColor(SVGLayoutStyle::initialStrokePaintColor()) | |
80 , visitedLinkPaintUri(SVGLayoutStyle::initialStrokePaintUri()) | |
81 { | |
82 } | |
83 | |
84 StyleStrokeData::StyleStrokeData(const StyleStrokeData& other) | |
85 : RefCounted<StyleStrokeData>() | |
86 , opacity(other.opacity) | |
87 , miterLimit(other.miterLimit) | |
88 , width(other.width) | |
89 , dashOffset(other.dashOffset) | |
90 , dashArray(other.dashArray) | |
91 , paintType(other.paintType) | |
92 , paintColor(other.paintColor) | |
93 , paintUri(other.paintUri) | |
94 , visitedLinkPaintType(other.visitedLinkPaintType) | |
95 , visitedLinkPaintColor(other.visitedLinkPaintColor) | |
96 , visitedLinkPaintUri(other.visitedLinkPaintUri) | |
97 { | |
98 } | |
99 | |
100 bool StyleStrokeData::operator==(const StyleStrokeData& other) const | |
101 { | |
102 return width == other.width | |
103 && opacity == other.opacity | |
104 && miterLimit == other.miterLimit | |
105 && dashOffset == other.dashOffset | |
106 && *dashArray == *other.dashArray | |
107 && paintType == other.paintType | |
108 && paintColor == other.paintColor | |
109 && paintUri == other.paintUri | |
110 && visitedLinkPaintType == other.visitedLinkPaintType | |
111 && visitedLinkPaintColor == other.visitedLinkPaintColor | |
112 && visitedLinkPaintUri == other.visitedLinkPaintUri; | |
113 } | |
114 | |
115 StyleStopData::StyleStopData() | |
116 : opacity(SVGLayoutStyle::initialStopOpacity()) | |
117 , color(SVGLayoutStyle::initialStopColor()) | |
118 { | |
119 } | |
120 | |
121 StyleStopData::StyleStopData(const StyleStopData& other) | |
122 : RefCounted<StyleStopData>() | |
123 , opacity(other.opacity) | |
124 , color(other.color) | |
125 { | |
126 } | |
127 | |
128 bool StyleStopData::operator==(const StyleStopData& other) const | |
129 { | |
130 return color == other.color | |
131 && opacity == other.opacity; | |
132 } | |
133 | |
134 StyleMiscData::StyleMiscData() | |
135 : floodColor(SVGLayoutStyle::initialFloodColor()) | |
136 , floodOpacity(SVGLayoutStyle::initialFloodOpacity()) | |
137 , lightingColor(SVGLayoutStyle::initialLightingColor()) | |
138 , baselineShiftValue(SVGLayoutStyle::initialBaselineShiftValue()) | |
139 { | |
140 } | |
141 | |
142 StyleMiscData::StyleMiscData(const StyleMiscData& other) | |
143 : RefCounted<StyleMiscData>() | |
144 , floodColor(other.floodColor) | |
145 , floodOpacity(other.floodOpacity) | |
146 , lightingColor(other.lightingColor) | |
147 , baselineShiftValue(other.baselineShiftValue) | |
148 { | |
149 } | |
150 | |
151 bool StyleMiscData::operator==(const StyleMiscData& other) const | |
152 { | |
153 return floodOpacity == other.floodOpacity | |
154 && floodColor == other.floodColor | |
155 && lightingColor == other.lightingColor | |
156 && baselineShiftValue == other.baselineShiftValue; | |
157 } | |
158 | |
159 StyleResourceData::StyleResourceData() | |
160 : clipper(SVGLayoutStyle::initialClipperResource()) | |
161 , filter(SVGLayoutStyle::initialFilterResource()) | |
162 , masker(SVGLayoutStyle::initialMaskerResource()) | |
163 { | |
164 } | |
165 | |
166 StyleResourceData::StyleResourceData(const StyleResourceData& other) | |
167 : RefCounted<StyleResourceData>() | |
168 , clipper(other.clipper) | |
169 , filter(other.filter) | |
170 , masker(other.masker) | |
171 { | |
172 } | |
173 | |
174 bool StyleResourceData::operator==(const StyleResourceData& other) const | |
175 { | |
176 return clipper == other.clipper | |
177 && filter == other.filter | |
178 && masker == other.masker; | |
179 } | |
180 | |
181 StyleInheritedResourceData::StyleInheritedResourceData() | |
182 : markerStart(SVGLayoutStyle::initialMarkerStartResource()) | |
183 , markerMid(SVGLayoutStyle::initialMarkerMidResource()) | |
184 , markerEnd(SVGLayoutStyle::initialMarkerEndResource()) | |
185 { | |
186 } | |
187 | |
188 StyleInheritedResourceData::StyleInheritedResourceData(const StyleInheritedResou
rceData& other) | |
189 : RefCounted<StyleInheritedResourceData>() | |
190 , markerStart(other.markerStart) | |
191 , markerMid(other.markerMid) | |
192 , markerEnd(other.markerEnd) | |
193 { | |
194 } | |
195 | |
196 bool StyleInheritedResourceData::operator==(const StyleInheritedResourceData& ot
her) const | |
197 { | |
198 return markerStart == other.markerStart | |
199 && markerMid == other.markerMid | |
200 && markerEnd == other.markerEnd; | |
201 } | |
202 | |
203 StyleLayoutData::StyleLayoutData() | |
204 : cx(SVGLayoutStyle::initialCx()) | |
205 , cy(SVGLayoutStyle::initialCy()) | |
206 , x(SVGLayoutStyle::initialX()) | |
207 , y(SVGLayoutStyle::initialY()) | |
208 , r(SVGLayoutStyle::initialR()) | |
209 , rx(SVGLayoutStyle::initialRx()) | |
210 , ry(SVGLayoutStyle::initialRy()) | |
211 { | |
212 } | |
213 | |
214 inline StyleLayoutData::StyleLayoutData(const StyleLayoutData& other) | |
215 : RefCounted<StyleLayoutData>() | |
216 , cx(other.cx) | |
217 , cy(other.cy) | |
218 , x(other.x) | |
219 , y(other.y) | |
220 , r(other.r) | |
221 , rx(other.rx) | |
222 , ry(other.ry) | |
223 { | |
224 } | |
225 | |
226 PassRefPtr<StyleLayoutData> StyleLayoutData::copy() const | |
227 { | |
228 return adoptRef(new StyleLayoutData(*this)); | |
229 } | |
230 | |
231 bool StyleLayoutData::operator==(const StyleLayoutData& other) const | |
232 { | |
233 return x == other.x | |
234 && y == other.y | |
235 && r == other.r | |
236 && rx == other.rx | |
237 && ry == other.ry | |
238 && cx == other.cx | |
239 && cy == other.cy; | |
240 } | |
241 | |
242 } | |
OLD | NEW |