diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/generated/JSDataGridColumnList.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/generated/JSDataGridColumnList.cpp | 301 |
1 files changed, 301 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/WebCore/generated/JSDataGridColumnList.cpp b/src/3rdparty/webkit/WebCore/generated/JSDataGridColumnList.cpp new file mode 100644 index 0000000..276878e --- /dev/null +++ b/src/3rdparty/webkit/WebCore/generated/JSDataGridColumnList.cpp @@ -0,0 +1,301 @@ +/* + 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 "JSDataGridColumnList.h" + +#include "AtomicString.h" +#include "DataGridColumn.h" +#include "DataGridColumnList.h" +#include "ExceptionCode.h" +#include "JSDataGridColumn.h" +#include <runtime/Error.h> +#include <runtime/JSNumberCell.h> +#include <runtime/PropertyNameArray.h> +#include <wtf/GetPtr.h> + +using namespace JSC; + +namespace WebCore { + +ASSERT_CLASS_FITS_IN_CELL(JSDataGridColumnList); + +/* Hash table */ + +static const HashTableValue JSDataGridColumnListTableValues[5] = +{ + { "length", DontDelete|ReadOnly, (intptr_t)jsDataGridColumnListLength, (intptr_t)0 }, + { "sortColumn", DontDelete|ReadOnly, (intptr_t)jsDataGridColumnListSortColumn, (intptr_t)0 }, + { "primaryColumn", DontDelete|ReadOnly, (intptr_t)jsDataGridColumnListPrimaryColumn, (intptr_t)0 }, + { "constructor", DontEnum|ReadOnly, (intptr_t)jsDataGridColumnListConstructor, (intptr_t)0 }, + { 0, 0, 0, 0 } +}; + +static const HashTable JSDataGridColumnListTable = +#if ENABLE(PERFECT_HASH_SIZE) + { 15, JSDataGridColumnListTableValues, 0 }; +#else + { 10, 7, JSDataGridColumnListTableValues, 0 }; +#endif + +/* Hash table for constructor */ + +static const HashTableValue JSDataGridColumnListConstructorTableValues[1] = +{ + { 0, 0, 0, 0 } +}; + +static const HashTable JSDataGridColumnListConstructorTable = +#if ENABLE(PERFECT_HASH_SIZE) + { 0, JSDataGridColumnListConstructorTableValues, 0 }; +#else + { 1, 0, JSDataGridColumnListConstructorTableValues, 0 }; +#endif + +class JSDataGridColumnListConstructor : public DOMObject { +public: + JSDataGridColumnListConstructor(ExecState* exec) + : DOMObject(JSDataGridColumnListConstructor::createStructure(exec->lexicalGlobalObject()->objectPrototype())) + { + putDirect(exec->propertyNames().prototype, JSDataGridColumnListPrototype::self(exec, exec->lexicalGlobalObject()), None); + } + virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); + virtual const ClassInfo* classInfo() const { return &s_info; } + static const ClassInfo s_info; + + static PassRefPtr<Structure> createStructure(JSValue proto) + { + return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance)); + } +}; + +const ClassInfo JSDataGridColumnListConstructor::s_info = { "DataGridColumnListConstructor", 0, &JSDataGridColumnListConstructorTable, 0 }; + +bool JSDataGridColumnListConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + return getStaticValueSlot<JSDataGridColumnListConstructor, DOMObject>(exec, &JSDataGridColumnListConstructorTable, this, propertyName, slot); +} + +/* Hash table for prototype */ + +static const HashTableValue JSDataGridColumnListPrototypeTableValues[6] = +{ + { "item", DontDelete|Function, (intptr_t)jsDataGridColumnListPrototypeFunctionItem, (intptr_t)1 }, + { "add", DontDelete|Function, (intptr_t)jsDataGridColumnListPrototypeFunctionAdd, (intptr_t)5 }, + { "remove", DontDelete|Function, (intptr_t)jsDataGridColumnListPrototypeFunctionRemove, (intptr_t)1 }, + { "move", DontDelete|Function, (intptr_t)jsDataGridColumnListPrototypeFunctionMove, (intptr_t)2 }, + { "clear", DontDelete|Function, (intptr_t)jsDataGridColumnListPrototypeFunctionClear, (intptr_t)0 }, + { 0, 0, 0, 0 } +}; + +static const HashTable JSDataGridColumnListPrototypeTable = +#if ENABLE(PERFECT_HASH_SIZE) + { 31, JSDataGridColumnListPrototypeTableValues, 0 }; +#else + { 17, 15, JSDataGridColumnListPrototypeTableValues, 0 }; +#endif + +const ClassInfo JSDataGridColumnListPrototype::s_info = { "DataGridColumnListPrototype", 0, &JSDataGridColumnListPrototypeTable, 0 }; + +JSObject* JSDataGridColumnListPrototype::self(ExecState* exec, JSGlobalObject* globalObject) +{ + return getDOMPrototype<JSDataGridColumnList>(exec, globalObject); +} + +bool JSDataGridColumnListPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + return getStaticFunctionSlot<JSObject>(exec, &JSDataGridColumnListPrototypeTable, this, propertyName, slot); +} + +const ClassInfo JSDataGridColumnList::s_info = { "DataGridColumnList", 0, &JSDataGridColumnListTable, 0 }; + +JSDataGridColumnList::JSDataGridColumnList(PassRefPtr<Structure> structure, PassRefPtr<DataGridColumnList> impl) + : DOMObject(structure) + , m_impl(impl) +{ +} + +JSDataGridColumnList::~JSDataGridColumnList() +{ + forgetDOMObject(*Heap::heap(this)->globalData(), m_impl.get()); +} + +JSObject* JSDataGridColumnList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) +{ + return new (exec) JSDataGridColumnListPrototype(JSDataGridColumnListPrototype::createStructure(globalObject->objectPrototype())); +} + +bool JSDataGridColumnList::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + const HashEntry* entry = JSDataGridColumnListTable.entry(exec, propertyName); + if (entry) { + slot.setCustom(this, entry->propertyGetter()); + return true; + } + bool ok; + unsigned index = propertyName.toUInt32(&ok, false); + if (ok && index < static_cast<DataGridColumnList*>(impl())->length()) { + slot.setCustomIndex(this, index, indexGetter); + return true; + } + if (canGetItemsForName(exec, static_cast<DataGridColumnList*>(impl()), propertyName)) { + slot.setCustom(this, nameGetter); + return true; + } + return getStaticValueSlot<JSDataGridColumnList, Base>(exec, &JSDataGridColumnListTable, this, propertyName, slot); +} + +bool JSDataGridColumnList::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) +{ + if (propertyName < static_cast<DataGridColumnList*>(impl())->length()) { + slot.setCustomIndex(this, propertyName, indexGetter); + return true; + } + return getOwnPropertySlot(exec, Identifier::from(exec, propertyName), slot); +} + +JSValue jsDataGridColumnListLength(ExecState* exec, const Identifier&, const PropertySlot& slot) +{ + UNUSED_PARAM(exec); + DataGridColumnList* imp = static_cast<DataGridColumnList*>(static_cast<JSDataGridColumnList*>(asObject(slot.slotBase()))->impl()); + return jsNumber(exec, imp->length()); +} + +JSValue jsDataGridColumnListSortColumn(ExecState* exec, const Identifier&, const PropertySlot& slot) +{ + UNUSED_PARAM(exec); + DataGridColumnList* imp = static_cast<DataGridColumnList*>(static_cast<JSDataGridColumnList*>(asObject(slot.slotBase()))->impl()); + return toJS(exec, WTF::getPtr(imp->sortColumn())); +} + +JSValue jsDataGridColumnListPrimaryColumn(ExecState* exec, const Identifier&, const PropertySlot& slot) +{ + UNUSED_PARAM(exec); + DataGridColumnList* imp = static_cast<DataGridColumnList*>(static_cast<JSDataGridColumnList*>(asObject(slot.slotBase()))->impl()); + return toJS(exec, WTF::getPtr(imp->primaryColumn())); +} + +JSValue jsDataGridColumnListConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot) +{ + return static_cast<JSDataGridColumnList*>(asObject(slot.slotBase()))->getConstructor(exec); +} +void JSDataGridColumnList::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames) +{ + for (unsigned i = 0; i < static_cast<DataGridColumnList*>(impl())->length(); ++i) + propertyNames.add(Identifier::from(exec, i)); + Base::getPropertyNames(exec, propertyNames); +} + +JSValue JSDataGridColumnList::getConstructor(ExecState* exec) +{ + return getDOMConstructor<JSDataGridColumnListConstructor>(exec); +} + +JSValue JSC_HOST_CALL jsDataGridColumnListPrototypeFunctionItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) +{ + UNUSED_PARAM(args); + if (!thisValue.isObject(&JSDataGridColumnList::s_info)) + return throwError(exec, TypeError); + JSDataGridColumnList* castedThisObj = static_cast<JSDataGridColumnList*>(asObject(thisValue)); + DataGridColumnList* imp = static_cast<DataGridColumnList*>(castedThisObj->impl()); + int index = args.at(0).toInt32(exec); + if (index < 0) { + setDOMException(exec, INDEX_SIZE_ERR); + return jsUndefined(); + } + + + JSC::JSValue result = toJS(exec, WTF::getPtr(imp->item(index))); + return result; +} + +JSValue JSC_HOST_CALL jsDataGridColumnListPrototypeFunctionAdd(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) +{ + UNUSED_PARAM(args); + if (!thisValue.isObject(&JSDataGridColumnList::s_info)) + return throwError(exec, TypeError); + JSDataGridColumnList* castedThisObj = static_cast<JSDataGridColumnList*>(asObject(thisValue)); + DataGridColumnList* imp = static_cast<DataGridColumnList*>(castedThisObj->impl()); + const UString& id = args.at(0).toString(exec); + const UString& label = args.at(1).toString(exec); + const UString& type = args.at(2).toString(exec); + bool primary = args.at(3).toBoolean(exec); + unsigned short sortable = args.at(4).toInt32(exec); + + + JSC::JSValue result = toJS(exec, WTF::getPtr(imp->add(id, label, type, primary, sortable))); + return result; +} + +JSValue JSC_HOST_CALL jsDataGridColumnListPrototypeFunctionRemove(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) +{ + UNUSED_PARAM(args); + if (!thisValue.isObject(&JSDataGridColumnList::s_info)) + return throwError(exec, TypeError); + JSDataGridColumnList* castedThisObj = static_cast<JSDataGridColumnList*>(asObject(thisValue)); + DataGridColumnList* imp = static_cast<DataGridColumnList*>(castedThisObj->impl()); + DataGridColumn* column = toDataGridColumn(args.at(0)); + + imp->remove(column); + return jsUndefined(); +} + +JSValue JSC_HOST_CALL jsDataGridColumnListPrototypeFunctionMove(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) +{ + UNUSED_PARAM(args); + if (!thisValue.isObject(&JSDataGridColumnList::s_info)) + return throwError(exec, TypeError); + JSDataGridColumnList* castedThisObj = static_cast<JSDataGridColumnList*>(asObject(thisValue)); + DataGridColumnList* imp = static_cast<DataGridColumnList*>(castedThisObj->impl()); + DataGridColumn* column = toDataGridColumn(args.at(0)); + unsigned index = args.at(1).toInt32(exec); + + imp->move(column, index); + return jsUndefined(); +} + +JSValue JSC_HOST_CALL jsDataGridColumnListPrototypeFunctionClear(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) +{ + UNUSED_PARAM(args); + if (!thisValue.isObject(&JSDataGridColumnList::s_info)) + return throwError(exec, TypeError); + JSDataGridColumnList* castedThisObj = static_cast<JSDataGridColumnList*>(asObject(thisValue)); + DataGridColumnList* imp = static_cast<DataGridColumnList*>(castedThisObj->impl()); + + imp->clear(); + return jsUndefined(); +} + + +JSValue JSDataGridColumnList::indexGetter(ExecState* exec, const Identifier&, const PropertySlot& slot) +{ + JSDataGridColumnList* thisObj = static_cast<JSDataGridColumnList*>(asObject(slot.slotBase())); + return toJS(exec, static_cast<DataGridColumnList*>(thisObj->impl())->item(slot.index())); +} +JSC::JSValue toJS(JSC::ExecState* exec, DataGridColumnList* object) +{ + return getDOMObjectWrapper<JSDataGridColumnList>(exec, object); +} +DataGridColumnList* toDataGridColumnList(JSC::JSValue value) +{ + return value.isObject(&JSDataGridColumnList::s_info) ? static_cast<JSDataGridColumnList*>(asObject(value))->impl() : 0; +} + +} |