1/*
2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#include "config.h"
22#include "JSSVGCircleElement.h"
23
24#include "JSDOMAttribute.h"
25#include "JSDOMBinding.h"
26#include "JSDOMConstructorNotConstructable.h"
27#include "JSDOMConvertInterface.h"
28#include "JSDOMExceptionHandling.h"
29#include "JSDOMGlobalObject.h"
30#include "JSDOMWrapperCache.h"
31#include "JSSVGAnimatedBoolean.h"
32#include "JSSVGAnimatedLength.h"
33#include "ScriptExecutionContext.h"
34#include <JavaScriptCore/HeapSnapshotBuilder.h>
35#include <JavaScriptCore/JSCInlines.h>
36#include <wtf/GetPtr.h>
37#include <wtf/PointerPreparations.h>
38#include <wtf/URL.h>
39
40
41namespace WebCore {
42using namespace JSC;
43
44// Attributes
45
46JSC::EncodedJSValue jsSVGCircleElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
47bool setJSSVGCircleElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
48JSC::EncodedJSValue jsSVGCircleElementCx(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
49JSC::EncodedJSValue jsSVGCircleElementCy(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
50JSC::EncodedJSValue jsSVGCircleElementR(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
51JSC::EncodedJSValue jsSVGCircleElementExternalResourcesRequired(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
52
53class JSSVGCircleElementPrototype : public JSC::JSNonFinalObject {
54public:
55 using Base = JSC::JSNonFinalObject;
56 static JSSVGCircleElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
57 {
58 JSSVGCircleElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGCircleElementPrototype>(vm.heap)) JSSVGCircleElementPrototype(vm, globalObject, structure);
59 ptr->finishCreation(vm);
60 return ptr;
61 }
62
63 DECLARE_INFO;
64 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
65 {
66 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
67 }
68
69private:
70 JSSVGCircleElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
71 : JSC::JSNonFinalObject(vm, structure)
72 {
73 }
74
75 void finishCreation(JSC::VM&);
76};
77
78using JSSVGCircleElementConstructor = JSDOMConstructorNotConstructable<JSSVGCircleElement>;
79
80template<> JSValue JSSVGCircleElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
81{
82 return JSSVGGeometryElement::getConstructor(vm, &globalObject);
83}
84
85template<> void JSSVGCircleElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
86{
87 putDirect(vm, vm.propertyNames->prototype, JSSVGCircleElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
88 putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGCircleElement"_s)), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
89 putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
90}
91
92template<> const ClassInfo JSSVGCircleElementConstructor::s_info = { "SVGCircleElement", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGCircleElementConstructor) };
93
94/* Hash table for prototype */
95
96static const HashTableValue JSSVGCircleElementPrototypeTableValues[] =
97{
98 { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGCircleElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGCircleElementConstructor) } },
99 { "cx", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGCircleElementCx), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
100 { "cy", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGCircleElementCy), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
101 { "r", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGCircleElementR), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
102 { "externalResourcesRequired", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGCircleElementExternalResourcesRequired), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
103};
104
105const ClassInfo JSSVGCircleElementPrototype::s_info = { "SVGCircleElementPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGCircleElementPrototype) };
106
107void JSSVGCircleElementPrototype::finishCreation(VM& vm)
108{
109 Base::finishCreation(vm);
110 reifyStaticProperties(vm, JSSVGCircleElement::info(), JSSVGCircleElementPrototypeTableValues, *this);
111}
112
113const ClassInfo JSSVGCircleElement::s_info = { "SVGCircleElement", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGCircleElement) };
114
115JSSVGCircleElement::JSSVGCircleElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGCircleElement>&& impl)
116 : JSSVGGeometryElement(structure, globalObject, WTFMove(impl))
117{
118}
119
120void JSSVGCircleElement::finishCreation(VM& vm)
121{
122 Base::finishCreation(vm);
123 ASSERT(inherits(vm, info()));
124
125}
126
127JSObject* JSSVGCircleElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
128{
129 return JSSVGCircleElementPrototype::create(vm, &globalObject, JSSVGCircleElementPrototype::createStructure(vm, &globalObject, JSSVGGeometryElement::prototype(vm, globalObject)));
130}
131
132JSObject* JSSVGCircleElement::prototype(VM& vm, JSDOMGlobalObject& globalObject)
133{
134 return getDOMPrototype<JSSVGCircleElement>(vm, globalObject);
135}
136
137JSValue JSSVGCircleElement::getConstructor(VM& vm, const JSGlobalObject* globalObject)
138{
139 return getDOMConstructor<JSSVGCircleElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
140}
141
142template<> inline JSSVGCircleElement* IDLAttribute<JSSVGCircleElement>::cast(ExecState& state, EncodedJSValue thisValue)
143{
144 return jsDynamicCast<JSSVGCircleElement*>(state.vm(), JSValue::decode(thisValue));
145}
146
147EncodedJSValue jsSVGCircleElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
148{
149 VM& vm = state->vm();
150 auto throwScope = DECLARE_THROW_SCOPE(vm);
151 auto* prototype = jsDynamicCast<JSSVGCircleElementPrototype*>(vm, JSValue::decode(thisValue));
152 if (UNLIKELY(!prototype))
153 return throwVMTypeError(state, throwScope);
154 return JSValue::encode(JSSVGCircleElement::getConstructor(state->vm(), prototype->globalObject()));
155}
156
157bool setJSSVGCircleElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
158{
159 VM& vm = state->vm();
160 auto throwScope = DECLARE_THROW_SCOPE(vm);
161 auto* prototype = jsDynamicCast<JSSVGCircleElementPrototype*>(vm, JSValue::decode(thisValue));
162 if (UNLIKELY(!prototype)) {
163 throwVMTypeError(state, throwScope);
164 return false;
165 }
166 // Shadowing a built-in constructor
167 return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue));
168}
169
170static inline JSValue jsSVGCircleElementCxGetter(ExecState& state, JSSVGCircleElement& thisObject, ThrowScope& throwScope)
171{
172 UNUSED_PARAM(throwScope);
173 UNUSED_PARAM(state);
174 auto& impl = thisObject.wrapped();
175 JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.cxAnimated());
176 return result;
177}
178
179EncodedJSValue jsSVGCircleElementCx(ExecState* state, EncodedJSValue thisValue, PropertyName)
180{
181 return IDLAttribute<JSSVGCircleElement>::get<jsSVGCircleElementCxGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "cx");
182}
183
184static inline JSValue jsSVGCircleElementCyGetter(ExecState& state, JSSVGCircleElement& thisObject, ThrowScope& throwScope)
185{
186 UNUSED_PARAM(throwScope);
187 UNUSED_PARAM(state);
188 auto& impl = thisObject.wrapped();
189 JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.cyAnimated());
190 return result;
191}
192
193EncodedJSValue jsSVGCircleElementCy(ExecState* state, EncodedJSValue thisValue, PropertyName)
194{
195 return IDLAttribute<JSSVGCircleElement>::get<jsSVGCircleElementCyGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "cy");
196}
197
198static inline JSValue jsSVGCircleElementRGetter(ExecState& state, JSSVGCircleElement& thisObject, ThrowScope& throwScope)
199{
200 UNUSED_PARAM(throwScope);
201 UNUSED_PARAM(state);
202 auto& impl = thisObject.wrapped();
203 JSValue result = toJS<IDLInterface<SVGAnimatedLength>>(state, *thisObject.globalObject(), throwScope, impl.rAnimated());
204 return result;
205}
206
207EncodedJSValue jsSVGCircleElementR(ExecState* state, EncodedJSValue thisValue, PropertyName)
208{
209 return IDLAttribute<JSSVGCircleElement>::get<jsSVGCircleElementRGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "r");
210}
211
212static inline JSValue jsSVGCircleElementExternalResourcesRequiredGetter(ExecState& state, JSSVGCircleElement& thisObject, ThrowScope& throwScope)
213{
214 UNUSED_PARAM(throwScope);
215 UNUSED_PARAM(state);
216 auto& impl = thisObject.wrapped();
217 JSValue result = toJS<IDLInterface<SVGAnimatedBoolean>>(state, *thisObject.globalObject(), throwScope, impl.externalResourcesRequiredAnimated());
218 return result;
219}
220
221EncodedJSValue jsSVGCircleElementExternalResourcesRequired(ExecState* state, EncodedJSValue thisValue, PropertyName)
222{
223 return IDLAttribute<JSSVGCircleElement>::get<jsSVGCircleElementExternalResourcesRequiredGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "externalResourcesRequired");
224}
225
226void JSSVGCircleElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)
227{
228 auto* thisObject = jsCast<JSSVGCircleElement*>(cell);
229 builder.setWrappedObjectForCell(cell, &thisObject->wrapped());
230 if (thisObject->scriptExecutionContext())
231 builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
232 Base::heapSnapshot(cell, builder);
233}
234
235
236}
237