OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 unsigned SVGPathElement::getPathSegAtLength(float length) | 79 unsigned SVGPathElement::getPathSegAtLength(float length) |
80 { | 80 { |
81 unsigned pathSeg = 0; | 81 unsigned pathSeg = 0; |
82 getSVGPathSegAtLengthFromSVGPathByteStream(pathByteStream(), length, pathSeg
); | 82 getSVGPathSegAtLengthFromSVGPathByteStream(pathByteStream(), length, pathSeg
); |
83 return pathSeg; | 83 return pathSeg; |
84 } | 84 } |
85 | 85 |
86 PassRefPtr<SVGPathSegClosePath> SVGPathElement::createSVGPathSegClosePath() | 86 PassRefPtr<SVGPathSegClosePath> SVGPathElement::createSVGPathSegClosePath() |
87 { | 87 { |
88 return SVGPathSegClosePath::create(0, PathSegUndefinedRole); | 88 return SVGPathSegClosePath::create(0); |
89 } | 89 } |
90 | 90 |
91 PassRefPtr<SVGPathSegMovetoAbs> SVGPathElement::createSVGPathSegMovetoAbs(float
x, float y) | 91 PassRefPtr<SVGPathSegMovetoAbs> SVGPathElement::createSVGPathSegMovetoAbs(float
x, float y) |
92 { | 92 { |
93 return SVGPathSegMovetoAbs::create(0, PathSegUndefinedRole, x, y); | 93 return SVGPathSegMovetoAbs::create(0, x, y); |
94 } | 94 } |
95 | 95 |
96 PassRefPtr<SVGPathSegMovetoRel> SVGPathElement::createSVGPathSegMovetoRel(float
x, float y) | 96 PassRefPtr<SVGPathSegMovetoRel> SVGPathElement::createSVGPathSegMovetoRel(float
x, float y) |
97 { | 97 { |
98 return SVGPathSegMovetoRel::create(0, PathSegUndefinedRole, x, y); | 98 return SVGPathSegMovetoRel::create(0, x, y); |
99 } | 99 } |
100 | 100 |
101 PassRefPtr<SVGPathSegLinetoAbs> SVGPathElement::createSVGPathSegLinetoAbs(float
x, float y) | 101 PassRefPtr<SVGPathSegLinetoAbs> SVGPathElement::createSVGPathSegLinetoAbs(float
x, float y) |
102 { | 102 { |
103 return SVGPathSegLinetoAbs::create(0, PathSegUndefinedRole, x, y); | 103 return SVGPathSegLinetoAbs::create(0, x, y); |
104 } | 104 } |
105 | 105 |
106 PassRefPtr<SVGPathSegLinetoRel> SVGPathElement::createSVGPathSegLinetoRel(float
x, float y) | 106 PassRefPtr<SVGPathSegLinetoRel> SVGPathElement::createSVGPathSegLinetoRel(float
x, float y) |
107 { | 107 { |
108 return SVGPathSegLinetoRel::create(0, PathSegUndefinedRole, x, y); | 108 return SVGPathSegLinetoRel::create(0, x, y); |
109 } | 109 } |
110 | 110 |
111 PassRefPtr<SVGPathSegCurvetoCubicAbs> SVGPathElement::createSVGPathSegCurvetoCub
icAbs(float x, float y, float x1, float y1, float x2, float y2) | 111 PassRefPtr<SVGPathSegCurvetoCubicAbs> SVGPathElement::createSVGPathSegCurvetoCub
icAbs(float x, float y, float x1, float y1, float x2, float y2) |
112 { | 112 { |
113 return SVGPathSegCurvetoCubicAbs::create(0, PathSegUndefinedRole, x, y, x1,
y1, x2, y2); | 113 return SVGPathSegCurvetoCubicAbs::create(0, x, y, x1, y1, x2, y2); |
114 } | 114 } |
115 | 115 |
116 PassRefPtr<SVGPathSegCurvetoCubicRel> SVGPathElement::createSVGPathSegCurvetoCub
icRel(float x, float y, float x1, float y1, float x2, float y2) | 116 PassRefPtr<SVGPathSegCurvetoCubicRel> SVGPathElement::createSVGPathSegCurvetoCub
icRel(float x, float y, float x1, float y1, float x2, float y2) |
117 { | 117 { |
118 return SVGPathSegCurvetoCubicRel::create(0, PathSegUndefinedRole, x, y, x1,
y1, x2, y2); | 118 return SVGPathSegCurvetoCubicRel::create(0, x, y, x1, y1, x2, y2); |
119 } | 119 } |
120 | 120 |
121 PassRefPtr<SVGPathSegCurvetoQuadraticAbs> SVGPathElement::createSVGPathSegCurvet
oQuadraticAbs(float x, float y, float x1, float y1) | 121 PassRefPtr<SVGPathSegCurvetoQuadraticAbs> SVGPathElement::createSVGPathSegCurvet
oQuadraticAbs(float x, float y, float x1, float y1) |
122 { | 122 { |
123 return SVGPathSegCurvetoQuadraticAbs::create(0, PathSegUndefinedRole, x, y,
x1, y1); | 123 return SVGPathSegCurvetoQuadraticAbs::create(0, x, y, x1, y1); |
124 } | 124 } |
125 | 125 |
126 PassRefPtr<SVGPathSegCurvetoQuadraticRel> SVGPathElement::createSVGPathSegCurvet
oQuadraticRel(float x, float y, float x1, float y1) | 126 PassRefPtr<SVGPathSegCurvetoQuadraticRel> SVGPathElement::createSVGPathSegCurvet
oQuadraticRel(float x, float y, float x1, float y1) |
127 { | 127 { |
128 return SVGPathSegCurvetoQuadraticRel::create(0, PathSegUndefinedRole, x, y,
x1, y1); | 128 return SVGPathSegCurvetoQuadraticRel::create(0, x, y, x1, y1); |
129 } | 129 } |
130 | 130 |
131 PassRefPtr<SVGPathSegArcAbs> SVGPathElement::createSVGPathSegArcAbs(float x, flo
at y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) | 131 PassRefPtr<SVGPathSegArcAbs> SVGPathElement::createSVGPathSegArcAbs(float x, flo
at y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) |
132 { | 132 { |
133 return SVGPathSegArcAbs::create(0, PathSegUndefinedRole, x, y, r1, r2, angle
, largeArcFlag, sweepFlag); | 133 return SVGPathSegArcAbs::create(0, x, y, r1, r2, angle, largeArcFlag, sweepF
lag); |
134 } | 134 } |
135 | 135 |
136 PassRefPtr<SVGPathSegArcRel> SVGPathElement::createSVGPathSegArcRel(float x, flo
at y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) | 136 PassRefPtr<SVGPathSegArcRel> SVGPathElement::createSVGPathSegArcRel(float x, flo
at y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) |
137 { | 137 { |
138 return SVGPathSegArcRel::create(0, PathSegUndefinedRole, x, y, r1, r2, angle
, largeArcFlag, sweepFlag); | 138 return SVGPathSegArcRel::create(0, x, y, r1, r2, angle, largeArcFlag, sweepF
lag); |
139 } | 139 } |
140 | 140 |
141 PassRefPtr<SVGPathSegLinetoHorizontalAbs> SVGPathElement::createSVGPathSegLineto
HorizontalAbs(float x) | 141 PassRefPtr<SVGPathSegLinetoHorizontalAbs> SVGPathElement::createSVGPathSegLineto
HorizontalAbs(float x) |
142 { | 142 { |
143 return SVGPathSegLinetoHorizontalAbs::create(0, PathSegUndefinedRole, x); | 143 return SVGPathSegLinetoHorizontalAbs::create(0, x); |
144 } | 144 } |
145 | 145 |
146 PassRefPtr<SVGPathSegLinetoHorizontalRel> SVGPathElement::createSVGPathSegLineto
HorizontalRel(float x) | 146 PassRefPtr<SVGPathSegLinetoHorizontalRel> SVGPathElement::createSVGPathSegLineto
HorizontalRel(float x) |
147 { | 147 { |
148 return SVGPathSegLinetoHorizontalRel::create(0, PathSegUndefinedRole, x); | 148 return SVGPathSegLinetoHorizontalRel::create(0, x); |
149 } | 149 } |
150 | 150 |
151 PassRefPtr<SVGPathSegLinetoVerticalAbs> SVGPathElement::createSVGPathSegLinetoVe
rticalAbs(float y) | 151 PassRefPtr<SVGPathSegLinetoVerticalAbs> SVGPathElement::createSVGPathSegLinetoVe
rticalAbs(float y) |
152 { | 152 { |
153 return SVGPathSegLinetoVerticalAbs::create(0, PathSegUndefinedRole, y); | 153 return SVGPathSegLinetoVerticalAbs::create(0, y); |
154 } | 154 } |
155 | 155 |
156 PassRefPtr<SVGPathSegLinetoVerticalRel> SVGPathElement::createSVGPathSegLinetoVe
rticalRel(float y) | 156 PassRefPtr<SVGPathSegLinetoVerticalRel> SVGPathElement::createSVGPathSegLinetoVe
rticalRel(float y) |
157 { | 157 { |
158 return SVGPathSegLinetoVerticalRel::create(0, PathSegUndefinedRole, y); | 158 return SVGPathSegLinetoVerticalRel::create(0, y); |
159 } | 159 } |
160 | 160 |
161 PassRefPtr<SVGPathSegCurvetoCubicSmoothAbs> SVGPathElement::createSVGPathSegCurv
etoCubicSmoothAbs(float x, float y, float x2, float y2) | 161 PassRefPtr<SVGPathSegCurvetoCubicSmoothAbs> SVGPathElement::createSVGPathSegCurv
etoCubicSmoothAbs(float x, float y, float x2, float y2) |
162 { | 162 { |
163 return SVGPathSegCurvetoCubicSmoothAbs::create(0, PathSegUndefinedRole, x, y
, x2, y2); | 163 return SVGPathSegCurvetoCubicSmoothAbs::create(0, x, y, x2, y2); |
164 } | 164 } |
165 | 165 |
166 PassRefPtr<SVGPathSegCurvetoCubicSmoothRel> SVGPathElement::createSVGPathSegCurv
etoCubicSmoothRel(float x, float y, float x2, float y2) | 166 PassRefPtr<SVGPathSegCurvetoCubicSmoothRel> SVGPathElement::createSVGPathSegCurv
etoCubicSmoothRel(float x, float y, float x2, float y2) |
167 { | 167 { |
168 return SVGPathSegCurvetoCubicSmoothRel::create(0, PathSegUndefinedRole, x, y
, x2, y2); | 168 return SVGPathSegCurvetoCubicSmoothRel::create(0, x, y, x2, y2); |
169 } | 169 } |
170 | 170 |
171 PassRefPtr<SVGPathSegCurvetoQuadraticSmoothAbs> SVGPathElement::createSVGPathSeg
CurvetoQuadraticSmoothAbs(float x, float y) | 171 PassRefPtr<SVGPathSegCurvetoQuadraticSmoothAbs> SVGPathElement::createSVGPathSeg
CurvetoQuadraticSmoothAbs(float x, float y) |
172 { | 172 { |
173 return SVGPathSegCurvetoQuadraticSmoothAbs::create(0, PathSegUndefinedRole,
x, y); | 173 return SVGPathSegCurvetoQuadraticSmoothAbs::create(0, x, y); |
174 } | 174 } |
175 | 175 |
176 PassRefPtr<SVGPathSegCurvetoQuadraticSmoothRel> SVGPathElement::createSVGPathSeg
CurvetoQuadraticSmoothRel(float x, float y) | 176 PassRefPtr<SVGPathSegCurvetoQuadraticSmoothRel> SVGPathElement::createSVGPathSeg
CurvetoQuadraticSmoothRel(float x, float y) |
177 { | 177 { |
178 return SVGPathSegCurvetoQuadraticSmoothRel::create(0, PathSegUndefinedRole,
x, y); | 178 return SVGPathSegCurvetoQuadraticSmoothRel::create(0, x, y); |
179 } | 179 } |
180 | 180 |
181 bool SVGPathElement::isSupportedAttribute(const QualifiedName& attrName) | 181 bool SVGPathElement::isSupportedAttribute(const QualifiedName& attrName) |
182 { | 182 { |
183 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 183 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
184 if (supportedAttributes.isEmpty()) { | 184 if (supportedAttributes.isEmpty()) { |
185 supportedAttributes.add(SVGNames::dAttr); | 185 supportedAttributes.add(SVGNames::dAttr); |
186 supportedAttributes.add(SVGNames::pathLengthAttr); | 186 supportedAttributes.add(SVGNames::pathLengthAttr); |
187 } | 187 } |
188 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 188 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 281 |
282 // FIXME: Eventually we should support getBBox for detached elements. | 282 // FIXME: Eventually we should support getBBox for detached elements. |
283 if (!renderer()) | 283 if (!renderer()) |
284 return FloatRect(); | 284 return FloatRect(); |
285 | 285 |
286 RenderSVGShape* renderer = toRenderSVGShape(this->renderer()); | 286 RenderSVGShape* renderer = toRenderSVGShape(this->renderer()); |
287 return renderer->path().boundingRect(); | 287 return renderer->path().boundingRect(); |
288 } | 288 } |
289 | 289 |
290 } | 290 } |
OLD | NEW |