|
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 "JSWebKitAnimationEvent.h" |
|
23 |
|
24 #include "KURL.h" |
|
25 #include "WebKitAnimationEvent.h" |
|
26 #include <runtime/Error.h> |
|
27 #include <runtime/JSNumberCell.h> |
|
28 #include <runtime/JSString.h> |
|
29 #include <wtf/GetPtr.h> |
|
30 |
|
31 using namespace JSC; |
|
32 |
|
33 namespace WebCore { |
|
34 |
|
35 ASSERT_CLASS_FITS_IN_CELL(JSWebKitAnimationEvent); |
|
36 |
|
37 /* Hash table */ |
|
38 #if ENABLE(JIT) |
|
39 #define THUNK_GENERATOR(generator) , generator |
|
40 #else |
|
41 #define THUNK_GENERATOR(generator) |
|
42 #endif |
|
43 |
|
44 static const HashTableValue JSWebKitAnimationEventTableValues[4] = |
|
45 { |
|
46 { "animationName", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitAnimationEventAnimationName), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
47 { "elapsedTime", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitAnimationEventElapsedTime), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
48 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitAnimationEventConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
49 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
50 }; |
|
51 |
|
52 #undef THUNK_GENERATOR |
|
53 static JSC_CONST_HASHTABLE HashTable JSWebKitAnimationEventTable = { 9, 7, JSWebKitAnimationEventTableValues, 0 }; |
|
54 /* Hash table for constructor */ |
|
55 #if ENABLE(JIT) |
|
56 #define THUNK_GENERATOR(generator) , generator |
|
57 #else |
|
58 #define THUNK_GENERATOR(generator) |
|
59 #endif |
|
60 |
|
61 static const HashTableValue JSWebKitAnimationEventConstructorTableValues[1] = |
|
62 { |
|
63 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
64 }; |
|
65 |
|
66 #undef THUNK_GENERATOR |
|
67 static JSC_CONST_HASHTABLE HashTable JSWebKitAnimationEventConstructorTable = { 1, 0, JSWebKitAnimationEventConstructorTableValues, 0 }; |
|
68 class JSWebKitAnimationEventConstructor : public DOMConstructorObject { |
|
69 public: |
|
70 JSWebKitAnimationEventConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
71 |
|
72 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
73 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
74 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
75 static const JSC::ClassInfo s_info; |
|
76 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
77 { |
|
78 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
79 } |
|
80 protected: |
|
81 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
82 }; |
|
83 |
|
84 const ClassInfo JSWebKitAnimationEventConstructor::s_info = { "WebKitAnimationEventConstructor", 0, &JSWebKitAnimationEventConstructorTable, 0 }; |
|
85 |
|
86 JSWebKitAnimationEventConstructor::JSWebKitAnimationEventConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
87 : DOMConstructorObject(JSWebKitAnimationEventConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
88 { |
|
89 putDirect(exec->propertyNames().prototype, JSWebKitAnimationEventPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
90 } |
|
91 |
|
92 bool JSWebKitAnimationEventConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
93 { |
|
94 return getStaticValueSlot<JSWebKitAnimationEventConstructor, DOMObject>(exec, &JSWebKitAnimationEventConstructorTable, this, propertyName, slot); |
|
95 } |
|
96 |
|
97 bool JSWebKitAnimationEventConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
98 { |
|
99 return getStaticValueDescriptor<JSWebKitAnimationEventConstructor, DOMObject>(exec, &JSWebKitAnimationEventConstructorTable, this, propertyName, descriptor); |
|
100 } |
|
101 |
|
102 /* Hash table for prototype */ |
|
103 #if ENABLE(JIT) |
|
104 #define THUNK_GENERATOR(generator) , generator |
|
105 #else |
|
106 #define THUNK_GENERATOR(generator) |
|
107 #endif |
|
108 |
|
109 static const HashTableValue JSWebKitAnimationEventPrototypeTableValues[2] = |
|
110 { |
|
111 { "initWebKitAnimationEvent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsWebKitAnimationEventPrototypeFunctionInitWebKitAnimationEvent), (intptr_t)5 THUNK_GENERATOR(0) }, |
|
112 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
113 }; |
|
114 |
|
115 #undef THUNK_GENERATOR |
|
116 static JSC_CONST_HASHTABLE HashTable JSWebKitAnimationEventPrototypeTable = { 2, 1, JSWebKitAnimationEventPrototypeTableValues, 0 }; |
|
117 const ClassInfo JSWebKitAnimationEventPrototype::s_info = { "WebKitAnimationEventPrototype", 0, &JSWebKitAnimationEventPrototypeTable, 0 }; |
|
118 |
|
119 JSObject* JSWebKitAnimationEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
120 { |
|
121 return getDOMPrototype<JSWebKitAnimationEvent>(exec, globalObject); |
|
122 } |
|
123 |
|
124 bool JSWebKitAnimationEventPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
125 { |
|
126 return getStaticFunctionSlot<JSObject>(exec, &JSWebKitAnimationEventPrototypeTable, this, propertyName, slot); |
|
127 } |
|
128 |
|
129 bool JSWebKitAnimationEventPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
130 { |
|
131 return getStaticFunctionDescriptor<JSObject>(exec, &JSWebKitAnimationEventPrototypeTable, this, propertyName, descriptor); |
|
132 } |
|
133 |
|
134 const ClassInfo JSWebKitAnimationEvent::s_info = { "WebKitAnimationEvent", &JSEvent::s_info, &JSWebKitAnimationEventTable, 0 }; |
|
135 |
|
136 JSWebKitAnimationEvent::JSWebKitAnimationEvent(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<WebKitAnimationEvent> impl) |
|
137 : JSEvent(structure, globalObject, impl) |
|
138 { |
|
139 } |
|
140 |
|
141 JSObject* JSWebKitAnimationEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
142 { |
|
143 return new (exec) JSWebKitAnimationEventPrototype(globalObject, JSWebKitAnimationEventPrototype::createStructure(JSEventPrototype::self(exec, globalObject))); |
|
144 } |
|
145 |
|
146 bool JSWebKitAnimationEvent::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
147 { |
|
148 return getStaticValueSlot<JSWebKitAnimationEvent, Base>(exec, &JSWebKitAnimationEventTable, this, propertyName, slot); |
|
149 } |
|
150 |
|
151 bool JSWebKitAnimationEvent::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
152 { |
|
153 return getStaticValueDescriptor<JSWebKitAnimationEvent, Base>(exec, &JSWebKitAnimationEventTable, this, propertyName, descriptor); |
|
154 } |
|
155 |
|
156 JSValue jsWebKitAnimationEventAnimationName(ExecState* exec, JSValue slotBase, const Identifier&) |
|
157 { |
|
158 JSWebKitAnimationEvent* castedThis = static_cast<JSWebKitAnimationEvent*>(asObject(slotBase)); |
|
159 UNUSED_PARAM(exec); |
|
160 WebKitAnimationEvent* imp = static_cast<WebKitAnimationEvent*>(castedThis->impl()); |
|
161 JSValue result = jsString(exec, imp->animationName()); |
|
162 return result; |
|
163 } |
|
164 |
|
165 JSValue jsWebKitAnimationEventElapsedTime(ExecState* exec, JSValue slotBase, const Identifier&) |
|
166 { |
|
167 JSWebKitAnimationEvent* castedThis = static_cast<JSWebKitAnimationEvent*>(asObject(slotBase)); |
|
168 UNUSED_PARAM(exec); |
|
169 WebKitAnimationEvent* imp = static_cast<WebKitAnimationEvent*>(castedThis->impl()); |
|
170 JSValue result = jsNumber(exec, imp->elapsedTime()); |
|
171 return result; |
|
172 } |
|
173 |
|
174 JSValue jsWebKitAnimationEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
175 { |
|
176 JSWebKitAnimationEvent* domObject = static_cast<JSWebKitAnimationEvent*>(asObject(slotBase)); |
|
177 return JSWebKitAnimationEvent::getConstructor(exec, domObject->globalObject()); |
|
178 } |
|
179 JSValue JSWebKitAnimationEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
180 { |
|
181 return getDOMConstructor<JSWebKitAnimationEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
182 } |
|
183 |
|
184 EncodedJSValue JSC_HOST_CALL jsWebKitAnimationEventPrototypeFunctionInitWebKitAnimationEvent(ExecState* exec) |
|
185 { |
|
186 JSValue thisValue = exec->hostThisValue(); |
|
187 if (!thisValue.inherits(&JSWebKitAnimationEvent::s_info)) |
|
188 return throwVMTypeError(exec); |
|
189 JSWebKitAnimationEvent* castedThis = static_cast<JSWebKitAnimationEvent*>(asObject(thisValue)); |
|
190 WebKitAnimationEvent* imp = static_cast<WebKitAnimationEvent*>(castedThis->impl()); |
|
191 const String& typeArg = ustringToString(exec->argument(0).toString(exec)); |
|
192 bool canBubbleArg = exec->argument(1).toBoolean(exec); |
|
193 bool cancelableArg = exec->argument(2).toBoolean(exec); |
|
194 const String& animationNameArg = ustringToString(exec->argument(3).toString(exec)); |
|
195 double elapsedTimeArg = exec->argument(4).toNumber(exec); |
|
196 |
|
197 imp->initWebKitAnimationEvent(typeArg, canBubbleArg, cancelableArg, animationNameArg, elapsedTimeArg); |
|
198 return JSValue::encode(jsUndefined()); |
|
199 } |
|
200 |
|
201 |
|
202 } |