/* This file is part of the WebKit open source project. This file has been generated by generate-bindings.pl. DO NOT MODIFY! This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "JSWebKitAnimation.h" #include "ExceptionCode.h" #include "JSDOMBinding.h" #include "KURL.h" #include "WebKitAnimation.h" #include #include #include using namespace JSC; namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSWebKitAnimation); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSWebKitAnimationTableValues[11] = { { "name", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationName), (intptr_t)0 THUNK_GENERATOR(0) }, { "duration", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationDuration), (intptr_t)0 THUNK_GENERATOR(0) }, { "elapsedTime", DontDelete, (intptr_t)static_cast(jsWebKitAnimationElapsedTime), (intptr_t)setJSWebKitAnimationElapsedTime THUNK_GENERATOR(0) }, { "delay", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationDelay), (intptr_t)0 THUNK_GENERATOR(0) }, { "iterationCount", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationIterationCount), (intptr_t)0 THUNK_GENERATOR(0) }, { "paused", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationPaused), (intptr_t)0 THUNK_GENERATOR(0) }, { "ended", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationEnded), (intptr_t)0 THUNK_GENERATOR(0) }, { "direction", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationDirection), (intptr_t)0 THUNK_GENERATOR(0) }, { "fillMode", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationFillMode), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSWebKitAnimationTable = { 33, 31, JSWebKitAnimationTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSWebKitAnimationConstructorTableValues[7] = { { "DIRECTION_NORMAL", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationDIRECTION_NORMAL), (intptr_t)0 THUNK_GENERATOR(0) }, { "DIRECTION_ALTERNATE", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationDIRECTION_ALTERNATE), (intptr_t)0 THUNK_GENERATOR(0) }, { "FILL_NONE", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationFILL_NONE), (intptr_t)0 THUNK_GENERATOR(0) }, { "FILL_BACKWARDS", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationFILL_BACKWARDS), (intptr_t)0 THUNK_GENERATOR(0) }, { "FILL_FORWARDS", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationFILL_FORWARDS), (intptr_t)0 THUNK_GENERATOR(0) }, { "FILL_BOTH", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationFILL_BOTH), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSWebKitAnimationConstructorTable = { 16, 15, JSWebKitAnimationConstructorTableValues, 0 }; COMPILE_ASSERT(0 == WebKitAnimation::DIRECTION_NORMAL, WebKitAnimationEnumDIRECTION_NORMALIsWrongUseDontCheckEnums); COMPILE_ASSERT(1 == WebKitAnimation::DIRECTION_ALTERNATE, WebKitAnimationEnumDIRECTION_ALTERNATEIsWrongUseDontCheckEnums); COMPILE_ASSERT(0 == WebKitAnimation::FILL_NONE, WebKitAnimationEnumFILL_NONEIsWrongUseDontCheckEnums); COMPILE_ASSERT(1 == WebKitAnimation::FILL_BACKWARDS, WebKitAnimationEnumFILL_BACKWARDSIsWrongUseDontCheckEnums); COMPILE_ASSERT(2 == WebKitAnimation::FILL_FORWARDS, WebKitAnimationEnumFILL_FORWARDSIsWrongUseDontCheckEnums); COMPILE_ASSERT(3 == WebKitAnimation::FILL_BOTH, WebKitAnimationEnumFILL_BOTHIsWrongUseDontCheckEnums); class JSWebKitAnimationConstructor : public DOMConstructorObject { public: JSWebKitAnimationConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSWebKitAnimationConstructor::s_info = { "WebKitAnimationConstructor", &DOMConstructorObject::s_info, &JSWebKitAnimationConstructorTable, 0 }; JSWebKitAnimationConstructor::JSWebKitAnimationConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSWebKitAnimationPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSWebKitAnimationConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot(exec, &JSWebKitAnimationConstructorTable, this, propertyName, slot); } bool JSWebKitAnimationConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor(exec, &JSWebKitAnimationConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSWebKitAnimationPrototypeTableValues[9] = { { "DIRECTION_NORMAL", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationDIRECTION_NORMAL), (intptr_t)0 THUNK_GENERATOR(0) }, { "DIRECTION_ALTERNATE", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationDIRECTION_ALTERNATE), (intptr_t)0 THUNK_GENERATOR(0) }, { "FILL_NONE", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationFILL_NONE), (intptr_t)0 THUNK_GENERATOR(0) }, { "FILL_BACKWARDS", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationFILL_BACKWARDS), (intptr_t)0 THUNK_GENERATOR(0) }, { "FILL_FORWARDS", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationFILL_FORWARDS), (intptr_t)0 THUNK_GENERATOR(0) }, { "FILL_BOTH", DontDelete | ReadOnly, (intptr_t)static_cast(jsWebKitAnimationFILL_BOTH), (intptr_t)0 THUNK_GENERATOR(0) }, { "play", DontDelete | Function, (intptr_t)static_cast(jsWebKitAnimationPrototypeFunctionPlay), (intptr_t)0 THUNK_GENERATOR(0) }, { "pause", DontDelete | Function, (intptr_t)static_cast(jsWebKitAnimationPrototypeFunctionPause), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSWebKitAnimationPrototypeTable = { 17, 15, JSWebKitAnimationPrototypeTableValues, 0 }; const ClassInfo JSWebKitAnimationPrototype::s_info = { "WebKitAnimationPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSWebKitAnimationPrototypeTable, 0 }; JSObject* JSWebKitAnimationPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype(exec, globalObject); } bool JSWebKitAnimationPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticPropertySlot(exec, &JSWebKitAnimationPrototypeTable, this, propertyName, slot); } bool JSWebKitAnimationPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticPropertyDescriptor(exec, &JSWebKitAnimationPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSWebKitAnimation::s_info = { "WebKitAnimation", &JSDOMWrapper::s_info, &JSWebKitAnimationTable, 0 }; JSWebKitAnimation::JSWebKitAnimation(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr impl) : JSDOMWrapper(structure, globalObject) , m_impl(impl) { ASSERT(inherits(&s_info)); } JSObject* JSWebKitAnimation::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSWebKitAnimationPrototype(exec->globalData(), globalObject, JSWebKitAnimationPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype())); } bool JSWebKitAnimation::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot(exec, &JSWebKitAnimationTable, this, propertyName, slot); } bool JSWebKitAnimation::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor(exec, &JSWebKitAnimationTable, this, propertyName, descriptor); } JSValue jsWebKitAnimationName(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebKitAnimation* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); WebKitAnimation* imp = static_cast(castedThis->impl()); JSValue result = jsString(exec, imp->name()); return result; } JSValue jsWebKitAnimationDuration(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebKitAnimation* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); WebKitAnimation* imp = static_cast(castedThis->impl()); JSValue result = jsNumber(imp->duration()); return result; } JSValue jsWebKitAnimationElapsedTime(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebKitAnimation* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); WebKitAnimation* imp = static_cast(castedThis->impl()); JSValue result = jsNumber(imp->elapsedTime()); return result; } JSValue jsWebKitAnimationDelay(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebKitAnimation* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); WebKitAnimation* imp = static_cast(castedThis->impl()); JSValue result = jsNumber(imp->delay()); return result; } JSValue jsWebKitAnimationIterationCount(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebKitAnimation* castedThis = static_cast(asObject(slotBase)); return castedThis->iterationCount(exec); } JSValue jsWebKitAnimationPaused(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebKitAnimation* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); WebKitAnimation* imp = static_cast(castedThis->impl()); JSValue result = jsBoolean(imp->paused()); return result; } JSValue jsWebKitAnimationEnded(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebKitAnimation* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); WebKitAnimation* imp = static_cast(castedThis->impl()); JSValue result = jsBoolean(imp->ended()); return result; } JSValue jsWebKitAnimationDirection(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebKitAnimation* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); WebKitAnimation* imp = static_cast(castedThis->impl()); JSValue result = jsNumber(imp->direction()); return result; } JSValue jsWebKitAnimationFillMode(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebKitAnimation* castedThis = static_cast(asObject(slotBase)); UNUSED_PARAM(exec); WebKitAnimation* imp = static_cast(castedThis->impl()); JSValue result = jsNumber(imp->fillMode()); return result; } JSValue jsWebKitAnimationConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebKitAnimation* domObject = static_cast(asObject(slotBase)); return JSWebKitAnimation::getConstructor(exec, domObject->globalObject()); } void JSWebKitAnimation::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) { lookupPut(exec, propertyName, value, &JSWebKitAnimationTable, this, slot); } void setJSWebKitAnimationElapsedTime(ExecState* exec, JSObject* thisObject, JSValue value) { JSWebKitAnimation* castedThis = static_cast(thisObject); WebKitAnimation* imp = static_cast(castedThis->impl()); imp->setElapsedTime(value.toNumber(exec)); } JSValue JSWebKitAnimation::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor(exec, static_cast(globalObject)); } EncodedJSValue JSC_HOST_CALL jsWebKitAnimationPrototypeFunctionPlay(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSWebKitAnimation::s_info)) return throwVMTypeError(exec); JSWebKitAnimation* castedThis = static_cast(asObject(thisValue)); WebKitAnimation* imp = static_cast(castedThis->impl()); imp->play(); return JSValue::encode(jsUndefined()); } EncodedJSValue JSC_HOST_CALL jsWebKitAnimationPrototypeFunctionPause(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSWebKitAnimation::s_info)) return throwVMTypeError(exec); JSWebKitAnimation* castedThis = static_cast(asObject(thisValue)); WebKitAnimation* imp = static_cast(castedThis->impl()); imp->pause(); return JSValue::encode(jsUndefined()); } // Constant getters JSValue jsWebKitAnimationDIRECTION_NORMAL(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast(0)); } JSValue jsWebKitAnimationDIRECTION_ALTERNATE(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast(1)); } JSValue jsWebKitAnimationFILL_NONE(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast(0)); } JSValue jsWebKitAnimationFILL_BACKWARDS(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast(1)); } JSValue jsWebKitAnimationFILL_FORWARDS(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast(2)); } JSValue jsWebKitAnimationFILL_BOTH(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast(3)); } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, WebKitAnimation* impl) { return wrap(exec, globalObject, impl); } WebKitAnimation* toWebKitAnimation(JSC::JSValue value) { return value.inherits(&JSWebKitAnimation::s_info) ? static_cast(asObject(value))->impl() : 0; } }