2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
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.
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.
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.
22 #include "JSWheelEvent.h"
24 #include "ExceptionCode.h"
25 #include "JSDOMBinding.h"
26 #include "JSDOMWindow.h"
27 #include "WheelEvent.h"
28 #include <runtime/Error.h>
29 #include <wtf/GetPtr.h>
35 ASSERT_CLASS_FITS_IN_CELL(JSWheelEvent);
39 #define THUNK_GENERATOR(generator) , generator
41 #define THUNK_GENERATOR(generator)
44 #define INTRINSIC(intrinsic) , intrinsic
46 #define INTRINSIC(intrinsic)
49 static const HashTableValue JSWheelEventTableValues[] =
51 { "screenX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventScreenX), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
52 { "screenY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventScreenY), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53 { "clientX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventClientX), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
54 { "clientY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventClientY), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
55 { "ctrlKey", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventCtrlKey), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
56 { "shiftKey", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventShiftKey), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
57 { "altKey", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventAltKey), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
58 { "metaKey", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventMetaKey), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
59 { "wheelDelta", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventWheelDelta), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
60 { "wheelDeltaX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventWheelDeltaX), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
61 { "wheelDeltaY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventWheelDeltaY), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
62 { "offsetX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventOffsetX), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
63 { "offsetY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventOffsetY), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
64 { "x", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventX), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
65 { "y", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventY), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
66 { "webkitDirectionInvertedFromDevice", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventWebkitDirectionInvertedFromDevice), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
67 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
68 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
71 #undef THUNK_GENERATOR
72 static const HashTable JSWheelEventTable = { 65, 63, JSWheelEventTableValues, 0 };
73 /* Hash table for constructor */
75 #define THUNK_GENERATOR(generator) , generator
77 #define THUNK_GENERATOR(generator)
80 #define INTRINSIC(intrinsic) , intrinsic
82 #define INTRINSIC(intrinsic)
85 static const HashTableValue JSWheelEventConstructorTableValues[] =
87 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
90 #undef THUNK_GENERATOR
91 static const HashTable JSWheelEventConstructorTable = { 1, 0, JSWheelEventConstructorTableValues, 0 };
92 const ClassInfo JSWheelEventConstructor::s_info = { "WheelEventConstructor", &DOMConstructorObject::s_info, &JSWheelEventConstructorTable, 0, CREATE_METHOD_TABLE(JSWheelEventConstructor) };
94 JSWheelEventConstructor::JSWheelEventConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
95 : DOMConstructorObject(structure, globalObject)
99 void JSWheelEventConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
101 Base::finishCreation(exec->globalData());
102 ASSERT(inherits(&s_info));
103 putDirect(exec->globalData(), exec->propertyNames().prototype, JSWheelEventPrototype::self(exec, globalObject), DontDelete | ReadOnly);
106 bool JSWheelEventConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
108 return getStaticValueSlot<JSWheelEventConstructor, JSDOMWrapper>(exec, &JSWheelEventConstructorTable, static_cast<JSWheelEventConstructor*>(cell), propertyName, slot);
111 bool JSWheelEventConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
113 return getStaticValueDescriptor<JSWheelEventConstructor, JSDOMWrapper>(exec, &JSWheelEventConstructorTable, static_cast<JSWheelEventConstructor*>(object), propertyName, descriptor);
116 /* Hash table for prototype */
118 #define THUNK_GENERATOR(generator) , generator
120 #define THUNK_GENERATOR(generator)
123 #define INTRINSIC(intrinsic) , intrinsic
125 #define INTRINSIC(intrinsic)
128 static const HashTableValue JSWheelEventPrototypeTableValues[] =
130 { "initWebKitWheelEvent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsWheelEventPrototypeFunctionInitWebKitWheelEvent), (intptr_t)11 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
131 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
134 #undef THUNK_GENERATOR
135 static const HashTable JSWheelEventPrototypeTable = { 2, 1, JSWheelEventPrototypeTableValues, 0 };
136 const ClassInfo JSWheelEventPrototype::s_info = { "WheelEventPrototype", &JSC::JSNonFinalObject::s_info, &JSWheelEventPrototypeTable, 0, CREATE_METHOD_TABLE(JSWheelEventPrototype) };
138 JSObject* JSWheelEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
140 return getDOMPrototype<JSWheelEvent>(exec, globalObject);
143 bool JSWheelEventPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
145 JSWheelEventPrototype* thisObject = jsCast<JSWheelEventPrototype*>(cell);
146 return getStaticFunctionSlot<JSObject>(exec, &JSWheelEventPrototypeTable, thisObject, propertyName, slot);
149 bool JSWheelEventPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
151 JSWheelEventPrototype* thisObject = jsCast<JSWheelEventPrototype*>(object);
152 return getStaticFunctionDescriptor<JSObject>(exec, &JSWheelEventPrototypeTable, thisObject, propertyName, descriptor);
155 const ClassInfo JSWheelEvent::s_info = { "WheelEvent", &JSUIEvent::s_info, &JSWheelEventTable, 0 , CREATE_METHOD_TABLE(JSWheelEvent) };
157 JSWheelEvent::JSWheelEvent(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<WheelEvent> impl)
158 : JSUIEvent(structure, globalObject, impl)
162 void JSWheelEvent::finishCreation(JSGlobalData& globalData)
164 Base::finishCreation(globalData);
165 ASSERT(inherits(&s_info));
168 JSObject* JSWheelEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
170 return JSWheelEventPrototype::create(exec->globalData(), globalObject, JSWheelEventPrototype::createStructure(exec->globalData(), globalObject, JSUIEventPrototype::self(exec, globalObject)));
173 bool JSWheelEvent::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
175 JSWheelEvent* thisObject = jsCast<JSWheelEvent*>(cell);
176 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
177 return getStaticValueSlot<JSWheelEvent, Base>(exec, &JSWheelEventTable, thisObject, propertyName, slot);
180 bool JSWheelEvent::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
182 JSWheelEvent* thisObject = jsCast<JSWheelEvent*>(object);
183 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
184 return getStaticValueDescriptor<JSWheelEvent, Base>(exec, &JSWheelEventTable, thisObject, propertyName, descriptor);
187 JSValue jsWheelEventScreenX(ExecState* exec, JSValue slotBase, const Identifier&)
189 JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
191 WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
192 JSValue result = jsNumber(imp->screenX());
197 JSValue jsWheelEventScreenY(ExecState* exec, JSValue slotBase, const Identifier&)
199 JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
201 WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
202 JSValue result = jsNumber(imp->screenY());
207 JSValue jsWheelEventClientX(ExecState* exec, JSValue slotBase, const Identifier&)
209 JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
211 WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
212 JSValue result = jsNumber(imp->clientX());
217 JSValue jsWheelEventClientY(ExecState* exec, JSValue slotBase, const Identifier&)
219 JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
221 WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
222 JSValue result = jsNumber(imp->clientY());
227 JSValue jsWheelEventCtrlKey(ExecState* exec, JSValue slotBase, const Identifier&)
229 JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
231 WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
232 JSValue result = jsBoolean(imp->ctrlKey());
237 JSValue jsWheelEventShiftKey(ExecState* exec, JSValue slotBase, const Identifier&)
239 JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
241 WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
242 JSValue result = jsBoolean(imp->shiftKey());
247 JSValue jsWheelEventAltKey(ExecState* exec, JSValue slotBase, const Identifier&)
249 JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
251 WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
252 JSValue result = jsBoolean(imp->altKey());
257 JSValue jsWheelEventMetaKey(ExecState* exec, JSValue slotBase, const Identifier&)
259 JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
261 WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
262 JSValue result = jsBoolean(imp->metaKey());
267 JSValue jsWheelEventWheelDelta(ExecState* exec, JSValue slotBase, const Identifier&)
269 JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
271 WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
272 JSValue result = jsNumber(imp->wheelDelta());
277 JSValue jsWheelEventWheelDeltaX(ExecState* exec, JSValue slotBase, const Identifier&)
279 JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
281 WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
282 JSValue result = jsNumber(imp->wheelDeltaX());
287 JSValue jsWheelEventWheelDeltaY(ExecState* exec, JSValue slotBase, const Identifier&)
289 JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
291 WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
292 JSValue result = jsNumber(imp->wheelDeltaY());
297 JSValue jsWheelEventOffsetX(ExecState* exec, JSValue slotBase, const Identifier&)
299 JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
301 WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
302 JSValue result = jsNumber(imp->offsetX());
307 JSValue jsWheelEventOffsetY(ExecState* exec, JSValue slotBase, const Identifier&)
309 JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
311 WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
312 JSValue result = jsNumber(imp->offsetY());
317 JSValue jsWheelEventX(ExecState* exec, JSValue slotBase, const Identifier&)
319 JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
321 WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
322 JSValue result = jsNumber(imp->x());
327 JSValue jsWheelEventY(ExecState* exec, JSValue slotBase, const Identifier&)
329 JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
331 WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
332 JSValue result = jsNumber(imp->y());
337 JSValue jsWheelEventWebkitDirectionInvertedFromDevice(ExecState* exec, JSValue slotBase, const Identifier&)
339 JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
341 WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
342 JSValue result = jsBoolean(imp->webkitDirectionInvertedFromDevice());
347 JSValue jsWheelEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
349 JSWheelEvent* domObject = static_cast<JSWheelEvent*>(asObject(slotBase));
350 return JSWheelEvent::getConstructor(exec, domObject->globalObject());
353 JSValue JSWheelEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
355 return getDOMConstructor<JSWheelEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
358 EncodedJSValue JSC_HOST_CALL jsWheelEventPrototypeFunctionInitWebKitWheelEvent(ExecState* exec)
360 JSValue thisValue = exec->hostThisValue();
361 if (!thisValue.inherits(&JSWheelEvent::s_info))
362 return throwVMTypeError(exec);
363 JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(thisValue));
364 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSWheelEvent::s_info);
365 WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
366 int wheelDeltaX(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec));
367 if (exec->hadException())
368 return JSValue::encode(jsUndefined());
369 int wheelDeltaY(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toInt32(exec));
370 if (exec->hadException())
371 return JSValue::encode(jsUndefined());
372 DOMWindow* view(toDOMWindow(MAYBE_MISSING_PARAMETER(exec, 2, MissingIsUndefined)));
373 if (exec->hadException())
374 return JSValue::encode(jsUndefined());
375 int screenX(MAYBE_MISSING_PARAMETER(exec, 3, MissingIsUndefined).toInt32(exec));
376 if (exec->hadException())
377 return JSValue::encode(jsUndefined());
378 int screenY(MAYBE_MISSING_PARAMETER(exec, 4, MissingIsUndefined).toInt32(exec));
379 if (exec->hadException())
380 return JSValue::encode(jsUndefined());
381 int clientX(MAYBE_MISSING_PARAMETER(exec, 5, MissingIsUndefined).toInt32(exec));
382 if (exec->hadException())
383 return JSValue::encode(jsUndefined());
384 int clientY(MAYBE_MISSING_PARAMETER(exec, 6, MissingIsUndefined).toInt32(exec));
385 if (exec->hadException())
386 return JSValue::encode(jsUndefined());
387 bool ctrlKey(MAYBE_MISSING_PARAMETER(exec, 7, MissingIsUndefined).toBoolean(exec));
388 if (exec->hadException())
389 return JSValue::encode(jsUndefined());
390 bool altKey(MAYBE_MISSING_PARAMETER(exec, 8, MissingIsUndefined).toBoolean(exec));
391 if (exec->hadException())
392 return JSValue::encode(jsUndefined());
393 bool shiftKey(MAYBE_MISSING_PARAMETER(exec, 9, MissingIsUndefined).toBoolean(exec));
394 if (exec->hadException())
395 return JSValue::encode(jsUndefined());
396 bool metaKey(MAYBE_MISSING_PARAMETER(exec, 10, MissingIsUndefined).toBoolean(exec));
397 if (exec->hadException())
398 return JSValue::encode(jsUndefined());
399 imp->initWebKitWheelEvent(wheelDeltaX, wheelDeltaY, view, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey);
400 return JSValue::encode(jsUndefined());