| /* |
| 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 "JSSVGUnitTypes.h" |
| |
| #include "JSDOMBinding.h" |
| #include "JSDOMConstructor.h" |
| #include <runtime/FunctionPrototype.h> |
| #include <wtf/GetPtr.h> |
| |
| using namespace JSC; |
| |
| namespace WebCore { |
| |
| // Attributes |
| |
| JSC::EncodedJSValue jsSVGUnitTypesConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSSVGUnitTypesConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| |
| class JSSVGUnitTypesPrototype : public JSC::JSNonFinalObject { |
| public: |
| typedef JSC::JSNonFinalObject Base; |
| static JSSVGUnitTypesPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) |
| { |
| JSSVGUnitTypesPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGUnitTypesPrototype>(vm.heap)) JSSVGUnitTypesPrototype(vm, globalObject, structure); |
| ptr->finishCreation(vm); |
| return ptr; |
| } |
| |
| DECLARE_INFO; |
| static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
| { |
| return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
| } |
| |
| private: |
| JSSVGUnitTypesPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
| : JSC::JSNonFinalObject(vm, structure) |
| { |
| } |
| |
| void finishCreation(JSC::VM&); |
| }; |
| |
| typedef JSDOMConstructorNotConstructable<JSSVGUnitTypes> JSSVGUnitTypesConstructor; |
| |
| /* Hash table for constructor */ |
| |
| static const HashTableValue JSSVGUnitTypesConstructorTableValues[] = |
| { |
| { "SVG_UNIT_TYPE_UNKNOWN", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } }, |
| { "SVG_UNIT_TYPE_USERSPACEONUSE", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } }, |
| { "SVG_UNIT_TYPE_OBJECTBOUNDINGBOX", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } }, |
| }; |
| |
| static_assert(SVGUnitTypes::SVG_UNIT_TYPE_UNKNOWN == 0, "SVG_UNIT_TYPE_UNKNOWN in SVGUnitTypes does not match value from IDL"); |
| static_assert(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE == 1, "SVG_UNIT_TYPE_USERSPACEONUSE in SVGUnitTypes does not match value from IDL"); |
| static_assert(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX == 2, "SVG_UNIT_TYPE_OBJECTBOUNDINGBOX in SVGUnitTypes does not match value from IDL"); |
| |
| template<> JSValue JSSVGUnitTypesConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
| { |
| UNUSED_PARAM(vm); |
| return globalObject.functionPrototype(); |
| } |
| |
| template<> void JSSVGUnitTypesConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
| { |
| putDirect(vm, vm.propertyNames->prototype, JSSVGUnitTypes::prototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum); |
| putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("SVGUnitTypes"))), ReadOnly | DontEnum); |
| putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum); |
| reifyStaticProperties(vm, JSSVGUnitTypesConstructorTableValues, *this); |
| } |
| |
| template<> const ClassInfo JSSVGUnitTypesConstructor::s_info = { "SVGUnitTypes", &Base::s_info, 0, CREATE_METHOD_TABLE(JSSVGUnitTypesConstructor) }; |
| |
| /* Hash table for prototype */ |
| |
| static const HashTableValue JSSVGUnitTypesPrototypeTableValues[] = |
| { |
| { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGUnitTypesConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGUnitTypesConstructor) } }, |
| { "SVG_UNIT_TYPE_UNKNOWN", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } }, |
| { "SVG_UNIT_TYPE_USERSPACEONUSE", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } }, |
| { "SVG_UNIT_TYPE_OBJECTBOUNDINGBOX", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } }, |
| }; |
| |
| const ClassInfo JSSVGUnitTypesPrototype::s_info = { "SVGUnitTypesPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSSVGUnitTypesPrototype) }; |
| |
| void JSSVGUnitTypesPrototype::finishCreation(VM& vm) |
| { |
| Base::finishCreation(vm); |
| reifyStaticProperties(vm, JSSVGUnitTypesPrototypeTableValues, *this); |
| } |
| |
| const ClassInfo JSSVGUnitTypes::s_info = { "SVGUnitTypes", &Base::s_info, 0, CREATE_METHOD_TABLE(JSSVGUnitTypes) }; |
| |
| JSSVGUnitTypes::JSSVGUnitTypes(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGUnitTypes>&& impl) |
| : JSDOMWrapper<SVGUnitTypes>(structure, globalObject, WTFMove(impl)) |
| { |
| } |
| |
| JSObject* JSSVGUnitTypes::createPrototype(VM& vm, JSGlobalObject* globalObject) |
| { |
| return JSSVGUnitTypesPrototype::create(vm, globalObject, JSSVGUnitTypesPrototype::createStructure(vm, globalObject, globalObject->objectPrototype())); |
| } |
| |
| JSObject* JSSVGUnitTypes::prototype(VM& vm, JSGlobalObject* globalObject) |
| { |
| return getDOMPrototype<JSSVGUnitTypes>(vm, globalObject); |
| } |
| |
| void JSSVGUnitTypes::destroy(JSC::JSCell* cell) |
| { |
| JSSVGUnitTypes* thisObject = static_cast<JSSVGUnitTypes*>(cell); |
| thisObject->JSSVGUnitTypes::~JSSVGUnitTypes(); |
| } |
| |
| EncodedJSValue jsSVGUnitTypesConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| JSSVGUnitTypesPrototype* domObject = jsDynamicCast<JSSVGUnitTypesPrototype*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!domObject)) |
| return throwVMTypeError(state, throwScope); |
| return JSValue::encode(JSSVGUnitTypes::getConstructor(state->vm(), domObject->globalObject())); |
| } |
| |
| bool setJSSVGUnitTypesConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| JSValue value = JSValue::decode(encodedValue); |
| JSSVGUnitTypesPrototype* domObject = jsDynamicCast<JSSVGUnitTypesPrototype*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!domObject)) { |
| throwVMTypeError(state, throwScope); |
| return false; |
| } |
| // Shadowing a built-in constructor |
| return domObject->putDirect(state->vm(), state->propertyNames().constructor, value); |
| } |
| |
| JSValue JSSVGUnitTypes::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
| { |
| return getDOMConstructor<JSSVGUnitTypesConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
| } |
| |
| bool JSSVGUnitTypesOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) |
| { |
| UNUSED_PARAM(handle); |
| UNUSED_PARAM(visitor); |
| return false; |
| } |
| |
| void JSSVGUnitTypesOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
| { |
| auto* jsSVGUnitTypes = jsCast<JSSVGUnitTypes*>(handle.slot()->asCell()); |
| auto& world = *static_cast<DOMWrapperWorld*>(context); |
| uncacheWrapper(world, &jsSVGUnitTypes->wrapped(), jsSVGUnitTypes); |
| } |
| |
| SVGUnitTypes* JSSVGUnitTypes::toWrapped(JSC::JSValue value) |
| { |
| if (auto* wrapper = jsDynamicCast<JSSVGUnitTypes*>(value)) |
| return &wrapper->wrapped(); |
| return nullptr; |
| } |
| |
| } |