tizen beta release
[profile/ivi/webkit-efl.git] / DerivedSources / WebCore / JSOverflowEvent.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 "JSOverflowEvent.h"
23
24 #include "JSDictionary.h"
25 #include "OverflowEvent.h"
26 #include <runtime/Error.h>
27 #include <wtf/GetPtr.h>
28
29 using namespace JSC;
30
31 namespace WebCore {
32
33 ASSERT_CLASS_FITS_IN_CELL(JSOverflowEvent);
34
35 /* Hash table */
36 #if ENABLE(JIT)
37 #define THUNK_GENERATOR(generator) , generator
38 #else
39 #define THUNK_GENERATOR(generator)
40 #endif
41 #if ENABLE(DFG_JIT)
42 #define INTRINSIC(intrinsic) , intrinsic
43 #else
44 #define INTRINSIC(intrinsic)
45 #endif
46
47 static const HashTableValue JSOverflowEventTableValues[] =
48 {
49     { "orient", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventOrient), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
50     { "horizontalOverflow", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventHorizontalOverflow), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
51     { "verticalOverflow", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventVerticalOverflow), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
52     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
54 };
55
56 #undef THUNK_GENERATOR
57 static const HashTable JSOverflowEventTable = { 9, 7, JSOverflowEventTableValues, 0 };
58 /* Hash table for constructor */
59 #if ENABLE(JIT)
60 #define THUNK_GENERATOR(generator) , generator
61 #else
62 #define THUNK_GENERATOR(generator)
63 #endif
64 #if ENABLE(DFG_JIT)
65 #define INTRINSIC(intrinsic) , intrinsic
66 #else
67 #define INTRINSIC(intrinsic)
68 #endif
69
70 static const HashTableValue JSOverflowEventConstructorTableValues[] =
71 {
72     { "HORIZONTAL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventHORIZONTAL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
73     { "VERTICAL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventVERTICAL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
74     { "BOTH", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventBOTH), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
75     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
76 };
77
78 #undef THUNK_GENERATOR
79 static const HashTable JSOverflowEventConstructorTable = { 9, 7, JSOverflowEventConstructorTableValues, 0 };
80
81 COMPILE_ASSERT(0 == OverflowEvent::HORIZONTAL, OverflowEventEnumHORIZONTALIsWrongUseDontCheckEnums);
82 COMPILE_ASSERT(1 == OverflowEvent::VERTICAL, OverflowEventEnumVERTICALIsWrongUseDontCheckEnums);
83 COMPILE_ASSERT(2 == OverflowEvent::BOTH, OverflowEventEnumBOTHIsWrongUseDontCheckEnums);
84
85 const ClassInfo JSOverflowEventConstructor::s_info = { "OverflowEventConstructor", &DOMConstructorObject::s_info, &JSOverflowEventConstructorTable, 0, CREATE_METHOD_TABLE(JSOverflowEventConstructor) };
86
87 JSOverflowEventConstructor::JSOverflowEventConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
88     : DOMConstructorObject(structure, globalObject)
89 {
90 }
91
92 void JSOverflowEventConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
93 {
94     Base::finishCreation(exec->globalData());
95     ASSERT(inherits(&s_info));
96     putDirect(exec->globalData(), exec->propertyNames().prototype, JSOverflowEventPrototype::self(exec, globalObject), DontDelete | ReadOnly);
97 }
98
99 bool JSOverflowEventConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
100 {
101     return getStaticValueSlot<JSOverflowEventConstructor, JSDOMWrapper>(exec, &JSOverflowEventConstructorTable, static_cast<JSOverflowEventConstructor*>(cell), propertyName, slot);
102 }
103
104 bool JSOverflowEventConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
105 {
106     return getStaticValueDescriptor<JSOverflowEventConstructor, JSDOMWrapper>(exec, &JSOverflowEventConstructorTable, static_cast<JSOverflowEventConstructor*>(object), propertyName, descriptor);
107 }
108
109 EncodedJSValue JSC_HOST_CALL JSOverflowEventConstructor::constructJSOverflowEvent(ExecState* exec)
110 {
111     JSOverflowEventConstructor* jsConstructor = static_cast<JSOverflowEventConstructor*>(exec->callee());
112
113     ScriptExecutionContext* executionContext = jsConstructor->scriptExecutionContext();
114     if (!executionContext)
115         return throwVMError(exec, createReferenceError(exec, "Constructor associated execution context is unavailable"));
116
117     AtomicString eventType = ustringToAtomicString(exec->argument(0).toString(exec));
118     if (exec->hadException())
119         return JSValue::encode(jsUndefined());
120
121     OverflowEventInit eventInit;
122
123     JSValue initializerValue = exec->argument(1);
124     if (!initializerValue.isUndefinedOrNull()) {
125         // Given the above test, this will always yield an object.
126         JSObject* initializerObject = initializerValue.toObject(exec);
127
128         // Create the dictionary wrapper from the initializer object.
129         JSDictionary dictionary(exec, initializerObject);
130
131         // Attempt to fill in the EventInit.
132         if (!fillOverflowEventInit(eventInit, dictionary))
133             return JSValue::encode(jsUndefined());
134     }
135
136     RefPtr<OverflowEvent> event = OverflowEvent::create(eventType, eventInit);
137     return JSValue::encode(toJS(exec, jsConstructor->globalObject(), event.get()));
138 }
139
140 bool fillOverflowEventInit(OverflowEventInit& eventInit, JSDictionary& dictionary)
141 {
142     if (!fillEventInit(eventInit, dictionary))
143         return false;
144
145     if (!dictionary.tryGetProperty("orient", eventInit.orient))
146         return false;
147     if (!dictionary.tryGetProperty("horizontalOverflow", eventInit.horizontalOverflow))
148         return false;
149     if (!dictionary.tryGetProperty("verticalOverflow", eventInit.verticalOverflow))
150         return false;
151     return true;
152 }
153
154 ConstructType JSOverflowEventConstructor::getConstructData(JSCell*, ConstructData& constructData)
155 {
156     constructData.native.function = constructJSOverflowEvent;
157     return ConstructTypeHost;
158 }
159
160 /* Hash table for prototype */
161 #if ENABLE(JIT)
162 #define THUNK_GENERATOR(generator) , generator
163 #else
164 #define THUNK_GENERATOR(generator)
165 #endif
166 #if ENABLE(DFG_JIT)
167 #define INTRINSIC(intrinsic) , intrinsic
168 #else
169 #define INTRINSIC(intrinsic)
170 #endif
171
172 static const HashTableValue JSOverflowEventPrototypeTableValues[] =
173 {
174     { "HORIZONTAL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventHORIZONTAL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
175     { "VERTICAL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventVERTICAL), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
176     { "BOTH", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventBOTH), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
177     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
178 };
179
180 #undef THUNK_GENERATOR
181 static const HashTable JSOverflowEventPrototypeTable = { 9, 7, JSOverflowEventPrototypeTableValues, 0 };
182 const ClassInfo JSOverflowEventPrototype::s_info = { "OverflowEventPrototype", &JSC::JSNonFinalObject::s_info, &JSOverflowEventPrototypeTable, 0, CREATE_METHOD_TABLE(JSOverflowEventPrototype) };
183
184 JSObject* JSOverflowEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
185 {
186     return getDOMPrototype<JSOverflowEvent>(exec, globalObject);
187 }
188
189 bool JSOverflowEventPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
190 {
191     JSOverflowEventPrototype* thisObject = jsCast<JSOverflowEventPrototype*>(cell);
192     return getStaticValueSlot<JSOverflowEventPrototype, JSObject>(exec, &JSOverflowEventPrototypeTable, thisObject, propertyName, slot);
193 }
194
195 bool JSOverflowEventPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
196 {
197     JSOverflowEventPrototype* thisObject = jsCast<JSOverflowEventPrototype*>(object);
198     return getStaticValueDescriptor<JSOverflowEventPrototype, JSObject>(exec, &JSOverflowEventPrototypeTable, thisObject, propertyName, descriptor);
199 }
200
201 const ClassInfo JSOverflowEvent::s_info = { "OverflowEvent", &JSEvent::s_info, &JSOverflowEventTable, 0 , CREATE_METHOD_TABLE(JSOverflowEvent) };
202
203 JSOverflowEvent::JSOverflowEvent(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<OverflowEvent> impl)
204     : JSEvent(structure, globalObject, impl)
205 {
206 }
207
208 void JSOverflowEvent::finishCreation(JSGlobalData& globalData)
209 {
210     Base::finishCreation(globalData);
211     ASSERT(inherits(&s_info));
212 }
213
214 JSObject* JSOverflowEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
215 {
216     return JSOverflowEventPrototype::create(exec->globalData(), globalObject, JSOverflowEventPrototype::createStructure(exec->globalData(), globalObject, JSEventPrototype::self(exec, globalObject)));
217 }
218
219 bool JSOverflowEvent::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
220 {
221     JSOverflowEvent* thisObject = jsCast<JSOverflowEvent*>(cell);
222     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
223     return getStaticValueSlot<JSOverflowEvent, Base>(exec, &JSOverflowEventTable, thisObject, propertyName, slot);
224 }
225
226 bool JSOverflowEvent::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
227 {
228     JSOverflowEvent* thisObject = jsCast<JSOverflowEvent*>(object);
229     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
230     return getStaticValueDescriptor<JSOverflowEvent, Base>(exec, &JSOverflowEventTable, thisObject, propertyName, descriptor);
231 }
232
233 JSValue jsOverflowEventOrient(ExecState* exec, JSValue slotBase, const Identifier&)
234 {
235     JSOverflowEvent* castedThis = static_cast<JSOverflowEvent*>(asObject(slotBase));
236     UNUSED_PARAM(exec);
237     OverflowEvent* imp = static_cast<OverflowEvent*>(castedThis->impl());
238     JSValue result = jsNumber(imp->orient());
239     return result;
240 }
241
242
243 JSValue jsOverflowEventHorizontalOverflow(ExecState* exec, JSValue slotBase, const Identifier&)
244 {
245     JSOverflowEvent* castedThis = static_cast<JSOverflowEvent*>(asObject(slotBase));
246     UNUSED_PARAM(exec);
247     OverflowEvent* imp = static_cast<OverflowEvent*>(castedThis->impl());
248     JSValue result = jsBoolean(imp->horizontalOverflow());
249     return result;
250 }
251
252
253 JSValue jsOverflowEventVerticalOverflow(ExecState* exec, JSValue slotBase, const Identifier&)
254 {
255     JSOverflowEvent* castedThis = static_cast<JSOverflowEvent*>(asObject(slotBase));
256     UNUSED_PARAM(exec);
257     OverflowEvent* imp = static_cast<OverflowEvent*>(castedThis->impl());
258     JSValue result = jsBoolean(imp->verticalOverflow());
259     return result;
260 }
261
262
263 JSValue jsOverflowEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
264 {
265     JSOverflowEvent* domObject = static_cast<JSOverflowEvent*>(asObject(slotBase));
266     return JSOverflowEvent::getConstructor(exec, domObject->globalObject());
267 }
268
269 JSValue JSOverflowEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
270 {
271     return getDOMConstructor<JSOverflowEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
272 }
273
274 // Constant getters
275
276 JSValue jsOverflowEventHORIZONTAL(ExecState* exec, JSValue, const Identifier&)
277 {
278     UNUSED_PARAM(exec);
279     return jsNumber(static_cast<int>(0));
280 }
281
282 JSValue jsOverflowEventVERTICAL(ExecState* exec, JSValue, const Identifier&)
283 {
284     UNUSED_PARAM(exec);
285     return jsNumber(static_cast<int>(1));
286 }
287
288 JSValue jsOverflowEventBOTH(ExecState* exec, JSValue, const Identifier&)
289 {
290     UNUSED_PARAM(exec);
291     return jsNumber(static_cast<int>(2));
292 }
293
294
295 }