diff -r 000000000000 -r 4f2f89ce4247 WebCore/generated/JSTouch.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WebCore/generated/JSTouch.cpp Fri Sep 17 09:02:29 2010 +0300 @@ -0,0 +1,252 @@ +/* + 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" + +#if ENABLE(TOUCH_EVENTS) + +#include "JSTouch.h" + +#include "EventTarget.h" +#include "JSEventTarget.h" +#include "Touch.h" +#include +#include + +using namespace JSC; + +namespace WebCore { + +ASSERT_CLASS_FITS_IN_CELL(JSTouch); + +/* Hash table */ +#if ENABLE(JIT) +#define THUNK_GENERATOR(generator) , generator +#else +#define THUNK_GENERATOR(generator) +#endif + +static const HashTableValue JSTouchTableValues[10] = +{ + { "clientX", DontDelete | ReadOnly, (intptr_t)static_cast(jsTouchClientX), (intptr_t)0 THUNK_GENERATOR(0) }, + { "clientY", DontDelete | ReadOnly, (intptr_t)static_cast(jsTouchClientY), (intptr_t)0 THUNK_GENERATOR(0) }, + { "screenX", DontDelete | ReadOnly, (intptr_t)static_cast(jsTouchScreenX), (intptr_t)0 THUNK_GENERATOR(0) }, + { "screenY", DontDelete | ReadOnly, (intptr_t)static_cast(jsTouchScreenY), (intptr_t)0 THUNK_GENERATOR(0) }, + { "pageX", DontDelete | ReadOnly, (intptr_t)static_cast(jsTouchPageX), (intptr_t)0 THUNK_GENERATOR(0) }, + { "pageY", DontDelete | ReadOnly, (intptr_t)static_cast(jsTouchPageY), (intptr_t)0 THUNK_GENERATOR(0) }, + { "target", DontDelete | ReadOnly, (intptr_t)static_cast(jsTouchTarget), (intptr_t)0 THUNK_GENERATOR(0) }, + { "identifier", DontDelete | ReadOnly, (intptr_t)static_cast(jsTouchIdentifier), (intptr_t)0 THUNK_GENERATOR(0) }, + { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast(jsTouchConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, + { 0, 0, 0, 0 THUNK_GENERATOR(0) } +}; + +#undef THUNK_GENERATOR +static JSC_CONST_HASHTABLE HashTable JSTouchTable = { 32, 31, JSTouchTableValues, 0 }; +/* Hash table for constructor */ +#if ENABLE(JIT) +#define THUNK_GENERATOR(generator) , generator +#else +#define THUNK_GENERATOR(generator) +#endif + +static const HashTableValue JSTouchConstructorTableValues[1] = +{ + { 0, 0, 0, 0 THUNK_GENERATOR(0) } +}; + +#undef THUNK_GENERATOR +static JSC_CONST_HASHTABLE HashTable JSTouchConstructorTable = { 1, 0, JSTouchConstructorTableValues, 0 }; +class JSTouchConstructor : public DOMConstructorObject { +public: + JSTouchConstructor(JSC::ExecState*, JSDOMGlobalObject*); + + virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); + virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); + virtual const JSC::ClassInfo* classInfo() const { return &s_info; } + static const JSC::ClassInfo s_info; + static PassRefPtr createStructure(JSC::JSValue prototype) + { + return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); + } +protected: + static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; +}; + +const ClassInfo JSTouchConstructor::s_info = { "TouchConstructor", 0, &JSTouchConstructorTable, 0 }; + +JSTouchConstructor::JSTouchConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) + : DOMConstructorObject(JSTouchConstructor::createStructure(globalObject->objectPrototype()), globalObject) +{ + putDirect(exec->propertyNames().prototype, JSTouchPrototype::self(exec, globalObject), DontDelete | ReadOnly); +} + +bool JSTouchConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + return getStaticValueSlot(exec, &JSTouchConstructorTable, this, propertyName, slot); +} + +bool JSTouchConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +{ + return getStaticValueDescriptor(exec, &JSTouchConstructorTable, this, propertyName, descriptor); +} + +/* Hash table for prototype */ +#if ENABLE(JIT) +#define THUNK_GENERATOR(generator) , generator +#else +#define THUNK_GENERATOR(generator) +#endif + +static const HashTableValue JSTouchPrototypeTableValues[1] = +{ + { 0, 0, 0, 0 THUNK_GENERATOR(0) } +}; + +#undef THUNK_GENERATOR +static JSC_CONST_HASHTABLE HashTable JSTouchPrototypeTable = { 1, 0, JSTouchPrototypeTableValues, 0 }; +const ClassInfo JSTouchPrototype::s_info = { "TouchPrototype", 0, &JSTouchPrototypeTable, 0 }; + +JSObject* JSTouchPrototype::self(ExecState* exec, JSGlobalObject* globalObject) +{ + return getDOMPrototype(exec, globalObject); +} + +const ClassInfo JSTouch::s_info = { "Touch", 0, &JSTouchTable, 0 }; + +JSTouch::JSTouch(NonNullPassRefPtr structure, JSDOMGlobalObject* globalObject, PassRefPtr impl) + : DOMObjectWithGlobalPointer(structure, globalObject) + , m_impl(impl) +{ +} + +JSTouch::~JSTouch() +{ + forgetDOMObject(this, impl()); +} + +JSObject* JSTouch::createPrototype(ExecState* exec, JSGlobalObject* globalObject) +{ + return new (exec) JSTouchPrototype(globalObject, JSTouchPrototype::createStructure(globalObject->objectPrototype())); +} + +bool JSTouch::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + return getStaticValueSlot(exec, &JSTouchTable, this, propertyName, slot); +} + +bool JSTouch::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +{ + return getStaticValueDescriptor(exec, &JSTouchTable, this, propertyName, descriptor); +} + +JSValue jsTouchClientX(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTouch* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Touch* imp = static_cast(castedThis->impl()); + JSValue result = jsNumber(exec, imp->clientX()); + return result; +} + +JSValue jsTouchClientY(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTouch* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Touch* imp = static_cast(castedThis->impl()); + JSValue result = jsNumber(exec, imp->clientY()); + return result; +} + +JSValue jsTouchScreenX(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTouch* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Touch* imp = static_cast(castedThis->impl()); + JSValue result = jsNumber(exec, imp->screenX()); + return result; +} + +JSValue jsTouchScreenY(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTouch* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Touch* imp = static_cast(castedThis->impl()); + JSValue result = jsNumber(exec, imp->screenY()); + return result; +} + +JSValue jsTouchPageX(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTouch* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Touch* imp = static_cast(castedThis->impl()); + JSValue result = jsNumber(exec, imp->pageX()); + return result; +} + +JSValue jsTouchPageY(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTouch* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Touch* imp = static_cast(castedThis->impl()); + JSValue result = jsNumber(exec, imp->pageY()); + return result; +} + +JSValue jsTouchTarget(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTouch* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Touch* imp = static_cast(castedThis->impl()); + JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->target())); + return result; +} + +JSValue jsTouchIdentifier(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTouch* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Touch* imp = static_cast(castedThis->impl()); + JSValue result = jsNumber(exec, imp->identifier()); + return result; +} + +JSValue jsTouchConstructor(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSTouch* domObject = static_cast(asObject(slotBase)); + return JSTouch::getConstructor(exec, domObject->globalObject()); +} +JSValue JSTouch::getConstructor(ExecState* exec, JSGlobalObject* globalObject) +{ + return getDOMConstructor(exec, static_cast(globalObject)); +} + +JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Touch* object) +{ + return getDOMObjectWrapper(exec, globalObject, object); +} +Touch* toTouch(JSC::JSValue value) +{ + return value.inherits(&JSTouch::s_info) ? static_cast(asObject(value))->impl() : 0; +} + +} + +#endif // ENABLE(TOUCH_EVENTS)