tizen beta release
[profile/ivi/webkit-efl.git] / DerivedSources / WebCore / JSWheelEvent.cpp
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 "JSWheelEvent.h"
23
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>
30
31 using namespace JSC;
32
33 namespace WebCore {
34
35 ASSERT_CLASS_FITS_IN_CELL(JSWheelEvent);
36
37 /* Hash table */
38 #if ENABLE(JIT)
39 #define THUNK_GENERATOR(generator) , generator
40 #else
41 #define THUNK_GENERATOR(generator)
42 #endif
43 #if ENABLE(DFG_JIT)
44 #define INTRINSIC(intrinsic) , intrinsic
45 #else
46 #define INTRINSIC(intrinsic)
47 #endif
48
49 static const HashTableValue JSWheelEventTableValues[] =
50 {
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) }
69 };
70
71 #undef THUNK_GENERATOR
72 static const HashTable JSWheelEventTable = { 65, 63, JSWheelEventTableValues, 0 };
73 /* Hash table for constructor */
74 #if ENABLE(JIT)
75 #define THUNK_GENERATOR(generator) , generator
76 #else
77 #define THUNK_GENERATOR(generator)
78 #endif
79 #if ENABLE(DFG_JIT)
80 #define INTRINSIC(intrinsic) , intrinsic
81 #else
82 #define INTRINSIC(intrinsic)
83 #endif
84
85 static const HashTableValue JSWheelEventConstructorTableValues[] =
86 {
87     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
88 };
89
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) };
93
94 JSWheelEventConstructor::JSWheelEventConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
95     : DOMConstructorObject(structure, globalObject)
96 {
97 }
98
99 void JSWheelEventConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
100 {
101     Base::finishCreation(exec->globalData());
102     ASSERT(inherits(&s_info));
103     putDirect(exec->globalData(), exec->propertyNames().prototype, JSWheelEventPrototype::self(exec, globalObject), DontDelete | ReadOnly);
104 }
105
106 bool JSWheelEventConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
107 {
108     return getStaticValueSlot<JSWheelEventConstructor, JSDOMWrapper>(exec, &JSWheelEventConstructorTable, static_cast<JSWheelEventConstructor*>(cell), propertyName, slot);
109 }
110
111 bool JSWheelEventConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
112 {
113     return getStaticValueDescriptor<JSWheelEventConstructor, JSDOMWrapper>(exec, &JSWheelEventConstructorTable, static_cast<JSWheelEventConstructor*>(object), propertyName, descriptor);
114 }
115
116 /* Hash table for prototype */
117 #if ENABLE(JIT)
118 #define THUNK_GENERATOR(generator) , generator
119 #else
120 #define THUNK_GENERATOR(generator)
121 #endif
122 #if ENABLE(DFG_JIT)
123 #define INTRINSIC(intrinsic) , intrinsic
124 #else
125 #define INTRINSIC(intrinsic)
126 #endif
127
128 static const HashTableValue JSWheelEventPrototypeTableValues[] =
129 {
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) }
132 };
133
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) };
137
138 JSObject* JSWheelEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
139 {
140     return getDOMPrototype<JSWheelEvent>(exec, globalObject);
141 }
142
143 bool JSWheelEventPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
144 {
145     JSWheelEventPrototype* thisObject = jsCast<JSWheelEventPrototype*>(cell);
146     return getStaticFunctionSlot<JSObject>(exec, &JSWheelEventPrototypeTable, thisObject, propertyName, slot);
147 }
148
149 bool JSWheelEventPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
150 {
151     JSWheelEventPrototype* thisObject = jsCast<JSWheelEventPrototype*>(object);
152     return getStaticFunctionDescriptor<JSObject>(exec, &JSWheelEventPrototypeTable, thisObject, propertyName, descriptor);
153 }
154
155 const ClassInfo JSWheelEvent::s_info = { "WheelEvent", &JSUIEvent::s_info, &JSWheelEventTable, 0 , CREATE_METHOD_TABLE(JSWheelEvent) };
156
157 JSWheelEvent::JSWheelEvent(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<WheelEvent> impl)
158     : JSUIEvent(structure, globalObject, impl)
159 {
160 }
161
162 void JSWheelEvent::finishCreation(JSGlobalData& globalData)
163 {
164     Base::finishCreation(globalData);
165     ASSERT(inherits(&s_info));
166 }
167
168 JSObject* JSWheelEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
169 {
170     return JSWheelEventPrototype::create(exec->globalData(), globalObject, JSWheelEventPrototype::createStructure(exec->globalData(), globalObject, JSUIEventPrototype::self(exec, globalObject)));
171 }
172
173 bool JSWheelEvent::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
174 {
175     JSWheelEvent* thisObject = jsCast<JSWheelEvent*>(cell);
176     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
177     return getStaticValueSlot<JSWheelEvent, Base>(exec, &JSWheelEventTable, thisObject, propertyName, slot);
178 }
179
180 bool JSWheelEvent::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
181 {
182     JSWheelEvent* thisObject = jsCast<JSWheelEvent*>(object);
183     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
184     return getStaticValueDescriptor<JSWheelEvent, Base>(exec, &JSWheelEventTable, thisObject, propertyName, descriptor);
185 }
186
187 JSValue jsWheelEventScreenX(ExecState* exec, JSValue slotBase, const Identifier&)
188 {
189     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
190     UNUSED_PARAM(exec);
191     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
192     JSValue result = jsNumber(imp->screenX());
193     return result;
194 }
195
196
197 JSValue jsWheelEventScreenY(ExecState* exec, JSValue slotBase, const Identifier&)
198 {
199     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
200     UNUSED_PARAM(exec);
201     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
202     JSValue result = jsNumber(imp->screenY());
203     return result;
204 }
205
206
207 JSValue jsWheelEventClientX(ExecState* exec, JSValue slotBase, const Identifier&)
208 {
209     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
210     UNUSED_PARAM(exec);
211     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
212     JSValue result = jsNumber(imp->clientX());
213     return result;
214 }
215
216
217 JSValue jsWheelEventClientY(ExecState* exec, JSValue slotBase, const Identifier&)
218 {
219     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
220     UNUSED_PARAM(exec);
221     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
222     JSValue result = jsNumber(imp->clientY());
223     return result;
224 }
225
226
227 JSValue jsWheelEventCtrlKey(ExecState* exec, JSValue slotBase, const Identifier&)
228 {
229     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
230     UNUSED_PARAM(exec);
231     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
232     JSValue result = jsBoolean(imp->ctrlKey());
233     return result;
234 }
235
236
237 JSValue jsWheelEventShiftKey(ExecState* exec, JSValue slotBase, const Identifier&)
238 {
239     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
240     UNUSED_PARAM(exec);
241     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
242     JSValue result = jsBoolean(imp->shiftKey());
243     return result;
244 }
245
246
247 JSValue jsWheelEventAltKey(ExecState* exec, JSValue slotBase, const Identifier&)
248 {
249     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
250     UNUSED_PARAM(exec);
251     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
252     JSValue result = jsBoolean(imp->altKey());
253     return result;
254 }
255
256
257 JSValue jsWheelEventMetaKey(ExecState* exec, JSValue slotBase, const Identifier&)
258 {
259     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
260     UNUSED_PARAM(exec);
261     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
262     JSValue result = jsBoolean(imp->metaKey());
263     return result;
264 }
265
266
267 JSValue jsWheelEventWheelDelta(ExecState* exec, JSValue slotBase, const Identifier&)
268 {
269     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
270     UNUSED_PARAM(exec);
271     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
272     JSValue result = jsNumber(imp->wheelDelta());
273     return result;
274 }
275
276
277 JSValue jsWheelEventWheelDeltaX(ExecState* exec, JSValue slotBase, const Identifier&)
278 {
279     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
280     UNUSED_PARAM(exec);
281     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
282     JSValue result = jsNumber(imp->wheelDeltaX());
283     return result;
284 }
285
286
287 JSValue jsWheelEventWheelDeltaY(ExecState* exec, JSValue slotBase, const Identifier&)
288 {
289     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
290     UNUSED_PARAM(exec);
291     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
292     JSValue result = jsNumber(imp->wheelDeltaY());
293     return result;
294 }
295
296
297 JSValue jsWheelEventOffsetX(ExecState* exec, JSValue slotBase, const Identifier&)
298 {
299     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
300     UNUSED_PARAM(exec);
301     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
302     JSValue result = jsNumber(imp->offsetX());
303     return result;
304 }
305
306
307 JSValue jsWheelEventOffsetY(ExecState* exec, JSValue slotBase, const Identifier&)
308 {
309     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
310     UNUSED_PARAM(exec);
311     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
312     JSValue result = jsNumber(imp->offsetY());
313     return result;
314 }
315
316
317 JSValue jsWheelEventX(ExecState* exec, JSValue slotBase, const Identifier&)
318 {
319     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
320     UNUSED_PARAM(exec);
321     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
322     JSValue result = jsNumber(imp->x());
323     return result;
324 }
325
326
327 JSValue jsWheelEventY(ExecState* exec, JSValue slotBase, const Identifier&)
328 {
329     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
330     UNUSED_PARAM(exec);
331     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
332     JSValue result = jsNumber(imp->y());
333     return result;
334 }
335
336
337 JSValue jsWheelEventWebkitDirectionInvertedFromDevice(ExecState* exec, JSValue slotBase, const Identifier&)
338 {
339     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
340     UNUSED_PARAM(exec);
341     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
342     JSValue result = jsBoolean(imp->webkitDirectionInvertedFromDevice());
343     return result;
344 }
345
346
347 JSValue jsWheelEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
348 {
349     JSWheelEvent* domObject = static_cast<JSWheelEvent*>(asObject(slotBase));
350     return JSWheelEvent::getConstructor(exec, domObject->globalObject());
351 }
352
353 JSValue JSWheelEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
354 {
355     return getDOMConstructor<JSWheelEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
356 }
357
358 EncodedJSValue JSC_HOST_CALL jsWheelEventPrototypeFunctionInitWebKitWheelEvent(ExecState* exec)
359 {
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());
401 }
402
403
404 }