/* 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(SVG) #include "JSSVGTransformList.h" #include "JSSVGMatrix.h" #include "JSSVGTransform.h" #include "SVGTransform.h" #include "SVGTransformList.h" #include #include #include using namespace JSC; namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSSVGTransformList); /* Hash table */ static const HashTableValue JSSVGTransformListTableValues[2] = { { "numberOfItems", DontDelete|ReadOnly, (intptr_t)jsSVGTransformListNumberOfItems, (intptr_t)0 }, { 0, 0, 0, 0 } }; static JSC_CONST_HASHTABLE HashTable JSSVGTransformListTable = #if ENABLE(PERFECT_HASH_SIZE) { 0, JSSVGTransformListTableValues, 0 }; #else { 2, 1, JSSVGTransformListTableValues, 0 }; #endif /* Hash table for prototype */ static const HashTableValue JSSVGTransformListPrototypeTableValues[10] = { { "clear", DontDelete|Function, (intptr_t)jsSVGTransformListPrototypeFunctionClear, (intptr_t)0 }, { "initialize", DontDelete|Function, (intptr_t)jsSVGTransformListPrototypeFunctionInitialize, (intptr_t)1 }, { "getItem", DontDelete|Function, (intptr_t)jsSVGTransformListPrototypeFunctionGetItem, (intptr_t)1 }, { "insertItemBefore", DontDelete|Function, (intptr_t)jsSVGTransformListPrototypeFunctionInsertItemBefore, (intptr_t)2 }, { "replaceItem", DontDelete|Function, (intptr_t)jsSVGTransformListPrototypeFunctionReplaceItem, (intptr_t)2 }, { "removeItem", DontDelete|Function, (intptr_t)jsSVGTransformListPrototypeFunctionRemoveItem, (intptr_t)1 }, { "appendItem", DontDelete|Function, (intptr_t)jsSVGTransformListPrototypeFunctionAppendItem, (intptr_t)1 }, { "createSVGTransformFromMatrix", DontDelete|Function, (intptr_t)jsSVGTransformListPrototypeFunctionCreateSVGTransformFromMatrix, (intptr_t)1 }, { "consolidate", DontDelete|Function, (intptr_t)jsSVGTransformListPrototypeFunctionConsolidate, (intptr_t)0 }, { 0, 0, 0, 0 } }; static JSC_CONST_HASHTABLE HashTable JSSVGTransformListPrototypeTable = #if ENABLE(PERFECT_HASH_SIZE) { 63, JSSVGTransformListPrototypeTableValues, 0 }; #else { 33, 31, JSSVGTransformListPrototypeTableValues, 0 }; #endif const ClassInfo JSSVGTransformListPrototype::s_info = { "SVGTransformListPrototype", 0, &JSSVGTransformListPrototypeTable, 0 }; JSObject* JSSVGTransformListPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype(exec, globalObject); } bool JSSVGTransformListPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticFunctionSlot(exec, &JSSVGTransformListPrototypeTable, this, propertyName, slot); } const ClassInfo JSSVGTransformList::s_info = { "SVGTransformList", 0, &JSSVGTransformListTable, 0 }; JSSVGTransformList::JSSVGTransformList(PassRefPtr structure, PassRefPtr impl, SVGElement* context) : DOMObject(structure) , m_context(context) , m_impl(impl) { } JSSVGTransformList::~JSSVGTransformList() { forgetDOMObject(*Heap::heap(this)->globalData(), m_impl.get()); } JSObject* JSSVGTransformList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSSVGTransformListPrototype(JSSVGTransformListPrototype::createStructure(globalObject->objectPrototype())); } bool JSSVGTransformList::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot(exec, &JSSVGTransformListTable, this, propertyName, slot); } JSValue jsSVGTransformListNumberOfItems(ExecState* exec, const Identifier&, const PropertySlot& slot) { UNUSED_PARAM(exec); SVGTransformList* imp = static_cast(static_cast(asObject(slot.slotBase()))->impl()); return jsNumber(exec, imp->numberOfItems()); } JSValue JSC_HOST_CALL jsSVGTransformListPrototypeFunctionClear(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) { UNUSED_PARAM(args); if (!thisValue.isObject(&JSSVGTransformList::s_info)) return throwError(exec, TypeError); JSSVGTransformList* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->clear(exec, args); } JSValue JSC_HOST_CALL jsSVGTransformListPrototypeFunctionInitialize(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) { UNUSED_PARAM(args); if (!thisValue.isObject(&JSSVGTransformList::s_info)) return throwError(exec, TypeError); JSSVGTransformList* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->initialize(exec, args); } JSValue JSC_HOST_CALL jsSVGTransformListPrototypeFunctionGetItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) { UNUSED_PARAM(args); if (!thisValue.isObject(&JSSVGTransformList::s_info)) return throwError(exec, TypeError); JSSVGTransformList* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->getItem(exec, args); } JSValue JSC_HOST_CALL jsSVGTransformListPrototypeFunctionInsertItemBefore(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) { UNUSED_PARAM(args); if (!thisValue.isObject(&JSSVGTransformList::s_info)) return throwError(exec, TypeError); JSSVGTransformList* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->insertItemBefore(exec, args); } JSValue JSC_HOST_CALL jsSVGTransformListPrototypeFunctionReplaceItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) { UNUSED_PARAM(args); if (!thisValue.isObject(&JSSVGTransformList::s_info)) return throwError(exec, TypeError); JSSVGTransformList* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->replaceItem(exec, args); } JSValue JSC_HOST_CALL jsSVGTransformListPrototypeFunctionRemoveItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) { UNUSED_PARAM(args); if (!thisValue.isObject(&JSSVGTransformList::s_info)) return throwError(exec, TypeError); JSSVGTransformList* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->removeItem(exec, args); } JSValue JSC_HOST_CALL jsSVGTransformListPrototypeFunctionAppendItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) { UNUSED_PARAM(args); if (!thisValue.isObject(&JSSVGTransformList::s_info)) return throwError(exec, TypeError); JSSVGTransformList* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->appendItem(exec, args); } JSValue JSC_HOST_CALL jsSVGTransformListPrototypeFunctionCreateSVGTransformFromMatrix(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) { UNUSED_PARAM(args); if (!thisValue.isObject(&JSSVGTransformList::s_info)) return throwError(exec, TypeError); JSSVGTransformList* castedThisObj = static_cast(asObject(thisValue)); SVGTransformList* imp = static_cast(castedThisObj->impl()); TransformationMatrix matrix = toSVGMatrix(args.at(0)); JSC::JSValue result = toJS(exec, JSSVGStaticPODTypeWrapper::create(imp->createSVGTransformFromMatrix(matrix)).get(), castedThisObj->context()); return result; } JSValue JSC_HOST_CALL jsSVGTransformListPrototypeFunctionConsolidate(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) { UNUSED_PARAM(args); if (!thisValue.isObject(&JSSVGTransformList::s_info)) return throwError(exec, TypeError); JSSVGTransformList* castedThisObj = static_cast(asObject(thisValue)); SVGTransformList* imp = static_cast(castedThisObj->impl()); JSC::JSValue result = toJS(exec, JSSVGStaticPODTypeWrapper::create(imp->consolidate()).get(), castedThisObj->context()); return result; } JSC::JSValue toJS(JSC::ExecState* exec, SVGTransformList* object, SVGElement* context) { return getDOMObjectWrapper(exec, object, context); } SVGTransformList* toSVGTransformList(JSC::JSValue value) { return value.isObject(&JSSVGTransformList::s_info) ? static_cast(asObject(value))->impl() : 0; } } #endif // ENABLE(SVG)