/* 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 "SVGElement.h" #include "JSSVGMatrix.h" #include #include #include using namespace JSC; namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSSVGMatrix) /* Hash table */ static const HashTableValue JSSVGMatrixTableValues[7] = { { "a", DontDelete, (intptr_t)jsSVGMatrixA, (intptr_t)setJSSVGMatrixA }, { "b", DontDelete, (intptr_t)jsSVGMatrixB, (intptr_t)setJSSVGMatrixB }, { "c", DontDelete, (intptr_t)jsSVGMatrixC, (intptr_t)setJSSVGMatrixC }, { "d", DontDelete, (intptr_t)jsSVGMatrixD, (intptr_t)setJSSVGMatrixD }, { "e", DontDelete, (intptr_t)jsSVGMatrixE, (intptr_t)setJSSVGMatrixE }, { "f", DontDelete, (intptr_t)jsSVGMatrixF, (intptr_t)setJSSVGMatrixF }, { 0, 0, 0, 0 } }; static const HashTable JSSVGMatrixTable = #if ENABLE(PERFECT_HASH_SIZE) { 15, JSSVGMatrixTableValues, 0 }; #else { 16, 15, JSSVGMatrixTableValues, 0 }; #endif /* Hash table for prototype */ static const HashTableValue JSSVGMatrixPrototypeTableValues[12] = { { "multiply", DontDelete|Function, (intptr_t)jsSVGMatrixPrototypeFunctionMultiply, (intptr_t)1 }, { "inverse", DontDelete|Function, (intptr_t)jsSVGMatrixPrototypeFunctionInverse, (intptr_t)0 }, { "translate", DontDelete|Function, (intptr_t)jsSVGMatrixPrototypeFunctionTranslate, (intptr_t)2 }, { "scale", DontDelete|Function, (intptr_t)jsSVGMatrixPrototypeFunctionScale, (intptr_t)1 }, { "scaleNonUniform", DontDelete|Function, (intptr_t)jsSVGMatrixPrototypeFunctionScaleNonUniform, (intptr_t)2 }, { "rotate", DontDelete|Function, (intptr_t)jsSVGMatrixPrototypeFunctionRotate, (intptr_t)1 }, { "rotateFromVector", DontDelete|Function, (intptr_t)jsSVGMatrixPrototypeFunctionRotateFromVector, (intptr_t)2 }, { "flipX", DontDelete|Function, (intptr_t)jsSVGMatrixPrototypeFunctionFlipX, (intptr_t)0 }, { "flipY", DontDelete|Function, (intptr_t)jsSVGMatrixPrototypeFunctionFlipY, (intptr_t)0 }, { "skewX", DontDelete|Function, (intptr_t)jsSVGMatrixPrototypeFunctionSkewX, (intptr_t)1 }, { "skewY", DontDelete|Function, (intptr_t)jsSVGMatrixPrototypeFunctionSkewY, (intptr_t)1 }, { 0, 0, 0, 0 } }; static const HashTable JSSVGMatrixPrototypeTable = #if ENABLE(PERFECT_HASH_SIZE) { 63, JSSVGMatrixPrototypeTableValues, 0 }; #else { 33, 31, JSSVGMatrixPrototypeTableValues, 0 }; #endif const ClassInfo JSSVGMatrixPrototype::s_info = { "SVGMatrixPrototype", 0, &JSSVGMatrixPrototypeTable, 0 }; JSObject* JSSVGMatrixPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype(exec, globalObject); } bool JSSVGMatrixPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticFunctionSlot(exec, &JSSVGMatrixPrototypeTable, this, propertyName, slot); } const ClassInfo JSSVGMatrix::s_info = { "SVGMatrix", 0, &JSSVGMatrixTable, 0 }; JSSVGMatrix::JSSVGMatrix(PassRefPtr structure, PassRefPtr > impl, SVGElement* context) : DOMObject(structure) , m_context(context) , m_impl(impl) { } JSSVGMatrix::~JSSVGMatrix() { forgetDOMObject(*Heap::heap(this)->globalData(), m_impl.get()); } JSObject* JSSVGMatrix::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSSVGMatrixPrototype(JSSVGMatrixPrototype::createStructure(globalObject->objectPrototype())); } bool JSSVGMatrix::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot(exec, &JSSVGMatrixTable, this, propertyName, slot); } JSValuePtr jsSVGMatrixA(ExecState* exec, const Identifier&, const PropertySlot& slot) { TransformationMatrix imp(*static_cast(asObject(slot.slotBase()))->impl()); return jsNumber(exec, imp.a()); } JSValuePtr jsSVGMatrixB(ExecState* exec, const Identifier&, const PropertySlot& slot) { TransformationMatrix imp(*static_cast(asObject(slot.slotBase()))->impl()); return jsNumber(exec, imp.b()); } JSValuePtr jsSVGMatrixC(ExecState* exec, const Identifier&, const PropertySlot& slot) { TransformationMatrix imp(*static_cast(asObject(slot.slotBase()))->impl()); return jsNumber(exec, imp.c()); } JSValuePtr jsSVGMatrixD(ExecState* exec, const Identifier&, const PropertySlot& slot) { TransformationMatrix imp(*static_cast(asObject(slot.slotBase()))->impl()); return jsNumber(exec, imp.d()); } JSValuePtr jsSVGMatrixE(ExecState* exec, const Identifier&, const PropertySlot& slot) { TransformationMatrix imp(*static_cast(asObject(slot.slotBase()))->impl()); return jsNumber(exec, imp.e()); } JSValuePtr jsSVGMatrixF(ExecState* exec, const Identifier&, const PropertySlot& slot) { TransformationMatrix imp(*static_cast(asObject(slot.slotBase()))->impl()); return jsNumber(exec, imp.f()); } void JSSVGMatrix::put(ExecState* exec, const Identifier& propertyName, JSValuePtr value, PutPropertySlot& slot) { lookupPut(exec, propertyName, value, &JSSVGMatrixTable, this, slot); } void setJSSVGMatrixA(ExecState* exec, JSObject* thisObject, JSValuePtr value) { TransformationMatrix imp(*static_cast(thisObject)->impl()); imp.setA(value->toNumber(exec)); static_cast(thisObject)->impl()->commitChange(imp, static_cast(thisObject)->context()); } void setJSSVGMatrixB(ExecState* exec, JSObject* thisObject, JSValuePtr value) { TransformationMatrix imp(*static_cast(thisObject)->impl()); imp.setB(value->toNumber(exec)); static_cast(thisObject)->impl()->commitChange(imp, static_cast(thisObject)->context()); } void setJSSVGMatrixC(ExecState* exec, JSObject* thisObject, JSValuePtr value) { TransformationMatrix imp(*static_cast(thisObject)->impl()); imp.setC(value->toNumber(exec)); static_cast(thisObject)->impl()->commitChange(imp, static_cast(thisObject)->context()); } void setJSSVGMatrixD(ExecState* exec, JSObject* thisObject, JSValuePtr value) { TransformationMatrix imp(*static_cast(thisObject)->impl()); imp.setD(value->toNumber(exec)); static_cast(thisObject)->impl()->commitChange(imp, static_cast(thisObject)->context()); } void setJSSVGMatrixE(ExecState* exec, JSObject* thisObject, JSValuePtr value) { TransformationMatrix imp(*static_cast(thisObject)->impl()); imp.setE(value->toNumber(exec)); static_cast(thisObject)->impl()->commitChange(imp, static_cast(thisObject)->context()); } void setJSSVGMatrixF(ExecState* exec, JSObject* thisObject, JSValuePtr value) { TransformationMatrix imp(*static_cast(thisObject)->impl()); imp.setF(value->toNumber(exec)); static_cast(thisObject)->impl()->commitChange(imp, static_cast(thisObject)->context()); } JSValuePtr jsSVGMatrixPrototypeFunctionMultiply(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args) { if (!thisValue->isObject(&JSSVGMatrix::s_info)) return throwError(exec, TypeError); JSSVGMatrix* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->multiply(exec, args); } JSValuePtr jsSVGMatrixPrototypeFunctionInverse(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args) { if (!thisValue->isObject(&JSSVGMatrix::s_info)) return throwError(exec, TypeError); JSSVGMatrix* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->inverse(exec, args); } JSValuePtr jsSVGMatrixPrototypeFunctionTranslate(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args) { if (!thisValue->isObject(&JSSVGMatrix::s_info)) return throwError(exec, TypeError); JSSVGMatrix* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->translate(exec, args); } JSValuePtr jsSVGMatrixPrototypeFunctionScale(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args) { if (!thisValue->isObject(&JSSVGMatrix::s_info)) return throwError(exec, TypeError); JSSVGMatrix* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->scale(exec, args); } JSValuePtr jsSVGMatrixPrototypeFunctionScaleNonUniform(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args) { if (!thisValue->isObject(&JSSVGMatrix::s_info)) return throwError(exec, TypeError); JSSVGMatrix* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->scaleNonUniform(exec, args); } JSValuePtr jsSVGMatrixPrototypeFunctionRotate(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args) { if (!thisValue->isObject(&JSSVGMatrix::s_info)) return throwError(exec, TypeError); JSSVGMatrix* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->rotate(exec, args); } JSValuePtr jsSVGMatrixPrototypeFunctionRotateFromVector(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args) { if (!thisValue->isObject(&JSSVGMatrix::s_info)) return throwError(exec, TypeError); JSSVGMatrix* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->rotateFromVector(exec, args); } JSValuePtr jsSVGMatrixPrototypeFunctionFlipX(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args) { if (!thisValue->isObject(&JSSVGMatrix::s_info)) return throwError(exec, TypeError); JSSVGMatrix* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->flipX(exec, args); } JSValuePtr jsSVGMatrixPrototypeFunctionFlipY(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args) { if (!thisValue->isObject(&JSSVGMatrix::s_info)) return throwError(exec, TypeError); JSSVGMatrix* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->flipY(exec, args); } JSValuePtr jsSVGMatrixPrototypeFunctionSkewX(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args) { if (!thisValue->isObject(&JSSVGMatrix::s_info)) return throwError(exec, TypeError); JSSVGMatrix* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->skewX(exec, args); } JSValuePtr jsSVGMatrixPrototypeFunctionSkewY(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args) { if (!thisValue->isObject(&JSSVGMatrix::s_info)) return throwError(exec, TypeError); JSSVGMatrix* castedThisObj = static_cast(asObject(thisValue)); return castedThisObj->skewY(exec, args); } JSC::JSValuePtr toJS(JSC::ExecState* exec, JSSVGPODTypeWrapper* object, SVGElement* context) { return getDOMObjectWrapper >(exec, object, context); } TransformationMatrix toSVGMatrix(JSC::JSValuePtr value) { return value->isObject(&JSSVGMatrix::s_info) ? (TransformationMatrix) *static_cast(asObject(value))->impl() : TransformationMatrix(); } } #endif // ENABLE(SVG)