| /* |
| 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 "JSSVGRenderingIntent.h" |
| |
| #include "JSDOMBinding.h" |
| #include "JSDOMConstructor.h" |
| #include <runtime/FunctionPrototype.h> |
| #include <wtf/GetPtr.h> |
| |
| using namespace JSC; |
| |
| namespace WebCore { |
| |
| // Attributes |
| |
| JSC::EncodedJSValue jsSVGRenderingIntentConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSSVGRenderingIntentConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| |
| class JSSVGRenderingIntentPrototype : public JSC::JSNonFinalObject { |
| public: |
| typedef JSC::JSNonFinalObject Base; |
| static JSSVGRenderingIntentPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) |
| { |
| JSSVGRenderingIntentPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGRenderingIntentPrototype>(vm.heap)) JSSVGRenderingIntentPrototype(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: |
| JSSVGRenderingIntentPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
| : JSC::JSNonFinalObject(vm, structure) |
| { |
| } |
| |
| void finishCreation(JSC::VM&); |
| }; |
| |
| typedef JSDOMConstructorNotConstructable<JSSVGRenderingIntent> JSSVGRenderingIntentConstructor; |
| |
| /* Hash table for constructor */ |
| |
| static const HashTableValue JSSVGRenderingIntentConstructorTableValues[] = |
| { |
| { "RENDERING_INTENT_UNKNOWN", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } }, |
| { "RENDERING_INTENT_AUTO", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } }, |
| { "RENDERING_INTENT_PERCEPTUAL", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } }, |
| { "RENDERING_INTENT_RELATIVE_COLORIMETRIC", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(3) } }, |
| { "RENDERING_INTENT_SATURATION", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(4) } }, |
| { "RENDERING_INTENT_ABSOLUTE_COLORIMETRIC", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(5) } }, |
| }; |
| |
| static_assert(SVGRenderingIntent::RENDERING_INTENT_UNKNOWN == 0, "RENDERING_INTENT_UNKNOWN in SVGRenderingIntent does not match value from IDL"); |
| static_assert(SVGRenderingIntent::RENDERING_INTENT_AUTO == 1, "RENDERING_INTENT_AUTO in SVGRenderingIntent does not match value from IDL"); |
| static_assert(SVGRenderingIntent::RENDERING_INTENT_PERCEPTUAL == 2, "RENDERING_INTENT_PERCEPTUAL in SVGRenderingIntent does not match value from IDL"); |
| static_assert(SVGRenderingIntent::RENDERING_INTENT_RELATIVE_COLORIMETRIC == 3, "RENDERING_INTENT_RELATIVE_COLORIMETRIC in SVGRenderingIntent does not match value from IDL"); |
| static_assert(SVGRenderingIntent::RENDERING_INTENT_SATURATION == 4, "RENDERING_INTENT_SATURATION in SVGRenderingIntent does not match value from IDL"); |
| static_assert(SVGRenderingIntent::RENDERING_INTENT_ABSOLUTE_COLORIMETRIC == 5, "RENDERING_INTENT_ABSOLUTE_COLORIMETRIC in SVGRenderingIntent does not match value from IDL"); |
| |
| template<> JSValue JSSVGRenderingIntentConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
| { |
| UNUSED_PARAM(vm); |
| return globalObject.functionPrototype(); |
| } |
| |
| template<> void JSSVGRenderingIntentConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
| { |
| putDirect(vm, vm.propertyNames->prototype, JSSVGRenderingIntent::prototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum); |
| putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("SVGRenderingIntent"))), ReadOnly | DontEnum); |
| putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum); |
| reifyStaticProperties(vm, JSSVGRenderingIntentConstructorTableValues, *this); |
| } |
| |
| template<> const ClassInfo JSSVGRenderingIntentConstructor::s_info = { "SVGRenderingIntent", &Base::s_info, 0, CREATE_METHOD_TABLE(JSSVGRenderingIntentConstructor) }; |
| |
| /* Hash table for prototype */ |
| |
| static const HashTableValue JSSVGRenderingIntentPrototypeTableValues[] = |
| { |
| { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGRenderingIntentConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGRenderingIntentConstructor) } }, |
| { "RENDERING_INTENT_UNKNOWN", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } }, |
| { "RENDERING_INTENT_AUTO", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } }, |
| { "RENDERING_INTENT_PERCEPTUAL", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } }, |
| { "RENDERING_INTENT_RELATIVE_COLORIMETRIC", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(3) } }, |
| { "RENDERING_INTENT_SATURATION", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(4) } }, |
| { "RENDERING_INTENT_ABSOLUTE_COLORIMETRIC", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(5) } }, |
| }; |
| |
| const ClassInfo JSSVGRenderingIntentPrototype::s_info = { "SVGRenderingIntentPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSSVGRenderingIntentPrototype) }; |
| |
| void JSSVGRenderingIntentPrototype::finishCreation(VM& vm) |
| { |
| Base::finishCreation(vm); |
| reifyStaticProperties(vm, JSSVGRenderingIntentPrototypeTableValues, *this); |
| } |
| |
| const ClassInfo JSSVGRenderingIntent::s_info = { "SVGRenderingIntent", &Base::s_info, 0, CREATE_METHOD_TABLE(JSSVGRenderingIntent) }; |
| |
| JSSVGRenderingIntent::JSSVGRenderingIntent(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGRenderingIntent>&& impl) |
| : JSDOMWrapper<SVGRenderingIntent>(structure, globalObject, WTFMove(impl)) |
| { |
| } |
| |
| JSObject* JSSVGRenderingIntent::createPrototype(VM& vm, JSGlobalObject* globalObject) |
| { |
| return JSSVGRenderingIntentPrototype::create(vm, globalObject, JSSVGRenderingIntentPrototype::createStructure(vm, globalObject, globalObject->objectPrototype())); |
| } |
| |
| JSObject* JSSVGRenderingIntent::prototype(VM& vm, JSGlobalObject* globalObject) |
| { |
| return getDOMPrototype<JSSVGRenderingIntent>(vm, globalObject); |
| } |
| |
| void JSSVGRenderingIntent::destroy(JSC::JSCell* cell) |
| { |
| JSSVGRenderingIntent* thisObject = static_cast<JSSVGRenderingIntent*>(cell); |
| thisObject->JSSVGRenderingIntent::~JSSVGRenderingIntent(); |
| } |
| |
| EncodedJSValue jsSVGRenderingIntentConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| JSSVGRenderingIntentPrototype* domObject = jsDynamicCast<JSSVGRenderingIntentPrototype*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!domObject)) |
| return throwVMTypeError(state, throwScope); |
| return JSValue::encode(JSSVGRenderingIntent::getConstructor(state->vm(), domObject->globalObject())); |
| } |
| |
| bool setJSSVGRenderingIntentConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| JSValue value = JSValue::decode(encodedValue); |
| JSSVGRenderingIntentPrototype* domObject = jsDynamicCast<JSSVGRenderingIntentPrototype*>(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 JSSVGRenderingIntent::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
| { |
| return getDOMConstructor<JSSVGRenderingIntentConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
| } |
| |
| bool JSSVGRenderingIntentOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) |
| { |
| UNUSED_PARAM(handle); |
| UNUSED_PARAM(visitor); |
| return false; |
| } |
| |
| void JSSVGRenderingIntentOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
| { |
| auto* jsSVGRenderingIntent = jsCast<JSSVGRenderingIntent*>(handle.slot()->asCell()); |
| auto& world = *static_cast<DOMWrapperWorld*>(context); |
| uncacheWrapper(world, &jsSVGRenderingIntent->wrapped(), jsSVGRenderingIntent); |
| } |
| |
| SVGRenderingIntent* JSSVGRenderingIntent::toWrapped(JSC::JSValue value) |
| { |
| if (auto* wrapper = jsDynamicCast<JSSVGRenderingIntent*>(value)) |
| return &wrapper->wrapped(); |
| return nullptr; |
| } |
| |
| } |