|
1 /* |
|
2 This file is part of the WebKit open source project. |
|
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
|
4 |
|
5 This library is free software; you can redistribute it and/or |
|
6 modify it under the terms of the GNU Library General Public |
|
7 License as published by the Free Software Foundation; either |
|
8 version 2 of the License, or (at your option) any later version. |
|
9 |
|
10 This library is distributed in the hope that it will be useful, |
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 Library General Public License for more details. |
|
14 |
|
15 You should have received a copy of the GNU Library General Public License |
|
16 along with this library; see the file COPYING.LIB. If not, write to |
|
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
18 Boston, MA 02110-1301, USA. |
|
19 */ |
|
20 |
|
21 #include "config.h" |
|
22 |
|
23 |
|
24 #if ENABLE(SVG) |
|
25 |
|
26 #include "Document.h" |
|
27 #include "Frame.h" |
|
28 #include "SVGDocumentExtensions.h" |
|
29 #include "SVGElement.h" |
|
30 #include "SVGAnimatedTemplate.h" |
|
31 #include "JSSVGPathElement.h" |
|
32 |
|
33 #include <wtf/GetPtr.h> |
|
34 |
|
35 #include "CSSMutableStyleDeclaration.h" |
|
36 #include "CSSStyleDeclaration.h" |
|
37 #include "JSCSSStyleDeclaration.h" |
|
38 #include "JSSVGAnimatedBoolean.h" |
|
39 #include "JSSVGAnimatedNumber.h" |
|
40 #include "JSSVGAnimatedString.h" |
|
41 #include "JSSVGAnimatedTransformList.h" |
|
42 #include "JSSVGElement.h" |
|
43 #include "JSSVGMatrix.h" |
|
44 #include "JSSVGPathSegArcAbs.h" |
|
45 #include "JSSVGPathSegArcRel.h" |
|
46 #include "JSSVGPathSegClosePath.h" |
|
47 #include "JSSVGPathSegCurvetoCubicAbs.h" |
|
48 #include "JSSVGPathSegCurvetoCubicRel.h" |
|
49 #include "JSSVGPathSegCurvetoCubicSmoothAbs.h" |
|
50 #include "JSSVGPathSegCurvetoCubicSmoothRel.h" |
|
51 #include "JSSVGPathSegCurvetoQuadraticAbs.h" |
|
52 #include "JSSVGPathSegCurvetoQuadraticRel.h" |
|
53 #include "JSSVGPathSegCurvetoQuadraticSmoothAbs.h" |
|
54 #include "JSSVGPathSegCurvetoQuadraticSmoothRel.h" |
|
55 #include "JSSVGPathSegLinetoAbs.h" |
|
56 #include "JSSVGPathSegLinetoHorizontalAbs.h" |
|
57 #include "JSSVGPathSegLinetoHorizontalRel.h" |
|
58 #include "JSSVGPathSegLinetoRel.h" |
|
59 #include "JSSVGPathSegLinetoVerticalAbs.h" |
|
60 #include "JSSVGPathSegLinetoVerticalRel.h" |
|
61 #include "JSSVGPathSegList.h" |
|
62 #include "JSSVGPathSegMovetoAbs.h" |
|
63 #include "JSSVGPathSegMovetoRel.h" |
|
64 #include "JSSVGPoint.h" |
|
65 #include "JSSVGRect.h" |
|
66 #include "JSSVGStringList.h" |
|
67 #include "PlatformString.h" |
|
68 #include "SVGElement.h" |
|
69 #include "SVGPathElement.h" |
|
70 #include "SVGPathSegArc.h" |
|
71 #include "SVGPathSegClosePath.h" |
|
72 #include "SVGPathSegCurvetoCubic.h" |
|
73 #include "SVGPathSegCurvetoCubicSmooth.h" |
|
74 #include "SVGPathSegCurvetoQuadratic.h" |
|
75 #include "SVGPathSegCurvetoQuadraticSmooth.h" |
|
76 #include "SVGPathSegLineto.h" |
|
77 #include "SVGPathSegLinetoHorizontal.h" |
|
78 #include "SVGPathSegLinetoVertical.h" |
|
79 #include "SVGPathSegList.h" |
|
80 #include "SVGPathSegMoveto.h" |
|
81 #include "SVGStringList.h" |
|
82 |
|
83 using namespace KJS; |
|
84 |
|
85 namespace WebCore { |
|
86 |
|
87 /* Hash table */ |
|
88 |
|
89 static const HashEntry JSSVGPathElementTableEntries[] = |
|
90 { |
|
91 { "systemLanguage", JSSVGPathElement::SystemLanguageAttrNum, DontDelete|ReadOnly, 0, &JSSVGPathElementTableEntries[16] }, |
|
92 { "externalResourcesRequired", JSSVGPathElement::ExternalResourcesRequiredAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
93 { "className", JSSVGPathElement::ClassNameAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
94 { "requiredFeatures", JSSVGPathElement::RequiredFeaturesAttrNum, DontDelete|ReadOnly, 0, &JSSVGPathElementTableEntries[17] }, |
|
95 { 0, 0, 0, 0, 0 }, |
|
96 { 0, 0, 0, 0, 0 }, |
|
97 { 0, 0, 0, 0, 0 }, |
|
98 { "farthestViewportElement", JSSVGPathElement::FarthestViewportElementAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
99 { "xmllang", JSSVGPathElement::XmllangAttrNum, DontDelete, 0, &JSSVGPathElementTableEntries[19] }, |
|
100 { "requiredExtensions", JSSVGPathElement::RequiredExtensionsAttrNum, DontDelete|ReadOnly, 0, &JSSVGPathElementTableEntries[18] }, |
|
101 { "pathLength", JSSVGPathElement::PathLengthAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
102 { 0, 0, 0, 0, 0 }, |
|
103 { "style", JSSVGPathElement::StyleAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
104 { 0, 0, 0, 0, 0 }, |
|
105 { 0, 0, 0, 0, 0 }, |
|
106 { "pathSegList", JSSVGPathElement::PathSegListAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
107 { "xmlspace", JSSVGPathElement::XmlspaceAttrNum, DontDelete, 0, 0 }, |
|
108 { "transform", JSSVGPathElement::TransformAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
109 { "nearestViewportElement", JSSVGPathElement::NearestViewportElementAttrNum, DontDelete|ReadOnly, 0, &JSSVGPathElementTableEntries[20] }, |
|
110 { "normalizedPathSegList", JSSVGPathElement::NormalizedPathSegListAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
111 { "animatedPathSegList", JSSVGPathElement::AnimatedPathSegListAttrNum, DontDelete|ReadOnly, 0, &JSSVGPathElementTableEntries[21] }, |
|
112 { "animatedNormalizedPathSegList", JSSVGPathElement::AnimatedNormalizedPathSegListAttrNum, DontDelete|ReadOnly, 0, 0 } |
|
113 }; |
|
114 |
|
115 static const HashTable JSSVGPathElementTable = |
|
116 { |
|
117 2, 22, JSSVGPathElementTableEntries, 16 |
|
118 }; |
|
119 |
|
120 /* Hash table for prototype */ |
|
121 |
|
122 static const HashEntry JSSVGPathElementPrototypeTableEntries[] = |
|
123 { |
|
124 { "createSVGPathSegArcAbs", JSSVGPathElement::CreateSVGPathSegArcAbsFuncNum, DontDelete|Function, 7, &JSSVGPathElementPrototypeTableEntries[32] }, |
|
125 { 0, 0, 0, 0, 0 }, |
|
126 { "createSVGPathSegCurvetoCubicAbs", JSSVGPathElement::CreateSVGPathSegCurvetoCubicAbsFuncNum, DontDelete|Function, 6, 0 }, |
|
127 { 0, 0, 0, 0, 0 }, |
|
128 { 0, 0, 0, 0, 0 }, |
|
129 { "getCTM", JSSVGPathElement::GetCTMFuncNum, DontDelete|Function, 0, 0 }, |
|
130 { "getScreenCTM", JSSVGPathElement::GetScreenCTMFuncNum, DontDelete|Function, 0, 0 }, |
|
131 { "createSVGPathSegLinetoRel", JSSVGPathElement::CreateSVGPathSegLinetoRelFuncNum, DontDelete|Function, 2, 0 }, |
|
132 { 0, 0, 0, 0, 0 }, |
|
133 { "createSVGPathSegCurvetoQuadraticAbs", JSSVGPathElement::CreateSVGPathSegCurvetoQuadraticAbsFuncNum, DontDelete|Function, 4, 0 }, |
|
134 { "getTransformToElement", JSSVGPathElement::GetTransformToElementFuncNum, DontDelete|Function, 1, 0 }, |
|
135 { "getBBox", JSSVGPathElement::GetBBoxFuncNum, DontDelete|Function, 0, 0 }, |
|
136 { "createSVGPathSegLinetoAbs", JSSVGPathElement::CreateSVGPathSegLinetoAbsFuncNum, DontDelete|Function, 2, 0 }, |
|
137 { "createSVGPathSegLinetoHorizontalAbs", JSSVGPathElement::CreateSVGPathSegLinetoHorizontalAbsFuncNum, DontDelete|Function, 1, &JSSVGPathElementPrototypeTableEntries[28] }, |
|
138 { 0, 0, 0, 0, 0 }, |
|
139 { "createSVGPathSegClosePath", JSSVGPathElement::CreateSVGPathSegClosePathFuncNum, DontDelete|Function, 0, 0 }, |
|
140 { "createSVGPathSegCurvetoQuadraticRel", JSSVGPathElement::CreateSVGPathSegCurvetoQuadraticRelFuncNum, DontDelete|Function, 4, &JSSVGPathElementPrototypeTableEntries[33] }, |
|
141 { "createSVGPathSegCurvetoQuadraticSmoothRel", JSSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothRelFuncNum, DontDelete|Function, 2, 0 }, |
|
142 { "createSVGPathSegLinetoVerticalAbs", JSSVGPathElement::CreateSVGPathSegLinetoVerticalAbsFuncNum, DontDelete|Function, 1, 0 }, |
|
143 { "createSVGPathSegArcRel", JSSVGPathElement::CreateSVGPathSegArcRelFuncNum, DontDelete|Function, 7, 0 }, |
|
144 { "getTotalLength", JSSVGPathElement::GetTotalLengthFuncNum, DontDelete|Function, 0, &JSSVGPathElementPrototypeTableEntries[27] }, |
|
145 { "createSVGPathSegMovetoRel", JSSVGPathElement::CreateSVGPathSegMovetoRelFuncNum, DontDelete|Function, 2, 0 }, |
|
146 { 0, 0, 0, 0, 0 }, |
|
147 { "createSVGPathSegMovetoAbs", JSSVGPathElement::CreateSVGPathSegMovetoAbsFuncNum, DontDelete|Function, 2, &JSSVGPathElementPrototypeTableEntries[30] }, |
|
148 { "createSVGPathSegCurvetoCubicRel", JSSVGPathElement::CreateSVGPathSegCurvetoCubicRelFuncNum, DontDelete|Function, 6, 0 }, |
|
149 { 0, 0, 0, 0, 0 }, |
|
150 { "getPathSegAtLength", JSSVGPathElement::GetPathSegAtLengthFuncNum, DontDelete|Function, 1, &JSSVGPathElementPrototypeTableEntries[29] }, |
|
151 { "getPointAtLength", JSSVGPathElement::GetPointAtLengthFuncNum, DontDelete|Function, 1, &JSSVGPathElementPrototypeTableEntries[31] }, |
|
152 { "createSVGPathSegLinetoHorizontalRel", JSSVGPathElement::CreateSVGPathSegLinetoHorizontalRelFuncNum, DontDelete|Function, 1, 0 }, |
|
153 { "createSVGPathSegLinetoVerticalRel", JSSVGPathElement::CreateSVGPathSegLinetoVerticalRelFuncNum, DontDelete|Function, 1, 0 }, |
|
154 { "createSVGPathSegCurvetoCubicSmoothAbs", JSSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothAbsFuncNum, DontDelete|Function, 4, 0 }, |
|
155 { "createSVGPathSegCurvetoCubicSmoothRel", JSSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothRelFuncNum, DontDelete|Function, 4, 0 }, |
|
156 { "createSVGPathSegCurvetoQuadraticSmoothAbs", JSSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothAbsFuncNum, DontDelete|Function, 2, 0 }, |
|
157 { "hasExtension", JSSVGPathElement::HasExtensionFuncNum, DontDelete|Function, 1, 0 } |
|
158 }; |
|
159 |
|
160 static const HashTable JSSVGPathElementPrototypeTable = |
|
161 { |
|
162 2, 34, JSSVGPathElementPrototypeTableEntries, 27 |
|
163 }; |
|
164 |
|
165 const ClassInfo JSSVGPathElementPrototype::info = { "SVGPathElementPrototype", 0, &JSSVGPathElementPrototypeTable, 0 }; |
|
166 |
|
167 JSObject* JSSVGPathElementPrototype::self(ExecState* exec) |
|
168 { |
|
169 return KJS::cacheGlobalObject<JSSVGPathElementPrototype>(exec, "[[JSSVGPathElement.prototype]]"); |
|
170 } |
|
171 |
|
172 bool JSSVGPathElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
173 { |
|
174 return getStaticFunctionSlot<JSSVGPathElementPrototypeFunction, JSObject>(exec, &JSSVGPathElementPrototypeTable, this, propertyName, slot); |
|
175 } |
|
176 |
|
177 const ClassInfo JSSVGPathElement::info = { "SVGPathElement", &JSSVGElement::info, &JSSVGPathElementTable, 0 }; |
|
178 |
|
179 JSSVGPathElement::JSSVGPathElement(ExecState* exec, SVGPathElement* impl) |
|
180 : JSSVGElement(exec, impl) |
|
181 { |
|
182 setPrototype(JSSVGPathElementPrototype::self(exec)); |
|
183 } |
|
184 |
|
185 bool JSSVGPathElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
186 { |
|
187 return getStaticValueSlot<JSSVGPathElement, JSSVGElement>(exec, &JSSVGPathElementTable, this, propertyName, slot); |
|
188 } |
|
189 |
|
190 JSValue* JSSVGPathElement::getValueProperty(ExecState* exec, int token) const |
|
191 { |
|
192 switch (token) { |
|
193 case PathLengthAttrNum: { |
|
194 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
195 |
|
196 ASSERT(exec && exec->dynamicInterpreter()); |
|
197 |
|
198 RefPtr<SVGAnimatedNumber> obj = imp->pathLengthAnimated(); |
|
199 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
200 if (activeFrame) { |
|
201 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
202 if (extensions) { |
|
203 if (extensions->hasGenericContext<SVGAnimatedNumber>(obj.get())) |
|
204 ASSERT(extensions->genericContext<SVGAnimatedNumber>(obj.get()) == imp); |
|
205 else |
|
206 extensions->setGenericContext<SVGAnimatedNumber>(obj.get(), imp); |
|
207 } |
|
208 } |
|
209 |
|
210 return toJS(exec, obj.get()); |
|
211 } |
|
212 case RequiredFeaturesAttrNum: { |
|
213 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
214 |
|
215 return toJS(exec, WTF::getPtr(imp->requiredFeatures())); |
|
216 } |
|
217 case RequiredExtensionsAttrNum: { |
|
218 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
219 |
|
220 return toJS(exec, WTF::getPtr(imp->requiredExtensions())); |
|
221 } |
|
222 case SystemLanguageAttrNum: { |
|
223 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
224 |
|
225 return toJS(exec, WTF::getPtr(imp->systemLanguage())); |
|
226 } |
|
227 case XmllangAttrNum: { |
|
228 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
229 |
|
230 return jsString(imp->xmllang()); |
|
231 } |
|
232 case XmlspaceAttrNum: { |
|
233 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
234 |
|
235 return jsString(imp->xmlspace()); |
|
236 } |
|
237 case ExternalResourcesRequiredAttrNum: { |
|
238 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
239 |
|
240 ASSERT(exec && exec->dynamicInterpreter()); |
|
241 |
|
242 RefPtr<SVGAnimatedBoolean> obj = imp->externalResourcesRequiredAnimated(); |
|
243 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
244 if (activeFrame) { |
|
245 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
246 if (extensions) { |
|
247 if (extensions->hasGenericContext<SVGAnimatedBoolean>(obj.get())) |
|
248 ASSERT(extensions->genericContext<SVGAnimatedBoolean>(obj.get()) == imp); |
|
249 else |
|
250 extensions->setGenericContext<SVGAnimatedBoolean>(obj.get(), imp); |
|
251 } |
|
252 } |
|
253 |
|
254 return toJS(exec, obj.get()); |
|
255 } |
|
256 case ClassNameAttrNum: { |
|
257 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
258 |
|
259 ASSERT(exec && exec->dynamicInterpreter()); |
|
260 |
|
261 RefPtr<SVGAnimatedString> obj = imp->classNameAnimated(); |
|
262 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
263 if (activeFrame) { |
|
264 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
265 if (extensions) { |
|
266 if (extensions->hasGenericContext<SVGAnimatedString>(obj.get())) |
|
267 ASSERT(extensions->genericContext<SVGAnimatedString>(obj.get()) == imp); |
|
268 else |
|
269 extensions->setGenericContext<SVGAnimatedString>(obj.get(), imp); |
|
270 } |
|
271 } |
|
272 |
|
273 return toJS(exec, obj.get()); |
|
274 } |
|
275 case StyleAttrNum: { |
|
276 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
277 |
|
278 return toJS(exec, WTF::getPtr(imp->style())); |
|
279 } |
|
280 case TransformAttrNum: { |
|
281 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
282 |
|
283 ASSERT(exec && exec->dynamicInterpreter()); |
|
284 |
|
285 RefPtr<SVGAnimatedTransformList> obj = imp->transformAnimated(); |
|
286 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
287 if (activeFrame) { |
|
288 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
289 if (extensions) { |
|
290 if (extensions->hasGenericContext<SVGAnimatedTransformList>(obj.get())) |
|
291 ASSERT(extensions->genericContext<SVGAnimatedTransformList>(obj.get()) == imp); |
|
292 else |
|
293 extensions->setGenericContext<SVGAnimatedTransformList>(obj.get(), imp); |
|
294 } |
|
295 } |
|
296 |
|
297 return toJS(exec, obj.get()); |
|
298 } |
|
299 case NearestViewportElementAttrNum: { |
|
300 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
301 |
|
302 return toJS(exec, WTF::getPtr(imp->nearestViewportElement())); |
|
303 } |
|
304 case FarthestViewportElementAttrNum: { |
|
305 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
306 |
|
307 return toJS(exec, WTF::getPtr(imp->farthestViewportElement())); |
|
308 } |
|
309 case PathSegListAttrNum: { |
|
310 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
311 |
|
312 return toJS(exec, WTF::getPtr(imp->pathSegList())); |
|
313 } |
|
314 case NormalizedPathSegListAttrNum: { |
|
315 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
316 |
|
317 return toJS(exec, WTF::getPtr(imp->normalizedPathSegList())); |
|
318 } |
|
319 case AnimatedPathSegListAttrNum: { |
|
320 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
321 |
|
322 return toJS(exec, WTF::getPtr(imp->animatedPathSegList())); |
|
323 } |
|
324 case AnimatedNormalizedPathSegListAttrNum: { |
|
325 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
326 |
|
327 return toJS(exec, WTF::getPtr(imp->animatedNormalizedPathSegList())); |
|
328 } |
|
329 } |
|
330 return 0; |
|
331 } |
|
332 |
|
333 void JSSVGPathElement::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr) |
|
334 { |
|
335 lookupPut<JSSVGPathElement, JSSVGElement>(exec, propertyName, value, attr, &JSSVGPathElementTable, this); |
|
336 } |
|
337 |
|
338 void JSSVGPathElement::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/) |
|
339 { |
|
340 switch (token) { |
|
341 case XmllangAttrNum: { |
|
342 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
343 |
|
344 imp->setXmllang(value->toString(exec)); |
|
345 break; |
|
346 } |
|
347 case XmlspaceAttrNum: { |
|
348 SVGPathElement* imp = static_cast<SVGPathElement*>(impl()); |
|
349 |
|
350 imp->setXmlspace(value->toString(exec)); |
|
351 break; |
|
352 } |
|
353 } |
|
354 } |
|
355 |
|
356 JSValue* JSSVGPathElementPrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args) |
|
357 { |
|
358 if (!thisObj->inherits(&JSSVGPathElement::info)) |
|
359 return throwError(exec, TypeError); |
|
360 |
|
361 SVGPathElement* imp = static_cast<SVGPathElement*>(static_cast<JSSVGPathElement*>(thisObj)->impl()); |
|
362 |
|
363 switch (id) { |
|
364 case JSSVGPathElement::GetTotalLengthFuncNum: { |
|
365 |
|
366 |
|
367 KJS::JSValue* result = jsNumber(imp->getTotalLength()); |
|
368 return result; |
|
369 } |
|
370 case JSSVGPathElement::GetPointAtLengthFuncNum: { |
|
371 float distance = args[0]->toFloat(exec); |
|
372 |
|
373 |
|
374 KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapper<FloatPoint>(imp->getPointAtLength(distance))); |
|
375 return result; |
|
376 } |
|
377 case JSSVGPathElement::GetPathSegAtLengthFuncNum: { |
|
378 float distance = args[0]->toFloat(exec); |
|
379 |
|
380 |
|
381 KJS::JSValue* result = jsNumber(imp->getPathSegAtLength(distance)); |
|
382 return result; |
|
383 } |
|
384 case JSSVGPathElement::CreateSVGPathSegClosePathFuncNum: { |
|
385 |
|
386 |
|
387 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegClosePath())); |
|
388 return result; |
|
389 } |
|
390 case JSSVGPathElement::CreateSVGPathSegMovetoAbsFuncNum: { |
|
391 float x = args[0]->toFloat(exec); |
|
392 float y = args[1]->toFloat(exec); |
|
393 |
|
394 |
|
395 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegMovetoAbs(x, y))); |
|
396 return result; |
|
397 } |
|
398 case JSSVGPathElement::CreateSVGPathSegMovetoRelFuncNum: { |
|
399 float x = args[0]->toFloat(exec); |
|
400 float y = args[1]->toFloat(exec); |
|
401 |
|
402 |
|
403 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegMovetoRel(x, y))); |
|
404 return result; |
|
405 } |
|
406 case JSSVGPathElement::CreateSVGPathSegLinetoAbsFuncNum: { |
|
407 float x = args[0]->toFloat(exec); |
|
408 float y = args[1]->toFloat(exec); |
|
409 |
|
410 |
|
411 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegLinetoAbs(x, y))); |
|
412 return result; |
|
413 } |
|
414 case JSSVGPathElement::CreateSVGPathSegLinetoRelFuncNum: { |
|
415 float x = args[0]->toFloat(exec); |
|
416 float y = args[1]->toFloat(exec); |
|
417 |
|
418 |
|
419 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegLinetoRel(x, y))); |
|
420 return result; |
|
421 } |
|
422 case JSSVGPathElement::CreateSVGPathSegCurvetoCubicAbsFuncNum: { |
|
423 float x = args[0]->toFloat(exec); |
|
424 float y = args[1]->toFloat(exec); |
|
425 float x1 = args[2]->toFloat(exec); |
|
426 float y1 = args[3]->toFloat(exec); |
|
427 float x2 = args[4]->toFloat(exec); |
|
428 float y2 = args[5]->toFloat(exec); |
|
429 |
|
430 |
|
431 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2))); |
|
432 return result; |
|
433 } |
|
434 case JSSVGPathElement::CreateSVGPathSegCurvetoCubicRelFuncNum: { |
|
435 float x = args[0]->toFloat(exec); |
|
436 float y = args[1]->toFloat(exec); |
|
437 float x1 = args[2]->toFloat(exec); |
|
438 float y1 = args[3]->toFloat(exec); |
|
439 float x2 = args[4]->toFloat(exec); |
|
440 float y2 = args[5]->toFloat(exec); |
|
441 |
|
442 |
|
443 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2))); |
|
444 return result; |
|
445 } |
|
446 case JSSVGPathElement::CreateSVGPathSegCurvetoQuadraticAbsFuncNum: { |
|
447 float x = args[0]->toFloat(exec); |
|
448 float y = args[1]->toFloat(exec); |
|
449 float x1 = args[2]->toFloat(exec); |
|
450 float y1 = args[3]->toFloat(exec); |
|
451 |
|
452 |
|
453 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegCurvetoQuadraticAbs(x, y, x1, y1))); |
|
454 return result; |
|
455 } |
|
456 case JSSVGPathElement::CreateSVGPathSegCurvetoQuadraticRelFuncNum: { |
|
457 float x = args[0]->toFloat(exec); |
|
458 float y = args[1]->toFloat(exec); |
|
459 float x1 = args[2]->toFloat(exec); |
|
460 float y1 = args[3]->toFloat(exec); |
|
461 |
|
462 |
|
463 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegCurvetoQuadraticRel(x, y, x1, y1))); |
|
464 return result; |
|
465 } |
|
466 case JSSVGPathElement::CreateSVGPathSegArcAbsFuncNum: { |
|
467 float x = args[0]->toFloat(exec); |
|
468 float y = args[1]->toFloat(exec); |
|
469 float r1 = args[2]->toFloat(exec); |
|
470 float r2 = args[3]->toFloat(exec); |
|
471 float angle = args[4]->toFloat(exec); |
|
472 bool largeArcFlag = args[5]->toBoolean(exec); |
|
473 bool sweepFlag = args[6]->toBoolean(exec); |
|
474 |
|
475 |
|
476 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegArcAbs(x, y, r1, r2, angle, largeArcFlag, sweepFlag))); |
|
477 return result; |
|
478 } |
|
479 case JSSVGPathElement::CreateSVGPathSegArcRelFuncNum: { |
|
480 float x = args[0]->toFloat(exec); |
|
481 float y = args[1]->toFloat(exec); |
|
482 float r1 = args[2]->toFloat(exec); |
|
483 float r2 = args[3]->toFloat(exec); |
|
484 float angle = args[4]->toFloat(exec); |
|
485 bool largeArcFlag = args[5]->toBoolean(exec); |
|
486 bool sweepFlag = args[6]->toBoolean(exec); |
|
487 |
|
488 |
|
489 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegArcRel(x, y, r1, r2, angle, largeArcFlag, sweepFlag))); |
|
490 return result; |
|
491 } |
|
492 case JSSVGPathElement::CreateSVGPathSegLinetoHorizontalAbsFuncNum: { |
|
493 float x = args[0]->toFloat(exec); |
|
494 |
|
495 |
|
496 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegLinetoHorizontalAbs(x))); |
|
497 return result; |
|
498 } |
|
499 case JSSVGPathElement::CreateSVGPathSegLinetoHorizontalRelFuncNum: { |
|
500 float x = args[0]->toFloat(exec); |
|
501 |
|
502 |
|
503 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegLinetoHorizontalRel(x))); |
|
504 return result; |
|
505 } |
|
506 case JSSVGPathElement::CreateSVGPathSegLinetoVerticalAbsFuncNum: { |
|
507 float y = args[0]->toFloat(exec); |
|
508 |
|
509 |
|
510 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegLinetoVerticalAbs(y))); |
|
511 return result; |
|
512 } |
|
513 case JSSVGPathElement::CreateSVGPathSegLinetoVerticalRelFuncNum: { |
|
514 float y = args[0]->toFloat(exec); |
|
515 |
|
516 |
|
517 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegLinetoVerticalRel(y))); |
|
518 return result; |
|
519 } |
|
520 case JSSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothAbsFuncNum: { |
|
521 float x = args[0]->toFloat(exec); |
|
522 float y = args[1]->toFloat(exec); |
|
523 float x2 = args[2]->toFloat(exec); |
|
524 float y2 = args[3]->toFloat(exec); |
|
525 |
|
526 |
|
527 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2))); |
|
528 return result; |
|
529 } |
|
530 case JSSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothRelFuncNum: { |
|
531 float x = args[0]->toFloat(exec); |
|
532 float y = args[1]->toFloat(exec); |
|
533 float x2 = args[2]->toFloat(exec); |
|
534 float y2 = args[3]->toFloat(exec); |
|
535 |
|
536 |
|
537 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2))); |
|
538 return result; |
|
539 } |
|
540 case JSSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothAbsFuncNum: { |
|
541 float x = args[0]->toFloat(exec); |
|
542 float y = args[1]->toFloat(exec); |
|
543 |
|
544 |
|
545 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegCurvetoQuadraticSmoothAbs(x, y))); |
|
546 return result; |
|
547 } |
|
548 case JSSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothRelFuncNum: { |
|
549 float x = args[0]->toFloat(exec); |
|
550 float y = args[1]->toFloat(exec); |
|
551 |
|
552 |
|
553 KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegCurvetoQuadraticSmoothRel(x, y))); |
|
554 return result; |
|
555 } |
|
556 case JSSVGPathElement::HasExtensionFuncNum: { |
|
557 String extension = args[0]->toString(exec); |
|
558 |
|
559 |
|
560 KJS::JSValue* result = jsBoolean(imp->hasExtension(extension)); |
|
561 return result; |
|
562 } |
|
563 case JSSVGPathElement::GetBBoxFuncNum: { |
|
564 |
|
565 |
|
566 KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapper<FloatRect>(imp->getBBox())); |
|
567 return result; |
|
568 } |
|
569 case JSSVGPathElement::GetCTMFuncNum: { |
|
570 |
|
571 |
|
572 KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapper<AffineTransform>(imp->getCTM())); |
|
573 return result; |
|
574 } |
|
575 case JSSVGPathElement::GetScreenCTMFuncNum: { |
|
576 |
|
577 |
|
578 KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapper<AffineTransform>(imp->getScreenCTM())); |
|
579 return result; |
|
580 } |
|
581 case JSSVGPathElement::GetTransformToElementFuncNum: { |
|
582 ExceptionCode ec = 0; |
|
583 SVGElement* element = toSVGElement(args[0]); |
|
584 |
|
585 |
|
586 KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapper<AffineTransform>(imp->getTransformToElement(element, ec))); |
|
587 setDOMException(exec, ec); |
|
588 return result; |
|
589 } |
|
590 } |
|
591 return 0; |
|
592 } |
|
593 |
|
594 } |
|
595 |
|
596 #endif // ENABLE(SVG) |