|
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 #if ENABLE(SVG_ANIMATION) |
|
24 |
|
25 #include "JSSVGAnimationElement.h" |
|
26 |
|
27 #include "JSSVGAnimatedBoolean.h" |
|
28 #include "JSSVGElement.h" |
|
29 #include "JSSVGStringList.h" |
|
30 #include "SVGAnimationElement.h" |
|
31 #include "SVGElement.h" |
|
32 #include "SVGStringList.h" |
|
33 #include <runtime/Error.h> |
|
34 #include <runtime/JSNumberCell.h> |
|
35 #include <wtf/GetPtr.h> |
|
36 |
|
37 using namespace JSC; |
|
38 |
|
39 namespace WebCore { |
|
40 |
|
41 ASSERT_CLASS_FITS_IN_CELL(JSSVGAnimationElement); |
|
42 |
|
43 /* Hash table */ |
|
44 #if ENABLE(JIT) |
|
45 #define THUNK_GENERATOR(generator) , generator |
|
46 #else |
|
47 #define THUNK_GENERATOR(generator) |
|
48 #endif |
|
49 |
|
50 static const HashTableValue JSSVGAnimationElementTableValues[6] = |
|
51 { |
|
52 { "targetElement", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimationElementTargetElement), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
53 { "requiredFeatures", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimationElementRequiredFeatures), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
54 { "requiredExtensions", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimationElementRequiredExtensions), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
55 { "systemLanguage", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimationElementSystemLanguage), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
56 { "externalResourcesRequired", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimationElementExternalResourcesRequired), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
57 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
58 }; |
|
59 |
|
60 #undef THUNK_GENERATOR |
|
61 static JSC_CONST_HASHTABLE HashTable JSSVGAnimationElementTable = { 16, 15, JSSVGAnimationElementTableValues, 0 }; |
|
62 /* Hash table for prototype */ |
|
63 #if ENABLE(JIT) |
|
64 #define THUNK_GENERATOR(generator) , generator |
|
65 #else |
|
66 #define THUNK_GENERATOR(generator) |
|
67 #endif |
|
68 |
|
69 static const HashTableValue JSSVGAnimationElementPrototypeTableValues[9] = |
|
70 { |
|
71 { "getStartTime", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGAnimationElementPrototypeFunctionGetStartTime), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
72 { "getCurrentTime", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGAnimationElementPrototypeFunctionGetCurrentTime), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
73 { "getSimpleDuration", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGAnimationElementPrototypeFunctionGetSimpleDuration), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
74 { "hasExtension", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGAnimationElementPrototypeFunctionHasExtension), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
75 { "beginElement", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGAnimationElementPrototypeFunctionBeginElement), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
76 { "beginElementAt", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGAnimationElementPrototypeFunctionBeginElementAt), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
77 { "endElement", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGAnimationElementPrototypeFunctionEndElement), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
78 { "endElementAt", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGAnimationElementPrototypeFunctionEndElementAt), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
79 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
80 }; |
|
81 |
|
82 #undef THUNK_GENERATOR |
|
83 static JSC_CONST_HASHTABLE HashTable JSSVGAnimationElementPrototypeTable = { 17, 15, JSSVGAnimationElementPrototypeTableValues, 0 }; |
|
84 const ClassInfo JSSVGAnimationElementPrototype::s_info = { "SVGAnimationElementPrototype", 0, &JSSVGAnimationElementPrototypeTable, 0 }; |
|
85 |
|
86 JSObject* JSSVGAnimationElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
87 { |
|
88 return getDOMPrototype<JSSVGAnimationElement>(exec, globalObject); |
|
89 } |
|
90 |
|
91 bool JSSVGAnimationElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
92 { |
|
93 return getStaticFunctionSlot<JSObject>(exec, &JSSVGAnimationElementPrototypeTable, this, propertyName, slot); |
|
94 } |
|
95 |
|
96 bool JSSVGAnimationElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
97 { |
|
98 return getStaticFunctionDescriptor<JSObject>(exec, &JSSVGAnimationElementPrototypeTable, this, propertyName, descriptor); |
|
99 } |
|
100 |
|
101 const ClassInfo JSSVGAnimationElement::s_info = { "SVGAnimationElement", &JSSVGElement::s_info, &JSSVGAnimationElementTable, 0 }; |
|
102 |
|
103 JSSVGAnimationElement::JSSVGAnimationElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGAnimationElement> impl) |
|
104 : JSSVGElement(structure, globalObject, impl) |
|
105 { |
|
106 } |
|
107 |
|
108 JSObject* JSSVGAnimationElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
109 { |
|
110 return new (exec) JSSVGAnimationElementPrototype(globalObject, JSSVGAnimationElementPrototype::createStructure(JSSVGElementPrototype::self(exec, globalObject))); |
|
111 } |
|
112 |
|
113 bool JSSVGAnimationElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
114 { |
|
115 return getStaticValueSlot<JSSVGAnimationElement, Base>(exec, &JSSVGAnimationElementTable, this, propertyName, slot); |
|
116 } |
|
117 |
|
118 bool JSSVGAnimationElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
119 { |
|
120 return getStaticValueDescriptor<JSSVGAnimationElement, Base>(exec, &JSSVGAnimationElementTable, this, propertyName, descriptor); |
|
121 } |
|
122 |
|
123 JSValue jsSVGAnimationElementTargetElement(ExecState* exec, JSValue slotBase, const Identifier&) |
|
124 { |
|
125 JSSVGAnimationElement* castedThis = static_cast<JSSVGAnimationElement*>(asObject(slotBase)); |
|
126 UNUSED_PARAM(exec); |
|
127 SVGAnimationElement* imp = static_cast<SVGAnimationElement*>(castedThis->impl()); |
|
128 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->targetElement())); |
|
129 return result; |
|
130 } |
|
131 |
|
132 JSValue jsSVGAnimationElementRequiredFeatures(ExecState* exec, JSValue slotBase, const Identifier&) |
|
133 { |
|
134 JSSVGAnimationElement* castedThis = static_cast<JSSVGAnimationElement*>(asObject(slotBase)); |
|
135 UNUSED_PARAM(exec); |
|
136 SVGAnimationElement* imp = static_cast<SVGAnimationElement*>(castedThis->impl()); |
|
137 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->requiredFeatures()), imp); |
|
138 return result; |
|
139 } |
|
140 |
|
141 JSValue jsSVGAnimationElementRequiredExtensions(ExecState* exec, JSValue slotBase, const Identifier&) |
|
142 { |
|
143 JSSVGAnimationElement* castedThis = static_cast<JSSVGAnimationElement*>(asObject(slotBase)); |
|
144 UNUSED_PARAM(exec); |
|
145 SVGAnimationElement* imp = static_cast<SVGAnimationElement*>(castedThis->impl()); |
|
146 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->requiredExtensions()), imp); |
|
147 return result; |
|
148 } |
|
149 |
|
150 JSValue jsSVGAnimationElementSystemLanguage(ExecState* exec, JSValue slotBase, const Identifier&) |
|
151 { |
|
152 JSSVGAnimationElement* castedThis = static_cast<JSSVGAnimationElement*>(asObject(slotBase)); |
|
153 UNUSED_PARAM(exec); |
|
154 SVGAnimationElement* imp = static_cast<SVGAnimationElement*>(castedThis->impl()); |
|
155 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->systemLanguage()), imp); |
|
156 return result; |
|
157 } |
|
158 |
|
159 JSValue jsSVGAnimationElementExternalResourcesRequired(ExecState* exec, JSValue slotBase, const Identifier&) |
|
160 { |
|
161 JSSVGAnimationElement* castedThis = static_cast<JSSVGAnimationElement*>(asObject(slotBase)); |
|
162 UNUSED_PARAM(exec); |
|
163 SVGAnimationElement* imp = static_cast<SVGAnimationElement*>(castedThis->impl()); |
|
164 RefPtr<SVGAnimatedBoolean> obj = imp->externalResourcesRequiredAnimated(); |
|
165 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
166 return result; |
|
167 } |
|
168 |
|
169 EncodedJSValue JSC_HOST_CALL jsSVGAnimationElementPrototypeFunctionGetStartTime(ExecState* exec) |
|
170 { |
|
171 JSValue thisValue = exec->hostThisValue(); |
|
172 if (!thisValue.inherits(&JSSVGAnimationElement::s_info)) |
|
173 return throwVMTypeError(exec); |
|
174 JSSVGAnimationElement* castedThis = static_cast<JSSVGAnimationElement*>(asObject(thisValue)); |
|
175 SVGAnimationElement* imp = static_cast<SVGAnimationElement*>(castedThis->impl()); |
|
176 |
|
177 |
|
178 JSC::JSValue result = jsNumber(exec, imp->getStartTime()); |
|
179 return JSValue::encode(result); |
|
180 } |
|
181 |
|
182 EncodedJSValue JSC_HOST_CALL jsSVGAnimationElementPrototypeFunctionGetCurrentTime(ExecState* exec) |
|
183 { |
|
184 JSValue thisValue = exec->hostThisValue(); |
|
185 if (!thisValue.inherits(&JSSVGAnimationElement::s_info)) |
|
186 return throwVMTypeError(exec); |
|
187 JSSVGAnimationElement* castedThis = static_cast<JSSVGAnimationElement*>(asObject(thisValue)); |
|
188 SVGAnimationElement* imp = static_cast<SVGAnimationElement*>(castedThis->impl()); |
|
189 |
|
190 |
|
191 JSC::JSValue result = jsNumber(exec, imp->getCurrentTime()); |
|
192 return JSValue::encode(result); |
|
193 } |
|
194 |
|
195 EncodedJSValue JSC_HOST_CALL jsSVGAnimationElementPrototypeFunctionGetSimpleDuration(ExecState* exec) |
|
196 { |
|
197 JSValue thisValue = exec->hostThisValue(); |
|
198 if (!thisValue.inherits(&JSSVGAnimationElement::s_info)) |
|
199 return throwVMTypeError(exec); |
|
200 JSSVGAnimationElement* castedThis = static_cast<JSSVGAnimationElement*>(asObject(thisValue)); |
|
201 SVGAnimationElement* imp = static_cast<SVGAnimationElement*>(castedThis->impl()); |
|
202 ExceptionCode ec = 0; |
|
203 |
|
204 |
|
205 JSC::JSValue result = jsNumber(exec, imp->getSimpleDuration(ec)); |
|
206 setDOMException(exec, ec); |
|
207 return JSValue::encode(result); |
|
208 } |
|
209 |
|
210 EncodedJSValue JSC_HOST_CALL jsSVGAnimationElementPrototypeFunctionHasExtension(ExecState* exec) |
|
211 { |
|
212 JSValue thisValue = exec->hostThisValue(); |
|
213 if (!thisValue.inherits(&JSSVGAnimationElement::s_info)) |
|
214 return throwVMTypeError(exec); |
|
215 JSSVGAnimationElement* castedThis = static_cast<JSSVGAnimationElement*>(asObject(thisValue)); |
|
216 SVGAnimationElement* imp = static_cast<SVGAnimationElement*>(castedThis->impl()); |
|
217 const String& extension = ustringToString(exec->argument(0).toString(exec)); |
|
218 |
|
219 |
|
220 JSC::JSValue result = jsBoolean(imp->hasExtension(extension)); |
|
221 return JSValue::encode(result); |
|
222 } |
|
223 |
|
224 EncodedJSValue JSC_HOST_CALL jsSVGAnimationElementPrototypeFunctionBeginElement(ExecState* exec) |
|
225 { |
|
226 JSValue thisValue = exec->hostThisValue(); |
|
227 if (!thisValue.inherits(&JSSVGAnimationElement::s_info)) |
|
228 return throwVMTypeError(exec); |
|
229 JSSVGAnimationElement* castedThis = static_cast<JSSVGAnimationElement*>(asObject(thisValue)); |
|
230 SVGAnimationElement* imp = static_cast<SVGAnimationElement*>(castedThis->impl()); |
|
231 |
|
232 imp->beginElement(); |
|
233 return JSValue::encode(jsUndefined()); |
|
234 } |
|
235 |
|
236 EncodedJSValue JSC_HOST_CALL jsSVGAnimationElementPrototypeFunctionBeginElementAt(ExecState* exec) |
|
237 { |
|
238 JSValue thisValue = exec->hostThisValue(); |
|
239 if (!thisValue.inherits(&JSSVGAnimationElement::s_info)) |
|
240 return throwVMTypeError(exec); |
|
241 JSSVGAnimationElement* castedThis = static_cast<JSSVGAnimationElement*>(asObject(thisValue)); |
|
242 SVGAnimationElement* imp = static_cast<SVGAnimationElement*>(castedThis->impl()); |
|
243 float offset = exec->argument(0).toFloat(exec); |
|
244 |
|
245 imp->beginElementAt(offset); |
|
246 return JSValue::encode(jsUndefined()); |
|
247 } |
|
248 |
|
249 EncodedJSValue JSC_HOST_CALL jsSVGAnimationElementPrototypeFunctionEndElement(ExecState* exec) |
|
250 { |
|
251 JSValue thisValue = exec->hostThisValue(); |
|
252 if (!thisValue.inherits(&JSSVGAnimationElement::s_info)) |
|
253 return throwVMTypeError(exec); |
|
254 JSSVGAnimationElement* castedThis = static_cast<JSSVGAnimationElement*>(asObject(thisValue)); |
|
255 SVGAnimationElement* imp = static_cast<SVGAnimationElement*>(castedThis->impl()); |
|
256 |
|
257 imp->endElement(); |
|
258 return JSValue::encode(jsUndefined()); |
|
259 } |
|
260 |
|
261 EncodedJSValue JSC_HOST_CALL jsSVGAnimationElementPrototypeFunctionEndElementAt(ExecState* exec) |
|
262 { |
|
263 JSValue thisValue = exec->hostThisValue(); |
|
264 if (!thisValue.inherits(&JSSVGAnimationElement::s_info)) |
|
265 return throwVMTypeError(exec); |
|
266 JSSVGAnimationElement* castedThis = static_cast<JSSVGAnimationElement*>(asObject(thisValue)); |
|
267 SVGAnimationElement* imp = static_cast<SVGAnimationElement*>(castedThis->impl()); |
|
268 float offset = exec->argument(0).toFloat(exec); |
|
269 |
|
270 imp->endElementAt(offset); |
|
271 return JSValue::encode(jsUndefined()); |
|
272 } |
|
273 |
|
274 |
|
275 } |
|
276 |
|
277 #endif // ENABLE(SVG_ANIMATION) |