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 "JSSVGAnimatedNumber.h"
27 #include <runtime/Error.h>
28 #include <wtf/GetPtr.h>
34 ASSERT_CLASS_FITS_IN_CELL(JSSVGAnimatedNumber);
38 #define THUNK_GENERATOR(generator) , generator
40 #define THUNK_GENERATOR(generator)
43 #define INTRINSIC(intrinsic) , intrinsic
45 #define INTRINSIC(intrinsic)
48 static const HashTableValue JSSVGAnimatedNumberTableValues[] =
50 { "baseVal", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedNumberBaseVal), (intptr_t)setJSSVGAnimatedNumberBaseVal THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
51 { "animVal", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedNumberAnimVal), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
52 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedNumberConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
56 #undef THUNK_GENERATOR
57 static const HashTable JSSVGAnimatedNumberTable = { 8, 7, JSSVGAnimatedNumberTableValues, 0 };
58 /* Hash table for constructor */
60 #define THUNK_GENERATOR(generator) , generator
62 #define THUNK_GENERATOR(generator)
65 #define INTRINSIC(intrinsic) , intrinsic
67 #define INTRINSIC(intrinsic)
70 static const HashTableValue JSSVGAnimatedNumberConstructorTableValues[] =
72 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
75 #undef THUNK_GENERATOR
76 static const HashTable JSSVGAnimatedNumberConstructorTable = { 1, 0, JSSVGAnimatedNumberConstructorTableValues, 0 };
77 const ClassInfo JSSVGAnimatedNumberConstructor::s_info = { "SVGAnimatedNumberConstructor", &DOMConstructorObject::s_info, &JSSVGAnimatedNumberConstructorTable, 0, CREATE_METHOD_TABLE(JSSVGAnimatedNumberConstructor) };
79 JSSVGAnimatedNumberConstructor::JSSVGAnimatedNumberConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
80 : DOMConstructorObject(structure, globalObject)
84 void JSSVGAnimatedNumberConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
86 Base::finishCreation(exec->globalData());
87 ASSERT(inherits(&s_info));
88 putDirect(exec->globalData(), exec->propertyNames().prototype, JSSVGAnimatedNumberPrototype::self(exec, globalObject), DontDelete | ReadOnly);
91 bool JSSVGAnimatedNumberConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
93 return getStaticValueSlot<JSSVGAnimatedNumberConstructor, JSDOMWrapper>(exec, &JSSVGAnimatedNumberConstructorTable, static_cast<JSSVGAnimatedNumberConstructor*>(cell), propertyName, slot);
96 bool JSSVGAnimatedNumberConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
98 return getStaticValueDescriptor<JSSVGAnimatedNumberConstructor, JSDOMWrapper>(exec, &JSSVGAnimatedNumberConstructorTable, static_cast<JSSVGAnimatedNumberConstructor*>(object), propertyName, descriptor);
101 /* Hash table for prototype */
103 #define THUNK_GENERATOR(generator) , generator
105 #define THUNK_GENERATOR(generator)
108 #define INTRINSIC(intrinsic) , intrinsic
110 #define INTRINSIC(intrinsic)
113 static const HashTableValue JSSVGAnimatedNumberPrototypeTableValues[] =
115 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
118 #undef THUNK_GENERATOR
119 static const HashTable JSSVGAnimatedNumberPrototypeTable = { 1, 0, JSSVGAnimatedNumberPrototypeTableValues, 0 };
120 const ClassInfo JSSVGAnimatedNumberPrototype::s_info = { "SVGAnimatedNumberPrototype", &JSC::JSNonFinalObject::s_info, &JSSVGAnimatedNumberPrototypeTable, 0, CREATE_METHOD_TABLE(JSSVGAnimatedNumberPrototype) };
122 JSObject* JSSVGAnimatedNumberPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
124 return getDOMPrototype<JSSVGAnimatedNumber>(exec, globalObject);
127 const ClassInfo JSSVGAnimatedNumber::s_info = { "SVGAnimatedNumber", &JSDOMWrapper::s_info, &JSSVGAnimatedNumberTable, 0 , CREATE_METHOD_TABLE(JSSVGAnimatedNumber) };
129 JSSVGAnimatedNumber::JSSVGAnimatedNumber(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGAnimatedNumber> impl)
130 : JSDOMWrapper(structure, globalObject)
131 , m_impl(impl.leakRef())
135 void JSSVGAnimatedNumber::finishCreation(JSGlobalData& globalData)
137 Base::finishCreation(globalData);
138 ASSERT(inherits(&s_info));
141 JSObject* JSSVGAnimatedNumber::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
143 return JSSVGAnimatedNumberPrototype::create(exec->globalData(), globalObject, JSSVGAnimatedNumberPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
146 bool JSSVGAnimatedNumber::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
148 JSSVGAnimatedNumber* thisObject = jsCast<JSSVGAnimatedNumber*>(cell);
149 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
150 return getStaticValueSlot<JSSVGAnimatedNumber, Base>(exec, &JSSVGAnimatedNumberTable, thisObject, propertyName, slot);
153 bool JSSVGAnimatedNumber::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
155 JSSVGAnimatedNumber* thisObject = jsCast<JSSVGAnimatedNumber*>(object);
156 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
157 return getStaticValueDescriptor<JSSVGAnimatedNumber, Base>(exec, &JSSVGAnimatedNumberTable, thisObject, propertyName, descriptor);
160 JSValue jsSVGAnimatedNumberBaseVal(ExecState* exec, JSValue slotBase, const Identifier&)
162 JSSVGAnimatedNumber* castedThis = static_cast<JSSVGAnimatedNumber*>(asObject(slotBase));
164 SVGAnimatedNumber* imp = static_cast<SVGAnimatedNumber*>(castedThis->impl());
165 JSValue result = jsNumber(imp->baseVal());
170 JSValue jsSVGAnimatedNumberAnimVal(ExecState* exec, JSValue slotBase, const Identifier&)
172 JSSVGAnimatedNumber* castedThis = static_cast<JSSVGAnimatedNumber*>(asObject(slotBase));
174 SVGAnimatedNumber* imp = static_cast<SVGAnimatedNumber*>(castedThis->impl());
175 JSValue result = jsNumber(imp->animVal());
180 JSValue jsSVGAnimatedNumberConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
182 JSSVGAnimatedNumber* domObject = static_cast<JSSVGAnimatedNumber*>(asObject(slotBase));
183 return JSSVGAnimatedNumber::getConstructor(exec, domObject->globalObject());
186 void JSSVGAnimatedNumber::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
188 JSSVGAnimatedNumber* thisObject = jsCast<JSSVGAnimatedNumber*>(cell);
189 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
190 lookupPut<JSSVGAnimatedNumber, Base>(exec, propertyName, value, &JSSVGAnimatedNumberTable, thisObject, slot);
193 void setJSSVGAnimatedNumberBaseVal(ExecState* exec, JSObject* thisObject, JSValue value)
195 JSSVGAnimatedNumber* castedThis = static_cast<JSSVGAnimatedNumber*>(thisObject);
196 SVGAnimatedNumber* imp = static_cast<SVGAnimatedNumber*>(castedThis->impl());
197 ExceptionCode ec = 0;
198 imp->setBaseVal(value.toFloat(exec), ec);
199 setDOMException(exec, ec);
203 JSValue JSSVGAnimatedNumber::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
205 return getDOMConstructor<JSSVGAnimatedNumberConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
208 static inline bool isObservable(JSSVGAnimatedNumber* jsSVGAnimatedNumber)
210 if (jsSVGAnimatedNumber->hasCustomProperties())
215 bool JSSVGAnimatedNumberOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
217 JSSVGAnimatedNumber* jsSVGAnimatedNumber = static_cast<JSSVGAnimatedNumber*>(handle.get().asCell());
218 if (!isObservable(jsSVGAnimatedNumber))
220 UNUSED_PARAM(visitor);
224 void JSSVGAnimatedNumberOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
226 JSSVGAnimatedNumber* jsSVGAnimatedNumber = static_cast<JSSVGAnimatedNumber*>(handle.get().asCell());
227 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
228 uncacheWrapper(world, jsSVGAnimatedNumber->impl(), jsSVGAnimatedNumber);
229 jsSVGAnimatedNumber->releaseImpl();
232 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SVGAnimatedNumber* impl)
234 return wrap<JSSVGAnimatedNumber>(exec, globalObject, impl);
237 SVGAnimatedNumber* toSVGAnimatedNumber(JSC::JSValue value)
239 return value.inherits(&JSSVGAnimatedNumber::s_info) ? static_cast<JSSVGAnimatedNumber*>(asObject(value))->impl() : 0;
244 #endif // ENABLE(SVG)