diff -r 000000000000 -r 4f2f89ce4247 WebCore/generated/JSRect.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WebCore/generated/JSRect.cpp Fri Sep 17 09:02:29 2010 +0300 @@ -0,0 +1,206 @@ +/* + 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 "JSRect.h" + +#include "CSSPrimitiveValue.h" +#include "JSCSSPrimitiveValue.h" +#include "Rect.h" +#include + +using namespace JSC; + +namespace WebCore { + +ASSERT_CLASS_FITS_IN_CELL(JSRect); + +/* Hash table */ +#if ENABLE(JIT) +#define THUNK_GENERATOR(generator) , generator +#else +#define THUNK_GENERATOR(generator) +#endif + +static const HashTableValue JSRectTableValues[6] = +{ + { "top", DontDelete | ReadOnly, (intptr_t)static_cast(jsRectTop), (intptr_t)0 THUNK_GENERATOR(0) }, + { "right", DontDelete | ReadOnly, (intptr_t)static_cast(jsRectRight), (intptr_t)0 THUNK_GENERATOR(0) }, + { "bottom", DontDelete | ReadOnly, (intptr_t)static_cast(jsRectBottom), (intptr_t)0 THUNK_GENERATOR(0) }, + { "left", DontDelete | ReadOnly, (intptr_t)static_cast(jsRectLeft), (intptr_t)0 THUNK_GENERATOR(0) }, + { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast(jsRectConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, + { 0, 0, 0, 0 THUNK_GENERATOR(0) } +}; + +#undef THUNK_GENERATOR +static JSC_CONST_HASHTABLE HashTable JSRectTable = { 16, 15, JSRectTableValues, 0 }; +/* Hash table for constructor */ +#if ENABLE(JIT) +#define THUNK_GENERATOR(generator) , generator +#else +#define THUNK_GENERATOR(generator) +#endif + +static const HashTableValue JSRectConstructorTableValues[1] = +{ + { 0, 0, 0, 0 THUNK_GENERATOR(0) } +}; + +#undef THUNK_GENERATOR +static JSC_CONST_HASHTABLE HashTable JSRectConstructorTable = { 1, 0, JSRectConstructorTableValues, 0 }; +class JSRectConstructor : public DOMConstructorObject { +public: + JSRectConstructor(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 JSRectConstructor::s_info = { "RectConstructor", 0, &JSRectConstructorTable, 0 }; + +JSRectConstructor::JSRectConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) + : DOMConstructorObject(JSRectConstructor::createStructure(globalObject->objectPrototype()), globalObject) +{ + putDirect(exec->propertyNames().prototype, JSRectPrototype::self(exec, globalObject), DontDelete | ReadOnly); +} + +bool JSRectConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + return getStaticValueSlot(exec, &JSRectConstructorTable, this, propertyName, slot); +} + +bool JSRectConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +{ + return getStaticValueDescriptor(exec, &JSRectConstructorTable, this, propertyName, descriptor); +} + +/* Hash table for prototype */ +#if ENABLE(JIT) +#define THUNK_GENERATOR(generator) , generator +#else +#define THUNK_GENERATOR(generator) +#endif + +static const HashTableValue JSRectPrototypeTableValues[1] = +{ + { 0, 0, 0, 0 THUNK_GENERATOR(0) } +}; + +#undef THUNK_GENERATOR +static JSC_CONST_HASHTABLE HashTable JSRectPrototypeTable = { 1, 0, JSRectPrototypeTableValues, 0 }; +const ClassInfo JSRectPrototype::s_info = { "RectPrototype", 0, &JSRectPrototypeTable, 0 }; + +JSObject* JSRectPrototype::self(ExecState* exec, JSGlobalObject* globalObject) +{ + return getDOMPrototype(exec, globalObject); +} + +const ClassInfo JSRect::s_info = { "Rect", 0, &JSRectTable, 0 }; + +JSRect::JSRect(NonNullPassRefPtr structure, JSDOMGlobalObject* globalObject, PassRefPtr impl) + : DOMObjectWithGlobalPointer(structure, globalObject) + , m_impl(impl) +{ +} + +JSRect::~JSRect() +{ + forgetDOMObject(this, impl()); +} + +JSObject* JSRect::createPrototype(ExecState* exec, JSGlobalObject* globalObject) +{ + return new (exec) JSRectPrototype(globalObject, JSRectPrototype::createStructure(globalObject->objectPrototype())); +} + +bool JSRect::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + return getStaticValueSlot(exec, &JSRectTable, this, propertyName, slot); +} + +bool JSRect::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +{ + return getStaticValueDescriptor(exec, &JSRectTable, this, propertyName, descriptor); +} + +JSValue jsRectTop(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSRect* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Rect* imp = static_cast(castedThis->impl()); + JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->top())); + return result; +} + +JSValue jsRectRight(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSRect* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Rect* imp = static_cast(castedThis->impl()); + JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->right())); + return result; +} + +JSValue jsRectBottom(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSRect* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Rect* imp = static_cast(castedThis->impl()); + JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->bottom())); + return result; +} + +JSValue jsRectLeft(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSRect* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + Rect* imp = static_cast(castedThis->impl()); + JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->left())); + return result; +} + +JSValue jsRectConstructor(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSRect* domObject = static_cast(asObject(slotBase)); + return JSRect::getConstructor(exec, domObject->globalObject()); +} +JSValue JSRect::getConstructor(ExecState* exec, JSGlobalObject* globalObject) +{ + return getDOMConstructor(exec, static_cast(globalObject)); +} + +JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Rect* object) +{ + return getDOMObjectWrapper(exec, globalObject, object); +} +Rect* toRect(JSC::JSValue value) +{ + return value.inherits(&JSRect::s_info) ? static_cast(asObject(value))->impl() : 0; +} + +}