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 "JSSVGZoomEvent.h" |
23 | |
24 | #include "JSDOMAttribute.h" |
25 | #include "JSDOMBinding.h" |
26 | #include "JSDOMConstructorNotConstructable.h" |
27 | #include "JSDOMConvertInterface.h" |
28 | #include "JSDOMConvertNumbers.h" |
29 | #include "JSDOMExceptionHandling.h" |
30 | #include "JSDOMGlobalObject.h" |
31 | #include "JSDOMWrapperCache.h" |
32 | #include "JSSVGPoint.h" |
33 | #include "JSSVGRect.h" |
34 | #include "ScriptExecutionContext.h" |
35 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
36 | #include <JavaScriptCore/JSCInlines.h> |
37 | #include <wtf/GetPtr.h> |
38 | #include <wtf/PointerPreparations.h> |
39 | #include <wtf/URL.h> |
40 | |
41 | |
42 | namespace WebCore { |
43 | using namespace JSC; |
44 | |
45 | // Attributes |
46 | |
47 | JSC::EncodedJSValue jsSVGZoomEventConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
48 | bool setJSSVGZoomEventConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
49 | JSC::EncodedJSValue jsSVGZoomEventZoomRectScreen(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
50 | JSC::EncodedJSValue jsSVGZoomEventPreviousScale(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
51 | JSC::EncodedJSValue jsSVGZoomEventPreviousTranslate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
52 | JSC::EncodedJSValue jsSVGZoomEventNewScale(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
53 | JSC::EncodedJSValue jsSVGZoomEventNewTranslate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
54 | |
55 | class JSSVGZoomEventPrototype : public JSC::JSNonFinalObject { |
56 | public: |
57 | using Base = JSC::JSNonFinalObject; |
58 | static JSSVGZoomEventPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
59 | { |
60 | JSSVGZoomEventPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGZoomEventPrototype>(vm.heap)) JSSVGZoomEventPrototype(vm, globalObject, structure); |
61 | ptr->finishCreation(vm); |
62 | return ptr; |
63 | } |
64 | |
65 | DECLARE_INFO; |
66 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
67 | { |
68 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
69 | } |
70 | |
71 | private: |
72 | JSSVGZoomEventPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
73 | : JSC::JSNonFinalObject(vm, structure) |
74 | { |
75 | } |
76 | |
77 | void finishCreation(JSC::VM&); |
78 | }; |
79 | |
80 | using JSSVGZoomEventConstructor = JSDOMConstructorNotConstructable<JSSVGZoomEvent>; |
81 | |
82 | template<> JSValue JSSVGZoomEventConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
83 | { |
84 | return JSUIEvent::getConstructor(vm, &globalObject); |
85 | } |
86 | |
87 | template<> void JSSVGZoomEventConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
88 | { |
89 | putDirect(vm, vm.propertyNames->prototype, JSSVGZoomEvent::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
90 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("SVGZoomEvent"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
91 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
92 | } |
93 | |
94 | template<> const ClassInfo JSSVGZoomEventConstructor::s_info = { "SVGZoomEvent" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGZoomEventConstructor) }; |
95 | |
96 | /* Hash table for prototype */ |
97 | |
98 | static const HashTableValue JSSVGZoomEventPrototypeTableValues[] = |
99 | { |
100 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomEventConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGZoomEventConstructor) } }, |
101 | { "zoomRectScreen" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomEventZoomRectScreen), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
102 | { "previousScale" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomEventPreviousScale), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
103 | { "previousTranslate" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomEventPreviousTranslate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
104 | { "newScale" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomEventNewScale), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
105 | { "newTranslate" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomEventNewTranslate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
106 | }; |
107 | |
108 | const ClassInfo JSSVGZoomEventPrototype::s_info = { "SVGZoomEventPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGZoomEventPrototype) }; |
109 | |
110 | void JSSVGZoomEventPrototype::finishCreation(VM& vm) |
111 | { |
112 | Base::finishCreation(vm); |
113 | reifyStaticProperties(vm, JSSVGZoomEvent::info(), JSSVGZoomEventPrototypeTableValues, *this); |
114 | } |
115 | |
116 | const ClassInfo JSSVGZoomEvent::s_info = { "SVGZoomEvent" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSVGZoomEvent) }; |
117 | |
118 | JSSVGZoomEvent::JSSVGZoomEvent(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGZoomEvent>&& impl) |
119 | : JSUIEvent(structure, globalObject, WTFMove(impl)) |
120 | { |
121 | } |
122 | |
123 | void JSSVGZoomEvent::finishCreation(VM& vm) |
124 | { |
125 | Base::finishCreation(vm); |
126 | ASSERT(inherits(vm, info())); |
127 | |
128 | } |
129 | |
130 | JSObject* JSSVGZoomEvent::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
131 | { |
132 | return JSSVGZoomEventPrototype::create(vm, &globalObject, JSSVGZoomEventPrototype::createStructure(vm, &globalObject, JSUIEvent::prototype(vm, globalObject))); |
133 | } |
134 | |
135 | JSObject* JSSVGZoomEvent::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
136 | { |
137 | return getDOMPrototype<JSSVGZoomEvent>(vm, globalObject); |
138 | } |
139 | |
140 | JSValue JSSVGZoomEvent::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
141 | { |
142 | return getDOMConstructor<JSSVGZoomEventConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
143 | } |
144 | |
145 | template<> inline JSSVGZoomEvent* IDLAttribute<JSSVGZoomEvent>::cast(ExecState& state, EncodedJSValue thisValue) |
146 | { |
147 | return jsDynamicCast<JSSVGZoomEvent*>(state.vm(), JSValue::decode(thisValue)); |
148 | } |
149 | |
150 | EncodedJSValue jsSVGZoomEventConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
151 | { |
152 | VM& vm = state->vm(); |
153 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
154 | auto* prototype = jsDynamicCast<JSSVGZoomEventPrototype*>(vm, JSValue::decode(thisValue)); |
155 | if (UNLIKELY(!prototype)) |
156 | return throwVMTypeError(state, throwScope); |
157 | return JSValue::encode(JSSVGZoomEvent::getConstructor(state->vm(), prototype->globalObject())); |
158 | } |
159 | |
160 | bool setJSSVGZoomEventConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
161 | { |
162 | VM& vm = state->vm(); |
163 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
164 | auto* prototype = jsDynamicCast<JSSVGZoomEventPrototype*>(vm, JSValue::decode(thisValue)); |
165 | if (UNLIKELY(!prototype)) { |
166 | throwVMTypeError(state, throwScope); |
167 | return false; |
168 | } |
169 | // Shadowing a built-in constructor |
170 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
171 | } |
172 | |
173 | static inline JSValue jsSVGZoomEventZoomRectScreenGetter(ExecState& state, JSSVGZoomEvent& thisObject, ThrowScope& throwScope) |
174 | { |
175 | UNUSED_PARAM(throwScope); |
176 | UNUSED_PARAM(state); |
177 | auto& impl = thisObject.wrapped(); |
178 | JSValue result = toJSNewlyCreated<IDLInterface<SVGRect>>(state, *thisObject.globalObject(), throwScope, impl.zoomRectScreen()); |
179 | return result; |
180 | } |
181 | |
182 | EncodedJSValue jsSVGZoomEventZoomRectScreen(ExecState* state, EncodedJSValue thisValue, PropertyName) |
183 | { |
184 | return IDLAttribute<JSSVGZoomEvent>::get<jsSVGZoomEventZoomRectScreenGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "zoomRectScreen" ); |
185 | } |
186 | |
187 | static inline JSValue jsSVGZoomEventPreviousScaleGetter(ExecState& state, JSSVGZoomEvent& thisObject, ThrowScope& throwScope) |
188 | { |
189 | UNUSED_PARAM(throwScope); |
190 | UNUSED_PARAM(state); |
191 | auto& impl = thisObject.wrapped(); |
192 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.previousScale()); |
193 | return result; |
194 | } |
195 | |
196 | EncodedJSValue jsSVGZoomEventPreviousScale(ExecState* state, EncodedJSValue thisValue, PropertyName) |
197 | { |
198 | return IDLAttribute<JSSVGZoomEvent>::get<jsSVGZoomEventPreviousScaleGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "previousScale" ); |
199 | } |
200 | |
201 | static inline JSValue jsSVGZoomEventPreviousTranslateGetter(ExecState& state, JSSVGZoomEvent& thisObject, ThrowScope& throwScope) |
202 | { |
203 | UNUSED_PARAM(throwScope); |
204 | UNUSED_PARAM(state); |
205 | auto& impl = thisObject.wrapped(); |
206 | JSValue result = toJS<IDLInterface<SVGPoint>>(state, *thisObject.globalObject(), throwScope, impl.previousTranslate()); |
207 | return result; |
208 | } |
209 | |
210 | EncodedJSValue jsSVGZoomEventPreviousTranslate(ExecState* state, EncodedJSValue thisValue, PropertyName) |
211 | { |
212 | return IDLAttribute<JSSVGZoomEvent>::get<jsSVGZoomEventPreviousTranslateGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "previousTranslate" ); |
213 | } |
214 | |
215 | static inline JSValue jsSVGZoomEventNewScaleGetter(ExecState& state, JSSVGZoomEvent& thisObject, ThrowScope& throwScope) |
216 | { |
217 | UNUSED_PARAM(throwScope); |
218 | UNUSED_PARAM(state); |
219 | auto& impl = thisObject.wrapped(); |
220 | JSValue result = toJS<IDLUnrestrictedFloat>(state, throwScope, impl.newScale()); |
221 | return result; |
222 | } |
223 | |
224 | EncodedJSValue jsSVGZoomEventNewScale(ExecState* state, EncodedJSValue thisValue, PropertyName) |
225 | { |
226 | return IDLAttribute<JSSVGZoomEvent>::get<jsSVGZoomEventNewScaleGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "newScale" ); |
227 | } |
228 | |
229 | static inline JSValue jsSVGZoomEventNewTranslateGetter(ExecState& state, JSSVGZoomEvent& thisObject, ThrowScope& throwScope) |
230 | { |
231 | UNUSED_PARAM(throwScope); |
232 | UNUSED_PARAM(state); |
233 | auto& impl = thisObject.wrapped(); |
234 | JSValue result = toJS<IDLInterface<SVGPoint>>(state, *thisObject.globalObject(), throwScope, impl.newTranslate()); |
235 | return result; |
236 | } |
237 | |
238 | EncodedJSValue jsSVGZoomEventNewTranslate(ExecState* state, EncodedJSValue thisValue, PropertyName) |
239 | { |
240 | return IDLAttribute<JSSVGZoomEvent>::get<jsSVGZoomEventNewTranslateGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "newTranslate" ); |
241 | } |
242 | |
243 | void JSSVGZoomEvent::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
244 | { |
245 | auto* thisObject = jsCast<JSSVGZoomEvent*>(cell); |
246 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
247 | if (thisObject->scriptExecutionContext()) |
248 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
249 | Base::heapSnapshot(cell, builder); |
250 | } |
251 | |
252 | |
253 | } |
254 | |