2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
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.
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.
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.
25 #include "JSSVGAngle.h"
27 #include "ExceptionCode.h"
28 #include "JSDOMBinding.h"
31 #include <runtime/Error.h>
32 #include <runtime/JSString.h>
33 #include <wtf/GetPtr.h>
39 ASSERT_CLASS_FITS_IN_CELL(JSSVGAngle);
43 #define THUNK_GENERATOR(generator) , generator
45 #define THUNK_GENERATOR(generator)
48 #define INTRINSIC(intrinsic) , intrinsic
50 #define INTRINSIC(intrinsic)
53 static const HashTableValue JSSVGAngleTableValues[] =
55 { "unitType", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAngleUnitType), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
56 { "value", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAngleValue), (intptr_t)setJSSVGAngleValue THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
57 { "valueInSpecifiedUnits", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAngleValueInSpecifiedUnits), (intptr_t)setJSSVGAngleValueInSpecifiedUnits THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
58 { "valueAsString", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAngleValueAsString), (intptr_t)setJSSVGAngleValueAsString THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
59 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAngleConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
60 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
63 #undef THUNK_GENERATOR
64 static const HashTable JSSVGAngleTable = { 17, 15, JSSVGAngleTableValues, 0 };
65 /* Hash table for constructor */
67 #define THUNK_GENERATOR(generator) , generator
69 #define THUNK_GENERATOR(generator)
72 #define INTRINSIC(intrinsic) , intrinsic
74 #define INTRINSIC(intrinsic)
77 static const HashTableValue JSSVGAngleConstructorTableValues[] =
79 { "SVG_ANGLETYPE_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAngleSVG_ANGLETYPE_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
80 { "SVG_ANGLETYPE_UNSPECIFIED", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAngleSVG_ANGLETYPE_UNSPECIFIED), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
81 { "SVG_ANGLETYPE_DEG", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAngleSVG_ANGLETYPE_DEG), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
82 { "SVG_ANGLETYPE_RAD", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAngleSVG_ANGLETYPE_RAD), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
83 { "SVG_ANGLETYPE_GRAD", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAngleSVG_ANGLETYPE_GRAD), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
84 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
87 #undef THUNK_GENERATOR
88 static const HashTable JSSVGAngleConstructorTable = { 18, 15, JSSVGAngleConstructorTableValues, 0 };
90 COMPILE_ASSERT(0 == SVGAngle::SVG_ANGLETYPE_UNKNOWN, SVGAngleEnumSVG_ANGLETYPE_UNKNOWNIsWrongUseDontCheckEnums);
91 COMPILE_ASSERT(1 == SVGAngle::SVG_ANGLETYPE_UNSPECIFIED, SVGAngleEnumSVG_ANGLETYPE_UNSPECIFIEDIsWrongUseDontCheckEnums);
92 COMPILE_ASSERT(2 == SVGAngle::SVG_ANGLETYPE_DEG, SVGAngleEnumSVG_ANGLETYPE_DEGIsWrongUseDontCheckEnums);
93 COMPILE_ASSERT(3 == SVGAngle::SVG_ANGLETYPE_RAD, SVGAngleEnumSVG_ANGLETYPE_RADIsWrongUseDontCheckEnums);
94 COMPILE_ASSERT(4 == SVGAngle::SVG_ANGLETYPE_GRAD, SVGAngleEnumSVG_ANGLETYPE_GRADIsWrongUseDontCheckEnums);
96 const ClassInfo JSSVGAngleConstructor::s_info = { "SVGAngleConstructor", &DOMConstructorObject::s_info, &JSSVGAngleConstructorTable, 0, CREATE_METHOD_TABLE(JSSVGAngleConstructor) };
98 JSSVGAngleConstructor::JSSVGAngleConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
99 : DOMConstructorObject(structure, globalObject)
103 void JSSVGAngleConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
105 Base::finishCreation(exec->globalData());
106 ASSERT(inherits(&s_info));
107 putDirect(exec->globalData(), exec->propertyNames().prototype, JSSVGAnglePrototype::self(exec, globalObject), DontDelete | ReadOnly);
110 bool JSSVGAngleConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
112 return getStaticValueSlot<JSSVGAngleConstructor, JSDOMWrapper>(exec, &JSSVGAngleConstructorTable, static_cast<JSSVGAngleConstructor*>(cell), propertyName, slot);
115 bool JSSVGAngleConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
117 return getStaticValueDescriptor<JSSVGAngleConstructor, JSDOMWrapper>(exec, &JSSVGAngleConstructorTable, static_cast<JSSVGAngleConstructor*>(object), propertyName, descriptor);
120 /* Hash table for prototype */
122 #define THUNK_GENERATOR(generator) , generator
124 #define THUNK_GENERATOR(generator)
127 #define INTRINSIC(intrinsic) , intrinsic
129 #define INTRINSIC(intrinsic)
132 static const HashTableValue JSSVGAnglePrototypeTableValues[] =
134 { "SVG_ANGLETYPE_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAngleSVG_ANGLETYPE_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
135 { "SVG_ANGLETYPE_UNSPECIFIED", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAngleSVG_ANGLETYPE_UNSPECIFIED), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
136 { "SVG_ANGLETYPE_DEG", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAngleSVG_ANGLETYPE_DEG), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
137 { "SVG_ANGLETYPE_RAD", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAngleSVG_ANGLETYPE_RAD), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
138 { "SVG_ANGLETYPE_GRAD", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAngleSVG_ANGLETYPE_GRAD), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
139 { "newValueSpecifiedUnits", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGAnglePrototypeFunctionNewValueSpecifiedUnits), (intptr_t)2 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
140 { "convertToSpecifiedUnits", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGAnglePrototypeFunctionConvertToSpecifiedUnits), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
141 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
144 #undef THUNK_GENERATOR
145 static const HashTable JSSVGAnglePrototypeTable = { 18, 15, JSSVGAnglePrototypeTableValues, 0 };
146 const ClassInfo JSSVGAnglePrototype::s_info = { "SVGAnglePrototype", &JSC::JSNonFinalObject::s_info, &JSSVGAnglePrototypeTable, 0, CREATE_METHOD_TABLE(JSSVGAnglePrototype) };
148 JSObject* JSSVGAnglePrototype::self(ExecState* exec, JSGlobalObject* globalObject)
150 return getDOMPrototype<JSSVGAngle>(exec, globalObject);
153 bool JSSVGAnglePrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
155 JSSVGAnglePrototype* thisObject = jsCast<JSSVGAnglePrototype*>(cell);
156 return getStaticPropertySlot<JSSVGAnglePrototype, JSObject>(exec, &JSSVGAnglePrototypeTable, thisObject, propertyName, slot);
159 bool JSSVGAnglePrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
161 JSSVGAnglePrototype* thisObject = jsCast<JSSVGAnglePrototype*>(object);
162 return getStaticPropertyDescriptor<JSSVGAnglePrototype, JSObject>(exec, &JSSVGAnglePrototypeTable, thisObject, propertyName, descriptor);
165 const ClassInfo JSSVGAngle::s_info = { "SVGAngle", &JSDOMWrapper::s_info, &JSSVGAngleTable, 0 , CREATE_METHOD_TABLE(JSSVGAngle) };
167 JSSVGAngle::JSSVGAngle(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGPropertyTearOff<SVGAngle> > impl)
168 : JSDOMWrapper(structure, globalObject)
169 , m_impl(impl.leakRef())
173 void JSSVGAngle::finishCreation(JSGlobalData& globalData)
175 Base::finishCreation(globalData);
176 ASSERT(inherits(&s_info));
179 JSObject* JSSVGAngle::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
181 return JSSVGAnglePrototype::create(exec->globalData(), globalObject, JSSVGAnglePrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
184 bool JSSVGAngle::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
186 JSSVGAngle* thisObject = jsCast<JSSVGAngle*>(cell);
187 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
188 return getStaticValueSlot<JSSVGAngle, Base>(exec, &JSSVGAngleTable, thisObject, propertyName, slot);
191 bool JSSVGAngle::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
193 JSSVGAngle* thisObject = jsCast<JSSVGAngle*>(object);
194 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
195 return getStaticValueDescriptor<JSSVGAngle, Base>(exec, &JSSVGAngleTable, thisObject, propertyName, descriptor);
198 JSValue jsSVGAngleUnitType(ExecState* exec, JSValue slotBase, const Identifier&)
200 JSSVGAngle* castedThis = static_cast<JSSVGAngle*>(asObject(slotBase));
202 SVGAngle& imp = castedThis->impl()->propertyReference();
203 JSValue result = jsNumber(imp.unitType());
208 JSValue jsSVGAngleValue(ExecState* exec, JSValue slotBase, const Identifier&)
210 JSSVGAngle* castedThis = static_cast<JSSVGAngle*>(asObject(slotBase));
212 SVGAngle& imp = castedThis->impl()->propertyReference();
213 JSValue result = jsNumber(imp.value());
218 JSValue jsSVGAngleValueInSpecifiedUnits(ExecState* exec, JSValue slotBase, const Identifier&)
220 JSSVGAngle* castedThis = static_cast<JSSVGAngle*>(asObject(slotBase));
222 SVGAngle& imp = castedThis->impl()->propertyReference();
223 JSValue result = jsNumber(imp.valueInSpecifiedUnits());
228 JSValue jsSVGAngleValueAsString(ExecState* exec, JSValue slotBase, const Identifier&)
230 JSSVGAngle* castedThis = static_cast<JSSVGAngle*>(asObject(slotBase));
232 SVGAngle& imp = castedThis->impl()->propertyReference();
233 JSValue result = jsString(exec, imp.valueAsString());
238 JSValue jsSVGAngleConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
240 JSSVGAngle* domObject = static_cast<JSSVGAngle*>(asObject(slotBase));
241 return JSSVGAngle::getConstructor(exec, domObject->globalObject());
244 void JSSVGAngle::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
246 JSSVGAngle* thisObject = jsCast<JSSVGAngle*>(cell);
247 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
248 lookupPut<JSSVGAngle, Base>(exec, propertyName, value, &JSSVGAngleTable, thisObject, slot);
251 void setJSSVGAngleValue(ExecState* exec, JSObject* thisObject, JSValue value)
253 JSSVGAngle* castedThis = static_cast<JSSVGAngle*>(thisObject);
254 SVGPropertyTearOff<SVGAngle> * imp = static_cast<SVGPropertyTearOff<SVGAngle> *>(castedThis->impl());
255 if (imp->role() == AnimValRole) {
256 setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
259 SVGAngle& podImp = imp->propertyReference();
260 podImp.setValue(value.toFloat(exec));
265 void setJSSVGAngleValueInSpecifiedUnits(ExecState* exec, JSObject* thisObject, JSValue value)
267 JSSVGAngle* castedThis = static_cast<JSSVGAngle*>(thisObject);
268 SVGPropertyTearOff<SVGAngle> * imp = static_cast<SVGPropertyTearOff<SVGAngle> *>(castedThis->impl());
269 if (imp->role() == AnimValRole) {
270 setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
273 SVGAngle& podImp = imp->propertyReference();
274 podImp.setValueInSpecifiedUnits(value.toFloat(exec));
279 void setJSSVGAngleValueAsString(ExecState* exec, JSObject* thisObject, JSValue value)
281 JSSVGAngle* castedThis = static_cast<JSSVGAngle*>(thisObject);
282 SVGPropertyTearOff<SVGAngle> * imp = static_cast<SVGPropertyTearOff<SVGAngle> *>(castedThis->impl());
283 ExceptionCode ec = 0;
284 if (imp->role() == AnimValRole) {
285 setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
288 SVGAngle& podImp = imp->propertyReference();
289 podImp.setValueAsString(valueToStringWithNullCheck(exec, value), ec);
290 setDOMException(exec, ec);
296 JSValue JSSVGAngle::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
298 return getDOMConstructor<JSSVGAngleConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
301 EncodedJSValue JSC_HOST_CALL jsSVGAnglePrototypeFunctionNewValueSpecifiedUnits(ExecState* exec)
303 JSValue thisValue = exec->hostThisValue();
304 if (!thisValue.inherits(&JSSVGAngle::s_info))
305 return throwVMTypeError(exec);
306 JSSVGAngle* castedThis = static_cast<JSSVGAngle*>(asObject(thisValue));
307 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSSVGAngle::s_info);
308 SVGPropertyTearOff<SVGAngle> * imp = static_cast<SVGPropertyTearOff<SVGAngle> *>(castedThis->impl());
309 if (imp->role() == AnimValRole) {
310 setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
311 return JSValue::encode(jsUndefined());
313 SVGAngle& podImp = imp->propertyReference();
314 if (exec->argumentCount() < 2)
315 return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
316 ExceptionCode ec = 0;
317 unsigned short unitType(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toUInt32(exec));
318 if (exec->hadException())
319 return JSValue::encode(jsUndefined());
320 float valueInSpecifiedUnits(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toFloat(exec));
321 if (exec->hadException())
322 return JSValue::encode(jsUndefined());
323 podImp.newValueSpecifiedUnits(unitType, valueInSpecifiedUnits, ec);
324 setDOMException(exec, ec);
327 return JSValue::encode(jsUndefined());
330 EncodedJSValue JSC_HOST_CALL jsSVGAnglePrototypeFunctionConvertToSpecifiedUnits(ExecState* exec)
332 JSValue thisValue = exec->hostThisValue();
333 if (!thisValue.inherits(&JSSVGAngle::s_info))
334 return throwVMTypeError(exec);
335 JSSVGAngle* castedThis = static_cast<JSSVGAngle*>(asObject(thisValue));
336 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSSVGAngle::s_info);
337 SVGPropertyTearOff<SVGAngle> * imp = static_cast<SVGPropertyTearOff<SVGAngle> *>(castedThis->impl());
338 if (imp->role() == AnimValRole) {
339 setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
340 return JSValue::encode(jsUndefined());
342 SVGAngle& podImp = imp->propertyReference();
343 if (exec->argumentCount() < 1)
344 return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
345 ExceptionCode ec = 0;
346 unsigned short unitType(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toUInt32(exec));
347 if (exec->hadException())
348 return JSValue::encode(jsUndefined());
349 podImp.convertToSpecifiedUnits(unitType, ec);
350 setDOMException(exec, ec);
353 return JSValue::encode(jsUndefined());
358 JSValue jsSVGAngleSVG_ANGLETYPE_UNKNOWN(ExecState* exec, JSValue, const Identifier&)
361 return jsNumber(static_cast<int>(0));
364 JSValue jsSVGAngleSVG_ANGLETYPE_UNSPECIFIED(ExecState* exec, JSValue, const Identifier&)
367 return jsNumber(static_cast<int>(1));
370 JSValue jsSVGAngleSVG_ANGLETYPE_DEG(ExecState* exec, JSValue, const Identifier&)
373 return jsNumber(static_cast<int>(2));
376 JSValue jsSVGAngleSVG_ANGLETYPE_RAD(ExecState* exec, JSValue, const Identifier&)
379 return jsNumber(static_cast<int>(3));
382 JSValue jsSVGAngleSVG_ANGLETYPE_GRAD(ExecState* exec, JSValue, const Identifier&)
385 return jsNumber(static_cast<int>(4));
388 static inline bool isObservable(JSSVGAngle* jsSVGAngle)
390 if (jsSVGAngle->hasCustomProperties())
395 bool JSSVGAngleOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
397 JSSVGAngle* jsSVGAngle = static_cast<JSSVGAngle*>(handle.get().asCell());
398 if (!isObservable(jsSVGAngle))
400 UNUSED_PARAM(visitor);
404 void JSSVGAngleOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
406 JSSVGAngle* jsSVGAngle = static_cast<JSSVGAngle*>(handle.get().asCell());
407 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
408 uncacheWrapper(world, jsSVGAngle->impl(), jsSVGAngle);
409 jsSVGAngle->releaseImpl();
412 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SVGPropertyTearOff<SVGAngle> * impl)
414 return wrap<JSSVGAngle, SVGPropertyTearOff<SVGAngle> >(exec, globalObject, impl);
417 SVGPropertyTearOff<SVGAngle> * toSVGAngle(JSC::JSValue value)
419 return value.inherits(&JSSVGAngle::s_info) ? static_cast<JSSVGAngle*>(asObject(value))->impl() : 0;
424 #endif // ENABLE(SVG)